1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| /affichage des infos dans un formulaire pour permettre de les modifier
Function editer_identite_contact (){
Global $c_id,$c_email,$c_pass,$c_titre,$c_nom,$c_prenom,$c_age,$c_statut,$c_ville,$c_pays,$c_adresse_poste,$c_tel,$c_web;
$c_email = $_SESSION["email_c"];
$requet_identite = "SELECT c_id,c_email,c_pass,c_titre,c_nom,c_prenom,c_age,c_statut,c_ville,c_pays,c_adresse_poste,c_tel,c_web FROM candidats WHERE c_email=\"$c_email\"";
if ((!$result_identite = mysql_query($requet_identite))){
echo "<table align=\"center\" valign=\"top\" width=\"99%\" style=\"border-width:1; border-color:#009900; border-style:solid;\" bgcolor=#009900>".
"<tr>"."<td align=\"left\" width=\"99%\" height=\"100\" style=\"border-width:1; border-color:009900; border-style:solid;\">".
"<span class=\"msg_erreur\">Errreur de connexion à la base de données! Veuillez réessayer plus tard. Merci.</span>".
"</td></tr></table>" ;
}else{
$row = mysql_fetch_array($result_identite);
$c_id = stripslashes($row['c_id']);
$c_email = stripslashes($row['c_email']);
$c_pass = stripslashes($row['c_pass']);
$c_titre = stripslashes($row['c_titre']);
$c_nom = stripslashes($row['c_nom']);
$c_prenom = stripslashes($row['c_prenom']);
$c_age = stripslashes($row['c_age']);
$c_statut = stripslashes($row['c_statut']);
$c_ville = stripslashes($row['c_ville']);
$c_pays = stripslashes($row['c_pays']);
$c_adresse_poste = stripslashes($row['c_adresse_poste']);
$c_tel = stripslashes($row['c_tel']);
$c_web = stripslashes($row['c_web']);
echo "<table align=\"center\" valign=\"top\" width=\"99%\" style=\"border-width:1; border-color:#009900; border-style:solid;\" bgcolor=#009900>".
"<tr>"."<td align=\"center\" width=\"99%\">".
"<span class=titre1><b>Editer le Champ \"Identité & Contact\"</span>(laisser les champs vides en cas d'info indisponible)</td></tr></table>";
echo "<table align=\"center\" valign=\"top\" width=\"99%\" style=\"border-width:1; border-color:#009900; border-style:solid;\" bgcolor=#009900>".
"<tr>"."<td align=\"left\" width=\"15%\">".
"<form action=\"candidats.php?action=maj_identite_contact\" method=\"post\">".
"</td><td align=\"left\" width=\"60%\"></td></tr>".
"<tr><td align=\"left\"><b>Email:</b></td><td align=\"left\"> $c_email</td></tr>". //l'email ne doit pas être modifiables
"<tr><td align=\"left\"><b>Titre:</b></td><td align=\"left\"><select name=\"c_titre\">".
"<option value=\"\">--Choisir dans la liste--</option>";
$tablo_titre = array ("Dr", "M.","Mme","Melle");
Foreach ($tablo_titre as $titre_nom) {
if ($titre_nom == $c_titre){ $sel = "selected "; }
echo "<option value=\"$titre_nom\" $sel >$titre_nom</option>\n";
$sel = "";
}//fin de while
echo "</select></td></tr>";
echo "<tr><td align=\"left\"><b>Nom:</b></td><td align=\"left\"><input name=\"c_nom\" value=\"$c_nom\" SIZE=\"50\" maxlength=\"49\"></td></tr>".
"<tr><td align=\"left\"><b>Prénom:</b></td><td align=\"left\"><input name=\"c_prenom\" value=\"$c_prenom\" SIZE=\"50\" maxlength=\"49\"></td></tr>".
"<tr><td align=\"left\"><b>Age:</b></td><td align=\"left\"><input name=\"c_age\" value=\"$c_age\" SIZE=\"3\" maxlength=\"2\"></td></tr>".
"<tr><td align=\"left\"><b>Statut matrimonial:</b></td><td align=\"left\"><input name=\"c_statut\" value=\"$c_statut\" SIZE=\"30\" maxlength=\"39\"> (ex: célibataire; marié et père de 2 enfants)</td></tr>".
"<tr><td align=\"left\"><b>Ville:</b></td><td align=\"left\"><input name=\"c_ville\" value=\"$c_ville\" SIZE=\"20\" maxlength=\"39\"></td></tr>".
"<tr><td align=\"left\"><b>Pays:</b></td><td align=\"left\"><input name=\"c_pays\" value=\"$c_pays\" SIZE=\"20\" maxlength=\"39\"></td></tr>".
"<tr><td align=\"left\"><b>Adresse postale:</b></td><td align=\"left\"><input name=\"c_adresse_poste\" value=\"$c_adresse_poste\" SIZE=\"80\" maxlength=\"149\"></td></tr>".
"<tr><td align=\"left\"><b>Téléphone:</b></td><td align=\"left\"><input name=\"c_tel\" value=\"$c_tel\" SIZE=\"20\" maxlength=\"19\"></td></tr>".
"<tr><td align=\"left\"><b>Site web:</b></td><td align=\"left\"><input name=\"c_web\" value=\"$c_web\" SIZE=\"50\" maxlength=\"49\"> (avec le \"http://\" si sous domaine)</td></tr>".
"</table>";
echo "<table align=\"center\" valign=\"top\" width=\"99%\" style=\"border-width:1; border-color:#009900; border-style:solid;\" bgcolor=#009900>".
"<tr><td valign=top width=\"50%\" align=\"center\"><br><input type=\"image\" src=\"images/valider.png\" name=\"imageField\" alt=\"Mettre à jour\" border=\"0\" align=\"center\">".
"</td><td valign=top width=\"50%\" align=\"left\"><br><a href=\"candidats.php\"><img src=\"images\annuler.png\" alt=\"Annuler\" border=0></a>".
"<input type=\"hidden\" name=\"action\" value=\"maj_identite_contact\">".
"</p></form></td></tr></table>";
}
}
// pour mettre à jour les données
Function maj_identite_contact() {
Global $c_id,$c_email,$c_pass,$c_titre,$c_nom,$c_prenom,$c_age,$c_statut,$c_ville,$c_pays,$c_adresse_poste,$c_tel,$c_web;
$c_email = $_SESSION["email_c"];
$requet_maj_c_identite = "UPDATE candidats SET c_titre='".$c_titre."',c_nom='".$c_nom."',c_prenom='".$c_prenom."',c_age='".$c_age."',c_statut='".$c_statut."',c_ville='".$c_ville."',c_pays='".$c_pays."',c_adresse_poste='".$c_adresse_poste."',c_tel='".$c_tel."',c_web='".$c_web."' WHERE c_email='".$c_email."'";
/*mysql_query($requet_maj_c_identite)
or die("Couldn't connect to MySQL:<br>"
. mysql_error(). "<br>"
. mysql_errno());*/
if (!(mysql_query($requet_maj_c_identite))){
echo "<table align=\"center\" width=\"99%\" style=\"border-width:1; border-color:#009900; border-style:solid;\" cellspacing=0 bgcolor=#009900>".
"<tr><td align=\"center\"><span class=\"msg_erreur\">Errreur de connexion à la base de données! Veuillez réessayer plus tard. Merci.</td></tr>".
"<tr><td align=\"center\"><a href=\"candidats.php\"><span class=\"lien_blanc\">Revenir à la page d'accueil.</span></a></td></tr>".
"</table>";
}else{//pour mettre à jour
echo "<table align=\"center\" width=\"99%\" style=\"border-width:1; border-color:#009900; border-style:solid;\" cellspacing=0 bgcolor=#009900>".
"<tr><td align=\"center\"><span class=\"msg_succes\">Votre espace \"Identité & Contact\" a été mis à jour.</span></td></tr>".
"<tr><td align=\"center\"><a href=\"candidats.php\"><span class=\"lien_blanc\">Revenir à votre espace.</span></a></td></tr>".
"</table>" ;
//echo $requet_maj_c_identite;
}
} |
Partager