parmsMenu=$parmsMenu; $this->MenuPrealablementCliquer=$MenuPrealablementCliquer; $this->tabLookMenu=array( 'niveau1'=>array( 'puce'=>'puce1.gif', 'tdClassActif'=>'actif', 'a.ClassActif'=>'menu', 'font.ClassInactif'=>'menuInacif', 'font.ClassActif'=>'menuactif' ), 'niveau2'=>array( 'puce'=>'puce2.gif', 'tdClassActif'=>'actif', 'a.ClassActif'=>'menu2', 'font.ClassInactif'=>'menuInacif', 'font.ClassActif'=>'menu2actif' ) ); } public function SetImgPath($path){ $this->imgSrc=$path; } public function Ajout($nomMenu, $intitule, $parmsHref){ $this->items[$nomMenu]['label']=$intitule; $this->items[$nomMenu]['href']=$parmsHref; } public function AjoutSousMenu($attache, $nomMenu, $intitule, $parmsHref){ //$this->items[$nomMenu][$attache]['label']=$attache; $this->itemsAttachee[$attache][$nomMenu]['label']=$intitule; $this->itemsAttachee[$attache][$nomMenu]['href']=$parmsHref; } public function Reveler(Menu $m){ // print_r ($m->items); function firstLevelMenu($value,$key,$m){ $niveau='niveau1'; $htm.=" "; if (empty($value['href'])){ //menu sans action $htm.=" imgSrc.$m->tabLookMenu[$niveau]['puce']."\" width=\"9\" height=\"9\"> tabLookMenu[$niveau]['a.ClassActif']."\">".$value['label']." "; } else{ $htm.=" imgSrc.$m->tabLookMenu[$niveau]['puce']."\" width=\"9\" height=\"9\"> MenuPrealablementCliquer==$key?$m->tabLookMenu[$niveau]['tdClassActif']:""; $htm.="\">tabLookMenu[$niveau]['a.ClassActif']."\">MenuPrealablementCliquer==$key?$m->tabLookMenu[$niveau]['font.ClassActif']:""; $htm.="\">".$value['label']." "; } $htm.=""; return $htm; } function secondLevelMenu($key,$m){ $niveau='niveau2'; $htm.=" "; foreach ($m->itemsAttachee[$key] as $NomMenu=>$TabValue) { if (empty($TabValue['href'])){ //menu sans action $htm.=" "; } else{ $htm.=" "; } }//end foreach sous-menu $htm.="
imgSrc.$m->tabLookMenu[$niveau]['puce']."\" width=\"9\" height=\"9\"> ".$TabValue['label']."
  imgSrc.$m->tabLookMenu[$niveau]['puce']."\" width=\"9\" height=\"9\"> MenuPrealablementCliquer==$NomMenu?$m->tabLookMenu[$niveau]['tdClassActif']:""; $htm.="\">tabLookMenu[$niveau]['a.ClassActif']."\">MenuPrealablementCliquer==$NomMenu?$m->tabLookMenu[$niveau]['font.ClassActif']:""; $htm.="\">".$TabValue['label']."
"; return $htm; } $m->HTMLcontent.=" "; foreach($m->items as $NomMenu=>$TabValue){ $m->HTMLcontent.=firstLevelMenu($TabValue,$NomMenu,$m); if (array_key_exists($NomMenu,$m->itemsAttachee)){ $m->HTMLcontent.=secondLevelMenu($NomMenu,$m); } } $m->HTMLcontent.="
"; echo $m->HTMLcontent; } } ?>array( 'Host'=>'mysql.uclouvain.be', 'User'=>'cio-emplois', 'Pwd'=>'Vx1DcPOq', 'DB'=>'cio-emplois' ), 'auto-doc'=>array( 'Host'=>'mysql.uclouvain.be', 'User'=>'cio', 'Pwd'=>'1hRxmCv7', 'DB'=>'cio-auto-doc' ) ); if (array_key_exists($varDB,$tabDB)){ if (!$connexion = mysql_pconnect($tabDB[$varDB]['Host'],$tabDB[$varDB]['User'],$tabDB[$varDB]['Pwd'])){ die ('Désolé, connection impossible... Veillez contacter l\'administrateur du serveur'.mysql_error()); } else{ if (!mysql_select_db($tabDB[$varDB]['DB'], $connexion)) { die ('Impossible de sélectionner la base de données : ' . mysql_error()); } return $connexion; } } else { die ('seules les bases de données emploi et auto-doc sont admises'); } } ?>SetEncodedEmailHeader("From",$from_address,$from_name); $email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name); /* Set the Return-Path header to define the envelope sender address to which bounced messages are delivered. If you are using Windows, you need to use the smtp_message_class to set the return-path address. */ if(defined("PHP_OS") && strcmp(substr(PHP_OS,0,3),"WIN")) $email_message->SetHeader("Return-Path",$error_delivery_address); $email_message->SetEncodedEmailHeader("Errors-To",$error_delivery_address,$error_delivery_name); $email_message->SetEncodedHeader("Subject",$subject); $email_message->AddQuotedPrintableTextPart($email_message->WrapText($message)); $email_message->SetEncodedEmailHeader("To",$mailSender,""); $error=$email_message->Send(); // echo $usermail."-->"; // if(strcmp($error,"")) // echo "Error: $error
\n"; // else // echo "OK
\n"; } function Bienvenue($prenom,$nom){ return "

Bienvenue ".$prenom." ".smart_strtoupper($nom)."

"; } function Autentification_Ldap($uid,$pwd){ //echo "debug : Autentification_Ldap"; require_once ("ldap.inc.php"); $return=false; $rootDomain = "o=universite catholique de louvain, c=be"; $server = "ldap://vs-proxy-ldap.sipr-dc.ucl.ac.be";//"ldaps://ldap.sgsi.ucl.ac.be"; $port = "636"; $ldap = new Ldap( $server, $port, $rootDomain ); $ldap->connect(); // bind en anonyme $ldap->bindAnonymous(); // recuperation des donnes de l'utilisateur $user = $ldap->getUser($uid); // echo ("function.inc.php::debug"); // print_r($user->getData()); // accs via $user->getDn(), $user->getData() // authentification de l'utilisateur if ($user){ if ($success = $ldap->authenticate( $user->getDn(), $pwd)){ $return=$user->getData(); } } // fin de la transaction LDAP $ldap->close(); // print_r($return); return $return; } function LogonEtudiant(&$disp,&$menu, $connexion){ $disp="accueil"; $menu="accueil"; $strQuery = " SELECT idEtudiant,kompassOK FROM ETUDIANT as e WHERE e.idLogin=".$_SESSION['userId']." "; if (!$query=mysql_query ($strQuery)) echo "erreur : ".mysql_error()."
".$strQuery; $res = mysql_fetch_array($query); $_SESSION['idEtudiant']=$res['idEtudiant']; $_SESSION['kompassOK']=$res['kompassOK']; $strQuery = " UPDATE USR SET date_last_connect = NOW(), nbr_connect=nbr_connect+1 WHERE usrId=".$_SESSION['userId']." "; if (!$query=mysql_query ($strQuery)) echo "erreur mysql
$strQuery
".mysql_error(); if (isset($_SESSION['fgsdata'])){ Set_Etudiant_Data ($USR,$ETUDIANT); $cmd="updateUserData"; include ("votreEspaceEmploi/cmd_updateUserData.php"); } Set_Service_Inscrit(); $_SESSION['isLogged'] = true; } function Set_Service_Inscrit(){ $strQuery=" SELECT * FROM Etudiant_X_Service exs LEFT JOIN SERVICE s ON s.idReseau=exs.idService WHERE exs.idLogin=".$_SESSION['userId']." "; if(!$query = mysql_query($strQuery)) die("Erreur mysql : ".mysql_error()."
Query : ".$strQuery); if(mysql_num_rows($query)>0){ while ($resService=mysql_fetch_array($query,MYSQL_ASSOC)){ $_SESSION['service'][$resService['idReseau']]['id']=$resService['idReseau']; $_SESSION['service'][$resService['idReseau']]['sigleIntitule']=$resService['sigleIntitule']; $_SESSION['service'][$resService['idReseau']]['email']=$resService['email']; $_SESSION['service'][$resService['idReseau']]['intitule']=$resService['intitule']; $_SESSION['service'][$resService['idReseau']]['contact']=$resService['contact']; } } } function Set_Etudiant_Data(&$DATA_USR,&$DATA_ETUDIANT){ // print_r($_SESSION['fgsdata']); $DATA_USR['fgs']=$_SESSION['fgsdata']['matricfgs']; $DATA_USR['nom']=smart_utf8_decode($_SESSION['fgsdata']['nom']); $DATA_USR['prenom']=smart_utf8_decode($_SESSION['fgsdata']['prenom']); $DATA_USR['email']=$_SESSION['fgsdata']['email']; //echo "_SESSION['fgsdata']['email'] : ".$_SESSION['fgsdata']['email']."
"; // print_r ($DATA_USR); $DATA_ETUDIANT['titre']=$_SESSION['fgsdata']['titre']; $DATA_ETUDIANT['naissance']=$_SESSION['fgsdata']['datenaissance']; if (isset($_SESSION['fgsdata']['telephone'])) $DATA_ETUDIANT['tel']=$_SESSION['fgsdata']['telephone']; else $DATA_ETUDIANT['tel']=''; $DATA_ETUDIANT['adresse']=smart_utf8_decode($_SESSION['fgsdata']['rue']); $DATA_ETUDIANT['cp']=$_SESSION['fgsdata']['codepostal']; $DATA_ETUDIANT['ville']=smart_utf8_decode($_SESSION['fgsdata']['localite']); $DATA_ETUDIANT['pays']=smart_utf8_decode($_SESSION['fgsdata']['pays']); //======================================================================== // {{{ Diplome de l'tudiant }}} $fgs = sprintf("%08d",$_SESSION['fgs']); $xml = utf8_encode(" cioe iP1wFzuJgiRc426G0F4zn7E5 {$fgs} "); ini_set('soap.wsdl_cache_enabled', 0); $options = array ( 'trace'=>true, 'exceptions'=>false); $wsurl = 'http://localhost/sites/alumni-maj/ws/wsalumni_webhost.wsdl';//'http://webhost.uclouvain.be/sites/alumni-maj/ws/wsalumni.wsdl'; $ws = new SoapClient($wsurl,$options); $result = $ws->searchXml($xml); if (is_soap_fault($result)) { echo "soap fault...
"; } else{ $xmlarray=xml2ary($result); // print_r($xmlarray); // print_r($xmlarray[$_POST['mode']]['_c']['personne']['_c']); //print_r($xmlarray['alumni']['_c']['diplomes']['_c']['diplome']); foreach ($xmlarray['alumni']['_c']['diplomes']['_c']['diplome'] as $numDiplome=>$diplome){ $DATA_ETUDIANT['diplome'][$numDiplome]['ucl']=$diplome['_a']['ucl']; $DATA_ETUDIANT['diplome'][$numDiplome]['institution']=$diplome['_c']['institution']['_v']; $DATA_ETUDIANT['diplome'][$numDiplome]['libelle']=$diplome['_c']['libelle']['_v']; $DATA_ETUDIANT['diplome'][$numDiplome]['promotion']=$diplome['_c']['promotion']['_v']; } // echo "DEBUG : xmlarray[alumi]
\n"; // print_r($xmlarray['alumni']['_c']['adresse']['_c']['email']); echo "
\n"; $emailAlumni=$xmlarray['alumni']['_c']['adresse']['_c']['email']['_v']; if (!empty($emailAlumni)) $DATA_USR['email']=$xmlarray['alumni']['_c']['adresse']['_c']['email']['_v']; // else // $DATA_USR['email']=$_SESSION['fgsdata']['email']; //echo "DATA_USR['email'] : ".$DATA_USR['email']."
"; flush(); } // {{{ Diplome de l'tudiant }}} //======================================================================== } function MenuQuitter(){ return (" Quitter "); } /** * verification si compte et activ **/ function CompteDejaActive($fgs){ $return=false; if (!$resQuery=mysql_query("SELECT usrId FROM USR WHERE idStatut=4 AND fgs=".$fgs)){ echo "
erreur mysqll : ".mysql_error(); } elseif (mysql_num_rows($resQuery)>=1){ $result=mysql_fetch_array($resQuery,MYSQL_ASSOC); $_SESSION['userId'] = $result['usrId']; $return=true; } return $return; } function LogOut(){ session_unset(); session_destroy(); } /** * validation/verification identification via le portail **/ function check_portailucl($check_remote_ip=1) { $parms = (!empty($_POST)) ? $_POST : $_GET; global $error; $error = '' ; global $fgsdata; // echo $_SERVER['REMOTE_ADDR']; $return = false ; if (!empty($parms)) { // check mode if (isset($parms['mode']) AND !eregi('^(etudiant|alumni)$',$parms['mode'])) { $error = 'bad mode'; // check ip //} elseif ( !ereg('^192\.168\.7\.35$',$parms['IPClient']) ) { } elseif ($check_remote_ip && !ereg('^130\.104\.1\.173$',$_SERVER['REMOTE_ADDR']) ) { $error = 'bad ip'; // check publics } elseif (isset($parms['Publics']) AND !eregi('alumni|etudiant',$parms['Publics']) ) { $error = 'bad publics'; // check matricule fgs } else { if (isset($parms['MatricFGS'])) $fgsdata = get_fgs_data($parms['MatricFGS']); // verifier si fgs trouve... sinon erreur "bad matricule fgs" if (empty($fgsdata)) { $error = 'bad matricule fgs'; } else { // stocker tout ce qu'il faut dans les vars de session $return = true; } } } // echo $error; return $return ; } /** * obtenir le signaletique de fgs **/ function get_fgs_data($fgs) { $res = array(); if (empty($fgs) or !is_numeric($fgs)) return $res; $ws = new SoapClient('http://tomcat-prod.sipr.ucl.ac.be:8080/axis/FgsOperation.jws?wsdl'); $fromfgs = $ws->getSignaletiqueFgs($fgs); $signaletique = convert_xml_to_array($fromfgs); // verifier si fgs trouve... sinon erreur "bad matricule fgs" if (!empty($signaletique['nom'])) { $res = $signaletique; } return $res ; } /** * courtesy of Argon7 **/ /*##########################################################################*/ function convert_xml_to_array($xml){ // resolve problem with entities not being correcty parsed $xml = str_replace('&','&',$xml); $res = array(); $temp = array(); if (!empty($xml)) { $xml_parser = xml_parser_create(); $convert_result = xml_parse_into_struct($xml_parser, $xml, $nodes); xml_parser_free($xml_parser); // print_r($nodes); foreach ($nodes as $node) { if ($node['type'] == 'complete' AND isset($node['value'])) { $res[strtolower(smart_utf8_decode($node['tag']))] = smart_utf8_decode(trim($node['value'])); } } } return $res; } //}}} function smart_utf8_decode($in_str) //{{{ { // echo "debug : ".$in_str; // Replace ? with a unique string $new_str = str_replace("?", "q0u0e0s0t0i0o0n", $in_str); // Try the utf8_decode $new_str=utf8_decode($new_str); // if it contains ? marks if (strpos($new_str,"?") !== false) { // Something went wrong, set new_str to the original string. $new_str=$in_str; } else { // If not then all is well, put the ?-marks back where is belongs $new_str = str_replace("q0u0e0s0t0i0o0n", "?", $new_str); } //return unhtmlize(htmlentities($new_str)); // echo " -> ".$new_str."
"; return $new_str; } //}}} function xml2ary(&$string) //{{{ { $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parse_into_struct($parser, $string, $vals, $index); xml_parser_free($parser); $mnary=array(); $ary=&$mnary; foreach ($vals as $r) { $t=$r['tag']; if ($r['type']=='open') { if (isset($ary[$t])) { if (isset($ary[$t][0])) $ary[$t][]=array(); else $ary[$t]=array($ary[$t], array()); $cv=&$ary[$t][count($ary[$t])-1]; } else $cv=&$ary[$t]; if (isset($r['attributes'])) {foreach ($r['attributes'] as $k=>$v) $cv['_a'][$k]=$v;} $cv['_c']=array(); $cv['_c']['_p']=&$ary; $ary=&$cv['_c']; } elseif ($r['type']=='complete') { if (isset($ary[$t])) { // same as open if (isset($ary[$t][0])) $ary[$t][]=array(); else $ary[$t]=array($ary[$t], array()); $cv=&$ary[$t][count($ary[$t])-1]; } else $cv=&$ary[$t]; if (isset($r['attributes'])) {foreach ($r['attributes'] as $k=>$v) $cv['_a'][$k]=smart_utf8_decode($v);} $cv['_v']=(isset($r['value']) ? smart_utf8_decode($r['value']) : ''); } elseif ($r['type']=='close') { $ary=&$ary['_p']; } } _del_p($mnary); return $mnary; } // _Internal: Remove recursion in result array function _del_p(&$ary) { foreach ($ary as $k=>$v) { if ($k==='_p') unset($ary[$k]); elseif (is_array($ary[$k])) _del_p($ary[$k]); } } //}}} /*##########################################################################*/ function SelectOperateur($name,$class,$Parm_opperateur){ $select.=" "; // donnees $j=0; foreach ($TabDonnee[$i] as $champ=>$donnee){ echo "\n"; echo $donnee; echo "\n"; } //commandes echo ""; foreach ($TabCommande[$i] as $num=>$cmd){ echo $cmd; if ($num"; echo "\n"; // ligne fine intermediaire echo " "; } echo "\n"; //fin du tableau des offre } echo"
"; } function RubriqueFromStructure ($id){ $connexion=Connexion('auto-doc'); $strQuery=" SELECT * FROM X_structure xSt LEFT JOIN RUBRIQUE as R ON R.idRubrique=xSt.idRubrique LEFT JOIN SS_RUBRIQUE as ssR ON ssR.idSs_rubrique=xSt.idSs_rubrique WHERE xSt.idStructure=$id "; if ($query=mysql_query($strQuery)){ //$rubriquePrec=""; if (mysql_num_rows($query)>0){ $structure=mysql_fetch_array($query); return($structure); } } else echo "mysql erreur : ".mysql_error(); } function smart_strtoupper($chaine){ $chaine = ereg_replace('[]',chr(199),$chaine); $chaine = ereg_replace('[]',chr(140),$chaine); $chaine = ereg_replace('[]',chr(192),$chaine); $chaine = ereg_replace('[]',chr(193),$chaine); $chaine = ereg_replace('[]',chr(194),$chaine); $chaine = ereg_replace('[]',chr(195),$chaine); $chaine = ereg_replace('[]',chr(192),$chaine); $chaine = ereg_replace('[]',chr(197),$chaine); $chaine = ereg_replace('[]',chr(210),$chaine); $chaine = ereg_replace('[]',chr(211),$chaine); $chaine = ereg_replace('[]',chr(212),$chaine); $chaine = ereg_replace('[]',chr(213),$chaine); $chaine = ereg_replace('[]',chr(214),$chaine); $chaine = ereg_replace('[]',chr(200),$chaine); $chaine = ereg_replace('[]',chr(201),$chaine); $chaine = ereg_replace('[]',chr(202),$chaine); $chaine = ereg_replace('[]',chr(203),$chaine); $chaine = ereg_replace('[]',chr(204),$chaine); $chaine = ereg_replace('[]',chr(205),$chaine); $chaine = ereg_replace('[]',chr(206),$chaine); $chaine = ereg_replace('[]',chr(207),$chaine); $chaine = ereg_replace('[]',chr(217),$chaine); $chaine = ereg_replace('[]',chr(218),$chaine); $chaine = ereg_replace('[]',chr(219),$chaine); $chaine = ereg_replace('[]',chr(220),$chaine); $chaine = ereg_replace('[]','Y',$chaine); $chaine = ereg_replace('[]',chr(209),$chaine); return strtoupper($chaine); } // ------------------------------------------------------------------------- // // Petit moteur de recherche. // // ------------------------------------------------------------------------- // // Auteur: Frdric Bouchery // // Email: frederic.bouchery@consultant.com // // Web: http://www.cybergroupe.net/ // // ------------------------------------------------------------------------- // // Voici une petite fonction qui peut beaucoup vous aider. Elle prend en // // paramtre : // // - La chane de recherche (mots spars par des espaces ou toute // // ponctuation [cf : la ligne sur les ponctuations]), // // - le nom du champ rechercher dans la table. // // - Mettre "true" ou pas de paramtre pour une recherche en "OU" // // et "false" pour une recherche en "ET". // // ------------------------------------------------------------------------- // function Convert4Search($chaine, $tabChamp, $ou = true) { $chaine = trim(strtolower($chaine)); // Vous mettez les ponctuations et caractres que vous ne voulez pas $chaine = ereg_replace('["!?,;:]',' ',$chaine); $chaine = ereg_replace('[\']','\\\'',$chaine); // Conversion des caractres accentus $chaine = ereg_replace('[a]','[a]',$chaine); $chaine = ereg_replace('[o]','[o]',$chaine); $chaine = ereg_replace('[e]','[e]',$chaine); $chaine = ereg_replace('[c]','[c]',$chaine); $chaine = ereg_replace('[i]','[i]',$chaine); $chaine = ereg_replace('[u]','[u]',$chaine); $chaine = ereg_replace('[y]','[y]',$chaine); $chaine = ereg_replace('[n]','[n]',$chaine); // echo "count : ".count($tabChamp); if (count($tabChamp)>1){//$tabChamp est d'office un tableau $i=1; while (list($champ,) = each($tabChamp)){ $tabChaine[$i]=$chaine; if ($ou) { // C'est une recherche en "OU" $chaine .= "LCASE($champ) REGEXP '"; $chaine .= ereg_replace('([^ ]*)([ ]*)([^ ]+)','\\1|\\3',$chaine)."'"; } else { // C'est une recherche en "ET" $tabChaine[$i] = ereg_replace('[ ]*([^ ]+)[ ]*', "LCASE($champ) REGEXP ('\\1') AND ",$tabChaine[$i]); $tabChaine[$i] = ereg_replace(' AND $','',$tabChaine[$i]); } $i++; } //concatnation $chaine="("; $i=1; foreach($tabChaine as $subChaine){ $chaine .= "("; $chaine .= $subChaine; $chaine .= ")"; if ($i".mysql_error()."
"; list($modalite,$intitule,$email)=mysql_fetch_row($query); $tabModalite[$i]['intitule']=$intitule; $tabModalite[$i]['modalite']=$modalite; $tabModalite[$i]['mail']=$email; $tabModalite[$i]['idService']=$idService[$i]; } $mailService= $tabModalite[1]['mail']; $senderNameService= $tabModalite[1]['intitule']; return $tabModalite; } else { $strQuery="SELECT modalite_acces FROM SERVICE WHERE idReseau=$idService"; if (!$query=mysql_query($strQuery)) echo "erreur mysql :
".mysql_error()."
"; list($modalite)=mysql_fetch_row($query); return $modalite; } } else{ return false; } } //PrepareQuery() //--------------------------------------------------- function PrepareQuery($tab){ $strQuery=""; foreach($tab as $champ=>$val){ $strQuery.="$champ =\"$val\","; } $strQuery=substr($strQuery,0,-1); //enleve la derniere virgule return $strQuery; } function DB_Insert($TABLE,$tab){ $strQuery="INSERT INTO $TABLE SET ".PrepareQuery($tab); if (!mysql_query($strQuery)){ echo "
erreur mysql : ".mysql_error()."
".$strQuery; return false; } else{ return mysql_insert_id(); } } function DB_Update($TABLE,$tab,$nomClePrimaire,$valClePrimaire){ $strQuery="UPDATE $TABLE SET ".PrepareQuery($tab)." WHERE $nomClePrimaire=$valClePrimaire"; if (!mysql_query($strQuery)){ echo "
erreur mysql : ".mysql_error()."
".$strQuery; return false; } else{ return true; } } function DB_Delete($TABLE,$nomClePrimaire,$valClePrimaire){ $strQuery="DELETE FROM $TABLE WHERE $nomClePrimaire=$valClePrimaire"; if (!mysql_query($strQuery)){ echo "
erreur mysql : ".mysql_error()."
".$strQuery; return false; } else{ return true; } } function ChangerParametreUrl($tab){ $paramURL=''; if (is_array($tab)){ foreach($tab as $variable=>$valeur){ $paramURL.=$variable."=".$valeur."&"; } $paramURL=substr($paramURL,0,-1); //enleve la derniere virgule return $paramURL; } } //AffecterCarateristquesObjet() //--------------------------------------------------- function AffecterCarateristquesObjet($TABLE,$nomClePrimaire,$valeurClePrimaire){ if (!$result=mysql_query("SELECT * FROM $TABLE WHERE $nomClePrimaire=$valeurClePrimaire")) echo mysql_error(); return (mysql_fetch_array($result, MYSQL_ASSOC)); } /** * is_date_ok **/ function is_date_ok($d,$m,$y) { if (checkdate($m, $d, $y)) return true; else return false; return true; } function remove_directory($dir) { if ($handle = opendir("$dir")) { while (false !== ($item = readdir($handle))) { if ($item != "." && $item != "..") { if (is_dir("$dir/$item")) { remove_directory("$dir/$item"); } else { unlink("$dir/$item"); //echo " removing $dir/$item
\n"; } } } closedir($handle); rmdir($dir); //echo "removing $dir
\n"; } } function files_in_dir($dir){ $dh=opendir($dir); while (false !== ($filename = readdir($dh))) { if ($filename!='.' AND $filename!='..') $tabFile[]=$filename; } closedir($dir); return $tabFile; } function MonthNameArray($i){ $monthNameArray= array( 1 => 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ); return $monthNameArray[(int)$i]; } function SupprimerEtudiant($idLogin,$statut){ // echo $idLogin." ".$statut."
"; $strQuery_exs="DELETE FROM Etudiant_X_Service WHERE idLogin=".$idLogin; if ($statut=="administrateur"){ if (!mysql_query("DELETE FROM EMPLOI_MOTCLE WHERE idLogin=".$idLogin)) echo mysql_error(); if (!mysql_query("DELETE FROM DIPLOME2 WHERE idLogin=".$idLogin)) echo mysql_error(); if (!mysql_query("DELETE FROM OFFRE_NBR_CONSULT WHERE idLogin=".$idLogin)) echo mysql_error(); if (!mysql_query("DELETE FROM PANIER WHERE idLogin=".$idLogin)) echo mysql_error(); if (!mysql_query("DELETE FROM ETUDIANT WHERE idLogin=".$idLogin)) echo mysql_error(); if (!mysql_query("DELETE FROM USR WHERE usrId=".$idLogin)) echo mysql_error(); } elseif ($statut=="gestionnaire"){ $strQuery_exs.=" AND idService=".$_SESSION['Sess_ReseauID']; } if (!mysql_query($strQuery_exs)) echo mysql_error(); } function Menu($href="",$label){ $menu=''; $menu.="
"; if ($href<>"") $menu.="$label"; else $menu.="$label"; $menu.="
"; return $menu; } function MenuSurfer($titre,$strQuery,$onglet,$surfType,$idRubrique){ $menuSurfer=''; $menuSurfer.="$titre
"; if ($queryRubrique = mysql_query($strQuery)){ $menuSurfer.=" \n"; while($rubrique=mysql_fetch_array($queryRubrique)){ $menuSurfer.="\n"; $menuSurfer.="\n"; $menuSurfer.="\n"; $menuSurfer.="\n"; } $menuSurfer.="
{$rubrique['rubrique']}
\n"; return $menuSurfer; } else{ echo mysql_error(); return FALSE; } } function FormatDateHeure($dateheure){ list($date,$heure)=explode(" ",$dateheure); $date=implode("/", (array_reverse(explode("-",$date)))); return ($date." ".$heure); } function EchoService($service,$idService, $onglet){ echo"
{$service['intitule']}
"; if($idService!="" AND $idService==$service['idReseau']){ echo " "; $strQuery=" SELECT *, s.email,s.tel FROM SERVICE s NATURAL LEFT JOIN GESTIONNAIRE g LEFT JOIN USR u ON g.idLogin=u.usrId WHERE s.idReseau=$idService and g.responsable=1 "; if (!$QueryService = mysql_query($strQuery)) echo "
".mysql_error()."!! :
".$strQuery; $detailService=mysql_fetch_array($QueryService); $detailService['adresse']=nl2br($detailService['adresse']); echo" "; } else{ echo" "; } echo"

contact : ".ucfirst(strtolower($service['prenom']))." ".smart_strtoupper($service['nom'])."

{$detailService['adresse']}
tél : {$detailService['tel']}
Fax : {$detailService['fax']}
email : {$detailService['email']}
url : {$detailService['url']}

Remarque :
{$detailService['remarque']}

Disciplines concernées :
".$detailService['discipline']."
"; echo "

"; return 1; } ?>