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 151 152
| $recherche=$_POST['recherche'];
$req="select * from ordinateur, utilisateur
where ordinateur.IdUser=utilisateur.IdUser and RAM like '%$recherche%'
or CPU like '%$recherche%'
or DD like '%$recherche%' or Login like '%$recherche%' or NomPoste like '%$recherche%'";
$query = mysql_query($req, $connexion) or die("erreur".mysql_error());
$lgreq = mysql_fetch_array($query);
if(empty($_POST['recherche']))
{
echo'
<div id="background">
<div id="page">
<div class="header">
<div class="footer">
<div class="body"><div id="sidebar"> <a href="index.html"><img id="logo" src="images/logo.gif" with="154" height="74" alt="" title=""/></a>
<ul class="navigation">
<li><a href="index.html">Accueil</a></li>
<li class="active"><a href="gestion.php" >Gestion du Parc</a></li>
<li><a href="about.php">A propos</a></li>
<li class="last"><a href="contact.php">Contact</a></li>
</ul>
<div class="footenote"> <span>© Copyright © 2011.</span> <span><a href="index.html">Smart&Co</a> all rights reserved</span> </div>
</div>
<div id="content">
<div class="content">
<div class="icones">
<p>';
echo '<h2>Veuillez saisir un champ pour votre recherche<h2>';
echo'
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
header("Refresh: 1; URL=gestion.php");
}
else
{
if (mysql_num_rows($query) > 0)
{
echo '<div id="background">
<div id="page">
<div class="header">
<div class="footer">
<div class="body"><div id="sidebar"> <a href="index.html"><img id="logo" src="images/logo.gif" with="154" height="74" alt="" title=""/></a>
<ul class="navigation">
<li><a href="index.html">Accueil</a></li>
<li class="active"><a href="gestion.php" >Gestion du Parc</a></li>
<li><a href="about.php">A propos</a></li>
<li class="last"><a href="contact.php">Contact</a></li>
</ul>
<div class="footenote"> <span>© Copyright © 2011.</span> <span><a href="index.html">Smart&Co</a> all rights reserved</span> </div>
</div>
<div id="content">
<div class="content">
<div class="tableau">
<p>';
echo'<center><table border="1" width="75%"></center>';
echo '<tr><th>Nom du poste</th><th>Login</th><th>Ram</th><th>DD</th><th>CPU</th><th>Détails</th></tr>';
echo'</br>';
// BOUCLE SUR LES ECRANS
while ($lgreq != FALSE)
{
$NomPoste = $lgreq['NomPoste'];
$login = $lgreq['Login'];
$ram = $lgreq['RAM'];
$cpu = $lgreq['CPU'];
$DD = $lgreq['DD'];
echo '
<tr>
<td align="center">'.$NomPoste.'</td>
<td align="center">'.$login.'</td>
<td align="center">'.$ram.'</td>
<td align="center">'.$DD.'</td>
<td align="center">'.$cpu.'</td>
<td align ="center"><a href="detailordi.php?NomPoste='.$NomPoste.'"><img src="images/oeil.png" border="0" alt="user" /></a></a></td>
</tr>';
$lgreq=mysql_fetch_array($query);
}
echo '</table>';
echo'
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
}
else
{
echo'
<div id="background">
<div id="page">
<div class="header">
<div class="footer">
<div class="body"><div id="sidebar"> <a href="index.html"><img id="logo" src="images/logo.gif" with="154" height="74" alt="" title=""/></a>
<ul class="navigation">
<li><a href="index.html">Accueil</a></li>
<li class="active"><a href="gestion.php" >Gestion du Parc</a></li>
<li><a href="about.php">A propos</a></li>
<li class="last"><a href="contact.php">Contact</a></li>
</ul>
<div class="footenote"> <span>© Copyright © 2011.</span> <span><a href="index.html">Smart&Co</a> all rights reserved</span> </div>
</div>
<div id="content">
<div class="content">
<div class="icones">
<p>';
echo '<h2>Aucun résultat pour votre recherche<h2>';
echo'
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
header("Refresh: 1; URL=gestion.php");
}
echo'
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
} |