require_once 'admin/db.inc.php';
$mois = array("","jan", "fev", "mar", "apr", "mar", "june", "july", "aug", "sep", "oct", "nov", "dec");
$connexion = dbConnect();
$idActualite = intval($_GET['id']);
$page = $_GET["page"];
if($idActualite!="" && $idActualite > 0){
$sqlDetailActualite = "SELECT `IdActualite` , `ActDateCreation` , `ActTitreEn` , `ActIntroductionEn` , `ActDescriptifEn` , `ActPhoto` , `ActVignette`, `ActDatePublication`";
$sqlDetailActualite .= " FROM `systeam_actualites`";
$sqlDetailActualite .= " WHERE `IdActualite` ='$idActualite'";
$sqlDetailActualite .= " AND `ActTitreEn` != ''";
$sqlActualites.= " AND (AfficheAn=1)";
$sqlDetailActualite .= " ORDER BY `ActDatePublication` DESC";
$resultDetailActualite = dbQuery($sqlDetailActualite, $connexion);
if(dbResok($resultDetailActualite)){
//$rstDetail = dbFetchArray($resultDetailActualite, $connexion);
$rstDetail = $resultDetailActualite[0];
?>
Oct 6, 2024
switch($_GET['type']){
case "0":
echo "<<
Back";
break;
case "1":
echo "<<
Back";
break;
case "2":
echo "<<
Back";
break;
case "all":
echo "<<
Back";
break;
default:
echo "<<
Back";
break;
}
}
}else { //Si pas d'id actualite on affiche toutes les actualités
afficheBlocActus("PRODUCT", "0");
afficheBlocActus("EVENTS", "1");
afficheBlocActus("IN THE PRESS", "2");
if($nav) echo '
'.$nav->AffichageNavigation().'
';
/*
// AFFICHAGE PAR TRI CHRONOLOGIQUE DE BASE
$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 `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)){
$j = date('j', $rstActualite['ActDatePublication']);
$m = $mois[date('n',$rstActualite['ActDatePublication'])];
$n = date('Y', $rstActualite['ActDatePublication']);
?>
}
}
if($nav) echo '
'.$nav->AffichageNavigation().'
';
*/
}
// Affiche toutes les actualites correspondant a $typeActu, avec texteTitre en intro du bloc
function afficheBlocActus($texteTitre, $typeActu)
{
global $connexion, $mois, $idActualite, $page, $nav;
print "
";
print "
$texteTitre";
print "
";
$sqlActualites = "SELECT IdActualite, ActTitreEn , ActIntroductionEn , 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 ActTitreEn != ''";
$sqlActualites .= " AND ActType = " . $typeActu ;
$sqlActualites .= " AND (AfficheAn=1)" ;
$sqlActualites.= " ORDER BY ActDatePublication DESC ";
$nav = new Navigation($connexion, $sqlActualites, $page, 15 ,15, "https://www.systeam.fr/en/news", "","");
$resultActualites = dbQuery($nav->RequeteSQL(), $connexion);
if(dbResOk($resultActualites)){
foreach($resultActualites as $rstActualite)
{
$j = date('j', $rstActualite['ActDatePublication']);
$m = date('n',$rstActualite['ActDatePublication']);
$n = date('Y', $rstActualite['ActDatePublication']);
print "
{$rstActualite['ActTitreEn']}";
print "
$j {$mois[$m]} $n
";
print "
{$rstActualite['ActIntroductionEn']}
";
}
}
} // End function afficheBlocActus
?>