/**
  * Fonction qui permet d'afficher les derniers commentaires postés par les internautes
  * */
 public function getDerniersCommentaires($params = array())
 {
     $html = '';
     $string = new stringObject();
     $bbCode = new bbCodeObject();
     $sqlLimit = "LIMIT 5";
     if (isset($params['afficherTous']) && $params['afficherTous'] == true) {
         $reqCount = "\n                SELECT distinct idCommentaire,'commentaires' as typeCommentaires\n                FROM commentaires c\n                WHERE CommentaireValide=1\n            \tUNION\n            \tSELECT distinct idCommentairesEvenement as idCommentaire,'commentairesEvenement' as typeCommentaires\n            \tFROM commentairesEvenement\n            \tWHERE CommentaireValide=1\n            ";
         $resCount = $this->connexionBdd->requete($reqCount);
         $nbEnregistrementTotaux = mysql_num_rows($resCount);
         $pagination = new paginationObject();
         $nbEnregistrementsParPage = 15;
         $arrayPagination = $pagination->pagination(array('nomParamPageCourante' => 'pageCourante', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => $nbEnregistrementTotaux, 'typeLiens' => 'noformulaire'));
         $sqlLimit = $pagination->addLimitToQuery();
     }
     $req = "\n                SELECT distinct c.idCommentaire, u.mail,u.nom,u.prenom,c.commentaire,c.idEvenementGroupeAdresse,DATE_FORMAT(c.date,'%d/%m/%Y') as dateF, date,'commentaires' as typeCommentaires\n                FROM commentaires c\n\t\t\t\tLEFT JOIN utilisateur u ON u.idUtilisateur = c.idUtilisateur\n                LEFT JOIN _adresseEvenement ae ON ae.idEvenement = c.idEvenementGroupeAdresse\n                WHERE c.CommentaireValide=1\nUNION\nSELECT distinct c.idCommentairesEvenement as idCommentaire, u.mail,u.nom,u.prenom,c.commentaire,c.idEvenement as idEvenementGroupeAdresse ,DATE_FORMAT(c.date,'%d/%m/%Y') as dateF, date,'commentairesEvenement' as typeCommentaires\n                FROM commentairesEvenement c\n\t\t\t\tLEFT JOIN utilisateur u ON u.idUtilisateur = c.idUtilisateur\n                LEFT JOIN _adresseEvenement ae ON ae.idEvenement = c.idEvenement\n                WHERE c.CommentaireValide=1\n                ORDER BY date DESC\n                {$sqlLimit}\n            ";
     $res = $this->connexionBdd->requete($req);
     // on affiche l'encart seulement s'il y a au moins un commentaire
     if (mysql_num_rows($res) > 0) {
         $t = new Template('modules/archi/templates/');
         if (isset($params['afficherTous']) && $params['afficherTous'] == true) {
             $t->set_filenames(array('derniersCommentaires' => 'tousLesCommentaires.tpl'));
         } else {
             $t->set_filenames(array('derniersCommentaires' => 'encartAccueilCommentaires.tpl'));
             $t->assign_vars(array('urlTousLesCommentaires' => "<a href='" . $this->creerUrl('', 'tousLesCommentaires') . "'>" . _("Tous les commentaires") . "</a>"));
         }
         if (isset($params['afficherTous']) && $params['afficherTous'] == true) {
             $t->assign_vars(array('pagination' => $arrayPagination['html']));
         }
         while ($fetch = mysql_fetch_assoc($res)) {
             $ancre = "#commentaire";
             // recuperation de l'adresse concernée
             if ($fetch['typeCommentaires'] == 'commentaires') {
                 $idEvenementGroupeAdresse = $fetch['idEvenementGroupeAdresse'];
                 $resAdresses = $this->getAdressesFromEvenementGroupeAdresses($idEvenementGroupeAdresse);
                 $arrayIntituleAdresses = array();
                 while ($fetchAdresses = mysql_fetch_assoc($resAdresses)) {
                     $arrayIntituleAdresses[] = $this->getIntituleAdresse($fetchAdresses);
                 }
                 $idAdresse = $this->getIdAdresseFromIdEvenementGroupeAdresse($idEvenementGroupeAdresse);
                 $urlAdresse = $this->creerUrl('', '', array('archiAffichage' => 'adresseDetail', 'archiIdAdresse' => $idAdresse, 'archiIdEvenementGroupeAdresse' => $idEvenementGroupeAdresse));
                 $labelItemCommented = str_replace("( - )", "", implode(" / ", $arrayIntituleAdresses));
                 $ancre .= "Adresse" . $fetch['idCommentaire'];
             } elseif ($fetch['typeCommentaires'] == 'commentairesEvenement') {
                 $e = new archiEvenement();
                 $idEvenementGroupeAdresse = $e->getIdEvenementGroupeAdresseFromIdEvenement($fetch['idEvenementGroupeAdresse']);
                 $ancre .= "Evenement" . $fetch['idCommentaire'];
                 if ($idPersonne = archiPersonne::isPerson($idEvenementGroupeAdresse)) {
                     $nom = archiPersonne::getName($idPersonne);
                     $labelItemCommented = $nom->prenom . " " . $nom->nom;
                     $urlAdresse = $this->creerUrl('', '', array('archiAffichage' => 'evenementListe', 'selection' => "personne", 'id' => $idPersonne));
                     $urlImage = archiPersonne::getImage($idPersonne, 'mini', false);
                     if (!isset($urlImage) || empty($urlImage)) {
                         $array_image = archiPersonne::getImages($idPersonne);
                         if (isset($array_image) && !empty($array_image)) {
                             $img = $array_image[0];
                             $urlImage = "photos--" . $img->dateUpload . "-" . $img->idHistoriqueImage . "-mini.jpg";
                         }
                     }
                 } else {
                     $resAdresses = $this->getAdressesFromEvenementGroupeAdresses($idEvenementGroupeAdresse);
                     $arrayIntituleAdresses = array();
                     while ($fetchAdresses = mysql_fetch_assoc($resAdresses)) {
                         $arrayIntituleAdresses[] = $this->getIntituleAdresse($fetchAdresses);
                     }
                     $labelItemCommented = str_replace("( - )", "", implode(" / ", $arrayIntituleAdresses));
                     $idAdresse = $this->getIdAdresseFromIdEvenementGroupeAdresse($idEvenementGroupeAdresse);
                     $urlAdresse = $this->creerUrl('', '', array('archiAffichage' => 'adresseDetail', 'archiIdAdresse' => $idAdresse, 'archiIdEvenementGroupeAdresse' => $idEvenementGroupeAdresse));
                 }
             }
             $urlAdresse .= $ancre;
             $imageSurListeTousLesCommentaires = "";
             if (isset($params['afficherTous']) && $params['afficherTous'] == true) {
                 $txtCommentaire = stripslashes(stripslashes($fetch['commentaire']));
                 if (!archiPersonne::isPerson($idEvenementGroupeAdresse)) {
                     $arrayImage = $this->getUrlImageFromAdresse($idAdresse, 'mini', array('idEvenementGroupeAdresse' => $idEvenementGroupeAdresse));
                     $urlImage = $arrayImage['url'];
                 }
                 if (!empty($urlImage)) {
                     $imageSurListeTousLesCommentaires = "<div style='float:left;display:block;overflow-x:visible;overflow-y:hidden;padding-right:3px;width:80px;text-align:center;'><a href='" . $urlAdresse . "'><img src='" . $urlImage . "' border=0 align=middle></a></div>";
                 }
             } else {
                 $txtCommentaire = stripslashes($fetch['commentaire']);
                 $arrayTxtCommentaire = explode(" ", $txtCommentaire);
                 foreach ($arrayTxtCommentaire as $indice => $value) {
                     if (pia_strlen($arrayTxtCommentaire[$indice]) > 30) {
                         $arrayTxtCommentaire[$indice] = pia_substr($arrayTxtCommentaire[$indice], 0, 30) . "...";
                     }
                 }
                 $txtCommentaire = $string->coupureTexte(implode(" ", $arrayTxtCommentaire), 10);
             }
             $t->assign_block_vars('commentaires', array('commentaire' => $bbCode->convertToDisplay(array('text' => $txtCommentaire, 'type' => 'commentaire')), 'pseudo' => "<div style='display:block;overflow:auto;text-decoration:none;font-weight:normal;'>" . $imageSurListeTousLesCommentaires . "<span style='display:block;font-weight:normal;'>" . $fetch['dateF'] . " " . _("de") . " <span style='color:#507391;font-size:9px;font-weight:normal;'>\n                \t\t\t\t" . $fetch['nom'] . ' ' . $fetch['prenom'] . "</span>" . "<br>" . _("pour") . " <a href=\"" . $urlAdresse . "\" style='color:#507391;font-size:9px;'>" . $labelItemCommented . "</a></span></div><div style='clear:both;'></div>"));
         }
         ob_start();
         $t->pparse('derniersCommentaires');
         $html .= ob_get_contents();
         ob_end_clean();
     }
     return $html;
 }
 /**
  * Affichage de toutes les actualites
  *
  * @param array $params Paramètres
  *
  * @return string HTML
  * */
 public function getHtmlToutesLesActualites($params = array())
 {
     $html = "<h1>" . _("Actualités") . "</h1>";
     $d = new dateObject();
     $pagination = new paginationObject();
     $resDernieresActualites = $this->getDernieresActualites(array('sqlFields' => '0', "returnAsMysqlRes" => true));
     $nbEnregistrementTotaux = mysql_num_rows($resDernieresActualites);
     $nbEnregistrementsParPage = 15;
     $arrayPagination = $pagination->pagination(array('nomParamPageCourante' => 'page', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => $nbEnregistrementTotaux, 'typeLiens' => 'noformulaire'));
     $arrayActus = $this->getDernieresActualites(array("sqlWhere" => " AND desactive<>'1' ", "sqlLimit" => "LIMIT " . mysql_real_escape_string($arrayPagination['limitSqlDebut']) . ", " . $nbEnregistrementsParPage));
     $tab = new tableau();
     foreach ($arrayActus as $indice => $value) {
         if ($value['urlFichier'] != '') {
             $url = $value['urlFichier'];
         } else {
             $url = $this->creerUrl('', 'afficherActualite', array('archiIdActualite' => $value['idActualite']));
         }
         $tab->addValue("<a href='" . $url . "'>" . $d->toFrenchAffichage($value['date']) . " " . stripslashes($value['titre']) . "</a>");
         if ($value['photoIllustration'] != '') {
             list($w, $h) = getimagesize($this->getCheminPhysique() . "images/actualites/" . $value['idActualite'] . "/" . $value['photoIllustration']);
             if ($w > $h) {
                 $dimension = "width=80";
             } else {
                 $dimension = "height=80";
             }
             $tab->addValue("<img src='" . $this->urlImages . "actualites/" . $value['idActualite'] . "/" . $value['photoIllustration'] . "' {$dimension}>");
         } else {
             $tab->addValue("&nbsp;");
         }
     }
     $html .= $arrayPagination['html'];
     $html .= $tab->createHtmlTableFromArray(2, 'margin:0;padding:0;', '', '', " border=''");
     return $html;
 }
 private function getUserAddresses($userId)
 {
     $paginationAdresses = new paginationObject();
     $date = new dateObject();
     $adresse = new archiAdresse();
     $nbEnregistrementsParPage = 5;
     $req = "\n\t\t\t\t\t\tSELECT distinct ha1.idAdresse\n\t\t\t\t\t\tFROM historiqueAdresse ha2,  historiqueAdresse ha1\n\t\t\t\t\t\tLEFT JOIN indicatif ind ON ind.idIndicatif = ha1.idIndicatif\n\t\t\t\t\t\tWHERE ha2.idAdresse = ha1.idAdresse\n\t\t\t\t\t\tAND ha1.idUtilisateur = '" . $userId . "'\n\t\t\t\t\t\t\t\tGROUP BY ha1.idAdresse ,  ha1.idHistoriqueAdresse\n\t\t\t\t\t\t\t\tHAVING ha1.idHistoriqueAdresse = max(ha2.idHistoriqueAdresse)\n\t\t\t\t\t\t\t\tORDER BY ha1.date DESC\n\t\t\t\t\t\t\t\t";
     $res = $this->connexionBdd->requete($req);
     $nbEnregistrementTotaux = mysql_num_rows($res);
     $arrayPaginationAdresses = $paginationAdresses->pagination(array('nomParamPageCourante' => 'archiMonArchiAdressesPage', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => $nbEnregistrementTotaux, 'typeLiens' => 'noformulaire'));
     $req = "\n\t\t\t\t\t\tSELECT distinct ha1.idAdresse as idAdresse, ha1.date as date,  ha1.numero,  ha1.idRue,  ha1.idSousQuartier,  ha1.idQuartier,  ha1.idVille, ha1.idIndicatif,\n    \t\n\t\t\t\t\t\tha1.idAdresse as idAdresse,  ha1.numero,  ha1.idQuartier,  ha1.idVille, ind.nom,\n    \t\n\t\t\t\t\t\tr.nom as nomRue,\n\t\t\t\t\t\tsq.nom as nomSousQuartier,\n\t\t\t\t\t\tq.nom as nomQuartier,\n\t\t\t\t\t\tv.nom as nomVille,\n\t\t\t\t\t\tp.nom as nomPays,\n\t\t\t\t\t\tha1.numero as numeroAdresse,\n\t\t\t\t\t\tha1.idRue,\n\t\t\t\t\t\tr.prefixe as prefixeRue,\n\t\t\t\t\t\tIF (ha1.idSousQuartier != 0,  ha1.idSousQuartier,  r.idSousQuartier) AS idSousQuartier,\n\t\t\t\t\t\tIF (ha1.idQuartier != 0,  ha1.idQuartier,  sq.idQuartier) AS idQuartier,\n\t\t\t\t\t\tIF (ha1.idVille != 0,  ha1.idVille,  q.idVille) AS idVille,\n\t\t\t\t\t\tIF (ha1.idPays != 0,  ha1.idPays,  v.idPays) AS idPays,\n    \t\n\t\t\t\t\t\tha1.numero as numero,\n\t\t\t\t\t\tha1.idHistoriqueAdresse,\n\t\t\t\t\t\tha1.idIndicatif as idIndicatif\n    \t\n    \t\n\t\t\t\t\t\tFROM historiqueAdresse ha2,  historiqueAdresse ha1\n    \t\n\t\t\t\t\t\tLEFT JOIN indicatif ind ON ind.idIndicatif = ha1.idIndicatif\n    \t\n\t\t\t\t\t\tLEFT JOIN rue r         ON r.idRue = ha1.idRue\n\t\t\t\t\t\tLEFT JOIN sousQuartier sq    ON sq.idSousQuartier = if (ha1.idRue='0' and ha1.idSousQuartier!='0' , ha1.idSousQuartier , r.idSousQuartier )\n\t\t\t\t\t\tLEFT JOIN quartier q        ON q.idQuartier = if (ha1.idRue='0' and ha1.idSousQuartier='0' and ha1.idQuartier!='0' , ha1.idQuartier , sq.idQuartier )\n\t\t\t\t\t\tLEFT JOIN ville v        ON v.idVille = if (ha1.idRue='0' and ha1.idSousQuartier='0' and ha1.idQuartier='0' and ha1.idVille!='0' , ha1.idVille , q.idVille )\n\t\t\t\t\t\tLEFT JOIN pays p        ON p.idPays = if (ha1.idRue='0' and ha1.idSousQuartier='0' and ha1.idQuartier='0' and ha1.idVille='0' and ha1.idPays!='0' , ha1.idPays , v.idPays )\n\t\t\t\t\t\tWHERE ha2.idAdresse = ha1.idAdresse\n\t\t\t\t\t\tAND ha1.idUtilisateur = '" . $userId . "'\n\t\t\t\t\t\t\t\tGROUP BY ha1.idAdresse ,  ha1.idHistoriqueAdresse\n\t\t\t\t\t\t\t\tHAVING ha1.idHistoriqueAdresse = max(ha2.idHistoriqueAdresse)\n\t\t\t\t\t\t\t\tORDER BY ha1.date DESC\n\t\t\t\t\t\t\t\t";
     $req = $paginationAdresses->addLimitToQuery($req);
     $res = $this->connexionBdd->requete($req);
     $monArchi .= "<br><b>" . _("Liste de vos adresses :") . " </b><br>";
     $monArchi .= $arrayPaginationAdresses['html'];
     $tableauAdresse = new tableau();
     if (mysql_num_rows($res) == 0) {
         $monArchi .= "<br>" . _("Vous n'avez pas encore ajouté d'adresse.") . "<br>";
     }
     while ($fetch = mysql_fetch_assoc($res)) {
         $tableauAdresse->addValue($date->toFrench($fetch['date']));
         $tableauAdresse->addValue("<a href='" . $this->creerUrl('', 'adresseDetail', array('archiIdAdresse' => $fetch['idAdresse'])) . "'>" . stripslashes($adresse->getIntituleAdresse($fetch)) . "</a>");
     }
     $monArchi .= $tableauAdresse->createHtmlTableFromArray(2, "font-size:12px;");
     return $monArchi;
 }
 /**
  * Affiche la liste des sources avec des miniatures
  * 
  * @param array $params Paramètres
  * 
  * @return string HTML
  * */
 public function afficherListeSourcesAvecLogos($params = array())
 {
     $s = new stringObject();
     $bbCode = new bbCodeObject();
     $html = "<h1>" . _("Nos sources") . "</h1><br>";
     $html .= "<br>" . _("Pour assurer la crédibilité des informations renseignées par chaque internaute, nous vous livrons ici, de façon exhaustive et en toute transparence l'ensemble des sources qui sont consultées pour enrichir le site :") . "<br><br>";
     $reqCount = "SELECT 0 FROM source";
     $resCount = $this->connexionBdd->requete($reqCount);
     $nbSourcesTotal = mysql_num_rows($resCount);
     $nbEnregistrementsParPage = 15;
     $pagination = new paginationObject();
     $arrayPagination = $pagination->pagination(array('nomParamPageCourante' => 'archiPageNosSources', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => $nbSourcesTotal, 'typeLiens' => 'noformulaire'));
     $reqArchivesMunicipalesSansIdSourceEvenement = "\n                SELECT distinct he.idEvenement FROM historiqueEvenement he, historiqueEvenement he2 WHERE he2.idEvenement=he.idEvenement AND he.numeroArchive<>'' AND (he.idSource = '0' OR he.idSource = '')\n                GROUP BY he.idEvenement,  he.idHistoriqueEvenement\n                HAVING he.idHistoriqueEvenement = max(he2.idHistoriqueEvenement)\n                ";
     $resArchivesMunicipalesSansIdSourceEvenement = $this->connexionBdd->requete($reqArchivesMunicipalesSansIdSourceEvenement);
     $nbEvenementsSansIdSourceANDArchivesMunicipales = mysql_num_rows($resArchivesMunicipalesSansIdSourceEvenement);
     $reqArchivesMunicipalesSansIdSourceImage = "\n                SELECT distinct hi.idImage FROM historiqueImage hi,  historiqueImage hi2 WHERE hi2.idImage = hi.idImage AND hi.numeroArchive<>'' AND (hi.idSource='0' OR hi.idSource='')\n                GROUP BY hi.idImage ,  hi.idHistoriqueImage\n                HAVING hi.idHistoriqueImage = max(hi2.idHistoriqueImage)\n                ";
     $resArchivesMunicipalesSansIdSourceImage = $this->connexionBdd->requete($reqArchivesMunicipalesSansIdSourceImage);
     $nbImagesSansIdSourceANDArchivesMunicipales = mysql_num_rows($resArchivesMunicipalesSansIdSourceImage);
     $nbArchivesMunicipalesSansIdSource = $nbEvenementsSansIdSourceANDArchivesMunicipales + $nbImagesSansIdSourceANDArchivesMunicipales;
     $req = "\n            SELECT idSource ,  \n            (\n                (SELECT count(distinct he.idEvenement)  FROM historiqueEvenement he WHERE he.idSource = s.idSource )\n            + \n                (SELECT count(distinct hi.idImage) FROM historiqueImage hi WHERE hi.idSource = s.idSource)\n            + if (idSource=24, {$nbArchivesMunicipalesSansIdSource}, 0)\n            ) \n            as sumnb\n            FROM source s\n            ORDER BY sumnb DESC\n        ";
     $req = $pagination->addLimitToQuery($req);
     $res = $this->connexionBdd->requete($req);
     $t = new tableau();
     $t->addValue("");
     $t->addValue("<b>" . _("Sources") . "</b>");
     $t->addValue("<b><span style='font-size:12px;'>" . _("Nombre de liaisons (articles ou photos)") . "</span></b>");
     while ($fetch = mysql_fetch_assoc($res)) {
         $reqSource = "\n                    SELECT s.idSource as idSource,  s.nom as nomSource ,  ts.nom as nomTypeSource,  s.description as description\n                    FROM source s\n                    LEFT JOIN typeSource ts ON ts.idTypeSource = s.idTypeSource\n                    WHERE idSource = '" . $fetch['idSource'] . "'\n                    ";
         $resSource = $this->connexionBdd->requete($reqSource);
         $fetchSource = mysql_fetch_assoc($resSource);
         $image = "&nbsp;";
         $url = $this->creerUrl('', 'listeAdressesFromSource', array('source' => $fetch['idSource'], 'submit' => 'Rechercher'));
         if (file_exists($this->getCheminPhysique() . "images/logosSources/" . $fetch['idSource'] . ".jpg")) {
             $image = "<a href='" . $url . "'><img src='" . $this->getUrlImage() . "logosSources/" . $fetch['idSource'] . ".jpg' border=0></a>";
         }
         $nomTypeSource = "";
         if (isset($fetchSource['nomTypeSource']) && $fetchSource['nomTypeSource'] != '') {
             $nomTypeSource = " (" . $fetchSource['nomTypeSource'] . ")";
         }
         $description = $s->coupureTexte(strip_tags($bbCode->convertToDisplay(array('text' => stripslashes($fetchSource['description'])))), 10);
         $t->addValue($image, "style='width:200px;'");
         $t->addValue("<a href='" . $url . "'>" . stripslashes($fetchSource['nomSource']) . $nomTypeSource . "</a><br>" . $description);
         $t->addValue($fetch['sumnb']);
     }
     $html .= $arrayPagination['html'];
     $html .= $t->createHtmlTableFromArray(3);
     $html .= $arrayPagination['html'];
     return $html;
 }
 /**
  * Renvoi l'affichage de toutes les vues avec pagination pour le lien sur la page d'accueil
  *
  * @return string
  * */
 public function getHtmlToutesLesVues()
 {
     $html = "<h1>Vues</h1><br>";
     $pagination = new paginationObject();
     $d = new dateObject();
     $adresse = new archiAdresse();
     $string = new stringObject();
     $bbCode = new bbCodeObject();
     $nbEnregistrementTotaux = $this->getDernieresVues(array("getNbVuesTotal" => true));
     $nbEnregistrementsParPage = 15;
     $arrayPagination = $pagination->pagination(array('nomParamPageCourante' => 'page', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => $nbEnregistrementTotaux, 'typeLiens' => 'noformulaire'));
     $arrayVues = $this->getDernieresVues(array("sqlLimit" => "LIMIT " . $arrayPagination['limitSqlDebut'] . ",  " . $nbEnregistrementsParPage));
     $tab = new tableau();
     $i = 0;
     foreach ($arrayVues as $indice => $value) {
         $arrayIntituleAdressesVuesSur = array();
         foreach ($value['listeVueSur'] as $indice => $valueVuesSur) {
             $arrayIntituleAdressesVuesSur[] = $adresse->getIntituleAdresseFrom($valueVuesSur['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse', array('ifTitreAfficheTitreSeulement' => true, 'noVille' => true, 'noQuartier' => true, 'noSousQuartier' => true));
         }
         $arrayIntituleAdressesPrisDepuis = array();
         foreach ($value['listePrisDepuis'] as $indice => $valuePrisDepuis) {
             $arrayIntituleAdressesPrisDepuis[] = "<a href='" . $this->creerUrl('', '', array('archiAffichage' => 'adresseDetail', 'archiIdAdresse' => $valuePrisDepuis['idAdresse'], 'archiIdEvenementGroupeAdresse' => $valuePrisDepuis['idEvenementGroupeAdresse'])) . "'>" . $adresse->getIntituleAdresseFrom($valuePrisDepuis['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse', array('ifTitreAfficheTitreSeulement' => true, 'noVille' => true, 'noQuartier' => true, 'noSousQuartier' => true)) . "</a>";
         }
         $intituleAdresse1Adresse = $adresse->getIntituleAdresseFrom($value['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse', array('ifTitreAfficheTitreSeulement' => true, 'noVille' => true, 'noQuartier' => true, 'noSousQuartier' => true));
         $intituleAdresseAlt = strip_tags(str_replace("\"", "'", $intituleAdresse1Adresse));
         $intituleAdresseVueSur = implode("/", $arrayIntituleAdressesVuesSur);
         $intituleAdressePrisDepuis = implode("", $arrayIntituleAdressesPrisDepuis);
         $urlImage = 'photos-' . $string->convertStringToUrlRewrite($intituleAdresse1Adresse) . '-' . $value['dateUpload'] . '-' . $value['idHistoriqueImage'] . '-mini.jpg';
         $tab->addValue("<a href='" . $this->creerUrl('', 'imageDetail', array("archiIdImage" => $value['idImage'], "archiRetourAffichage" => 'evenement', "archiRetourIdName" => 'idEvenement', "archiRetourIdValue" => $value['idEvenementGroupeAdresse'])) . "'>" . date('d/m/Y', strtotime($value['dateUpload'])) . " " . $intituleAdresseVueSur . "</a><br><span style='font-weight:bold;font-size:14px;'>Pris depuis</span> <span style='font-size:14px;'>" . $intituleAdressePrisDepuis . "</span><br><span style='font-size:12px;'>" . $string->coupureTexte($bbCode->convertToDisplay(array('text' => $this->getDescriptionFromIdImage(array("idImage" => $value['idImage'])))), 15) . "</span>");
         $tab->addValue("<img style='margin-right:2px;float:left;' align='middle' src='" . $urlImage . "' alt='' title=\"" . $intituleAdresseAlt . "\" alt=\"" . $intituleAdresseAlt . "\">");
         $i++;
     }
     $html .= $arrayPagination['html'];
     $html .= $tab->createHtmlTableFromArray(2, 'margin:0;padding:0;', '', '');
     return $html;
 }
 /**
  * Liste des actualités
  * 
  * @param array $params Paramètres
  * 
  * @return string HTML
  * */
 public function listeActualites($params = array())
 {
     $html = "";
     $t = new tableau();
     $d = new dateObject();
     $pagination = new paginationObject();
     $nbEnregistrementsParPage = 5;
     $reqCount = "SELECT 0 FROM actualites";
     $resCount = $this->connexionBdd->requete($reqCount);
     $arrayPagination = $pagination->pagination(array('nomParamPageCourante' => 'page', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => mysql_num_rows($resCount), 'typeLiens' => 'noformulaire'));
     $req = "SELECT idActualite, titre,sousTitre,date,photoIllustration,texte,urlFichier,desactive FROM actualites ORDER BY date DESC";
     $req = $pagination->addLimitToQuery($req);
     $res = $this->connexionBdd->requete($req);
     $t->addValue("Date");
     $t->addValue("Statut");
     $t->addValue("Titre");
     while ($fetch = mysql_fetch_assoc($res)) {
         $t->addValue("<a href='" . $this->creerUrl('', 'adminActualites', array('archiIdActualite' => $fetch['idActualite'])) . "'>" . $d->toFrenchAffichage($fetch['date']) . "</a>");
         if ($fetch['desactive'] == 1) {
             $t->addValue("desactivée");
         } else {
             $t->addValue("active");
         }
         $t->addValue(stripslashes($fetch['titre']));
     }
     $html .= $arrayPagination['html'];
     $html .= $t->createHtmlTableFromArray(3);
     return $html;
 }