getinstance(); $emission = $pdo->prepare("SELECT * FROM `psyEmissions` WHERE isOnline=1 and `specialiteID`= '".$type."' and psyEmissions.hideEmi=0 and TO_DAYS(NOW()) - TO_DAYS(`onlineDateTime`) >= 0 ORDER BY `psyEmissions`.`onlineDateTime` DESC Limit 1"); $emission->execute(); return $emission->fetch( PDO::FETCH_OBJ ); } public function get_emmissions_bylimit($type,$limit) { $db=new Db(); $pdo=$db->getinstance(); if($type==103) $emission = $pdo->prepare("SELECT * FROM `psyEmissions` WHERE isOnline=1 and `specialiteID`= '".$type."' and psyEmissions.hideEmi=0 and TO_DAYS(NOW()) - TO_DAYS(`onlineDateTime`) >= 0 ORDER BY `psyEmissions`.`onlineDateTime` DESC Limit ".$limit.""); else $emission = $pdo->prepare("SELECT * FROM `psyEmissions` WHERE isOnline=1 and `specialiteID`= '".$type."' and psyEmissions.hideEmi=0 and TO_DAYS(NOW()) - TO_DAYS(`onlineDateTime`) >= 0 AND TO_DAYS(NOW()) - (TO_DAYS(`onlineDateTime`)+14)<= 0 ORDER BY `psyEmissions`.`onlineDateTime` DESC Limit ".$limit.""); $emission->execute(); return $emission; } public function get_videos() { $db=new Db(); $pdo=$db->getinstance(); $video = $pdo->prepare("SELECT * FROM `v3_vedio_reports` where onligne=1 ORDER BY `v3_vedio_reports`.`onlinedate` DESC LIMIT 5"); //echo "SELECT * FROM `v3_vedio_reports` where onligne=1 and ORDER BY `v3_vedio_reports`.`id` DESC LIMIT 3";exit; $video->execute(); return $video; } public function get_partenaires() { $db=new Db(); $pdo=$db->getinstance(); $partenaire = $pdo->prepare("select Partenaire_v3.id,Partenaire_v3.nom,v3_page.title,v3_page.id,v3_page.upper_title,v3_page.description,v3_partenaire_home.report from Partenaire_v3 INNER JOIN v3_partenaire_home on (v3_partenaire_home.id_partner=Partenaire_v3.id) INNER JOIN v3_page on(v3_page.id=v3_partenaire_home.id_page)"); $partenaire->execute(); return $partenaire; } } ?>getinstance(); $type = $pdo->prepare("select emissionID,title,specialiteID,titlePagePlayer from psyEmissions where emissionID=".$id.""); $type->execute(); return $type->fetch( PDO::FETCH_OBJ ); } public function affiche_emission_by_type($cond) { $db=new Db(); $pdo=$db->getinstance(); $news = $pdo->prepare("SELECT * FROM `psyEmissions` ".$cond.""); $news->execute(); //echo "SELECT * FROM `psyEmissions` WHERE `specialiteID`= '".$type."' and psyEmissions.hideEmi=0 and isOnline=1 and TO_DAYS(NOW()) - TO_DAYS(`onlineDateTime`) >= 3 ORDER BY `psyEmissions`.`onlineDateTime` DESC Limit 3"; return $news; } public function affiche_type_emission($obj) { $db=new Db(); $pdo=$db->getinstance(); $type = $pdo->prepare("select title_us,spec_color from psyProfilsSpecialites where profilSpecialiteID=".$obj.""); $type->execute(); return $type->fetch( PDO::FETCH_OBJ ); } public function affiche_specialitee_emission($obj) { $db=new Db(); $pdo=$db->getinstance(); $spec = $pdo->prepare("select title from psySpecialites where specialiteID=".$obj.""); $spec->execute(); return $spec->fetch( PDO::FETCH_OBJ ); } public function affiche_image_insight_intervenant($obj) { $db=new Db(); $pdo=$db->getinstance(); $spec = $pdo->prepare("select thunbnail from psyIntervenants_v3 where intervenantID=".$obj.""); $spec->execute(); return $spec->fetch( PDO::FETCH_OBJ ); } public function getDataForCanonicalURL($emissionID) { $db=new Db(); $pdo=$db->getinstance(); $spec = $pdo->prepare("select title, emissionID, `log` from psyEmissions where emissionID = ".$emissionID.""); $spec->execute(); return $spec->fetch( PDO::FETCH_OBJ ); } public function Getsondage($emissionID) { $db=new Db(); $pdo=$db->getinstance(); $sql="select quest_rep,TypeEmission,sondage,questID from psyEmissions where emissionID='$emissionID'"; $sth = $pdo->prepare($sql); //echo $sql; $sth->execute(); return $sth; } public function Getquestionnaire($sondageID) { $db=new Db(); $pdo=$db->getinstance(); $sql="select isOnline,textAfterSubmission,textIntro from psyQuestionnaires where questionnaireID='$sondageID'"; $sth = $pdo->prepare($sql); //echo $sql; $sth->execute(); return $sth; } public function Getquestions($sondageID,$qid,$controle) { $db=new Db(); $pdo=$db->getinstance(); $sql="select question".$qid."TypeID,question".$qid."Text $controle from psyQuestionnaires where questionnaireID='$sondageID'"; $sth = $pdo->prepare($sql); //echo $sql; $sth->execute(); return $sth; } public function Getassemblage($assemblage) { $db=new Db(); $pdo=$db->getinstance(); $sql="select * from `assemblage` where `assemblageID`='$assemblage'"; $sth = $pdo->prepare($sql); //echo $sql; $sth->execute(); return $sth; } } ?>