RE
Voilà je repost le code complet pour genre.
Code : Tout sélectionner
// Si une recherche à était effectué
} elseif (isset($_GET['genre']))
{
if ($_GET['genre'] != NULL)
{
// On récupère la recherche pour une paggination
if($_GET['genre'] != NULL) {
$genre = htmlentities($_GET['genre'], ENT_QUOTES);
}
// Si le nombre de page n'extsite pas elle est par défaut à 1
if($_GET['page_genre'] != NULL AND is_numeric($_GET['page_genre']))
{
$page_genre = htmlentities ($_GET['page_genre'], ENT_QUOTES);
} else {
$_GET['page_genre'] = 1;
}
// On récupère le nombre de résultat
$requete_page_genre = mysql_query("SELECT id FROM ticket_astuce WHERE genre1='$genre' OR genre2='$genre' ORDER BY id DESC");
$num_genre = mysql_num_rows($requete_page_genre);
// Nombre de résultat par page
$nombre_resultats_genre = 24;
$debut_affichage_genre = ($_GET['page_genre']-1)*$nombre_resultats_genre;
// Affichage des images films selon la recherche
$requete_genre = mysql_query("SELECT * FROM ticket_astuce WHERE genre1='$genre' OR genre2='$genre' ORDER BY id DESC LIMIT $debut_affichage_genre, $nombre_resultats_genre");
while( $genres = mysql_fetch_array($requete_genre)) {
$bulle = $genres['commentaire'];
// Système de bulle
?>
<li>
<div class="img-one-fourth">
<p class="fade-img" data-rel="zoom-icon"><a href=" http://***/Web/Films/Ajout_films/<?php echo $genres['image']; ?>" data-rel="prettyPhoto[mygallery]" title="<?php echo $genres['solution']; ?>"><img src=" http://***/Web/Films/Ajout_films/<?php echo $genres['image']; ?>" width="150" height="200" alt="<?php echo $genres['solution']; ?>" title="" /></a></p>
</div>
<div class="portfolio-content">
<p><a href="fiche.php?film=<?php echo $genres['id']; ?>" class="button-small"><img src="images/notes/oeil.png" width="20" height="20" alt="voir"> Consulter</a></p>
</div>
<div class="portfolio-content">
<p><a href="noter.php?id=<?php echo $genres['id']; ?>"><img src="images/notes/vote1.png" width="30" height="30" alt="Voter"></a></p>
</div> <!-- .portfolio-content -->
</li>
<?php
}
if($num_genre == NULL) { echo '<center>Messages</center>'; }
//Affichage du nombres de pages
if(is_numeric($_GET['page_genre']))
{
echo '<div id="container"><br />';
$pages_genre= $_GET['page_genre'];
if($_GET['page_genre'] != 1)
{
//$page_genre_p = $_GET['page_genre']-1;
//echo "<a href=\"index.php?page_affichage=$i\"></a>";
}
$total_genre = ceil($num_genre/$nombre_resultats_genre);
{
echo'<div id="tnt_pagination"><a href="index.php?genre=$genre&page_genre='.$genre.'">Début</a>';
if($page_genre>=10){$debut_genre=$page_genre-10;}else{$debut_genre=1;}//on vérifie que la page actuelle est supérieur a 5
if($page_genre<=$num_genre){$fin_genre=$page_genre+10;}else{$fin_genre=$num_genre;}
for ($i = $debut_genre; $i <= $fin_genre; $i++) {
if($page_genre==$i){
echo $i;
}
else{
echo'<a href="index.php?genre='.$genre.'&page_genre='.$i.'"> '.$i.'</a>';
}
}
}
echo '<a href="index.php?genre='.$genre.'&page_genre='.$total_genre.'"><img src="images/icons/11889-Metalian-Avance.png" width="10" height="10" alt="droite"></a>';
echo '<form method="GET" action="">';
echo'<input type="hidden" name="genre" value="'.$genre.'">';
echo '<select class="pagination" name="page_genre" onChange="this.form.submit();">';
for ($i = 1; $total_genre <= $i ; $i++) {
if($page_genre==$i){$sel='selected="selected"';}else{$sel='';}
echo'<option value="'.$i.'" '.$sel.'>Consulter la Page : '.$i.'</option>';
}
echo '</select>';
echo '<noscript><input type="submit" value="Changer" /></noscript>';
echo '</form></div></div>';
}
}
<style type="text/css">
.pagination {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
color: #FFF;
background-color: #F1F1F1;
border: 2px solid #999;
padding: 2px;
width: 150px;
margin-right: 1px;
margin-left: 1px;
text-decoration: none;
color: #63F;
margin-top: 5px;
margin-bottom: 2px;
}
a {
text-decoration: none;
}
#tnt_pagination {
-moz-box-shadow: none;
-webkit-box-shadow: none;
-o-box-shadow: none;
box-shadow: none;
border: 0 none !important;
background: transparent !important;
margin-left: 0;
margin-right: 0;
}
#tnt_pagination a:link, #tnt_pagination a:visited{
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-o-border-radius: 3px;
-ms-border-radius: 3px;
-khtml-border-radius: 3px;
border-radius: 3px;
-moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
-o-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
margin: 1px 2px;
padding: 5px 10px;
display: inline-block;
border-top: 1px solid #fff;
text-decoration: none !important;
color: #717171 !important;
font-size: smaller !important;
font-family: "Helvetica Neueu", Helvetica, Arial, sans-serif;
text-shadow: white 0 1px 0;
background-color: #f5f5f5;
background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#eaeaea));
/* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #f9f9f9, #eaeaea);
/* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, #f9f9f9, #eaeaea);
/* FF3.6 */
background-image: -ms-linear-gradient(top, #f9f9f9, #eaeaea);
/* IE10 */
background-image: -o-linear-gradient(top, #f9f9f9, #eaeaea);
/* Opera 11.10+ */
background-image: linear-gradient(top, #f9f9f9, #eaeaea);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f9f9f9', EndColorStr='#eaeaea');
/* IE6–IE9 */
}
#tnt_pagination a:hover {
border-color: #fff;
background-color: #FF9900;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#fafafa));
/* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #fefefe, #fafafa);
/* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, #fefefe, #fafafa);
/* FF3.6 */
background-image: -ms-linear-gradient(top, #fefefe, #fafafa);
/* IE10 */
background-image: -o-linear-gradient(top, #fefefe, #fafafa);
/* Opera 11.10+ */
background-image: linear-gradient(top, #fefefe, #fafafa);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#fefefe', EndColorStr='#fafafa');
/* IE6–IE9 */
}
#tnt_pagination .active_tnt_link {
-moz-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
-webkit-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
-o-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
border-color: #505050 !important;
color: #f2f2f2 !important;
text-shadow: black 0 1px 0;
background-color: #676767;
background-image: -webkit-gradient(linear, left top, left bottom, from(#5f5f5f), to(#5c5c5c));
/* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #5f5f5f, #5c5c5c);
/* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, #5f5f5f, #5c5c5c);
/* FF3.6 */
background-image: -ms-linear-gradient(top, #5f5f5f, #5c5c5c);
/* IE10 */
background-image: -o-linear-gradient(top, #5f5f5f, #5c5c5c);
/* Opera 11.10+ */
background-image: linear-gradient(top, #5f5f5f, #5c5c5c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#5f5f5f', EndColorStr='#5c5c5c');
/* IE6–IE9 */
}
#tnt_pagination .disabled_tnt_pagination {
padding:7px;
padding-top:2px;
padding-bottom:2px;
border:1px solid #EBEBEB;
margin-left:10px;
text-decoration:none;
background-color:#F5F5F5;
color:#D7D7D7;
cursor:default;
}
</style>