test.php








Inventaire

INVENTAIRE


Impossible de se connecter à la base de données.

“;
exit;
};
$barcode = $_POST[“barcode”];
$barcode = strtr($barcode,” “,”%”);
$barcode.=”%”;
//Requête

$query=”SELECT `itemcallnumber` , `barcode` , `datelastseen` , `itemlost` , `datelastborrowed` FROM items WHERE barcode LIKE ‘$barcode%’ “;
if ($barcode)
{
$query.=” AND barcode LIKE ‘%$barcode’ ” ;
};
$query.=” ORDER BY barcode”;
$res=mysql_query($query);

//Comptage des enregistrements
$nbre = mysql_num_rows($res);
echo”$nbre enregistrement(s) de $barcode


“;
echo “

“;
while($val=mysql_fetch_array($res))
{
$barcode = $val[‘barcode’];
$itemcallnumber = $val[‘itemcallnumber’];
$datelastseen = $val[‘datelastseen’];
$itemlost = $val[‘itemlost’];
$datelastborrowed = $val[‘datelastborrowed’];

//Tableau d’affichage de la liste
echo “

“;
if ($itemlost==1)
{
echo “

“;
}
else
{
echo “

“;
}
echo ”

“;
}
echo “

Cote N° d’inventaire vu pour la dernière fois Lost Dernier emprunt le :
“.$itemcallnumber.” “.$barcode.” “.$datelastseen.” disparu présent “.$datelastborrowed.”

“;

mysql_close();
?>