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
|
if(isset($_POST['modifSubmit'])){
// Insertion des informations envoyées par le formulaire dans des variables.
$societe = $_POST['societe']; $nom = $_POST['nomConsult'];
$prenom = $_POST['preConsult']; $fonction = $_POST['fonction'];
$numRue = $_POST['numRue']; $adresse = $_POST['nomRue'];
$codePost = $_POST['codePost']; $ville = $_POST['ville'];
$telFix = $_POST['telFix']; $telFax = $_POST['telFax'];
$telMob = $_POST['telMob']; $mail = $_POST['mail'];
$id_consult = $_POST['id_consult'];
//Verification des champs société et nom, si champs existants -> Insertion dans la BDD, sinon Alerte Javascript.
if($societe == ""){
echo"<script language='Javascript'>
<!--\n
alert('Aucune société n\'a été précisé\nVeuillez entrer le nom d'une société pour modifier les informations.');
history.back();
//-->
</script>\n";
}
elseif($nom == ""){
echo"<script language='Javascript'>
<!--\n
alert('Aucun nom n\'a été précisé\nVeuillez entrer le nom du consultant pour modifier les informations.');\n
history.back();
//-->
</script>\n";
}
else{
$req="UPDATE consultants SET societe = '$societe', nom = '$nom', prenom = '$prenom', fonction = '$fonction',
numRue = '$numRue', rue ='$adresse', codepostal ='$codePost', ville ='$ville', tel_fixe ='$telFix',
tel_fax='$telFax', tel_mobile='$telMob', mail ='$mail' where id_consult = '$id_consult'";
mysql_query($req);
$modif=mysql_insert_id();
}
} |
Partager