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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
<?php
if (isset($_POST["edit"]))
{
if (!isset($_POST["cid"]))
{
echo"Vous devez cocher au moins une case !";
echo'</br>';
echo '<a href="liste_intervenant_interne.php" class=style1 > Cliquez ici pour revenir à la page précédente </a> ';
exit();
}
// on créé une liste des id
$ids = implode(",",$_POST["cid"]);
$affiche= mysql_query("select * from intervenant_interne where id_intervenant IN ($ids)") or die(mysql_error());
// On fait une boucle pour lister tout ce que contient la table :
while ($object=mysql_fetch_array($affiche))
{
$id = $object['id_intervenant'];
$nom = $object['nom'];
$prenom = $object['prenom'] ;
$date_naiss = $object['date_naiss'] ;
$email = $object['email'] ;
$login = $object['login'] ;
$passwd = $object['passwd']; //md5 sha1
$num_téléphone = $object['telephone'] ;
$num_portable = $object['mobile_intervenant'] ;
$poste_interne = $object['poste_interne'] ;
$fax = $object['fax'] ;
$adresse = $object['adresse'] ;
$fk_droit_acces = $object['fk_droit_acces'] ;
$disponibilite = $object['disponibilite'] ;
$poste_oqp = $object['poste_oqp'] ;
$result = db_connect();
if (!$result)
die(mysql_error());
// selection de la base de données
$select = mysql_select_db($dbName,$result);
if (!$select)
die(mysql_error());
$Result= mysql_query("Select * from droit_acces") or die(mysql_error());
$nb = mysql_num_rows($Result);
$ListDir = '<option value="0">Tous les droits d\'accés</option>';
while ($tmpObject = mysql_fetch_array($Result)) //tant qu'il y a des droits d'accés, on les affiche
{
if ($fk_droit_acces== $tmpObject["id_droit_acces"])
{
$ListDir .= '<option value="'.$tmpObject["id_droit_acces"] .'" selected= "selected">'.$tmpObject["droit_acces"] .'</option>';
}
else
{
$ListDir .= '<option value="'.$tmpObject["id_droit_acces"] .'">'.$tmpObject["droit_acces"] .'</option>';
}
}
echo "<form name=\"modify\" method=\"post\">\n";
echo "<div align=\"center\">\n";
echo "<input name=\"modify\" type=\"hidden\" value=\"$id\">\n";
echo "<input name=\"operation\" type=\"hidden\" value=\"modify\">\n";
echo"<table width=\"100%\"><tr>
<td width=\"60%\" valign=\"top\">
<table class=\"adminform\">
<tr><th colspan=\"2\">Détails utilisateur </th></tr>";
echo "<input type='hidden' name='update' value=$object->id_intervenant/>";
echo" <tr><td width=\"25%\">Nom :</td>
<td><input type=\"text\" name=\"nom2\" class=\"inputbox\" size=\"40\" value=\"$nom\"></td><tr>\n";
echo"<tr><td>Prénom :</td><td>
<input type=\"text\" name=\"prenom2\" class=\"inputbox\" size=\"40\" value=\"$prenom\"></td>";
echo"<tr>
<td>Adresse E-mail : </td>
<td><input type=\"text\" name=\"email2\" class=\"inputbox\" size=\"40\" value=\"$email\"></td></tr>";
echo"<tr>
<td>Login* :</td>
<td colspan=\"5\"><input type=\"text\" name=\"login2\" class=\"inputbox\" size=\"40\" maxlength=\"50\" value=\"$login\"></td>
</tr>";
echo"<tr>
<td>Mot de passe : </td>
<td><input class=\"inputbox\" type=\"password\" name=\"passwd2\" size=\"40\" value=\"$passwd2\"></td>
</tr>";
echo"<tr>
<td>Numero de téléphone : </td>
<td><input class=\"inputbox\" type=\"text\" name=\"num_téléphone2\" size=\"40\" value=\"$num_téléphone\"></td>
</tr>";
echo"<tr>
<td>Numero de portable : </td>
<td><input class=\"inputbox\" type=\"text\" name=\"num_portable2\" size=\"40\" value=\"$num_portable\"></td>
</tr>";
echo"<tr>
<td>Poste interne :</td>
<td><input class=\"inputbox\" type=\"text\" name=\"poste_interne2\" size=\"40\" value=\"$poste_interne\"></td>
</tr>";
echo"<tr>
<td>Fax : </td>
<td><input class=\"inputbox\" type=\"text\" name=\"fax2\" size=\"40\" value=\"$fax\"></td>
</tr>";
echo"<tr>
<td valign=\"top\">Adresse : </td>
<td>
<textarea cols=\"60\" rows=\"10\" name=\"adresse2\" class=\"inputbox\" value=\"$adresse\"></textarea>
</td>
</tr>";
echo"<tr>
<td>Droit d'accés* :</td>
<td>
<select name=\"fk_droit_acces2\" id=\"fk_droit_acces\" value=\"$fk_droit_acces\">
<?=$ListDir?>
</select>
</td>
</tr>";
echo"<tr>
<td >poste occupé : </td>
<td><input class=\"inputbox\" type =\"text\" name=\"poste_oqp2\" size=\"40\" value=\"$poste_oqp\"></td>
</tr>";
echo"<tr>
<td >Disponibilite : </td>
<td><input class=\"inputbox\" type =\"radio\" name=\"disponibilite2\" size=\"40\" value=\"$disponibilite\"></td>
<td><input class=\"inputbox\" type =\"radio\" name=\"disponibilite2\" size=\"40\" value=\"$disponibilite\"></td>
</tr>";
echo"<tr>
<td>Date de naissance : </td>
<td><input type=\"text\" name=\"date_naiss2\" class=\"calendrier\" size=\"40\" value=\"$date_naiss\"></td></tr>";
echo"<tr>
</tr>";
echo"</table>";
echo"</td>";
echo"</tr>";
echo"</table>";
echo "<p> <a href=\"edit_intervenant_interne.php?operation=modify&id_intervenant=$id\">Modifier les informations</a></p>\n";
//echo "<input type=\"submit\" name=\"MAJ\" value=\"Mettre a jour\">\n";
echo "</form>\n<br>\n"; |
Partager