| // +--------------------------------------------------------------------------------+ // // $Id: liste_inscrit.php,v 1.6 2005/03/14 10:10:02 alex Exp $ global $HTTP_USER_AGENT; $javascript = "function confirmer () { if (window.confirm ('Cliquez sur OK pour confirmer.')) { window.formmail.submit(); } } function setCheckboxes(the_form) { var do_check=document.forms[the_form].elements['selecttotal'].checked; var elts = document.forms[the_form].elements['select[]']; var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0; if (elts_cnt) { for (var i = 0; i < elts_cnt; i++) { elts[i].checked = do_check; } // Fin for } else { elts.checked = do_check; } // Fin if... else return true; } // Fin de la fonction 'setCheckboxes()'"; GEN_stockerCodeScript($javascript); $url = CAR_URL ; $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'"; $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'". " order by ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM; $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 \n"; $res .= "\n"; } $res .= "
 '.CAR_NOM.''.CAR_PRENOM.''.CAR_DATE_INS.''.CAR_REGION.''.CAR_VILLE.'
".strtoupper($ligne[CAR_CHAMPS_NOM])." ".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM]))))." ".date("d m Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))."  ".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_REGION]))))."  ".strtoupper($ligne[CAR_CHAMPS_VILLE])." 
\n"; if ($mailer==1) { if (!is_array($select)) { $res .= '

'.CAR_NO_DESTINATAIRE.'

'; } else { $res .= envoie_mail_modere($GLOBALS['car_db']) ; } } else { $res .= carto_texte_cocher() ; } $res .= carto_formulaire($titre_mail, stripslashes($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 gen_FRENCH_DPT where GFD_ID='$argument'"; $resultat = $GLOBALS['car_db']->query($requete); if (DB::isError($resultat)) { die ($resultat->getMessage() .'
'.$resultat->getDebugInfo()); } $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT); $nom = $ligne->GFD_NAME; $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'"; $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.'

'; } 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'". " ORDER BY ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM; $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"; } $res.="
  ".CAR_NOM." ".CAR_PRENOM." ".CAR_DATE_INS." ".CAR_CP." ".CAR_VILLE."
".strtoupper($ligne[CAR_CHAMPS_NOM])."  ".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM]))))."  ".date("d m Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))." ".$ligne[CAR_CHAMPS_CODE_POSTAL]."  ".strtoupper($ligne[CAR_CHAMPS_VILLE])." 
\n"; if ($mailer==1) { if (!is_array($select)) { $res.= '

'.CAR_NO_DESTINATAIRE.'

'; } else { $res .= envoie_mail_modere($GLOBALS['car_db']) ; } } else { $res .=carto_texte_cocher() ; } $res .= carto_formulaire($titre_mail,stripslashes($corps)) ; } } ?>