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
| <?php
include("./admin/class/BDDClass.php");
?>
<div id="content">
<?php
$BDD = new BDD();
$les_news = $BDD->Requete("SELECT * FROM news order by date_news desc");// limit 0,1");
//$nb_article=0;
$nb_article=$BDD->CompteReponse($les_news);
//echo 'nb : '.$nb_article.' ';
$article = array ($nb_article);
if ($nb_article > 0)
{
$nb_news=0;
while($news=$BDD->RequeteArray($les_news))
{
//echo $news['contenu_news'];
$article[$nb_news]=$news['contenu_news'];
//echo ' art : '.$article[$nb_news];
$nb_news++;
}
//echo $article['0'];
}
else
echo 'Il n\'y a aucune News avec cette id!';
//echo $article[0];
unset($BDD);
?>
</div>
<div>
<?php
if(!isset($_GET['news']))
{
echo 'existe pas ';
$_GET['news']=0;
}
if($nb_article>1)
{
if($_GET['news'] > 0 )
{
?>
<a href="back_next.php?news=<?php echo $_GET['news']; ?>" onclick="document.getElementById('content').innerHTML='<?php $_GET['news']=($_GET['news']-1); echo $_GET['news']; /*echo $article[$page];*/ ?>';return false">
prec
</a>
<?php
}
?>
<?php
if($_GET['news'] < $nb_article )
{
?>
<a href="back_next.php?news=<?php echo $_GET['news']; ?>" onclick="document.getElementById('content').innerHTML='<?php $_GET['news']=($_GET['news']+1); echo $_GET['news']; /*echo $article[$_GET['news']];*/ ?>';return false">
suiv
</a>
<?php
}
}
?>
</div>
<?php
?> |