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
|
class page {
var $titre;
var $idPere;
var $idPage;
function affNews() {
$strSQL = "SELECT idNews, titreNews, news, imgNews FROM news ORDER BY idNews DESC LIMIT 3";
$resultat = reqSQL($strSQL);
while($tabl_result=mysql_fetch_array($resultat)){
echo "<TABLE width='100%' border='0' cellspacing='0' cellpadding='0'>
<TR><TD><TABLE width='100%' border='0' cellspacing='0' cellpadding='0'>
<TR><TD width='11'><IMG src='images/tit1.gif' width='11' height='34'></TD>
<TD background='images/tit2.gif' class='tit'>" .$tabl_result['titreNews']. "</TD>
<TD width='14'><IMG src='images/tit3.gif' width='14' height='34'></TD>
</TR>
</TABLE></TD>
</TR>";
echo"<TR><TD class='txt2'><DIV style='text-align:justify'>".nl2br($tabl_result['news']). "</DIV></TD></TR>
</TABLE><BR/>" ;
} // while
}
//affiche les menus
function affMenu($idpage) {
include_once "./fonctions.php";
//sélectionne toutes les pages filles de la page en cours
$strSQL = "SELECT idPage, nomMenu FROM page WHERE idParent = ".$idpage;
$resultat = reqSQL($strSQL);
//si la page n'a pas de fille, alors on modifie la requete pour obtenir ses pages soeurs
if (mysql_num_rows($resultat) == 0) {
$strSQL = "SELECT idPage, nomMenu FROM page WHERE idParent = " .$_ENV['idParent'];
$resultat = reqSQL($strSQL);
}
$menuRetour = "";
//etant donné qu'on a une page différente pour l'index et pour l'admin, il faudra afficher les bons menus
//pour cela on teste l'idPage et on définit l'url en fonction.
$url="";
if ($_ENV['idPage'] <100){ $url="index.php"; }
else {$url="admin.php";}
while ($tabl_result = mysql_fetch_array($resultat)) {
$menuRetour .= "<TR><TD width='20'><IMG src='images/puce.gif' width='18' height='18'></TD>";
$menuRetour .= "<TD width='145'><A href='".$url."?idPage=".$tabl_result['idPage']."' class='link0'>";
$menuRetour .= $tabl_result['nomMenu'];
$menuRetour .= "</A></TD></TR>";
}
return $menuRetour;
}
} |