=1) {} else { require ('tracip.php'); } echo ""; //Pub--------------------------------------------------- include ("../pub.php"); echo "$nom"; echo ""; echo ""; echo ""; include ("connect.inc.php"); $localité=$_GET['localité']; $id=$_GET['id']; $dept=$_GET['dept']; $action=$_GET['action']; $Pays=$_GET['pays']; $ident=$_POST['id']; $IP=$_POST['ipo']; //anti robots if(empty($_POST['comment'])) { $testrobot="ok"; } else { $testrobot="nok"; } // if ($ident) {} else { $ident=$_GET['ident']; } $date_saisie=$_POST['date_saisie']; $mp=$_GET['mp']; if ($id) {} else { $id=$_POST['id']; } $commentaires=$_POST['commentaires']; $expediteur=$_POST['expediteur']; $email=$_POST['email']; //$chemin="http://campingcar.free.fr/Francais/"; function get_ip() { if($_SERVER) { if($_SERVER['HTTP_X_FORWARDED_FOR']) $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; elseif($_SERVER['HTTP_CLIENT_IP']) $ip = $_SERVER['HTTP_CLIENT_IP']; else $ip = $_SERVER['REMOTE_ADDR']; } else { if(getenv('HTTP_X_FORWARDED_FOR')) $ip = getenv('HTTP_X_FORWARDED_FOR'); elseif(getenv('HTTP_CLIENT_IP')) $ip = getenv('HTTP_CLIENT_IP'); else $ip = getenv('REMOTE_ADDR'); } return $ip; } function checkmail($email){ $mail2 = trim($email); $lg=strlen($mail2); $pos1=strrpos($mail2,"."); $pos2=strrpos($mail2,"@"); if(ereg("@",$mail2) and $pos1>$pos2 and $lg>5 and $pos2>=1) { if (ereg(" ",$mail2)) { return false; } else { return true; } } else { return false; } } function sp2nbsp($string){ return str_replace(" ", " ", $string); } //enregistrement dans la bas de données if ($action=='maj') { $controle=checkmail($expediteur); if (($controle=="false" )|| ($testrobot<>"ok")) { echo "Email invalide, veuillez recommencer"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; } else { if (($commentaires=='' ) || (substr($commentaires,0,3)=='')|| (substr($commentaires,0,10)==', Vous n'avez saisi aucun commentaire
Saisie annulée.
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; } else { $tabl2="comadresses"; $instruction="INSERT INTO $tabl2 VALUES ( '','$date_saisie', '$id', '$commentaires', '$expediteur', '$email','$IP')"; $res=mysql($database, $instruction); $num_enreg= mysql_insert_id(); $action='ok'; } } } $tabl="adresses"; $tabl2="comadresses"; //suppression de commentaire if ($action=='supcom') { echo "suppression du commentaire"; echo "
"; echo "ident : ".$ident."
"; echo "
je confirme la suppression du commentaire"; echo "
annuler"; } else { if ($action=='okpoursup') { echo "Pays : ".$Pays; //supression des photos mysql($database,"DELETE FROM $tabl2 WHERE ident='$ident'"); }//fin si action=okpoursup $TableRech=mysql($database,"SELECT * FROM $tabl where id='$id'" ); $Nombreadresses=mysql_NumRows( $TableRech); //$Pays =mysql_result($TableRech, 0, "Pays"); $Tablecom=mysql($database,"SELECT * FROM $tabl2 where id='$id'" ); $Nombrecom=mysql_NumRows( $Tablecom); $j=0; while ($j < $Nombreadresses) /* faire tant que la fin de la table n'est pas atteinte */ { $texte_Pays =mysql_result($TableRech, $j, "Pays"); $texte_dept=mysql_result($TableRech, $j, "département"); $texte_nom =mysql_result($TableRech, $j, "nom"); $texte_Localité =mysql_result($TableRech, $j, "localité"); $texte_adresse =nl2br(mysql_result($TableRech, $j, "adresse")); $texte_date_creation=mysql_result($TableRech, $j, "date_creation"); $texte_infos=nl2br(mysql_result($TableRech, $j, "infos")); $texte_email=mysql_result($TableRech, $j, "email"); echo "Pays : $texte_Pays
"; $Pays=$texte_Pays; if ($Pays=="FRANCE") { echo "Département : $texte_dept"; } else { echo "region : $region"; } //echo "Aire de : $texte_Localité
"; ?>


"; echo " "; //boutons du haut //echo "Pays : $Pays
"; if ($Pays=="FRANCE") { echo ""; } else { echo ""; } ///formulaire d'ajout de commentaire if ($action=='ajouter') { $action="x"; //echo "$numid"; echo " "; echo " "; echo " "; } } //affichage de la fiche if ($action=='') { echo ""; //echo ""; } //______________________________________________________ //mode admin if ($groupe>=1) { echo "
"; echo ""; echo ""; //echo ""; echo ""; echo "
"; echo ""; echo ""; //echo ""; echo ""; echo "
"; $ip = get_ip(); if ($ip<>"146.185.223.173") { echo "
"; $datejour = Date ("Y-m-d"); echo ""; echo ""; echo "
"; echo " Votre commentaire :
"; echo " "; echo "
"; echo " Votre nom :"; echo " "; echo " "; echo "
"; echo " Votre E-mail :"; echo " "; //anti robots echo "
"; echo " "; echo "
"; echo " "; echo "
"; //echo ""; echo ""; echo ""; echo "
Votre adresse IP est : $ip ,elle sera enregistrée afin d'empêcher les personnes mal intentionnées de nuire. Merci de votre compréhension.
"; //echo ""; echo ""; echo ""; echo "
"; //echo ""; //echo "
"; echo ""; echo "
"; } echo "
"; echo " "; //if ($texte_date_modif=="0000-00-00") //{$texte_date_modif=$texte_date_creation;} //$ladatemodif=explode("-",$texte_date_modif); //echo " Date de dernière mise à jour des infos : "; //echo $ladatemodif[2]."/".$ladatemodif[1]."/".$ladatemodif[0]; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "

"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
  "; echo "
"; echo "  
Nom "; echo " du restaurant ou du site à visiter :"; echo " $texte_nom
"; echo "
Commune ou localité : "; echo " ";// echo $texte_Localité."
"; echo "
Adresse : "; echo " ";// echo $texte_adresse."
"; echo "
Autres informations :"; echo " $texte_infos
 
"; //echo "
"; echo "
"; //affichage des commentaires echo "
"; echo " "; echo "
Commentaires de camping-caristes :
"; if ($Nombrecom==''){ echo "Aucun commentaire sur cette aire pour le moment"; } echo " "; $h=0; while ($h < $Nombrecom) { $texte_ident=mysql_result($Tablecom, $h, "ident"); $texte_datesaisie =mysql_result($Tablecom, $h, "date_saisie"); $texte_commentaire =nl2br(mysql_result($Tablecom, $h, "commentaires")); $texte_expediteur =mysql_result($Tablecom, $h, "expediteur"); $texte_email =mysql_result($Tablecom, $h, "email"); echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; //echo " contacter l'auteur de
ce commentaire
"; //______________________________________________________ //mode admin if ($groupe>=1) { echo "
"; echo ""; echo ""; } echo "
"; $h++; } echo " "; $j++; } echo " "; //echo " "; //boutons du bas echo "

"; $ladatesaisie=explode("-",$texte_datesaisie); echo $ladatesaisie[2]."/".$ladatesaisie[1]."/".$ladatesaisie[0]; echo "$texte_commentaire
$texte_expediteur"; //echo " $texte_email
"; if ($Pays=="FRANCE") { echo ""; } else { echo ""; } if ($action=='') { echo ""; if ($groupe>=1) { echo ""; } } echo "
"; echo ""; echo ""; //echo ""; echo ""; echo "
"; echo ""; echo ""; echo ""; //echo ""; echo ""; echo "
"; echo ""; echo ""; echo "
"; echo ""; echo "
"; } mysql_close(); ?>