0byt3m1n1
Path:
/
home
/
k
/
a
/
s
/
kassiope
/
www
/
administrer
/
[
Home
]
File: recherche.php
c<? include("../configuration.inc.php"); necessite_identification(); necessite_priv("admin"); $DOC_TITLE = "Rechercher un produit"; include("modeles/haut.php"); ?> <table border=0 cellpadding=1 cellspacing=4 width=100%> <tr> <td class=label colspan=2 bgcolor="#EEEEEE">Résultat de votre recherche</td> </tr> <tr> <td colspan=2 height=20><IMG SRC="<?=$wwwroot?>/images/blank.gif" HEIGHT=20 ALT=""></td> </tr> <? $nb=10; //nombre d'enregistrement par page if(!$start) {$start=0;} $resultat = mysql_query_override("SELECT id, reference, nom FROM gaia_categories WHERE nom LIKE '%" . htmlspecialchars($_GET['motclef']) . "%' OR reference LIKE '%" . htmlspecialchars($_GET['motclef']) . "%' LIMIT $start,$nb"); if (mysql_num_rows_override($resultat) == 0) { echo "<tr><td colspan=2 class=normal>Nous n'avons pas trouvé de résultats incluant la référence <b>". $motclef ."</b>.<p></p><b>Suggestions :</b><br /><li type=square> Vérifiez la référence du produit.<br /><li type=square> Essayez une autre référence.<p></p></td></tr>"; } else { ?> <tr bgcolor="#6699ff"> <td class=normal>Référence</td> <td class=normal>Produit</td> </tr> <? while ($recherche=mysql_fetch_array_override($resultat)) { ?> <tr> <td class=normal><?=$recherche['reference'];?></td> <td class=normal><a href=produits.php?mode=modif&id=<?=$recherche['id'];?> class=normal><?=$recherche['nom_'.$_SESSION['langue'].''];?></a></td> </tr> <?}?> <tr> <td colspan=2 height=20><IMG SRC="<?=$wwwroot?>/images/blank.gif" HEIGHT=20 ALT=""></td> </tr> <tr><td colspan=2 class=normal align=center> <? //Boutons précédent et suivant if($start) { print("<a class=normal href=\"recherche.php?motclef=".$motclef."&start=".($start-$nb)."\">Page précédente</a>");} $result=mysql_query_override("SELECT COUNT(*) FROM gaia_categories WHERE nom LIKE '%" . htmlspecialchars($_GET['motclef']) . "%' OR reference LIKE '%" . htmlspecialchars($_GET['motclef']) . "%'"); $row=mysql_fetch_row_override($result); if($row[0]>($start+$nb)) { if($start) {print(" / ");} print("<a class=normal href=\"recherche.php?motclef=".$motclef."&start=".($start+$nb)."\">Page suivante</a>"); } print("<br />"); //Affichage des pages if($row[0]>$nb) // le nombre d'enreg. est > au nb de lignes d'affichage ? { print("Page : "); for($index=0;($index*$nb)<$row[0];$index++) // oui alors on affiche les numéros de pages { ?> <a class=normal href="<?=$_SERVER['PHP_SELF']."?motclef=".$motclef."&start=".$index*$nb; ?>"><? echo $index+1; ?></a> <?} }?> </td></tr> <?}?> </table> <? include("modeles/bas.php"); ?>