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
| <?php if (isset($_POST['modif_profil'])) {
//fonction verification des champs
$erreur = checkForm();
// pas d'erreur
if (empty($erreur)) {
//Protection par captcha
//if($_POST['captcha'] == $_SESSION['captcha']){
$req = Cnx::connectCnx()->prepare('UPDATE responsable SET resp_societe=:societe, resp_nom=:nom, resp_prenom=:prenom, resp_adresse=:adresse, resp_cp=:cp, resp_ville=:ville, resp_tel1=:tel1, resp_tel2=:tel2, resp_mail=:mail, resp_niveau=:niveau, resp_activate=:activate WHERE resp_id=:id');
$req -> bindParam(':id', $_POST['id']);
$req -> bindParam(':societe', $_POST['societe']);
$req -> bindParam(':nom', $_POST['nom']);
$req -> bindParam(':prenom', $_POST['prenom']);
$req -> bindParam(':adresse', $_POST['adresse']);
$req -> bindParam(':cp', $_POST['cp']);
$req -> bindParam(':ville', $_POST['ville']);
$req -> bindParam(':tel1', $_POST['tel1']);
$req -> bindParam(':tel2', $_POST['tel2']);
$req -> bindParam(':mail', $_POST['mail']);
$req -> bindParam(':niveau', $_POST['niveau']);
$req -> bindParam(':activate', $_POST['activate']);
$req -> execute();
/*}else{echo "Veuillez calculer le code de sécurité";}*/
echo '<pre>';
print_r($_POST);
echo '</pre>';
} else {
echo '<div class="error">';
foreach ($erreur as $e) {
echo $e, '<br />';
}
echo '</div>';
}
}
?>
<?php
$req = Cnx::connectCnx()->prepare('SELECT * FROM responsable WHERE resp_id=:id');
$req -> execute(array(
'id' => $Auth->user('resp_id')
));
$user = $req->fetch();
?>
<form enctype="multipart/form-data" action="modif_profil.php" method="post">
<input id="id" name="id" type="hidden" maxlength="30" size="30" value="<?php echo $user->resp_id ?>" placeholder="id"/> <br />
<input id="societe" name="societe" type="text" maxlength="30" size="30" value="<?php echo $user->resp_societe ?>" placeholder="Société"/> <br />
<input id="nom" name="nom" type="text" maxlength="30" size="30" value="<?php echo $user->resp_nom?>" placeholder="Nom *"/> <br />
<input id="prenom" name="prenom" type="text" maxlength="30" size="30" value="<?php echo $user->resp_prenom?>" placeholder="Prénom *"/> <br />
<input id="adresse" name="adresse" type="text" maxlength="200" size="30" value="<?php echo $user->resp_adresse?>" placeholder="Adresse *"/> <br />
<input id="cp" name="cp" type="text" maxlength="10" size="30" value="<?php echo $user->resp_cp?>" placeholder="Code Postal *"/> <br />
<input id="ville" name="ville" type="text" maxlength="20" size="30" value="<?php echo $user->resp_ville?>" placeholder="Ville *"/> <br />
<input id="tel1" name="tel1" type="text" maxlength="20" size="30" value="<?php echo $user->resp_tel1?>" placeholder="Tél Port *"/> <br />
<input id="tel2" name="tel2" type="text" maxlength="20" size="30" value="<?php echo $user->resp_tel2?>" placeholder="Tél Fixe"/> <br />
<input id="mail" name="mail" type="text" maxlength="100" size="30" value="<?php echo $user->resp_mail?>" placeholder="Email *"/> <br />
<input id="mail2" name="mail2" type="text" maxlength="100" size="30" value="<?php echo $user->resp_mail?>" placeholder="Confirmez votre Email *"/> <br />
<input id="activate" name="activate" type="text" maxlength="100" size="30" value="<?php echo $user->resp_activate?>" placeholder="Actif=1 Banni=0 *"/> <br />
<input id="niveau" name="niveau" type="hidden" value="<?php echo $user->resp_niveau ?>"/> <br />
<input id="captcha" name="captcha" type="text" size="30" placeholder="<?php echo captcha(); ?> = "/><br />
<small style="color: #CFCFCF;"><i> * Obligatoire</i></small> <br />
<input type="submit" name="modif_profil" value="Valider les modifications" /> <br />
</form> |
Partager