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
|
<?php
session_start();
include("connexion.php");
connect($host,$user,$mot_passe,$db_name);
if ( !session_is_registered("authen_user")){
#echo '<META HTTP-EQUIV="refresh" CONTENT="0;URL=index.php?erreur=404">';
#redirection instantanée
header("location:index.php?erreur=404");
}
//$date = date("d/m/Y à H\hi", filemtime($_SERVER['SCRIPT_FILENAME']));
$date = getdate();
$m = $date['mon'];
$j = $date['mday'];
$a = $date['year'];
$d= $j."/".$m."/".$a;
$sn=$_POST['sn'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link href="css/style.css" rel="stylesheet">
<title></title>
</head>
<body topmargin="0" leftmargin="0">
<table width="967" height="902" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#FFFFFF" style="border-collapse: collapse">
<tr>
<td width="100%" height="126" align="left" valign="top">
<table WIDTH="967" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<tr>
<td COLSPAN="6"><img SRC="img/header.jpg" WIDTH="387" HEIGHT="94"></td>
</tr>
<tr>
<td width="89"><a class="linx" href="user_home.php">Consultation </a></td>
<td width="111"><a class="linx" href="new.php">Ajouter nouveau</a></td>
<td width="467"><a class="linx" href="find2.php">Recherche</a></td>
<td width="38"><a class="linx" href=""></a></td>
<td width="175"><a class="linx" href="#6"></a></td>
<td width="87"><a class="linx" href="deco.php">Déconnecxion</a></td>
</tr>
<?php
$sql="select * from pc where n_serie='$sn' ";
$rs=mysql_query("$sql");
$i=1;
$query = "SELECT count(id) from pc where n_serie='$sn' ";
$result = mysql_query($query) or die (mysql_error());
$resultat=mysql_fetch_row($result);
//echo "nbre est : $resultat[0]";
//echo "<br />";
//echo "<br />";
while($tab=mysql_fetch_array($rs))
{
echo "<tr>";
echo "<td valign=top><p class=text2> $tab[0]</td>";
echo "<td valign=top><p class=text2> $tab[1]</td>";
echo "<td valign=top><p class=text2> $tab[11]</td>";
echo "<td valign=top><p class=text2> $tab[12]</td>";
echo "<td valign=top><p class=text2> $tab[3]</td>";
echo "<td valign=top><p class=text2> $tab[4]</td>";
echo "<td valign=top><p class=text2> $tab[5]</td>";
echo "<td valign=top><p class=text2> $tab[6]</td>";
echo "<td valign=top><p class=text2> $tab[8]</td>";
echo "<td valign=top><p class=text2> $tab[10]</td>";
}
?>
<tr>
<td COLSPAN="6"> </td>
</tr>
</table>
</td>
</tr>
<?php
$sql="select * from pc where n_serie='$sn' ";
$rs=mysql_query("$sql");
while($tab=mysql_fetch_array($rs)){
$Nom=$tab[1];
$Prenom=$tab[2];
$Service=$tab[3];
$Matricule=$tab[4];
}
?>
<td valign="top"><hr>
<table width="966" height="227" BORDER="0" CELLPADDING="0" CELLSPACING="0" bordercolor="#BDE7F7">
<tr>
<th height="33" ><p align="left" class=text2>Réaffectation de PC </th>
</tr>
<tr>
<td height="125" align="center">
<table width="335" height="105">
<form name="f2" action="affect2.php" method="post">
<input type="hidden" value="<?php echo $id; ?>" name="id">
<tr><td width="128"><span class="Style1"> Nom :</span></td>
<td width="195"><input name="nom" value="$Nom"></td></tr>
<tr><td><span class="Style1"> Prénom :</span></td> <td><input name="pre" value="$Prenom"></td></tr>
<tr><td><span class="Style1"> Matricule :</span></td> <td><input name="mat" value="$Matricule"></td></tr>
<tr><td><span class="Style1"> Services :</span></td> <td><input name="serv" value="$Service"></td></tr>
</td></tr>
<tr><td><span class="Style1"> Date : </span></td> <td><?php echo $d; ?></td></tr>
<tr>
<label></label></td></tr>
<tr><td height="52"><input type="submit" value="Valider" ></td>
<td><input type="reset" value="Annuler"></td></tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
if ( isset($_POST['Nom'])&& isset($_POST['Prénom']) && isset($_POST['Matricule']) &&
isset($_POST['Service']) && isset($_POST['Date']) )
{
//enregistrer les modifications de l'evenement concerné*/
$req=$bdd->prepare("UPDATE evenement SET
Nom=:$tab[nom],
Prenom=:$tab[prenom],
Matricule=:$tab[prenom],
Date=:$tab[date],
Service=:$tab[service]
WHERE n_serie='$sn' ");
}
?>
<tr><td><span class="Style1"> Prénom :</span></td> <td><input name="pre" value="$tab[prenom]"</td></tr>
<tr><td><span class="Style1"> Matricule :</span></td> <td><input name="mat" value="$tab[matricule]"></td></tr>
<tr><td><span class="Style1"> Services :</span></td> <td><input name="serv" value="$tab[service]"></td></tr>
</td></tr>
</body>
</head>
</html> |
Partager