'.$lib1.' '.$lib2.'
'; } function in_array_multi($needle, $haystack) { if(!is_array($haystack)) return $needle == $haystack; foreach($haystack as $value) if(in_array_multi($needle, $value)) return true; return false; } function chargetableuser($affichedept) { $tabledesroles = array(); $tableusers = array(); $tablepositions = array(); $tabletel = array(); $tablemails = array(); $tabletrombines = array(); $users = array(); $sql = "SELECT ref_user,id as ref_role,role FROM anrroles WHERE ref_departement='".$affichedept."'"; $result = mysql_query($sql) or die ($errquery); $nbroles = mysql_num_rows($result); for ($i=0;$i<$nbroles;$i++) { $tabledesroles[] = mysql_fetch_array($result, MYSQL_ASSOC); } mysql_free_result($result); for ($i=0;$i<$nbroles;$i++) { $sql = "SELECT position FROM anrpositionsroles WHERE ref_role='".$tabledesroles[$i]["ref_role"]."'"; $result = mysql_query($sql) or die ($errquery); $ligne = mysql_fetch_row($result); $tablepositions[$tabledesroles[$i]["ref_role"]] = $ligne[0]; mysql_free_result($result); } $idxuser = 0; for ($i=0;$i<$nbroles;$i++) { if (!in_array_multi($tabledesroles[$i]["ref_user"] , $tableusers)) { $sql = "SELECT id as ref_user,nom,prenom FROM anrusers WHERE id='".$tabledesroles[$i]["ref_user"]."'"; $result = mysql_query($sql) or die ($errquery); $ligne = mysql_fetch_array($result, MYSQL_ASSOC); $tableusers[$idxuser]["ref_user"] = $ligne["ref_user"]; $tableusers[$idxuser]["nom"] = $ligne["nom"]; $tableusers[$idxuser]["prenom"] = $ligne["prenom"]; $idxuser++; mysql_free_result($result); // print $sql."
"; } } $nbusers = count($tableusers); // for ($i=0;$i<$nbusers;$i++) { $sql = "SELECT ref_user,telephone FROM anrtel ORDER BY ordre"; $result = mysql_query($sql) or die ($errquery); $nbtel = mysql_num_rows($result); for ($j=0;$j<$nbtel;$j++) { $tabletel[] = mysql_fetch_array($result, MYSQL_ASSOC); } mysql_free_result($result); // } // for ($i=0;$i<$nbusers;$i++) { $sql = "SELECT ref_user,adresse FROM anrmails ORDER BY ordre"; $result = mysql_query($sql) or die ($errquery); $nbmails = mysql_num_rows($result); for ($j=0;$j<$nbmails;$j++) { $tablemails[] = mysql_fetch_array($result, MYSQL_ASSOC); } mysql_free_result($result); // } $sql = "SELECT * FROM anruserbureau"; $result = mysql_query($sql) or die ($errquery); $nbuserbur = mysql_num_rows($result); for ($j=0;$j<$nbuserbur;$j++) { $tableuserbur[] = mysql_fetch_array($result, MYSQL_ASSOC); } mysql_free_result($result); $sql = "SELECT * FROM anrbureaux"; $result = mysql_query($sql) or die ($errquery); $nbbur = mysql_num_rows($result); for ($j=0;$j<$nbbur;$j++) { $ligne = mysql_fetch_array($result, MYSQL_ASSOC); $tablebur[$ligne["id"]] = $ligne; } mysql_free_result($result); for ($i=0;$i<$nbusers;$i++) { $sql = "SELECT fichier FROM anrtrombines WHERE ref_user='".$tableusers[$i]["ref_user"]."'"; $result = mysql_query($sql) or die ($errquery); $ligne = mysql_fetch_row($result); $tabletrombines[$tableusers[$i]["ref_user"]]["fichier"] = $ligne[0]; mysql_free_result($result); } for ($u=0;$u<$nbusers;$u++) { $users[$u]["iduser"] = $tableusers[$u]["ref_user"]; $users[$u]["nom"] = $tableusers[$u]["nom"]; $users[$u]["prenom"] = $tableusers[$u]["prenom"]; $users[$u]["fichier"] = $tabletrombines[$tableusers[$u]["ref_user"]]["fichier"]; $users[$u]["ref_departement"] = $affichedept; $idxtel = 0; for ($t=0;$t<$nbtel;$t++) { if ($tabletel[$t]["ref_user"]==$users[$u]["iduser"]) { if ($idxtel > 0) { $reftel = "telephone".$idxtel; } else { $reftel = "telephone"; } $users[$u][$reftel] = $tabletel[$t]["telephone"]; $idxtel++; $users[$u]["nbtel"] = $idxtel; } } $idxbur = 0; for ($bur=0;$bur<$nbuserbur;$bur++) { if ($tableuserbur[$bur]["ref_user"]==$users[$u]["iduser"]) { if ($idxbur > 0) { $refbur = "bureau".$idxbur; } else { $refbur = "bureau"; } $users[$u][$refbur] = $tableuserbur[$bur]["ref_bureau"]; $users[$u][$refbur."_libelle"] = $tablebur[$tableuserbur[$bur]["ref_bureau"]]["libelle"]; $users[$u][$refbur."_desc"] = $tablebur[$tableuserbur[$bur]["ref_bureau"]]["description"]; $idxbur++; $users[$u]["nbbur"] = $idxbur; } } $idxmail = 0; for ($m=0;$m<$nbmails;$m++) { if ($tablemails[$m]["ref_user"]==$users[$u]["iduser"]) { if ($idxmail > 0) { $refmail = "adressemail".$idxmail; } else { $refmail = "adressemail"; } $users[$u][$refmail] = $tablemails[$m]["adresse"]; $idxmail++; $users[$u]["nbmails"] = $idxmail; } } $idxrole = 0; for ($i=0;$i<$nbroles;$i++) { if ($tabledesroles[$i]["ref_user"]==$users[$u]["iduser"]) { if ($idxrole > 0) { $refrole = "role".$idxrole; $refroleid = "roleid".$idxrole; } else { $refrole = "role"; $refroleid = "roleid"; } $users[$u][$refroleid] = $tabledesroles[$i]["ref_role"]; $users[$u][$refroleid."position"] = $tablepositions[$users[$u][$refroleid]]; $users[$u][$refrole] = $tabledesroles[$i]["role"]; $idxrole++; $users[$u]["nbroles"] = $idxrole; } } } usort($users, "cmp1"); return $users; } function unespace($chaine) { $chaine = preg_replace('@ +@', ' ', $chaine); return $chaine; } function headerjs($page) { print ""; } /************************************************** * * GetDirsList * Laurent Lacroix, 03/02/2001 20:00 * * Récupère dans un tableau, la liste des sous répertoires d'un * répertoire, jusqu'à une profondeur spécifiée dans MaxDeep et * dont les noms respectent l'expression régulière DirRegEx * * @param BasDir Nom complêt du répertoire à parcourir sans "/" final * @param MaxDeep Profondeur maximale de répertoire à scanner * @param Arr Le tableau dans lequel les noms des répertoires sont stockés * @param DirRegEx Expression régulière que les répertoires doivent vérifier * @return TRUE ou FALSE suivant le résultat d'exécution * * @see DelCarIf * **************************************************/ Function GetDirsList( $BasDir, $MaxDeep, &$Arr, $DirRegEx = "" ) { if( ! is_dir( $BasDir ) ) return ""; // // Premier passage (pour trier à la fin du traitement) $bFirstPass = FALSE; // // Création du tableau de résultats if( ! is_array( $Arr ) ) { $Arr = array(); $bFirstPass = TRUE; } // // Scanner répertoire source $BasDir .= "/"; if ( ! ( $d = dir( $BasDir ) ) ) return ""; while( $f = $d->read() ) { if ( $f == "" || $f == "." || $f == ".." ) continue; if ( ! is_dir( $BasDir . $f ) ) continue; if ( $DirRegEx != "" && ! ereg( $DirRegEx, $f ) ) continue; $Arr[] = $BasDir . $f . "/"; // // Appel récursif if ( $MaxDeep != 0 ) { GetDirsList( $BasDir . $f, $MaxDeep - 1, $Arr, $DirRegEx ); } } $d->Close(); if( $bFirstPass ) ASort( $Arr ); return TRUE; } function voirvignettes($dir) { $idximg = 0; foreach (glob($dir."/vignettes/*.jpg") as $filename) { print ""; $idximg++; } $idximg = 0; print "\r\n\r\n"; if ($idximg>0) { print "\r\n\r\n"; } } function headerpdf($lefichier,$lenom) { $dossier = dirname($SCRIPT_FILENAME)."projets/"; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Disposition: attachment; filename=".$lenom.".pdf;"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($dossier.$lefichier)); readfile($dossier.$lefichier); } function formattechaine ($machaine) { $machaine = strtr($machaine,"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ", "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn"); return ereg_replace("[^a-zA-Z0-9.]", "_", $machaine); } function trouveid($table) { $sql = "SELECT id FROM ".$table." ORDER BY id"; $result = mysql_query( $sql ) or die ("pb table"); $idxpreced = 0; $nouvelid = 1; $idmanquant = false; for ($i=0;$i 1) { $nouvelid = 1; $idmanquant = true; break; } } if ($i!=0) { if ($ligne[0] > ($idxpreced + 1)) { $nouvelid = $idxpreced + 1; $idmanquant = true; break; } else { $idxpreced = $ligne[0]; } } } if (mysql_num_rows($result)==0) { $nouvelid = 1; } mysql_free_result($result); if (!$idmanquant) { $nouvelid = $idxpreced + 1; } return $nouvelid; } /* function trouveid($table) { $sql = "SELECT id FROM ".$table." ORDER BY id"; $result = mysql_query( $sql ) or die ($errquery); $idxref = 1; for ($i=0;$i"; print "
";
  print_r($letableau);
  print "
"; } function generemotdepasse($id) { $acceptedChars = 'azertyuiopqsdfghjklmwxcvbnAZERTYUIPQSDFGHJKLMWXCVBN123456789'; $max = strlen($acceptedChars)-1; $password = null; for($i=0; $i < 6; $i++) { $password .= $acceptedChars{mt_rand(0, $max)}; } if ((isset($id))&&($id!="")) { $nouveaupass = crypt($password,CRYPT_STD_DES); $sql = "UPDATE anrusers SET pass='$nouveaupass' WHERE id='$id' ;"; $result = mysql_query( $sql ) or die ( "Erreur d'accès à la base de donnée !" ); } return $password; } function sqlpropre($chaine) { // if ($chaine != null) { return "'".str_replace("'","''",str_replace("\'" ,"'",$chaine))."'"; } if ((eregi("MIME-Version:|passwd|Content-Type:|Content-Transfer-Encoding:|bcc:|cc:|header|write|windows|web-inf|xss", $chaine))||strstr($chaine,'|')||strstr($chaine,'email.tst')) { exit(); } if ($chaine != null) { return str_replace("'","''",str_replace("\'" ,"'",$chaine)); } else { return " NULL "; } } function recupereparam ($parametre, $convertisseur, $valeurdefaut) { $tempo = $valeurdefaut ; if (array_key_exists($parametre, $_POST)) { $tempo = sqlpropre($_POST[$parametre]) ; } if ($convertisseur == "chaine") { $tempo = "" . $tempo ; } if ($convertisseur == "nombre") { $tempo = 0 + $tempo ; } return $tempo ; } function cmp3($a,$b) { if ($a["nom"] == $b["nom"]) return 0; return ($a["nom"] < $b["nom"]) ? -1 : 1; } function cmp2($a,$b) { if ($a["prenom"] == $b["prenom"]) return cmp3($a,$b); return ($a["prenom"] < $b["prenom"]) ? -1 : 1; } function cmp1($a,$b) { if ($a["roleidposition"] == $b["roleidposition"]) return cmp2($a,$b); return ($a["roleidposition"] < $b["roleidposition"]) ? -1 : 1; } function affichedept($departement) { print "

".$departement["libelle"]."

"; } function indicatif($montel,$indicatifanr) { if (substr($montel,0,6) == $indicatifanr) { $affichetel[0] = substr($montel,0,2); $affichetel[0] .= " "; $affichetel[0] .= substr($montel,2,2); $affichetel[0] .= " "; $affichetel[0] .= substr($montel,4,2); $affichetel[0] .= " "; $affichetel[0] .= substr($montel,6,2); $affichetel[1] = substr($montel,8,2); $affichetel[1] .= " ("; $affichetel[1] .= substr($montel,6,2); $affichetel[1] .= " "; $affichetel[1] .= substr($montel,8,2); $affichetel[1] .= ")"; $affichetel[2] = "(##"; $affichetel[2] .= substr($montel,6,2); $affichetel[2] .= " "; $affichetel[2] .= substr($montel,8,2); $affichetel[2] .= ")"; $affichetel[3] = ""; $affichetel[3] .= substr($montel,6,2); $affichetel[3] .= " "; $affichetel[3] .= substr($montel,8,2); $affichetel[3] .= ""; $affichetel[4] = substr($montel,6,2); $affichetel[4] .= " "; $affichetel[4] .= substr($montel,8,2); } else if ($montel!="") { $affichetel[0] = substr($montel,0,2); $affichetel[0] .= " "; $affichetel[0] .= substr($montel,2,2); $affichetel[0] .= " "; $affichetel[0] .= substr($montel,4,2); $affichetel[0] .= " "; $affichetel[0] .= substr($montel,6,2); $affichetel[0] .= " "; $affichetel[0] .= substr($montel,8,2); $affichetel[4] = substr($montel,0,2); $affichetel[4] .= " "; $affichetel[4] .= substr($montel,2,2); $affichetel[4] .= " "; $affichetel[4] .= substr($montel,4,2); $affichetel[4] .= " "; $affichetel[4] .= substr($montel,6,2); $affichetel[4] .= " "; $affichetel[4] .= substr($montel,8,2); } return $affichetel; } function affichepetituser($unuser,$refdept) { global $indicatifanr; $monposte = indicatif($unuser["telephone"],$indicatifanr); if ($monposte[2]!="") { $affichetel = " ".$monposte[2]; } else if ($monposte[0]!="") { $affichetel = " - ".$monposte[0]; } for ($b=0;$b<$unuser["nbbur"];$b++) { if ($b>0) { $affichebureau .= " ou "; } if ($b>0) { $indexbur = $b; } else { $indexbur = ""; } $affichebureau .= "pce "; if ($unuser["bureau".$indexbur."_desc"]!="") { $affichebureau .= $unuser["bureau".$indexbur."_desc"]." "; } $affichebureau .= $unuser["bureau".$indexbur."_libelle"]; } $photo = "./trombines/micro/".$unuser["fichier"]; if ($unuser["label"]!="") { $label = str_replace("
","",$unuser["label"]); $mention = "".$unuser["label"].""; } else { $label = stripslashes($unuser["prenom"])." ".stripslashes($unuser["nom"])." ".$affichetel." ".$affichebureau; } if ($unuser["style"]!="") { print "
"; } if (($unuser["fichier"]!="")&&(file_exists($photo))) { print " ".$mention; } else { print " ".$mention; } if ($unuser["style"]!="") { print "
"; } } function printpetituser($unuser) { global $indicatifanr; for ($b=0;$b<$unuser["nbbur"];$b++) { if ($b==0) { $affichebureau .= " pièce "; $indexbur = ""; } else { $affichebureau .= " ou "; $indexbur = $b; } $affichebureau .= $unuser["bureau".$indexbur."_libelle"]; } $monposte = indicatif($unuser["telephone"],$indicatifanr); if ($monposte[3]!="") { $affichetel = $monposte[3]; } else { $affichetel = $monposte[0]; } $label = "".stripslashes($unuser["prenom"])." ".stripslashes($unuser["nom"]).""; $retour .= "
"; $retour .= $label." - ".$affichetel." ".$affichebureau."
".stripslashes($unuser["role"]); for ($i=1;$i<$unuser["nbroles"];$i++) { $retour .= "
"; $retour .= stripslashes($unuser["role".$i]); } $telcomplet = indicatif($unuser["telephone"],"000000"); if ($telcomplet[3]!="") { $affichetel = $telcomplet[3]; } else { $affichetel = $telcomplet[0]; } if ($unuser["nbtel"]>1) { $retour .= "
".$affichetel." ou "; } for ($i=1;$i<$unuser["nbtel"];$i++) { $monposte = indicatif($unuser["telephone".$i],$indicatifanr); if ($monposte[3]!="") { $affichetel = $monposte[3]; } else { $affichetel = $monposte[0]; } if ($i>1) { $retour .= " - "; } $retour .= $affichetel; } if (!strpos($unuser["adressemail"],"agencerecherche")) { $retour .= "
".$unuser["adressemail"]; } // $retour .= affichetableau($unuser); $retour .= "
\n"; return $retour; /* global $indicatifanr; $monposte = indicatif($unuser["telephone"],$indicatifanr); if ($monposte[3]!="") { $affichetel = $monposte[3]; } else { $affichetel = $monposte[0]; } $label = "".stripslashes($unuser["prenom"])." ".stripslashes($unuser["nom"]).""; $retour .= "
"; $retour .= $label." - ".stripslashes($unuser["role"]); $retour .= "
".$affichetel; for ($i=1;$i<$unuser["nbtel"];$i++) { $monposte = indicatif($unuser["telephone".$i],$indicatifanr); if ($monposte[3]!="") { $affichetel = $monposte[3]; } else { $affichetel = $monposte[0]; } $retour .= " - ".$affichetel; } for ($i=1;$i<$unuser["nbroles"];$i++) { $retour .= "
".stripslashes($unuser["role".$i]); } $retour .= "
".$unuser["adressemail"]; $retour .= "
\n"; return $retour; */ } function pdfpetituser($unuser,$refdept) { global $indicatifanr; $monposte = indicatif($unuser["telephone"],$indicatifanr); $affichetel = $monposte[4]; $photo = "./trombines/micro/".$unuser["fichier"]; $label = stripslashes($unuser["prenom"])." ".stripslashes($unuser["nom"]); if (($unuser["fichier"]!="")&&(file_exists($photo))) { $pdf["photo"] = $photo; } $pdf["telephone"] = $affichetel; $pdf["label"] = $label; return $pdf; } function afficheuser($unuser) { global $indicatifanr; for ($b=0;$b<$unuser["nbbur"];$b++) { if ($b>0) { $affichebureau .= " ou "; } if ($b>0) { $indexbur = $b; } else { $indexbur = ""; } // $affichebureau .= $unuser["bureau".$indexbur."_desc"]." ".$unuser["bureau".$indexbur."_libelle"]; $affichebureau .= "pièce "; if ($unuser["bureau".$indexbur."_desc"]!="") { $affichebureau .= $unuser["bureau".$indexbur."_desc"]." "; } $affichebureau .= $unuser["bureau".$indexbur."_libelle"]; } print "
\n\n"; print "\n\n"; print "\n\n"; print "\n\n\n"; print "\n\n"; print "\n"; print "\n"; print "

"; print stripslashes($unuser["prenom"])." ".stripslashes($unuser["nom"])."

"; print "".stripslashes($unuser["role"]).""; if (stristr(stripslashes($unuser["role"]),"assistant")) { print ''; } // print "
 
"; /* for ($i=1;$i<$unuser["nbmails"];$i++) { $lemail = "adressemail".($i); print "
".$unuser[$lemail]; } */ for ($i=1;$i<$unuser["nbroles"];$i++) { print "\n
\n"; $lenum = "role".($i); print "".stripslashes($unuser[$lenum]).""; if (stristr(stripslashes($unuser[$lenum]),"assistant")||stristr(stripslashes($unuser[$lenum]),"secrétaire")) { print ''; } } print "\n
 
\n"; $affichetel = indicatif($unuser["telephone"],$indicatifanr); print $affichetel[0]."\n ".$affichetel[1]; for ($i=1;$i<$unuser["nbtel"];$i++) { if (($i > 1)&&(intval($i/2)==($i/2))) { print " / "; } // print "
"; else { print "

"; } $lenum = "telephone".($i); print substr($unuser[$lenum],0,2); print " "; print substr($unuser[$lenum],2,2); print " "; print substr($unuser[$lenum],4,2); print " "; print substr($unuser[$lenum],6,2); print " "; print substr($unuser[$lenum],8,2); } print "

".$affichebureau; print "
\n
"; $photo = "./trombines/minis/".$unuser["fichier"]; if (($unuser["fichier"]!="")&&(file_exists($photo))) { $tailleimage = getimagesize("trombines/minis/".$unuser["fichier"]); print "\n\n"; } else { $tailleimage = getimagesize("trombines/minis/mystere.gif"); print "\n\n"; } print ""; if ($unuser["adressemail"]!="") { print '
'; // print '
Envoyer un message
'; } print "
\n
\n"; // print "user :"; // affichetableau($unuser); // print "
 
\n"; } function voirfiche($unuser) { global $indicatifanr,$nivadmin,$ipinterne; // affichetableau($unuser); for ($b=0;$b<$unuser["nbbur"];$b++) { if ($b>0) { $affichebureau .= " ou "; } if ($b>0) { $indexbur = $b; } else { $indexbur = ""; } // $affichebureau .= $unuser["bureau".$indexbur."_desc"]." ".$unuser["bureau".$indexbur."_libelle"]; $affichebureau .= "pièce "; if ($unuser["bureau".$indexbur."_desc"]!="") { $affichebureau .= $unuser["bureau".$indexbur."_desc"]." "; } $affichebureau .= $unuser["bureau".$indexbur."_libelle"]; } print "
\n\n"; print "\n\n"; print "\n\n"; print "\n\n"; print "\n"; print ''; if ($ipinterne) { print '\n"; print "\n"; print ''; } else { print ''; print ''; print '\n"; print "\n"; } print ''; print '\n"; print "\n"; print ''; print '\n"; print "\n"; // if ($nivadmin=='99') { print ""; print "

"; print stripslashes($unuser["prenom"])." ".stripslashes($unuser["nom"])."

"; print "

".stripslashes($unuser["departement0"])." :

"; print "".stripslashes($unuser["role0"]).""; // print "
 
"; $deptpreced = $unuser["departement0"]; for ($i=1;$i<$unuser["nbroles"];$i++) { print "\n
\n"; $lenum = "role".$i; if ($unuser["departement".$i]!=$deptpreced) { print "

".stripslashes($unuser["departement".$i])." :

"; } print "".stripslashes($unuser[$lenum]).""; $deptpreced = $unuser["departement".$i]; } print "\n
 
\n"; $affichetel = indicatif($unuser["telephone"],$indicatifanr); print $affichetel[0]."\n ".$affichetel[1]; for ($i=1;$i<$unuser["nbtel"];$i++) { if (($i > 1)&&(intval($i/2)==($i/2))) { print " / "; } // print "
"; else { print "

"; } $lenum = "telephone".($i); print substr($unuser[$lenum],0,2); print " "; print substr($unuser[$lenum],2,2); print " "; print substr($unuser[$lenum],4,2); print " "; print substr($unuser[$lenum],6,2); print " "; print substr($unuser[$lenum],8,2); } print "

".$affichebureau; print "
\n
"; $photo = "./trombines/minis/".$unuser["fichier"]; if (($unuser["fichier"]!="")&&(file_exists($photo))) { $tailleimage = getimagesize("trombines/minis/".$unuser["fichier"]); print "\n\n"; } else { $tailleimage = getimagesize("trombines/minis/mystere.gif"); print "\n\n"; } print ""; if ($unuser["adressemail"]!="") { print '
Envoyer un message en utilisant votre logiciel
'; } print "
\n
'; print "Connectez-vous en cliquant sur le cadenas à gauche de l'écran
pour pouvoir utiliser la messagerie disponible sur cette page.
" ; print "\n
'; if (isset($unuser["messageok"])&&($unuser["messageok"]!="")) { if ($unuser["messageok"]==1) { print "Votre message a bien été envoyé. Par 'sécurité', une copie vous a aussi été envoyée."; } else { print "Il y a eu un problème a l'envoi de votre message..."; } } // else { print '
Envoyer un message :'; } print "\n
'; print ''; if (!$ipinterne) { print ''; print '\n"; print '\n"; print "\n"; } print "
'; print ''; print "\n'; print ''; print "\n
\n"; print "\n
'; // if ($nivadmin=='99') { $oFCKeditor = new FCKeditor('FCKeditor1') ; if (strpos($_SERVER["SERVER_NAME"],"127.0.0.1")== false) { $oFCKeditor->BasePath = 'webedit/'; } else { $oFCKeditor->BasePath = '/https/webedit/'; } // $oFCKeditor->BasePath = '/anrteam/webedit/'; $oFCKeditor->ToolbarSet = 'ANR'; $oFCKeditor->Value = ''; $oFCKeditor->Create() ; // } // else { print ''; } // $spaw_root = DR.'spaw/'; // $sw = new SPAW_Wysiwyg('spaw1',stripslashes($HTTP_POST_VARS['spaw1'])); // $sw->show(); print "\n
Vous pouvez aussi utiliser votre logiciel de messagerie :"; print "
".$unuser["adressemail"]."
"; for ($i=1;$i<$unuser["nbmails"];$i++) { $lemail = "adressemail".($i); print "".$unuser[$lemail]."
 "; } print ""; // } print "\n"; print "

 \n"; } function printuser($unuser) { global $indicatifanr; $affiche = "\n\n"; $affiche .= "\n\n"; $affiche .= "\n\n"; $affiche .= "\n"; $affiche .= "
"; $affiche .= "\n"; $photo = "./trombines/minis/".$unuser["fichier"]; if (($unuser["fichier"]!="")&&(file_exists($photo))) { $carctimg = getimagesize($photo); $largeur = intval($carctimg[0]/2); $hauteur = intval($carctimg[1]/2); $affiche .= "\n\n"; } $affiche .= "
".stripslashes($unuser["prenom"])." ".stripslashes($unuser["nom"]).""; $affiche .= "
".stripslashes($unuser["role"]).""; for ($i=1;$i<$unuser["nbroles"];$i++) { $affiche .= "\n
\n"; $lenum = "role".($i); $affiche .= "".stripslashes($unuser[$lenum]).""; if (stristr(stripslashes($unuser[$lenum]),"assistant")||stristr(stripslashes($unuser[$lenum]),"secrétaire")) { $affiche .= ''; } } $affiche .= "\n
 
\n"; $affichetel = indicatif($unuser["telephone"],$indicatifanr); $affiche .= $affichetel[0]."\n ".$affichetel[1]; for ($i=1;$i<$unuser["nbtel"];$i++) { if (($i > 1)&&(intval($i/2)==($i/2))) { $affiche .= " / "; } else { $affiche .= "
"; } $lenum = "telephone".($i); $affiche .= substr($unuser[$lenum],0,2); $affiche .= " "; $affiche .= substr($unuser[$lenum],2,2); $affiche .= " "; $affiche .= substr($unuser[$lenum],4,2); $affiche .= " "; $affiche .= substr($unuser[$lenum],6,2); $affiche .= " "; $affiche .= substr($unuser[$lenum],8,2); } $affiche .= "
"; $affiche .= "
".$unuser["adressemail"]; $affiche .= "
\n"; return($affiche); } function afficheselectuser($refuseractu) { $sql = "SELECT id,prenom,nom FROM anrusers ORDER BY prenom,nom"; $result = mysql_query($sql) or die ($errquery); $num = mysql_num_rows($result); $selectuser = ""; $selectuser .= ""; $selectuser .= ""; $selectuser .= "
"; $selectuser .= "Imprimer
"; return($selectuser); } function afficheselectdept($affichedept) { $sql = "SELECT * FROM anrdepartements ORDER BY ordre,libelle"; $result = mysql_query($sql) or die ($errquery); $numdept = mysql_num_rows($result); $afficheselecteur = ""; $afficheselecteur .= ""; $afficheselecteur .= ""; $afficheselecteur .= ""; $afficheselecteur .= "
"; mysql_free_result($result); return($afficheselecteur); } /* WARNING! Due to a known bug in PHP 4.3.2 this script is not working well in this version. The sharpened images get too dark. The bug is fixed in version 4.3.3. Unsharp masking is a traditional darkroom technique that has proven very suitable for digital imaging. The principle of unsharp masking is to create a blurred copy of the image and compare it to the underlying original. The difference in colour values between the two images is greatest for the pixels near sharp edges. When this difference is subtracted from the original image, the edges will be accentuated. The Amount parameter simply says how much of the effect you want. 100 is 'normal'. Radius is the radius of the blurring circle of the mask. 'Threshold' is the least difference in colour values that is allowed between the original and the mask. In practice this means that low-contrast areas of the picture are left unrendered whereas edges are treated normally. This is good for pictures of e.g. skin or blue skies. Any suggenstions for improvement of the algorithm, expecially regarding the speed and the roundoff errors in the Gaussian blur process, are welcome. */ function UnsharpMask($img, $amount, $radius, $threshold) { //////////////////////////////////////////////////////////////////////////////////////////////// //// //// p h p U n s h a r p M a s k //// //// Unsharp mask algorithm by Torstein Hønsi 2003. //// thoensi_at_netcom_dot_no. //// Please leave this notice. //// /////////////////////////////////////////////////////////////////////////////////////////////// // $img is an image that is already created within php using // imgcreatetruecolor. No url! $img must be a truecolor image. // Attempt to calibrate the parameters to Photoshop: if ($amount > 500) $amount = 500; $amount = $amount * 0.016; if ($radius > 50) $radius = 50; $radius = $radius * 2; if ($threshold > 255) $threshold = 255; $radius = abs(round($radius)); // Only integers make sense. if ($radius == 0) { return $img; imagedestroy($img); break; } $w = imagesx($img); $h = imagesy($img); $imgCanvas = imagecreatetruecolor($w, $h); $imgCanvas2 = imagecreatetruecolor($w, $h); $imgBlur = imagecreatetruecolor($w, $h); $imgBlur2 = imagecreatetruecolor($w, $h); imagecopy ($imgCanvas, $img, 0, 0, 0, 0, $w, $h); imagecopy ($imgCanvas2, $img, 0, 0, 0, 0, $w, $h); // Gaussian blur matrix: // // 1 2 1 // 2 4 2 // 1 2 1 // ////////////////////////////////////////////////// // Move copies of the image around one pixel at the time and merge them with weight // according to the matrix. The same matrix is simply repeated for higher radii. for ($i = 0; $i < $radius; $i++) { imagecopy ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1); // up left imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); // center imagecopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); // During the loop above the blurred copy darkens, possibly due to a roundoff // error. Therefore the sharp picture has to go through the same loop to // produce a similar image for comparison. This is not a good thing, as processing // time increases heavily. imagecopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); } // Calculate the difference between the blurred pixels and the original // and set the pixels for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($imgCanvas2, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgCanvas, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); // When the masked pixels differ less from the original // than the threshold specifies, they are set to their original value. $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } imagedestroy($imgCanvas); imagedestroy($imgCanvas2); imagedestroy($imgBlur); imagedestroy($imgBlur2); return $img; } ?> ANR - Colloque Chimie durable - 18 et 19 septembre - Ecole Normale Supérieure de Lyon
Colloque Chimie durable
18 et 19 septembre - Ecole Normale Supérieure de Lyon
ACCUEIL
partenaires ANR axelera