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
|
</head>
</body>
<script type="text/javascript">
<!--
function FenetreImage(image, commentaire, commentaire2)
{
oFenetre = window.open('','Image','width=600,height=600,toolbar=no,scrollbars=no,resizable=no');
oFenetre.document.write("<html><head><title>"+commentaire+"</title></head>");
oFenetre.document.write("<script type=\"text/javascript\">function AjusteFenetre() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+2,document.images[0].height+100); window.focus();} else { setTimeout('AjusteFenetre()',1000) } }</"+"script>");
oFenetre.document.write("<body onload='AjusteFenetre()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
oFenetre.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><tr><td valign='middle' align='center'>");
oFenetre.document.write("<img src='"+image+"' border='0' alt='"+commentaire2+"' title='"+commentaire2+"'>");
oFenetre.document.write("</td></tr></table></body></html>");
oFenetre.document.close();
}
//-->
</script>
<?php
include("connect.inc");
if (($_POST['NOM'] == "")AND ($_POST['DISPONIBLE']==""))
{
$page = isset($_GET['page']) ? $_GET['page'] : '';
// Prepare le requete MySql
$req = "SELECT * from coleopteres WHERE (FAMILLE ='".$_POST['FAMILLE']."')";
$res = mysqli_query($connection, $req) or die ("La requête à échouée");
// Variable nombre d'enreg par page
$limit=4;
if(!isset($debut)) $debut=0;
$debut=$page*$limit;
// Compte le nombre de champ
$nb_total=mysqli_num_rows($res);
// Requete
$limite=mysqli_query($connection,"$req limit $debut,$limit");
$_POST['NOM']="Non renseigné";
$_POST['DISPONIBLE']="Non renseignée";
// Affiche le page par page avec ses liens
if ($page>0)
{
$precedent=$page-1;
echo "<a href=\"". $_SERVER['PHP_SELF'] . "?page=$precedent\">PRECEDENT</a>";
}
$i=0;
$j=1;
if($nb_total>$limit)
{
while($i<($nb_total/$limit))
{
if($i!=$page){echo "<a href=\"". $_SERVER['PHP_SELF'] . "?page=$i\>$j</a> ";}
else { echo "<b>$j</b>";}
$i++;$j++;
}
}
if($debut+$limit<$nb_total)
{
$suivant=$page+1;
echo "<a href=\"". $_SERVER['PHP_SELF'] . "?page=$suivant\">SUIVANT</a>";
}
//Affichage le contenu de votre table
//avec une limite, dans l'exemple $limit est à 4
$limit_str = "LIMIT ". $page * $limit .",$limit";
$result = mysqli_query($connection, "SELECT * from coleopteres WHERE (FAMILLE ='".$_POST['FAMILLE']."') $limit_str");
}
echo "<font color=#CC3300><big><b><i>Rappel de vos critères :
$nb_total insectes rendus.</i></b></big></font><br>";
$rappelcritère['Le nom contient :'] = $_POST['NOM'];
$rappelcritère['La disponibilité est : '] = $_POST['DISPONIBLE'];
$rappelcritère['La famille choisie : '] = $_POST['FAMILLE'];
echo "<table border=0 cellpadding=3 cellspacing=3>";
foreach($rappelcritère as $critère => $valeur)
{
echo"<tr><td><font color=#3300ff>$critère</font></td><td><font color=#009999>$valeur</font></td></tr>";
}
echo "</table>";"<br>";"<br>";
echo "<table width='100%' border='1' bordercolor=#FFCC66 bgcolor=#FFFFCC cellpadding='4' cellspacing='0'>";
echo "<br>";"<br>";
echo "<tr> <td colspan='7'></td></tr>
<td><div align='center'><font color=#FF6600 size='3' face='Arial, Helvetica, sans-serif'><strong>Référence</strong></font></div></td>
<td><div align='center'><font color=#FF6600 size='3' face='Arial, Helvetica, sans-serif'><strong>Nom</strong></font></div></td>
<td><div align='center'><font color=#FF6600 size='3' face='Arial, Helvetica, sans-serif'><strong>Famille</strong></font></div></td>
<td><div align='center'><font color=#FF6600 size='3' face='Arial, Helvetica, sans-serif'><strong>Origine</strong></font></div></td>
<td><div align='center'><font color=#FF6600 size='3' face='Arial, Helvetica, sans-serif'><strong>Prix</strong></font></div></td>
<td><div align='center'><font color=#FF6600 size='3' face='Arial, Helvetica, sans-serif'><strong>Dispo</strong></font></div></td>
<td><div align='center'><font color=#FF6600 size='3' face='Arial, Helvetica, sans-serif'><strong>Image</strong></font></div></td>
</tr>";
while($ligne = mysqli_fetch_assoc($result))
{
extract($ligne);
echo '<tr onmouseover="this.style.background=\'#F0FFF0\';" onmouseout="this.style.background=\'#FFFFCC\';">';
echo '<td><div align="left"><font color=\'#FF6600\' size="2" face="Arial, Helvetica, sans-serif"><strong>'.$REFERENCE.'</strong></font></div></td>';
echo '<td><div align="left"><font color=\'#FF6600\' size="2" face="Arial, Helvetica, sans-serif"><strong>'.$NOM.'</strong></font></div></td>';
echo '<td><div align="left"><font color=\'#FF6600\' size="2" face="Arial, Helvetica, sans-serif"><strong>'.$FAMILLE.'</strong></font></div></td>';
echo '<td><div align="left"><font color=\'#FF6600\' size="2" face="Arial, Helvetica, sans-serif"><strong>'.$ORIGINE.'</strong></font></div></td>';
echo '<td><div align="right"><font color=\'#FF6600\' size="2" face="Arial, Helvetica, sans-serif"><strong>'.$PRIX.' </strong></font></div></td>';
echo '<td><div align="center"><font color=\'#FF6600\' size="2" face="Arial, Helvetica, sans-serif"><strong>'.$DISPONIBLE.'</strong></font></div></td>';
echo '<td><div align="center"><a href=javascript:FenetreImage("../img_cetoine/'.$ligne['IMAGE'].'","'.$REFERENCE.'","Origine:'.$ORIGINE.'")>
<img src="../img_cetoine/'.$ligne['IMAGEV'].'" border="0" class="image" align="middle" alt="Cliquez pour Agrandir"></a></td>';
echo '</tr>';
}
echo '</table>';
?>
</body>
</html> |
Partager