| // +--------------------------------------------------------------------------------+ // // $Id: liste_inscrit.php,v 1.6 2005/03/14 10:10:02 alex Exp $ global $HTTP_USER_AGENT; define("LATIN1_UC_CHARS", "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ"); define("LATIN1_LC_CHARS", "àáâãäåæçèéêëìíîïðñòóôõöøùúûüý"); if (!function_exists("uc_latin1")) { function uc_latin1 ($str) { $str = strtoupper(strtr($str, LATIN1_LC_CHARS, LATIN1_UC_CHARS)); return strtr($str, array("ß" => "SS")); } } $javascript = ""; echo $javascript; $url = $GLOBALS['car_url']->getURL() ; $corps = (isset($_POST['corps'])) ? $_POST['corps'] : '' ; $titre_mail = (isset($_POST['titre_mail'])) ? $_POST['titre_mail'] : ''; $tabmonde = explode ('*',$monde->historique); // Premier cas, on vient de cliquer sur un pays qui n'est pas // la France, on affiche les adhérents de ce pays if (count($tabmonde) == 3) { $argument = $tabmonde[2]; $requete = "select * from carto_PAYS where CP_ID_pays='$argument'"; $resultat = $GLOBALS['car_db']->query($requete); if (DB::isError($resultat)) { die ($resultat->getMessage().'
'.$resultat->getDebugInfo()) ; } $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; $pays = $ligne->CP_Intitule_pays; $monde->nom = $monde->nom.'*'.$pays; $tabonglet = explode ('*', $monde->historique); $tabnom = explode ('*', $monde->nom); foreach ($tabonglet as $key => $value) { $res .= 'url."&historique_cartes=$chemin\"> > ".$tabnom[$key] ; } else if ($key == (count($tabonglet)-1)) { $res .= "> > $pays"; } else { $chemin .= '*'.$value; $res .= " href=\"".$monde->url."&historique_cartes=$chemin\"> > ".$tabnom[$key] ; } $res .= '' ; } $capitale = $ligne->CP_Intitule_capitale; $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr". " from ".CAR_ANNUAIRE. " where ".CAR_CHAMPS_CE_PAYS."='$argument'"; if (defined('SQL_SUPPLEMENTAIRE') && SQL_SUPPLEMENTAIRE != '') { $requete_2 .= ' AND '.SQL_SUPPLEMENTAIRE.' '; } $resultat_2 = $GLOBALS['car_db']->query($requete_2); if (DB::isError($resultat_2)) { die ($resultat_2->getMessage().'
'.$resultat_2->getDebugInfo()) ; } $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT) ; $res .= '

'.$pays.' ('.$capitale.') : ' ; if ($ligne_2->nbr == 0) { $res .= 'aucun inscrit '.CAR_LABEL_PROJET."

\n"; if (!$GLOBALS['car_auth']->getAuth()) { //$res .= AUTH_formulaire_login(); } else { $res .= '
'.CAR_PAS_D_INSCRIT.'
'."\n" ; } return $res ; } else if ($ligne_2->nbr == 1) { $res .= $ligne_2->nbr." inscrit " ; } else { $res .= $ligne_2->nbr." inscrits " ; } $res .= CAR_LABEL_PROJET."\n"; if (!$GLOBALS['car_auth']->getAuth()) { //$res .= AUTH_formulaire_login(); } else { $res .= '
'. '
'. ' '. ' '. ' '. ' '. ' '. ' '. ' '. ' '. ' '. ' '; $requete = "select * from ".CAR_ANNUAIRE. " where ".CAR_CHAMPS_CE_PAYS."='$argument'"; if (defined('SQL_SUPPLEMENTAIRE') && SQL_SUPPLEMENTAIRE != '') { $requete .= ' AND '.SQL_SUPPLEMENTAIRE.' '; } $requete .= " order by ".CAR_CHAMPS_VILLE; $resultat= $GLOBALS['car_db']->query($requete); if (DB::isError($resultat)) { die ($resultat->getMessage().'
'.$resultat->getDebugInfo()) ; } $indic=0; $i=1; while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { if ($indic==0) { $res.="\n"; $indic=1; } else { $res.="\n"; $indic=0; } $res .= "". "\n \n"; $res .= "\n"; } $res .= "
 '.CAR_NOM.''.CAR_DATE_INS.''.CAR_VILLE.'
 ". "". ""; if ($ligne['PARTICIPANT_NOM_PRENOM_VISIBLE']) { $res .= strtoupper($ligne[CAR_CHAMPS_NOM])." ". str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM])))); } else { $res .= $ligne['PARTICIPANT_PSEUDO']; } $res .= " ".date("d.m.Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))."  ".uc_latin1($ligne[CAR_CHAMPS_VILLE])." 
\n"; if ($mailer == 1) { if (!is_array($select)) { $res .= "
".CAR_NO_DESTINATAIRE."
"; } else { $res .= envoie_mail($GLOBALS['car_db']); } } else { $res .= carto_texte_cocher(); } $res .= carto_formulaire($titre_mail, $corps) ; } // 2 ème cas, on vient de cliquer sur un département français } else if (count($tabmonde) == 4) { $argument = $tabmonde[3]; $requete = "SELECT * FROM ".CAR_TABLE_DPT." WHERE lpad(".CAR_CHAMPS_CARTO_DEP.", 2, '0' )='$argument'"; $resultat = $GLOBALS['car_db']->query($requete); if (DB::isError($resultat)) { die ($resultat->getMessage() .'
'.$resultat->getDebugInfo()); } $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); $nom = $ligne[CAR_CHAMPS_NOM_DEP]; $tabonglet=explode ('*', $monde->historique); $tabnom=explode ('*', $monde->nom); $res.="
\n"; foreach ($tabonglet as $key=>$value) { if ($key==0) { $chemin=$value; $value='monde'; $res.= "url."&historique_cartes=$chemin\"> > ".$tabnom[$key].""; } else if ($key==(count($tabonglet)-1)) { $res.=" > $nom"; } else { $chemin.='*'.$value; $res.= "url."&historique_cartes=$chemin\"> > ".$tabnom[$key].""; } } $res .= "
\n"; $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr". " FROM ".CAR_ANNUAIRE. " WHERE ".CAR_CHAMPS_DPT." = '$argument'". " AND ".CAR_CHAMPS_CE_PAYS."='fr'"; if (defined('SQL_SUPPLEMENTAIRE') && SQL_SUPPLEMENTAIRE != '') { $requete_2 .= ' AND '.SQL_SUPPLEMENTAIRE.' '; } $resultat_2 = $GLOBALS['car_db']->query($requete_2); if (DB::isError($resultat_2)) { die ($resultat_2->getMessage().'
'.$resultat_2->getDebugInfo()) ; } $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT); $res .= '

'.$nom.' : ' ; if ($ligne_2->nbr == 0) { $res .= 'aucun inscrit '.CAR_LABEL_PROJET."

\n"; if (!$GLOBALS['car_auth']->getAuth()) { // $res .= AUTH_formulaire_login(); } else { $res .= '
'.CAR_PAS_D_INSCRIT.'
'."\n" ; } return $res ; } else if ($ligne_2->nbr == 1) { $res .= $ligne_2->nbr." inscrit " ; } else { $res .= $ligne_2->nbr." inscrits " ; } $res .= CAR_LABEL_PROJET."\n"; if (!$GLOBALS['car_auth']->getAuth()) { // $res .= AUTH_formulaire_login(); } else { $res.= "
\n"; $requete = "SELECT * FROM ".CAR_ANNUAIRE. " WHERE ".CAR_CHAMPS_DPT." = '$argument'". " AND ".CAR_CHAMPS_CE_PAYS."='fr'"; if (defined('SQL_SUPPLEMENTAIRE') && SQL_SUPPLEMENTAIRE != '') { $requete .= ' AND '.SQL_SUPPLEMENTAIRE.' '; } $requete .= " ORDER BY ".CAR_CHAMPS_VILLE; $resultat = $GLOBALS['car_db']->query($requete); if (DB::isError($resultat)) { die ($resultat->getMessage().'
'.$resultat->getDebugInfo()) ; } $indic=0; $i=1; while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { if ($indic==0) { $res.="\n"; $indic=1; } else { $res.="\n"; $indic=0; } $res .= "". "\n \n"; } $res.="
  ".CAR_NOM." ".CAR_DATE_INS." ".CAR_CP." ".CAR_VILLE."
 ". "". ""; if ($ligne['PARTICIPANT_NOM_PRENOM_VISIBLE']) { $res .= uc_latin1($ligne[CAR_CHAMPS_NOM])." ". str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM])))); } else { $res .= $ligne['PARTICIPANT_PSEUDO']; } $res .= " ".date("d m Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))." ".$ligne[CAR_CHAMPS_CODE_POSTAL]."  ".uc_latin1($ligne[CAR_CHAMPS_VILLE])." 
\n"; if ($mailer==1) { if (!is_array($select)) { $res.= CAR_NO_DESTINATAIRE; } else { $res .= envoie_mail($GLOBALS['car_db']) ; } } else { $res .=carto_texte_cocher() ; } $res .= carto_formulaire($titre_mail, $corps) ; } } ?>