require_once 'admin/db.inc.php';
$connexion = dbConnect();
$mois = array("", "jan", "fév", "mar", "avr", "mai", "juin", "juil", "aoû", "sep", "oct", "nov", "déc");
$type_actu = "0";
$idActualite = intval($_GET['id']);
$page = $_GET["page"];
if($idActualite!="" && $idActualite > 0){
$sqlDetailActualite = "SELECT `IdActualite` , `ActDateCreation` , `ActTitre` , `ActIntroduction` , `ActDescriptif` , `ActPhoto` , `ActVignette`, `ActDatePublication`";
$sqlDetailActualite .= " FROM `systeam_actualites`";
$sqlDetailActualite .= " WHERE `IdActualite` ='$idActualite'";
$sqlDetailActualite .= " AND `ActType` = ".$type_actu;
$sqlDetailActualite .= " AND `AfficheFr` = 1";
$sqlDetailActualite .= " ORDER BY `ActDatePublication` DESC";
$resultDetailActualite = dbQuery($sqlDetailActualite, $connexion);
$j = date('j', $rstDetail['ActDatePublication']);
$m = date('n',$rstDetail['ActDatePublication']);
$n = date('Y', $rstDetail['ActDatePublication']);
if(dbResok($resultDetailActualite)){
//$rstDetail = dbFetchArray($resultDetailActualite, $connexion);
$rstDetail = $resultDetailActualite[0];
?>
<<
Retour
}
}else { //Si pas d'id actualite on affiche toutes les actualités
$sqlActualites = "SELECT IdActualite, ActTitre , ActIntroduction , ActVignette,ActDatePublication FROM systeam_actualites WHERE en_ligne=1 ";
$dateActuelle = time();
$sqlActualites.= " AND (ActDatePublication=0 OR ActDatePublication<=".$dateActuelle.")";
$sqlActualites.= " AND (ActDateDepublication=0 OR ActDateDepublication>=".$dateActuelle.")";
$sqlActualites .= " AND `ActTitre` != ''";
$sqlActualites .= " AND `ActType` = ".$type_actu ;
$sqlActualites .= " AND `AfficheFr` = 1";
$sqlActualites.= " ORDER BY ActDatePublication DESC ";
$nav = new Navigation($connexion, $sqlActualites, $page, 15 ,15, "https://www.systeam.fr/actualites", "","");
$resultActualites = dbQuery($nav->RequeteSQL(), $connexion);
if(dbResOk($resultActualites)){
//while($rstActualite = dbFetchArray( $resultActualites, $connexion)){
foreach($resultActualites as $rstActualite)
{
$j = date('j', $rstActualite['ActDatePublication']);
$m = date('n',$rstActualite['ActDatePublication']);
$n = date('Y', $rstActualite['ActDatePublication']);
?>
}
}
if($nav) echo '
'.$nav->AffichageNavigation().'
';
}
?>