Migration du profil
authorx2000coic <x2000coic>
Sat, 27 Mar 2004 15:03:22 +0000 (15:03 +0000)
committerx2000coic <x2000coic>
Sat, 27 Mar 2004 15:03:22 +0000 (15:03 +0000)
c'est fonctionnel, mais sans plus :
 - il faut améliorer l'intégration de la css
 - permettre une meilleure customisation des titres des champs, des textes, des agencements... en particulier pour l'onglet mentor et compétences où le tpl appelle 2 grosses fonctions php qui font l'affichage...

35 files changed:
configs/menu.conf.php
configs/profil.conf [new file with mode: 0644]
htdocs/getphoto.php
htdocs/profil.php [new file with mode: 0644]
include/applis.func.inc.php
include/geoloc.inc.php [new file with mode: 0644]
include/profil.func.inc.php [new file with mode: 0644]
include/profil.inc.php [new file with mode: 0644]
include/profil/profil_adresses.inc.php [new file with mode: 0644]
include/profil/profil_emploi.inc.php [new file with mode: 0644]
include/profil/profil_general.inc.php [new file with mode: 0644]
include/profil/profil_mentor.inc.php [new file with mode: 0644]
include/profil/profil_poly.inc.php [new file with mode: 0644]
include/profil/profil_skill.inc.php [new file with mode: 0644]
include/profil/update_adresses.inc.php [new file with mode: 0644]
include/profil/update_emploi.inc.php [new file with mode: 0644]
include/profil/update_general.inc.php [new file with mode: 0644]
include/profil/update_mentor.inc.php [new file with mode: 0644]
include/profil/update_poly.inc.php [new file with mode: 0644]
include/profil/update_skill.inc.php [new file with mode: 0644]
include/profil/verif_adresses.inc.php [new file with mode: 0644]
include/profil/verif_emploi.inc.php [new file with mode: 0644]
include/profil/verif_general.inc.php [new file with mode: 0644]
include/profil/verif_mentor.inc.php [new file with mode: 0644]
include/profil/verif_poly.inc.php [new file with mode: 0644]
include/profil/verif_skill.inc.php [new file with mode: 0644]
include/tabs.inc.php [new file with mode: 0644]
templates/profil.tpl [new file with mode: 0644]
templates/profil/adresses.tpl [new file with mode: 0644]
templates/profil/emploi.tpl [new file with mode: 0644]
templates/profil/general.tpl [new file with mode: 0644]
templates/profil/mentor.tpl [new file with mode: 0644]
templates/profil/naissance.tpl [new file with mode: 0644]
templates/profil/poly.tpl [new file with mode: 0644]
templates/profil/skill.tpl [new file with mode: 0644]

index 8dc8058..e62b2af 100644 (file)
@@ -5,7 +5,7 @@ if(logged()) {
         0 => Array( 'Page d\'accueil' => 'login.php' ),
         'Personnaliser' => Array(
             'Mes emails' => 'emails.php' ,
-            'Mon profil' => '###url###' ,
+            'Mon profil' => 'profil.php' ,
             'Mes contacts' => 'mescontacts.php' ,
             'Mon mot de passe' => 'motdepassemd5.php' ,
             'Mes préférences' => 'preferences.php' 
diff --git a/configs/profil.conf b/configs/profil.conf
new file mode 100644 (file)
index 0000000..2b5a4d6
--- /dev/null
@@ -0,0 +1,11 @@
+#
+# Textes du profil
+#
+
+
+#page du formulaire pour la date de naissance
+profil_naissance_erreur = """Date de naissance incorrecte ou incohérente.
+                             Exemple: 1er février 1990 se rentre 01021990."""
+profil_naissance_titre = "Date de naissance"
+profil_naissance_intro = "Avant d'accéder à ton profil pour la première fois, tu dois donner ta date de naissance au format JJMMAAAA. Elle ne sera plus demandée par la suite et ne pourra être changée. Elle servira en cas de perte du mot de passe comme sécurité supplémentaire, et uniquement à cela. Elle n'est jamais visible ou lisible."
+profil_naissance_titre = "Date de naissance"
index 8349a25..d6eb5df 100644 (file)
@@ -1,14 +1,26 @@
 <?php
-require("db_connect.inc.php");
-require("controlpermanent.inc.php");
-require_once("appel.inc.php");
-require_once("validations.inc.php");
+
+require('auto.prepend.inc.php');
+new_skinned_page('login.tpl', AUTH_COOKIE);
+
+//require("db_connect.inc.php");
+//require("controlpermanent.inc.php");
+//require_once("appel.inc.php");
+//require_once("validations.inc.php");
 
 // getdata.php3 - by Florian Dittmer <dittmer@gmx.net> 
 // Example php script to demonstrate the direct passing of binary data 
 // to the user. More infos at http://www.phpbuilder.com 
 // Syntax: getdata.php3?id=<id> 
 
+function url($url) {
+    $chemins = Array('.', '..', '/');
+    foreach ($chemins as $ch)
+      if (file_exists("$ch/login.php") || file_exists("$ch/public/login.php"))
+        return "$ch/$url";
+    return "";
+}
+
 if(isset($_REQUEST['x'])) {
        if(isset($_REQUEST['req']) && $_REQUEST['req']="true") {
                $myphoto = PhotoReq::get_unique_request($_REQUEST['x']);
diff --git a/htdocs/profil.php b/htdocs/profil.php
new file mode 100644 (file)
index 0000000..e47bb1a
--- /dev/null
@@ -0,0 +1,184 @@
+<?php
+require("auto.prepend.inc.php");
+new_skinned_page('profil.tpl',AUTH_COOKIE);
+
+if ($no_update_bd) {
+    $_REQUEST = array();
+    $_POST = array();
+    $_GET = array();
+    $str_error = "La base de donnée est actuellement en consultation seulement, tu peux voir ton profil mais pas y faire de modifications.";
+}
+else
+  $str_error = '';//chaine contenant toutes les erreurs
+
+$page->assign_by_ref('profil_error',$str_error);
+
+//on charge les fonctions
+require_once('profil.inc.php');
+
+//on met a jour $opened_tab et $new_tab qui sont le tab du POST et le tab demande
+// Tout d'abord, quel est le tab actuel ?
+// si on vient d'un POST, old_tab etait le tab courant
+if(isset($_REQUEST['old_tab']))
+  if(isset($tabname_array[$_REQUEST['old_tab']])) // on verifie que la valeur postee existe bien
+    $opened_tab = $_REQUEST['old_tab'];
+
+
+//en cas de bouton valider + passer au suivant, on definit ces deux variables
+if(isset($_REQUEST['modifier+suivant'])){
+  $_REQUEST['modifier'] = 'modifier';
+  $_REQUEST['go_to_next'] = 'go_to_next';
+}
+
+$new_tab = $opened_tab;
+
+if(isset($_REQUEST['new_tab'])){
+        if(isset($tabname_array[$_REQUEST['new_tab']]))
+                $new_tab = $_REQUEST['new_tab'];
+       else
+               $new_tab = $opened_tab;
+}
+else
+        $new_tab = $opened_tab;
+
+//echo "opening profil_{$opened_tab}.inc.php<br>";
+require_once("profil/profil_{$opened_tab}.inc.php");
+
+// pour tous les tabs, on recupere les bits car on a besoin de tous les bits pour en mettre a jour un, la date d naissance pour verifier
+// quelle est bien rentree et la date.
+$sql = "SELECT ".
+"FIND_IN_SET('mobile_public', bits), FIND_IN_SET('mobile_ax', bits)".
+", FIND_IN_SET('web_public', bits)".
+", FIND_IN_SET('libre_public', bits)".
+", naissance, DATE_FORMAT(date,'%d.%m.%Y')".
+" FROM auth_user_md5".
+" WHERE user_id=".$_SESSION['uid'];
+
+$result = mysql_query($sql);
+list($mobile_public, $mobile_ax,
+$web_public, $libre_public,
+$naissance, $date_modif_profil) = mysql_fetch_row($result);
+
+if(mysql_errno($conn) !=0) echo mysql_errno($conn).": ".mysql_error($conn);
+
+//en cas de modifications
+if(isset($_REQUEST['modifier']) && ($opened_tab == 'general')){
+  $mobile_public = (isset($_REQUEST['mobile_public']));
+  $mobile_ax = (isset($_REQUEST['mobile_ax']));
+  $libre_public = (isset($_REQUEST['libre_public']));
+  $web_public = (isset($_REQUEST['web_public']));
+}
+
+
+// lorsqu'on n'a pas la date de naissance en base de données
+if (!$naissance && !$no_update_bd)  {
+
+  # la date de naissance n'existait pas et vient d'être soumise dans la variable
+  # $_REQUEST['birth']
+  if (isset($_REQUEST['birth']) && !$no_update_bd) {
+
+    //en cas d'erreur :
+    if (!ereg("[0-3][0-9][0-1][0-9][1][9]([0-9]{2})", $_REQUEST['birth'])) {
+      $page->assign('etat_naissance','erreur');
+      $page->run();//on reaffiche le formulaire
+    }
+  
+    //sinon
+    mysql_query("UPDATE auth_user_md5 SET naissance='{$_REQUEST['birth']}' WHERE user_id=".$_SESSION['uid']);
+    $page->assign('etat_naissance','ok');
+    $page->run();
+}
+else
+  $page->assign('etat_naissance','query');
+  $page->run();//on affiche le formulaire pour naissance
+}
+
+
+// inclure tous les tests sur les champs du formulaire
+require_once("profil/verif_{$opened_tab}.inc.php");
+    
+if($str_error!=""){
+  $new_tab = $opened_tab;
+}
+else{
+  if(isset($_REQUEST['go_to_next']))
+    $new_tab = get_next_tab($opened_tab);
+
+  //doit-on faire un update ?
+  if (!empty($_REQUEST['modifier'])  && !$no_update_bd) {
+    
+    $date=date("Y-m-j");//nouvelle date de mise a jour
+
+    
+    //On sauvegarde l'uid pour l'AX
+    /* on sauvegarde les changements dans user_changes :
+    * on a juste besoin d'insérer le user_id de la personne dans la table
+    */
+    $sql="insert into user_changes ('{$_SESSION['uid']}')";
+    /* l'insertion ne se fait que s'il n'existe pas un enregistrement avec le même
+     * user_id car user_id est la clé primaire.
+     */
+    mysql_query($sql);
+    
+    //Mise a jour des bits
+    // bits : set('mobile_public','mobile_ax','web_public','libre_public')
+    $bits_reply = "";
+    if ($mobile_public) $bits_reply .= 'mobile_public,';
+    if ($mobile_ax) $bits_reply .= 'mobile_ax,';
+    if ($web_public) $bits_reply .= 'web_public,';
+    if ($libre_public) $bits_reply .= 'libre_public,';
+    if (!empty($bits_reply)) $bits_reply = substr($bits_reply, 0, -1);
+    $sql = "UPDATE auth_user_md5 set bits = '$bits_reply'";
+    // si on est en suid on ne met pas à jour la date
+    if(isset($_SESSION['suid'])) {
+      $sql = $sql." WHERE user_id={$_SESSION['uid']}";
+    } else {
+      $sql = $sql.",date='$date' WHERE user_id={$_SESSION['uid']}";
+    }
+    mysql_query($sql);
+
+    // mise a jour des champs relatifs au tab ouvert
+    require_once("profil/update_{$opened_tab}.inc.php");
+
+    //Warning : ca ne marche que si update_<tab>.inc.php contient bien une requete mysql qui mettra errno a 0
+    if (mysql_errno() == 0  /*|| mysql_affected_rows() == 1*/ ) {
+
+      $_SESSION['log']->log("profil");
+      
+      $page->assign('etat_update','ok');
+
+      //echo "opening profil_$new_tab.inc.php<br>";
+      require_once("profil/profil_{$new_tab}.inc.php");
+      require_once("profil/verif_{$new_tab}.inc.php");
+    }
+    else{
+      $page->assign('etat_update','error');
+      if($site_dev){
+        echo mysql_error();
+       echo '(message d\'erreur seulement présent en dev)<br />';
+      }
+      
+    }
+
+  }//fin if(update)
+  else { 
+    /* le profil n'a pas encore été soumis, on se contente de l'afficher pour
+     * permettre une modification
+     * si les boutons "plus..." ont été cliqués, on indique à la variable qui
+     * contrôle l'affichage des listes de choix d'afficher tous les choix pour le
+     * bouton cliquer (ex: toutes les applis)
+     */
+
+      require_once("profil/profil_{$new_tab}.inc.php");
+      require_once("profil/verif_{$new_tab}.inc.php");
+
+     
+  }
+}//fin else(!erreur)
+
+$page->assign('onglet',$new_tab);
+$page->assign('onglet_last', get_last_tab());
+$page->assign('onglet_tpl',"profil/$new_tab.tpl");
+$page->run();
+
+?>
index 80583ff..8cb9af3 100644 (file)
@@ -7,7 +7,9 @@
  * @see include/form_data_maj.inc.php
  * @see include/form_profil.inc.php
  * @see include/form_rech_av.inc.php
+ */
 function applis_options($current=0) {
+  global $globals;
   echo '<option value="-1"></option>';
   $res=$globals->db->query("select * from applis_def order by text");
   while ($arr_appli=mysql_fetch_array($res)) { 
@@ -16,7 +18,37 @@ function applis_options($current=0) {
     echo '>'.$arr_appli["text"]."</option>\n";
   }
 }
+/** pour appeller applis_options depuis smarty
+ */
+function _applis_options_smarty($params){
+  if(!isset($params['selected']))
+    $params['selected'] = 0;
+  applis_options($params['selected']);
+}
+$page->register_function('applis_options','_applis_options_smarty');
+
+
+/** affiche un Array javascript contenant les types de chaque appli
  */
+function applis_type(){
+  $res=mysql_query("select type from applis_def order by text");
+  if (list($appli_type)=mysql_fetch_row($res))
+    echo "new Array('".str_replace(",","','",$appli_type)."')";
+  while (list($appli_type)=mysql_fetch_row($res))
+    echo ",\nnew Array('".str_replace(",","','",$appli_type)."')";
+  mysql_free_result($res);
+}
+$page->register_function('applis_type','applis_type');
+
+/** affiche tous les types possibles d'applis
+ */
+function applis_type_all(){
+  $res = mysql_query("show columns from applis_def like 'type'");
+  $arr_appli = mysql_fetch_array($res);
+  echo str_replace(")","",str_replace("set(","",$arr_appli["Type"]));
+  mysql_free_result($res);
+}
+$page->register_function('applis_type_all','applis_type_all');
 
 /** formatte une ecole d'appli pour l'affichage
  */
diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php
new file mode 100644 (file)
index 0000000..e76ae28
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+
+/** donne la liste déroulante des pays
+ * @param $current pays actuellement selectionné
+ * @return echo
+ */
+function geoloc_pays($current) {
+  $sql = "SELECT a2,pays FROM geoloc_pays ORDER BY pays";
+
+  $result = mysql_query($sql);
+  while (list($my_id,$my_pays) = mysql_fetch_row($result))
+    printf("<option value=\"%s\" %s>%s</option>\n",$my_id,($current==$my_id?"selected":""),$my_pays);
+}
+function _geoloc_pays_smarty($params){
+  if(!isset($params['pays']))
+    return;
+  geoloc_pays($params['pays']);
+}
+$page->register_function('geoloc_pays', '_geoloc_pays_smarty');
+
+/** donne la liste deroulante des regions pour un pays
+ * @param $pays le pays dont on veut afficher les regions
+ * @param $current la region actuellement selectionnee
+ * @return echo
+ */
+function geoloc_region($pays,$current) {
+  $sql = "SELECT region,name FROM geoloc_region where a2='".$pays."' ORDER BY name";
+  $result = mysql_query($sql);
+  
+  echo "<option value=\"\"></option>";
+  while (list($regid,$regname) = mysql_fetch_row($result))
+    printf("<option value=\"%s\" %s>%s</option>\n",$regid,($current==$regid?"selected":""),$regname);
+}
+function _geoloc_region_smarty($params){
+  if(!isset($params['pays']))
+    return;
+  if(!isset($params['region']))
+    return;
+  geoloc_region($params['pays'], $params['region']);
+}
+$page->register_function('geoloc_region', '_geoloc_region_smarty');
+
+?>
+
diff --git a/include/profil.func.inc.php b/include/profil.func.inc.php
new file mode 100644 (file)
index 0000000..c662071
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+
+require_once('applis.func.inc.php');
+
+function replace_ifset(&$var,$req) {
+  if (isset($_REQUEST[$req])){
+    $var = stripslashes($_REQUEST[$req]);
+  }
+}
+
+function replace_ifset_i(&$var,$req,$i) {
+  if (isset($_REQUEST[$req][$i])){
+    $var[$i] = stripslashes($_REQUEST[$req][$i]);
+  }
+}
+
+function replace_ifset_i_j(&$var,$req,$i,$j) {
+  if (isset($_REQUEST[$req][$j])){
+    $var[$i] = stripslashes($_REQUEST[$req][$j]);
+  }
+}
+
+//pour afficher qqchose en html par un modifier smarty
+function _print_html_modifier($string){
+  return htmlentities($string);
+}
+
+
+//pour afficher depuis le php
+function print_html($string){
+  echo _print_html_modifier($string);
+}
+
+//pour rentrer qqchose dans la base
+function put_in_db($string){
+  return trim(addslashes($string));
+}
+
+function select_options($table,$valeur,$champ="text",$pad=false,$where="") {
+  $sql = "SELECT id,$champ FROM $table $where ORDER BY $champ";
+  $result = mysql_query($sql);
+  // on ajoute une entree vide si $pad est vrai
+  if ($pad) 
+    printf("<option value=\"0\" %s></option>\n",($valeur==0?"selected":""));
+  while (list($my_id,$my_text) = mysql_fetch_row($result)) {
+    printf("<option value=\"%s\" %s>%s</option>\n",$my_id,($valeur==$my_id?"selected":""),$my_text);
+  }
+  mysql_free_result($result);
+}
+
+function _select_options_smarty($params){
+  if((!isset($params['table'])) || (!isset($params['valeur'])))
+    return;
+  if(!isset($params['champ']))
+    $params['champ'] = 'text';
+  if(!isset($params['pad']) || !($params['pad']))
+    $pad = false;
+  else
+    $pad = true;
+  if(!isset($params['where']))
+    $params['where'] = '';
+  select_options($params['table'], $params['valeur'], $params['champ'], $pad, $params['where']);
+}
+
+?>
diff --git a/include/profil.inc.php b/include/profil.inc.php
new file mode 100644 (file)
index 0000000..636422c
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+
+require_once('tabs.inc.php');
+
+require_once('profil.func.inc.php');
+
+$page->register_modifier('print_html','_print_html_modifier');
+$page->register_function('select_db_table','_select_options_smarty');
+$page->register_function('draw_onglets','draw_all_tabs');
+
+
+
+?>
diff --git a/include/profil/profil_adresses.inc.php b/include/profil/profil_adresses.inc.php
new file mode 100644 (file)
index 0000000..6fd9240
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+require_once('geoloc.inc.php');
+
+// on limite à 6 adresses personnelles par utilisateur
+$nb_adr_max = 6; // ( = max(adrid possibles)
+
+//les adresses sont stockées dans un tableau global indéxé par adrid;
+
+function is_adr_empty($adrid){
+  $adr = &$GLOBALS['adresses'][$adrid];
+  return ( 
+    ($adr['adr1'] == '') && ($adr['adr2'] == '') && ($adr['adr3'] == '') &&
+    ($adr['cp'] == '') && ($adr['ville'] == '') && ($adr['pays'] == '00') &&
+    ($adr['tel'] == '') && ($adr['fax'] == '')
+    );
+}
+
+function delete_address($adrid, $in_request_array = false){
+    mysql_query("DELETE FROM adresses WHERE uid = ".$_SESSION["uid"]." AND adrid = '$adrid'");
+    if($in_request_array == true){
+      unset($_REQUEST['adrid'][$adrid]);
+    }
+    else{
+      unset($GLOBALS['adresses'][$adrid]);
+    }
+}
+
+//on verifie si on nous a demande une suppression
+for($i = 1; $i <= $nb_adr_max; $i++){
+  if( isset( $_REQUEST['adrid_del'][$i] ) ) {
+    delete_address($i,true);
+  }
+}
+
+//$sql_order = "ORDER BY (NOT FIND_IN_SET('active', statut)), FIND_IN_SET('temporaire', statut)";
+$sql_order = '';
+
+//recuperation des adrid
+$res = mysql_query("SELECT adrid FROM adresses WHERE uid = {$_SESSION['uid']} AND NOT FIND_IN_SET('pro',statut) ".$sql_order);
+$i = 1;
+while(list($adrids[$i]) = mysql_fetch_row($res)){
+  $adresses[$adrids[$i]]['adrid'] = $adrids[$i];
+  $i++;
+}
+
+$page->assign_by_ref('adresses', $adresses);
+
+//recuperation des donnees de la bd
+$res = mysql_query(
+       "SELECT
+       FIND_IN_SET('res-secondaire', statut), FIND_IN_SET('courrier', statut),
+       FIND_IN_SET('active', statut), FIND_IN_SET('temporaire', statut),
+       adr1, adr2, adr3, cp, ville,
+        pays, region, tel, fax,
+       FIND_IN_SET('adr_public', visibilite), FIND_IN_SET('adr_ax', visibilite),
+       FIND_IN_SET('tel_public', visibilite), FIND_IN_SET('tel_ax', visibilite)
+       FROM adresses
+       WHERE uid = {$_SESSION['uid']} AND NOT FIND_IN_SET('pro',statut) ".$sql_order
+);
+
+$nb_adr = mysql_num_rows($res);
+
+for ($i = 1; $i <= $nb_adr; $i++) {
+  $adrid = $adrids[$i];
+  list(
+       $adresses[$adrid]['secondaire'], $adresses[$adrid]['courrier'],
+       $adresses[$adrid]['active'], $adresses[$adrid]['temporaire'],
+       $adresses[$adrid]['adr1'], $adresses[$adrid]['adr2'], $adresses[$adrid]['adr3'], $adresses[$adrid]['cp'], $adresses[$adrid]['ville'],
+       $adresses[$adrid]['pays'], $adresses[$adrid]['region'], $adresses[$adrid]['tel'], $adresses[$adrid]['fax'],
+       $adresses[$adrid]['adr_public'], $adresses[$adrid]['adr_ax'],
+       $adresses[$adrid]['tel_public'], $adresses[$adrid]['tel_ax']) = mysql_fetch_row($res);
+  $adresses[$adrid]['nouvelle'] = 'modif';
+  $adresses[$adrid]['numero_formulaire'] = -1;
+}
+
+?>
diff --git a/include/profil/profil_emploi.inc.php b/include/profil/profil_emploi.inc.php
new file mode 100644 (file)
index 0000000..d57184b
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+require_once('geoloc.inc.php');
+//fonctions pour afficher des select avec les bonnes options
+function select_secteur($secteur){
+       global $secteurs;
+       reset($secteurs);
+       if($secteur == '') $secteur = -1;
+       echo "<option value=\"\" ". (($secteur == '')?"selected":"") .">&nbsp;</option>\n";
+       foreach($secteurs as $sid => $slabel){
+               echo "<option value=\"$sid\" " . (($secteur == $sid)?"selected":"") . ">$slabel</option>\n";
+       }
+}
+function select_fonction($fonction){
+       global $fonctions, $fonctions_titre;
+       reset($fonctions);
+       echo "<option value=\"\" ". (($fonction == '0')?"selected":"") .">&nbsp;</option>\n";
+       foreach($fonctions as $fid => $flabel){
+               if($fonctions_titre[$fid] == 1)
+                       echo "<option value=\"$fid\" " . (($fonction == $fid)?"selected":"") . ">$flabel</option>\n";
+               else
+                       echo "<option value=\"$fid\" " . (($fonction == $fid)?"selected":"") . ">* $flabel</option>\n";
+       }
+}
+function select_ss_secteur($secteur,$ss_secteur){
+       if($secteur != ''){
+               echo "<option value=\"\">&nbsp;</option>\n";
+               $res = mysql_query("SELECT id, label FROM emploi_ss_secteur WHERE secteur = '$secteur'");
+               while(list($tmp_id, $tmp_label) = mysql_fetch_row($res)){
+                       echo "<option value=\"$tmp_id\" ". (($ss_secteur == $tmp_id)?"selected":"") .">$tmp_label</option>\n";
+               }
+       }
+       else{
+         echo "<option value=\"\" selected>&nbsp;</option>\n";
+       }
+}
+
+//fonctions pour smarty
+function _select_secteur_smarty($params){
+  select_secteur($params['secteur']);
+}
+function _select_ss_secteur_smarty($params){
+  if(!isset($params['secteur'])) return;
+  select_ss_secteur($params['secteur'], $params['ss_secteur']);
+}
+function _select_fonction_smarty($params){
+  select_fonction($params['fonction']);
+}
+$page->register_function('select_secteur', '_select_secteur_smarty');
+$page->register_function('select_ss_secteur', '_select_ss_secteur_smarty');
+$page->register_function('select_fonction', '_select_fonction_smarty');
+
+
+$res = mysql_query("SELECT entrid, entreprise, secteur, ss_secteur, poste, fonction,
+       adr1, adr2, adr3, cp, ville, pays, region, tel, fax,
+       FIND_IN_SET('entreprise_public',visibilite),FIND_IN_SET('entreprise_ax',visibilite),FIND_IN_SET('adr_public',visibilite),
+       FIND_IN_SET('adr_ax',visibilite),FIND_IN_SET('tel_public',visibilite),FIND_IN_SET('tel_ax',visibilite)
+        FROM entreprises
+        WHERE uid = '{$_SESSION['uid']}' ORDER BY entrid");
+//echo mysql_error();
+$nb_res = mysql_num_rows($res);
+for($i = 0; $i < $nb_res ; $i++){
+       list($endrid[$i], $entreprise[$i], $secteur[$i], $ss_secteur[$i], $poste[$i], $fonction[$i],
+                    $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $cppro[$i], $villepro[$i], $payspro[$i], $regionpro[$i],
+             $telpro[$i], $faxpro[$i], $entreprise_public[$i], $entreprise_ax[$i], $adrpro_public[$i], $adrpro_ax[$i],
+            $telpro_public[$i], $telpro_ax[$i]) = mysql_fetch_row($res);
+}
+//limite dure a 2
+for($i = $nb_res; $i < 2 ; $i++){
+       $endrid[$i] = $i;
+       $entreprise[$i] = '';
+       $secteur[$i] = '';
+       $ss_secteur[$i] = '';
+       $poste[$i] = '';
+       $fonction[$i] = '0';
+        $adrpro1[$i] = '';
+       $adrpro2[$i] = '';
+       $adrpro3[$i] = '';
+       $cppro[$i] = '';
+       $villepro[$i] = '';
+       $payspro[$i] = '00';
+       $regionpro[$i] = '';
+        $telpro[$i] = '';
+       $faxpro[$i] = '';
+       $entreprise_public[$i] = '';
+       $entreprise_ax[$i] ='';
+       $adrpro_public[$i] = '';
+       $adrpro_ax[$i] = '';                 
+       $telpro_public[$i] = '';
+       $telpro_ax[$i] = '';
+}
+
+$page->assign_by_ref('endrid',$endrid);
+$page->assign_by_ref('entreprise',$entreprise);
+$page->assign_by_ref('secteur',$secteur);
+$page->assign_by_ref('ss_secteur',$ss_secteur);
+$page->assign_by_ref('poste',$poste);
+$page->assign_by_ref('fonction',$fonction);
+$page->assign_by_ref('adrpro1',$adrpro1);
+$page->assign_by_ref('adrpro2',$adrpro2);
+$page->assign_by_ref('adrpro3',$adrpro3);
+$page->assign_by_ref('cppro',$cppro);
+$page->assign_by_ref('villepro',$villepro);
+$page->assign_by_ref('payspro',$payspro);
+$page->assign_by_ref('regionpro',$regionpro);
+$page->assign_by_ref('telpro',$telpro);
+$page->assign_by_ref('faxpro',$faxpro);
+$page->assign_by_ref('entreprise_public',$entreprise_public);
+$page->assign_by_ref('entreprise_ax',$entreprise_ax);
+$page->assign_by_ref('adrpro_public',$adrpro_public);
+$page->assign_by_ref('adrpro_ax',$adrpro_ax);
+$page->assign_by_ref('telpro_public',$telpro_public);
+$page->assign_by_ref('telpro_ax',$telpro_ax);
+
+//recuperation des donnees sur les secteurs :
+
+$res = mysql_query("SELECT id, label from emploi_secteur");
+
+while(list($tmp_secteur_id, $tmp_secteur_label) = mysql_fetch_row($res)){
+       $secteurs[$tmp_secteur_id] = $tmp_secteur_label;
+}
+
+//recuperation des donnees sur les fonctions :
+$res = mysql_query("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) from fonctions_def ORDER BY id");
+
+while(list($tmp_fonction_id, $tmp_fonction_label, $tmp_fonction_titre) = mysql_fetch_row($res)){
+       $fonctions[$tmp_fonction_id] = $tmp_fonction_label;
+       $fonctions_titre[$tmp_fonction_id] = $tmp_fonction_titre;
+}
+
+//recuperation du CV
+$res = mysql_query("SELECT cv from auth_user_md5 where user_id = '{$_SESSION['uid']}'");
+list($cv) = mysql_fetch_row($res);
+$page->assign_by_ref('cv',$cv);
+
+?>
diff --git a/include/profil/profil_general.inc.php b/include/profil/profil_general.inc.php
new file mode 100644 (file)
index 0000000..3465d8a
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+// on ramène les données du profil connecté (uid paramètre de session)
+$sql = "SELECT u.nom, u.prenom".
+        ", u.promo, epouse, FIND_IN_SET('femme',i.flags), nationalite".
+       ", mobile".
+       ", web".
+        ", libre".
+       ", alias".
+       ", a1.aid, a1.type".
+       ", a2.aid, a2.type".
+       " FROM auth_user_md5 AS u".
+       " LEFT  JOIN applis_ins AS a1 ON(a1.uid = u.user_id and a1.ordre = 0)".
+       " LEFT  JOIN applis_ins AS a2 ON(a2.uid = u.user_id and a2.ordre = 1)".
+       " LEFT  JOIN identification AS i ON(u.matricule = i.matricule) ".
+       " WHERE user_id=".$_SESSION['uid'];
+
+$result = mysql_query($sql);
+list($nom, $prenom,
+     $promo, $epouse, $femme, $nationalite,
+     $mobile, $web,
+     $libre, $alias,
+     $appli_id1,$appli_type1,
+     $appli_id2,$appli_type2) = mysql_fetch_row($result);
+if(mysql_errno($conn) !=0) echo mysql_errno($conn).": ".mysql_error($conn);
+
+mysql_free_result($result);
+
+$page->assign_by_ref('nom', $nom);
+$page->assign_by_ref('prenom', $prenom);
+$page->assign_by_ref('promo', $promo);
+$page->assign_by_ref('epouse', $epouse);
+$page->assign_by_ref('femme', $femme);
+$page->assign_by_ref('alias', $alias);
+
+
+
+replace_ifset($nationalite,'nationalite');
+$page->assign_by_ref('nationalite',$nationalite);
+
+replace_ifset($mobile,'mobile');
+$page->assign_by_ref('mobile',$mobile);
+
+replace_ifset($web,"web");
+$page->assign_by_ref('web',$web);
+
+replace_ifset($libre,"libre");
+$page->assign_by_ref('libre',$libre);
+
+replace_ifset($appli_id1,"appli_id1");
+replace_ifset($appli_id2,"appli_id2");
+$page->assign_by_ref('appli_id1',$appli_id1);
+$page->assign_by_ref('appli_id2',$appli_id2);
+replace_ifset($appli_type1,"appli_type1");
+replace_ifset($appli_type2,"appli_type2");
+$page->assign_by_ref('appli_type1',$appli_type1);
+$page->assign_by_ref('appli_type2',$appli_type2);
+
+?>
diff --git a/include/profil/profil_mentor.inc.php b/include/profil/profil_mentor.inc.php
new file mode 100644 (file)
index 0000000..fe704aa
--- /dev/null
@@ -0,0 +1,164 @@
+<?php
+
+require_once('geoloc.inc.php');
+
+function affiche_pays(){
+       global $mentor_pid, $mentor_pays, $nb_mentor_pays, $max_mentor_pays;
+       for($i = 1; $i <= $nb_mentor_pays ; $i++){
+           if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+       <span class="valeur"><?php print_html($mentor_pays[$i]);?></span>
+       </td>
+       <td class="colm">
+       <span class="valeur">&nbsp;&nbsp;</span>
+       </td>
+        <td class="cold">
+         <span class="lien"><a href="javascript:mentor_pays_del('<?php echo $mentor_pid[$i]; ?>');">retirer</a></span>
+        </td>
+      </tr>
+<?php } if($nb_mentor_pays < $max_mentor_pays) {
+          if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+        <select name="mentor_pays_id_new">
+          <?php geoloc_pays('00');?>
+        </select>
+       </td>
+       <td class="colm">
+       </td>
+       <td class="cold">
+        <span class="lien"><a href="javascript:mentor_pays_add();">ajouter</a></span>
+       </td>
+      </tr>
+
+<?php
+       }
+}
+
+function select_secteur($secteur){
+       if($secteur == '') $secteur = -1;
+       echo "<option value=\"\" ". (($secteur == '')?"selected":"") .">&nbsp;</option>\n";
+       $res = mysql_query("SELECT id, label FROM emploi_secteur");
+        while(list($tmp_id, $tmp_label) = mysql_fetch_row($res)){
+               echo "<option value=\"$tmp_id\" " . (($secteur == $tmp_id)?"selected":"") . ">$tmp_label</option>\n";
+       }
+}
+
+function select_ss_secteur($secteur,$ss_secteur){
+       if($secteur != ''){
+               echo "<option value=\"\">&nbsp;</option>\n";
+               $res = mysql_query("SELECT id, label FROM emploi_ss_secteur WHERE secteur = '$secteur'");
+               while(list($tmp_id, $tmp_label) = mysql_fetch_row($res)){
+                       echo "<option value=\"$tmp_id\" ". (($ss_secteur == $tmp_id)?"selected":"") .">$tmp_label</option>\n";
+               }
+       }
+       else{
+         echo "<option value=\"\" selected>&nbsp;</option>\n";
+       }
+}
+
+function affiche_secteurs(){
+       global $mentor_sid, $mentor_secteur, $mentor_ssid, $mentor_ss_secteur, $nb_mentor_secteurs, $max_mentor_secteurs;
+       global $mentor_secteur_id_new;
+       for($i = 1; $i <= $nb_mentor_secteurs ; $i++){
+           if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+       <span class="valeur"><?php print_html($mentor_secteur[$i]);?></span>
+       </td>
+       <td class="colm">
+       <span class="valeur"><?php print_html($mentor_ss_secteur[$i]);?></span>
+       </td>
+        <td class="cold">
+         <span class="lien"><a href="javascript:mentor_secteur_del('<?php echo $mentor_sid[$i]; ?>');">retirer</a></span>
+        </td>
+      </tr>
+<?php } if($nb_mentor_secteurs < $max_mentor_secteurs) {
+          if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+        <select name="mentor_secteur_id_new" OnChange="javascript:submit()">
+          <?php select_secteur($mentor_secteur_id_new);?>
+        </select>
+       </td>
+       <td class="colm">
+        <select name="mentor_ss_secteur_id_new">
+          <?php select_ss_secteur($mentor_secteur_id_new, '');?>
+        </select>
+       </td>
+       <td class="cold">
+        <span class="lien"><a href="javascript:mentor_secteur_add();">ajouter</a></span>
+       </td>
+      </tr>
+
+<?php
+       }
+}
+function _print_pays_smarty($params){affiche_pays();}
+function _print_secteurs_mentor_smarty($params){affiche_secteurs();}
+$page->register_function('print_pays','_print_pays_smarty');
+$page->register_function('print_secteurs_mentor','_print_secteurs_mentor_smarty');
+
+
+$max_mentor_pays = 10;
+$max_mentor_secteurs = 10;
+
+//suppression eventuelle d'un pays
+if(isset($_POST['mentor_pays_op']) && ($_POST['mentor_pays_op'] == 'retirer'))
+{
+  if(isset($_POST['mentor_pays_id']))
+  {
+    $id_supprimee = $_POST['mentor_pays_id'];
+    mysql_query("DELETE FROM mentor_pays WHERE uid = {$_SESSION['uid']} AND pid = '$id_supprimee' LIMIT 1");
+  }
+}
+
+//suppression d'un secteur / ss-secteur
+if(isset($_POST['mentor_secteur_op']) && ($_POST['mentor_secteur_op'] == 'retirer'))
+{
+  if(isset($_POST['mentor_secteur_id']))
+  {
+    $id_supprimee = $_POST['mentor_secteur_id'];
+    mysql_query("DELETE FROM mentor_secteurs WHERE uid = {$_SESSION['uid']} AND secteur = '$id_supprimee' LIMIT 1");
+  }
+}
+
+//recuperation de l'expertise
+$res = mysql_query("SELECT expertise FROM mentor WHERE uid = {$_SESSION['uid']}");
+
+if(mysql_num_rows($res) > 0){
+  list($mentor_expertise) = mysql_fetch_row($res);
+}
+else{
+  $mentor_expertise = '';
+}
+$mentor_expertise_bd = $mentor_expertise;
+
+$page->assign_by_ref('mentor_expertise', $mentor_expertise);
+//recuperation des pays
+$res = mysql_query("SELECT m.pid, p.pays 
+                    FROM mentor_pays AS m
+                   LEFT JOIN geoloc_pays AS p ON(m.pid = p.a2) WHERE m.uid = {$_SESSION['uid']} LIMIT $max_mentor_pays");
+
+$nb_mentor_pays = mysql_num_rows($res);
+if($nb_mentor_pays > 0){
+  for($i = 1; $i <= $nb_mentor_pays ; $i++)
+    list($mentor_pid[$i], $mentor_pays[$i]) = mysql_fetch_row($res);
+}
+
+//recuperation des secteurs
+$res = mysql_query("SELECT m.secteur, s.label, m.ss_secteur, ss.label
+                    FROM mentor_secteurs AS m
+                   LEFT JOIN emploi_secteur AS s ON(m.secteur = s.id)
+                   LEFT JOIN emploi_ss_secteur AS ss ON(s.id = ss.secteur AND m.ss_secteur = ss.id)
+                   WHERE m.uid = {$_SESSION['uid']}
+                   LIMIT $max_mentor_pays");
+$nb_mentor_secteurs = mysql_num_rows($res);
+if($nb_mentor_secteurs > 0){
+  for($i = 1; $i <= $nb_mentor_secteurs ; $i++)
+    list($mentor_sid[$i], $mentor_secteur[$i],
+         $mentor_ssid[$i], $mentor_ss_secteur[$i]) = mysql_fetch_row($res);
+}
+
+?>
diff --git a/include/profil/profil_poly.inc.php b/include/profil/profil_poly.inc.php
new file mode 100644 (file)
index 0000000..6c17304
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+
+//declaration des fonctions msarty pour les binets et groupex
+
+function _print_binet_smarty($params){
+  if(!isset($params['uid'])) return;
+  $result = mysql_query("select * from binets_ins, binets_def "
+    ."where binets_def.id=binets_ins.binet_id and user_id='{$params['uid']}'");
+  while ($myrow2=mysql_fetch_array($result)) { ?>
+          <span class="valeur"><?php echo $myrow2['text'];?></span>
+        </td>
+        <td class="cold">
+         <span class="lien">
+         <a href="javascript:binet_del(<?php echo $myrow2['id']; ?>);">retirer
+         </a></span>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+         &nbsp;
+        </td>
+        <td class="colm">
+<?php
+  }  
+  mysql_free_result($result);
+}
+$page->register_function('print_binets','_print_binet_smarty');
+
+function _print_groupex_smarty($params){
+  if(!isset($params['uid'])) return;
+  $result = mysql_query("select * from groupesx_ins, groupesx_def where groupesx_def.id=groupesx_ins.gid and guid='{$params['uid']}'");
+  while ($myrow2=mysql_fetch_array($result)) {
+  ?>
+       <td class="colm">
+         <span class="valeur"><?php echo $myrow2['text']; ?></span>
+        </td>
+        <td class="cold">
+         <span class="lien">
+         <a href="javascript:groupex_del(<?php echo $myrow2['id']; ?>);">
+         retirer</a></span>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+        </td>
+  <?php
+  }
+  mysql_free_result($result);
+}
+$page->register_function('print_groupex','_print_groupex_smarty');
+
+
+$sql = "SELECT u.nom, u.prenom".
+       ", u.promo, epouse, i.flags, section".
+       " FROM auth_user_md5 AS u".
+       " LEFT  JOIN identification AS i ON(u.matricule = i.matricule) ".
+       " WHERE user_id=".$_SESSION['uid'];
+
+$result = mysql_query($sql);
+list($nom, $prenom,
+     $promo, $epouse, $flags, $section) = mysql_fetch_row($result);
+
+//TODO : ne plus afficher directement les erreurs mysql...
+//if(mysql_errno($conn) !=0) echo mysql_errno($conn).": ".mysql_error($conn);
+
+replace_ifset($section,"section");
+$page->assign_by_ref('section', $section);
+
+/************* gestion des binets ************/
+if (isset($_REQUEST['binet_op']) && !$no_update_bd) {
+       // retrait binet
+       if($_REQUEST['binet_op']=="retirer" && !empty($_REQUEST['binet_id'])) {
+               mysql_query("delete from binets_ins where user_id='{$_SESSION['uid']}' and binet_id='{$_REQUEST['binet_id']}'");
+       }
+       // ajout binet
+       if ($_REQUEST['binet_op']=="ajouter" && !empty($_REQUEST['binet_id'])) {
+               mysql_query("insert into binets_ins (user_id,binet_id) VALUES('{$_SESSION['uid']}','{$_REQUEST['binet_id']}')");
+       }
+}
+/************* gestion des groupes X ************/
+if (isset($_REQUEST['groupex_op']) && !$no_update_bd) {
+       // retrait groupe X
+       if ($_REQUEST['groupex_op']=="retirer" && !empty($_REQUEST['groupex_id'])) {
+               mysql_query("delete from groupesx_ins where guid='{$_SESSION['uid']}' and gid='{$_REQUEST['groupex_id']}'");
+       }
+       // ajout groupe X
+       if ($_REQUEST['groupex_op']=="ajouter" && !empty($_REQUEST['groupex_id'])) {
+               mysql_query("insert into groupesx_ins (guid,gid) VALUES('{$_SESSION['uid']}','{$_REQUEST['groupex_id']}')");
+       }
+}
+
+
+?>
diff --git a/include/profil/profil_skill.inc.php b/include/profil/profil_skill.inc.php
new file mode 100644 (file)
index 0000000..a920ab3
--- /dev/null
@@ -0,0 +1,203 @@
+<?php
+
+function select_comppros_name($cproname){
+       global $comppros_def, $comppros_title;
+       reset($comppros_def);
+       echo "<option value=\"\"".(($cproname == "")?" selected":"")."></option>";
+       foreach( $comppros_def as $cid => $cname){
+               if($comppros_title[$cid] == 1){
+                       //c'est un titre de categorie
+                       echo "<option value=\"$cid\"".(($cname == $cproname)?" selected":"").">$cname</option>";
+               }
+               else{
+                       echo "<option value=\"$cid\"".(($cname == $cproname)?" selected":"").">-&nbsp;$cname</option>";
+               }
+       }
+}
+
+function select_langue_name($lgname){
+       global $langues_def;
+       reset($langues_def);
+       echo "<option value=\"\"".(($lgname == "")?" selected":"")."></option>";
+       foreach( $langues_def as $lid => $lname){
+               echo "<option value=\"$lid\"".(($lname == $lgname)?" selected":"").">$lname</option>";
+       }
+}
+
+function select_langue_level($llevel){
+        global $langues_levels;
+        reset($langues_levels);
+        echo "<option value=\"\"".(($lgname == "")?" selected":"")."></option>";
+        foreach( $langues_levels as $level => $levelname){
+                echo "<option value=\"$level\"".(($llevel == $level)?" selected":"").">&nbsp;$levelname&nbsp;</option>";
+        }
+}
+
+function select_comppros_level(){
+        global $comppros_levels;
+        reset($comppros_levels);
+        foreach( $comppros_levels as $level => $levelname){
+                echo "<option value=\"$level\">$levelname</option>";
+        }
+}
+
+function affiche_langues(){
+       global $nb_lg, $nb_lg_max, $langue_name, $langue_level, $langue_id;
+       for($i = 1; $i <= $nb_lg ; $i++){
+           if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+       <span class="valeur"><?php echo $langue_name[$i];?></span>
+       </td>
+       <td class="colm">
+       <span class="valeur">&nbsp;&nbsp;<?php echo ($langue_level[$i] == 0)?'-':$langue_level[$i];?></span>
+       </td>
+        <td class="cold">
+         <span class="lien"><a href="javascript:langue_del('<?php echo $langue_id[$i]; ?>');">retirer</a></span>
+        </td>
+      </tr>
+<?php } if($nb_lg < $nb_lg_max) {
+          if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+        <select name="langue_sel_add">
+          <?php select_langue_name("");?>
+        </select>
+       </td>
+       <td class="colm">
+        <select name="langue_level_sel_add">
+           <?php select_langue_level(0);?>
+        </select>
+       </td>
+       <td class="cold">
+        <span class="lien"><a href="javascript:langue_add();">ajouter</a></span>
+       </td>
+      </tr>
+
+<?php
+       }
+}
+
+function affiche_comppros() {
+       global $nb_cpro, $nb_cpro_max, $cpro_name, $cpro_level, $cpro_id;
+       for($i = 1; $i <= $nb_cpro ; $i++){
+           if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+       <span class="valeur"><?php echo $cpro_name[$i];?></span>
+       </td>
+       <td class="colm">
+       <span class="valeur">&nbsp;&nbsp;<?php echo $cpro_level[$i];?></span>
+       </td>
+        <td class="cold">
+         <span class="lien"><a href="javascript:comppros_del('<?php echo $cpro_id[$i]; ?>');">retirer</a></span>
+        </td>
+      </tr>
+<?php } if($nb_cpro < $nb_cpro_max) {
+          if ($i%2) echo '<tr class="pair">'; else echo '<tr class="impair">';
+?>
+       <td class="colg">
+        <select name="comppros_sel_add">
+          <?php select_comppros_name("");?>
+        </select>
+       </td>
+       <td class="colm">
+        <select name="comppros_level_sel_add">
+           <?php select_comppros_level();?>
+        </select>
+       </td>
+       <td class="cold">
+        <span class="lien"><a href="javascript:comppros_add();">ajouter</a></span>
+       </td>
+      </tr>
+
+<?php
+       }
+}
+function _print_langues_smarty($params){
+  affiche_langues();
+}
+function _print_comppros_smarty($params){
+  affiche_comppros();
+}
+$page->register_function('print_langues', '_print_langues_smarty');
+$page->register_function('print_comppros', '_print_comppros_smarty');
+
+
+if(isset($_REQUEST['langue_op']) && !$no_update_bd){
+       if($_REQUEST['langue_op']=='retirer'){
+               mysql_query("delete from langues_ins where uid='{$_SESSION['uid']}' and lid='{$_REQUEST['langue_id']}'");
+       }
+       else if($_REQUEST['langue_op'] == 'ajouter'){
+               if(isset($_REQUEST['langue_id']) && ($_REQUEST['langue_id'] != ''))
+               mysql_query("insert into langues_ins (uid,lid,level) VALUES('{$_SESSION['uid']}','{$_REQUEST['langue_id']}','{$_REQUEST['langue_level']}')");
+       }
+}
+
+if(isset($_REQUEST['comppros_op']) && !$no_update_bd){
+       if($_REQUEST['comppros_op']=='retirer'){
+               mysql_query("delete from competences_ins where uid='{$_SESSION['uid']}' and cid='{$_REQUEST['comppros_id']}'");
+       }
+       else if($_REQUEST['comppros_op'] == 'ajouter'){
+               if(isset($_REQUEST['comppros_id']) && ($_REQUEST['comppros_id'] != ''))
+               mysql_query("insert into competences_ins (uid,cid,level) VALUES('{$_SESSION['uid']}','{$_REQUEST['comppros_id']}','{$_REQUEST['comppros_level']}')");
+       }
+}
+
+// nombre maximum autorisé de langues
+$nb_lg_max = 10;
+// nombre maximum autorisé de compétences professionnelles
+$nb_cpro_max = 20;
+
+
+$res = mysql_query("SELECT ld.id, ld.langue_fr, li.level from langues_ins AS li, langues_def AS ld "
+               ."where (li.lid=ld.id and li.uid='{$_SESSION['uid']}') LIMIT $nb_lg_max");
+
+$nb_lg = mysql_num_rows($res);
+
+for ($i = 1; $i <= $nb_lg; $i++) {
+  list($langue_id[$i], $langue_name[$i], $langue_level[$i]) = mysql_fetch_row($res);
+}
+
+$res = mysql_query("SELECT cd.id, cd.text_fr, ci.level from competences_ins AS ci, competences_def AS cd "
+               ."where (ci.cid=cd.id and ci.uid='{$_SESSION['uid']}') LIMIT $nb_cpro_max");
+
+$nb_cpro = mysql_num_rows($res);
+
+for ($i = 1; $i <= $nb_cpro; $i++) {
+  list($cpro_id[$i], $cpro_name[$i], $cpro_level[$i]) = mysql_fetch_row($res);
+}
+
+//Definitions des tables de correspondances id => nom
+
+$langues_levels = Array(
+       1 => "1",
+       2 => "2",
+       3 => "3",
+       4 => "4",
+       5 => "5",
+       6 => "6"
+);
+
+$res = mysql_query("SELECT id, langue_fr FROM langues_def");
+//echo mysql_error();
+
+while(list($tmp_lid, $tmp_lg_fr) = mysql_fetch_row($res)){
+       $langues_def[$tmp_lid] = $tmp_lg_fr;
+}
+
+$comppros_levels = Array(
+       'initié' => 'initié',
+       'bonne connaissance' => 'bonne connaissance',
+       'expert' => 'expert'
+);
+
+$res = mysql_query("SELECT id, text_fr, FIND_IN_SET('titre',flags) FROM competences_def");
+//echo mysql_error();
+
+while(list($tmp_id, $tmp_text_fr, $tmp_title) = mysql_fetch_row($res)){
+       $comppros_def[$tmp_id] = $tmp_text_fr;
+       $comppros_title[$tmp_id] = $tmp_title;
+}
+
+?>
diff --git a/include/profil/update_adresses.inc.php b/include/profil/update_adresses.inc.php
new file mode 100644 (file)
index 0000000..d05264c
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+
+reset($adresses);
+
+foreach($adresses as $adrid => $adr){
+
+  if($adr['nouvelle'] != 'new'){ // test si on vient de creer cette adresse dans verif_adresse.inc.php
+  
+    //construction des bits
+    $visibilite = "";
+    if ($adr['adr_public']) $visibilite .= 'adr_public,';
+    if ($adr['adr_ax'])     $visibilite .= 'adr_ax,';
+    if ($adr['tel_public']) $visibilite .= 'tel_public,';
+    if ($adr['tel_ax'])     $visibilite .= 'tel_ax,';
+    if (! empty($visibilite)) $visibilite = substr($visibilite, 0, -1);
+
+    $statut = "";
+    if ($adr["secondaire"])    $statut .= 'res-secondaire,';
+    if ($adr["courrier"])      $statut .= 'courrier,';
+    if ($adr["active"])        $statut .= 'active,';
+    if ($adr["temporaire"])    $statut .= 'temporaire,';
+    if (! empty($statut)) $statut = substr($statut, 0, -1);
+
+
+    if ($adr["nouvelle"] == 'ajout') {
+    //nouvelle adresse
+      mysql_query("INSERT INTO adresses SET
+                        adr1 = '".put_in_db($adr['adr1'])."',
+                        adr2 = '".put_in_db($adr['adr2'])."',
+                        adr3 = '".put_in_db($adr['adr3'])."',
+                        cp = '".put_in_db($adr['cp'])."',
+                        ville = '".put_in_db($adr['ville'])."',
+                        pays = '".$adr['pays']."',
+                        region = '".$adr['region']."',
+                        tel = '".put_in_db($adr['tel'])."',
+                        fax = '".put_in_db($adr['fax'])."',
+                        visibilite = '$visibilite',
+                        datemaj = NOW(),
+                        statut = '$statut',
+                        uid = '{$_SESSION['uid']}', adrid = '$adrid'");
+    }
+    
+    else{ 
+      //c'est une mise à jour
+      mysql_query(
+                   "UPDATE adresses SET
+                                adr1 = '".put_in_db($adr['adr1'])."',
+                                adr2 = '".put_in_db($adr['adr2'])."',
+                                adr3 = '".put_in_db($adr['adr3'])."',
+                                cp = '".put_in_db($adr['cp'])."',
+                                ville = '".put_in_db($adr['ville'])."',
+                                pays = '".$adr['pays']."',
+                                region = '".$adr['region']."',
+                                tel = '".put_in_db($adr['tel'])."',
+                                fax = '".put_in_db($adr['fax'])."',
+                                visibilite = '$visibilite',
+                                datemaj = NOW(),
+                                statut = '$statut'
+                                WHERE uid = '".$_SESSION["uid"]."' AND adrid = '$adrid'"
+                   );
+    }// fin nouvelle / ancienne adresse
+  }//fin if nouvellement crée
+}//fin foreach
+?>
diff --git a/include/profil/update_emploi.inc.php b/include/profil/update_emploi.inc.php
new file mode 100644 (file)
index 0000000..749937b
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+for($i = 0; $i < 2; $i++){
+  
+ $visibilite = "";
+ if (! empty($_REQUEST["entreprise_public"][$i])) $visibilite .= 'entreprise_public,';
+ if (! empty($_REQUEST["entreprise_ax"][$i])) $visibilite .= 'entreprise_ax,';
+ if (! empty($_REQUEST["adrpro_public"][$i])) $visibilite .= 'adr_public,';
+ if (! empty($_REQUEST["adrpro_ax"][$i]))     $visibilite .= 'adr_ax,';
+ if (! empty($_REQUEST["telpro_public"][$i])) $visibilite .= 'tel_public,';
+ if (! empty($_REQUEST["telpro_ax"][$i]))     $visibilite .= 'tel_ax,';
+ if (! empty($visibilite)) $visibilite = substr($visibilite, 0, -1);
+
+mysql_query("REPLACE INTO entreprises(uid,entrid,entreprise,secteur,ss_secteur,poste,fonction,adr1,adr2,adr3,cp,ville,pays,region,tel,fax,visibilite) ".
+              "VALUES ('{$_SESSION['uid']}','$i','".put_in_db($entreprise[$i])."',".
+             ( ($secteur[$i] == "") ? "NULL ," : "'{$secteur[$i]}',") . //sinon un faux 0 est rentre dans la base
+             ( ($ss_secteur[$i] == "") ? "NULL " : "'{$ss_secteur[$i]}'") .
+             ",'".put_in_db($poste[$i])."','{$fonction[$i]}',".
+              "'".put_in_db($adrpro1[$i])."','".put_in_db($adrpro2[$i])."', '".put_in_db($adrpro3[$i])."','".put_in_db($cppro[$i])."',".
+              "'".put_in_db($villepro[$i])."','".put_in_db($payspro[$i])."','".put_in_db($regionpro[$i])."','".put_in_db($telpro[$i])."','".put_in_db($faxpro[$i])."', '$visibilite')");
+  echo mysql_error();
+}
+mysql_query("UPDATE auth_user_md5 set cv='".put_in_db($cv)."' where user_id='{$_SESSION['uid']}'");
+?>
diff --git a/include/profil/update_general.inc.php b/include/profil/update_general.inc.php
new file mode 100644 (file)
index 0000000..1f2a892
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+if ($appli_id1>0)
+     mysql_query("replace into applis_ins set uid={$_SESSION['uid']},aid=$appli_id1,type='$appli_type1',ordre=0");
+else
+     mysql_query("delete from applis_ins where uid={$_SESSION['uid']} and ordre=0");
+
+if ($appli_id2>0)
+     mysql_query("replace into applis_ins set uid={$_SESSION['uid']},aid=$appli_id2,type='$appli_type2',ordre=1");
+else
+     mysql_query("delete from applis_ins where uid={$_SESSION['uid']} and ordre=1");
+
+$sql = "UPDATE auth_user_md5 SET ".
+// champs calculés ou vérifés
+"alias='$alias',nationalite=$nationalite,web='$web',".
+"mobile='$mobile',".
+// champs libres, on ajoute les slashes
+"libre='".put_in_db($libre)."' WHERE user_id={$_SESSION['uid']}";
+
+
+mysql_query($sql);
+
+?>
diff --git a/include/profil/update_mentor.inc.php b/include/profil/update_mentor.inc.php
new file mode 100644 (file)
index 0000000..65906a3
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+//mise a jour d'expertise si nécessaire
+
+if($mentor_expertise != $mentor_expertise_bd)
+{
+  mysql_query("REPLACE INTO mentor(uid, expertise) VALUES('{$_SESSION['uid']}', '".put_in_db($mentor_expertise)."')");
+}
+
+
+?>
diff --git a/include/profil/update_poly.inc.php b/include/profil/update_poly.inc.php
new file mode 100644 (file)
index 0000000..71767ad
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+$sql = "UPDATE auth_user_md5 set section=$section WHERE user_id={$_SESSION['uid']}";
+
+mysql_query($sql);
+
+?>
diff --git a/include/profil/update_skill.inc.php b/include/profil/update_skill.inc.php
new file mode 100644 (file)
index 0000000..64387dd
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+
+
+?>
diff --git a/include/profil/verif_adresses.inc.php b/include/profil/verif_adresses.inc.php
new file mode 100644 (file)
index 0000000..4c7cb8e
--- /dev/null
@@ -0,0 +1,205 @@
+<?php
+
+function generate_new_adrid(){
+  global $adresses;
+  if(!isset($adresses)) //aucune adresses => retourne 1
+    return 1;
+  reset($adresses);
+  $i = 0;
+  foreach($adresses as $numero => $adr){
+    $adrid_array[$i] = $numero;
+    $i++;
+  }
+  sort($adrid_array,SORT_NUMERIC); // classe les adrid dans l'ordre croissant
+  $new_adrid = 1;
+  while(list($key,$current_adrid) = each($adrid_array)){
+    if($current_adrid == $new_adrid)
+      $new_adrid++;
+    else
+      return $new_adrid; //s'ils sont differents, il y a un trou dans la liste des adrid donc new_adrid convient
+  }
+  //si aucun convient, on retourne le plus grand des adrid actuel + 1
+  return $new_adrid;
+}
+
+function replace_ifset_adr($varname, $i){
+   if (isset($_REQUEST[$varname][$i]))
+       $GLOBALS['adresses'][$i][$varname] = stripslashes($_REQUEST[$varname][$i]);
+}
+
+function set_flag_adr($varname,$i){
+  if(isset($_REQUEST[$varname][$i])){
+     $GLOBALS['adresses'][$i][$varname] = 1;
+  }
+  else
+     $GLOBALS['adresses'][$i][$varname] = '0';
+}
+
+
+function replace_address($i){
+  if(!isset($GLOBALS['adresses'][$i])){
+    $GLOBALS['adresses'][$i]['nouvelle'] = 'ajout';
+    $GLOBALS['adresses'][$i]['adrid'] = $i;
+  }
+  
+  replace_ifset_adr('secondaire', $i);
+  set_flag_adr('courrier', $i);
+  replace_ifset_adr('temporaire', $i);
+  if(isset($_REQUEST['adrid_active']) && ($_REQUEST['adrid_active'] == $i))
+    $GLOBALS['adresses'][$i]['active'] = 1;
+  else
+    $GLOBALS['adresses'][$i]['active'] = 0;
+  replace_ifset_adr('adr1', $i);
+  replace_ifset_adr('adr2', $i);
+  replace_ifset_adr('adr3', $i);
+  replace_ifset_adr('cp', $i);
+  replace_ifset_adr('ville', $i);
+  replace_ifset_adr('pays', $i);
+  replace_ifset_adr('region', $i);
+  replace_ifset_adr('tel', $i);
+  replace_ifset_adr('fax', $i);
+  set_flag_adr('adr_public', $i);
+  set_flag_adr('adr_ax', $i);
+  set_flag_adr('tel_public', $i);
+  set_flag_adr('tel_ax', $i);
+  if($_REQUEST['numero_formulaire'][$i])
+    $GLOBALS['adresses'][$i]['numero_formulaire'] = $_REQUEST['numero_formulaire'][$i];
+  else
+    $GLOBALS['adresses'][$i]['numero_formulaire'] = -1;
+}
+
+
+//remplace par les eventuelles nouvelles valeurs :
+for ($adrid = 1; $adrid <= $nb_adr_max; $adrid++) {
+  if(isset($_REQUEST['adrid'][$adrid])){ //cet adrid etait donc present dans le formulaire
+    replace_address($adrid);
+  }
+}
+
+if(($_REQUEST['old_tab'] == 'adresses') && isset($_REQUEST['modifier'])){ // on ne valide que qd on vient du formulaire
+$adresses_principales = 0;
+reset($adresses);
+foreach($adresses as $adrid => $adr) {
+  //validité de chaque adresse
+  $description = (($adr['numero_formulaire'] > 0)?"Adresse n°{$adr['numero_formulaire']}":"Nouvelle adresse");
+  if (strlen(strtok($adr['adr1'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['adr1']))
+    {
+      $str_error = $str_error."Le champ '$description - Ligne 1' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($adr['adr2'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['adr2']))
+    {
+      $str_error = $str_error."Le champ '$description - Ligne 2' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($adr['adr3'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['adr3']))
+    {
+      $str_error = $str_error."Le champ '$description - Ligne 3' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($adr['cp'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['cp']))
+    {
+      $str_error = $str_error."Le champ '$description - Code Postal' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($adr['ville'],"<>{}@~?!§*`|%$^=+")) < strlen($adr['ville']))
+    {
+      $str_error = $str_error."Le champ '$description - Ville' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($adr['tel'],"<>{}@&#~\/:;?,!§*_`[]|%$^=\"")) < strlen($adr['tel']))
+    {
+      $str_error = $str_error."Le champ '$description - Téléphone' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($adr['fax'],"<>{}@&#~\/:;?,!§*_`[]|%$^=\"")) < strlen($adr['fax']))
+    {
+      $str_error = $str_error."Le champ '$description - Fax' contient un caractère interdit.<BR />";
+    }
+  if(!$adr['secondaire']){
+    if($adresses_principales == 1){ //deja une adresse principale
+      $str_error = $str_error."Tu ne peux avoir qu'une résidence principale.<BR />";
+      $adresses_principales++;//pour eviter de repeter le message plusieurs fois
+    }
+    else $adresses_principales = 1;
+  }
+}
+
+}
+
+//on vire les adresses vides :
+if(isset($adresses)){ // s'il y en a
+  reset($adresses);
+  foreach($adresses as $adrid => $adr){
+    if(is_adr_empty($adrid)){
+       delete_address($adrid);
+    }
+  }
+}
+//on génère une éventuelle nouvelle adresse
+if (!isset($adresses) || (count($adresses) < $nb_adr_max)){
+  $adrid = generate_new_adrid();
+  $adresses[$adrid]['adrid'] = $adrid;
+  $adr = &$adresses[$adrid];
+  $adr['adr1'] = '';
+  $adr['adr2'] = '';
+  $adr['adr3'] = '';
+  $adr['cp'] = '';
+  $adr['ville'] = '';
+  $adr['pays'] = '00';
+  $adr['region'] = '';
+  $adr['tel'] = '';
+  $adr['fax'] = '';
+  $adr['secondaire'] = 1;
+  $adr['courrier'] = 0;
+  $adr['active'] = 0;
+  $adr['temporaire'] = 1;
+  $adr['adr_public'] = 0;
+  $adr['adr_ax'] = 0;
+  $adr['tel_public'] = 0;
+  $adr['tel_ax'] = 0;
+  $adr['nouvelle'] = 'new'; //n'est pas issue d'un formulaire (sert dans update_adresses...)
+}
+
+unset($adr);
+unset($adrid);
+
+//tri des adresses :
+
+reset($adresses);
+$i = 1;
+foreach($adresses as $adrid_ => $adr_){
+  if(($adresses[$adrid_]['active']) && ($adr_['nouvelle'] != 'new')){
+    $ordre_des_adrid[$i] = $adrid_;
+    $i++;
+    $est_attribuee[$adrid_] = 1;
+  }
+  else
+    $est_attribuee[$adrid_] = 0;
+}
+
+reset($adresses);
+foreach($adresses as $adrid_ => $adr_){
+  if(($adresses[$adrid_]['secondaire'] == 0) && ($est_attribuee[$adrid_] == 0) && ($adr_['nouvelle'] != 'new')){ // principale et non attribuee
+    $ordre_des_adrid[$i] = $adrid_;
+    $i++;
+    $est_attribuee[$adrid_] = 1;
+  }
+}
+
+reset($adresses);
+foreach($adresses as $adrid_ => $adr_){
+  if(($adresses[$adrid_]['temporaire'] == 0) && ($est_attribuee[$adrid_] == 0) && ($adr_['nouvelle'] != 'new')){ // permanente et non attribuee
+    $ordre_des_adrid[$i] = $adrid_;
+    $i++;
+    $est_attribuee[$adrid_] = 1;
+  }
+}
+reset($adresses);
+foreach($adresses as $adrid_ => $adr_){
+  if($est_attribuee[$adrid_] == 0){ // non attribuee
+     $ordre_des_adrid[$i] = $adrid_;
+     $i++;
+     $est_attribuee[$adrid_] = 1;
+  }
+}
+
+$nb_adr = $i - 1;
+$page->assign_by_ref('ordre_adrid',$ordre_des_adrid);
+$page->assign('nb_adr',$nb_adr+1);
+
+?>
diff --git a/include/profil/verif_emploi.inc.php b/include/profil/verif_emploi.inc.php
new file mode 100644 (file)
index 0000000..6d4e281
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+
+function set_flag_i(&$var,$var_name,$i){
+  if(isset($_REQUEST[$var_name][$i])){
+       $var[$i] = 1;
+  }
+  else
+       $var[$i] = '0';
+}
+
+for($i = 0; $i < 2; $i++){
+replace_ifset_i($entreprise,"entreprise",$i);
+replace_ifset_i($poste,"poste",$i);
+replace_ifset_i($secteur,"secteur",$i);
+replace_ifset_i($ss_secteur,"ss_secteur",$i);
+replace_ifset_i($fonction,"fonction",$i);
+
+replace_ifset_i($adrpro1,"adrpro1",$i);
+replace_ifset_i($adrpro2,"adrpro2",$i);
+replace_ifset_i($adrpro3,"adrpro3",$i);
+replace_ifset_i($cppro,"cppro",$i);
+replace_ifset_i($villepro,"villepro",$i);
+replace_ifset_i($payspro,"payspro",$i);
+replace_ifset_i($regionpro,"regionpro",$i);
+replace_ifset_i($telpro,"telpro",$i);
+replace_ifset_i($faxpro,"faxpro",$i);
+
+if(isset($_REQUEST['adresse_flag'])){
+  set_flag_i($entreprise_public,"entreprise_public",$i);
+  set_flag_i($entreprise_ax,"entreprise_ax",$i);
+  set_flag_i($adrpro_public,"adrpro_public",$i);
+  set_flag_i($adrpro_ax,"adrpro_ax",$i);
+  set_flag_i($telpro_public,"telpro_public",$i);
+  set_flag_i($telpro_ax,"telpro_ax",$i);
+}
+replace_ifset($cv,"cv");
+
+// validité de l'entreprise
+$j = $i+1;
+if (strlen(strtok($entreprise[$i],"<>{}#~;!§*`[]|%^=")) < strlen($entreprise[$i]))
+{
+$str_error = $str_error."Le champ 'Entreprise $j' contient un caractère interdit.<BR />";
+}
+
+//validité du poste
+if (strlen(strtok(stripslashes($poste[$i]),"<>{}~?!§*`|%$^=+")) < strlen(stripslashes($poste[$i])))
+{
+$str_error = $str_error."Le champ 'Poste $j' contient un caractère interdit.<BR />";
+}
+
+//validité du CV
+if (strlen(strtok($cv,"<>{}~§`")) < strlen($cv))
+{
+  $str_error = $str_error."Le champ 'Curriculum vitae' contient un caractère interdit.<BR />";
+}
+
+if (strlen(strtok(stripslashes($adrpro1[$i]),"<>{}@~?!§*`|%$^=+")) < strlen(stripslashes($adrpro1[$i])))
+    {
+      $str_error = $str_error."Le champ 'Adresse professionnelle $j - Ligne 1' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok(stripslashes($adrpro2[$i]),"<>{}@~?!§*`|%$^=+")) < strlen(stripslashes($adrpro2[$i])))
+    {
+      $str_error = $str_error."Le champ 'Adresse professionnelle $j - Ligne 2' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok(stripslashes($adrpro3[$i]),"<>{}@~?!§*`|%$^=+")) < strlen(stripslashes($adrpro3[$i])))
+    {
+      $str_error = $str_error."Le champ 'Adresse professionnelle $j - Ligne 3' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok(stripslashes($cppro[$i]),"<>{}@~?!§*`|%$^=+")) < strlen(stripslashes($cppro[$i])))
+    {
+      $str_error = $str_error."Le champ 'Code Postal professionnel $j' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok(stripslashes($villepro[$i]),"<>{}@~?!§*`|%$^=+")) < strlen(stripslashes($villepro[$i])))
+    {
+      $str_error = $str_error."Le champ 'Ville professionnelle $j' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($telpro[$i],"<>{}@&#~\/:;?,!§*_`[]|%$^=")) < strlen($telpro[$i]))
+    {
+      $str_error = $str_error."Le champ 'Téléphone professionnel $j' contient un caractère interdit.<BR />";
+    }
+  if (strlen(strtok($faxpro[$i],"<>{}@&#~\/:;?,!§*_`[]|%$^=")) < strlen($faxpro[$i]))
+    {
+      $str_error = $str_error."Le champ 'Fax professionnel $j' contient un caractère interdit.<BR />";
+    }
+
+}
+?>
diff --git a/include/profil/verif_general.inc.php b/include/profil/verif_general.inc.php
new file mode 100644 (file)
index 0000000..e614061
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+// validité du mobile
+if (strlen(strtok($mobile,"<>{}@&#~\/:;?,!§*_`[]|%$^=")) < strlen($mobile))
+{
+  $str_error = $str_error."Le champ 'Téléphone mobile' contient un caractère interdit.<BR />"; 
+}
+
+// correction du champ web si vide
+if ($web=="http://" or $web == '') {
+  $web='';
+} elseif (!preg_match("{^(https?|ftp)://[a-zA-Z0-9._%#+/?=&~-]+$}i", $web)) {
+  // validité de l'url donnée dans web
+  $str_error = $str_error."URL incorrecte dans le champ 'Page web perso', une url doit commencer par http:// ou https:// ou ftp:// et ne pas contenir de caractères interdits<BR />";
+} else {
+  $web = str_replace('&', '&amp;', $web);
+}
+
+//validité du champ libre
+if (strlen(strtok($libre,"<>")) < strlen($libre))
+{
+  $str_error = $str_error."Le champ 'Complément libre' contient un caractère interdit.<BR />";
+}
+
+?>
diff --git a/include/profil/verif_mentor.inc.php b/include/profil/verif_mentor.inc.php
new file mode 100644 (file)
index 0000000..da100d0
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+//ajout eventuel d'un pays
+if(isset($_POST['mentor_pays_op']) && ($_POST['mentor_pays_op'] == 'ajouter') && ($nb_mentor_pays < $max_mentor_pays))
+{
+  if(isset($_POST['mentor_pays_id']) && ($_POST['mentor_pays_id'] != '00'))
+  {
+    $id_ajoutee = $_POST['mentor_pays_id'];
+    mysql_query("INSERT INTO mentor_pays(uid, pid)
+                 VALUES('{$_SESSION['uid']}', '$id_ajoutee')");
+    if(mysql_affected_rows() == 1){
+      $nb_mentor_pays++;
+      $mentor_pid[$nb_mentor_pays] = $id_ajoutee;
+      $mentor_pays[$nb_mentor_pays] = stripslashes($_POST['mentor_pays_name']);
+    }
+  }
+}
+
+//ajout d'un secteur
+if(isset($_POST['mentor_secteur_op']) && ($_POST['mentor_secteur_op'] == 'ajouter') && ($nb_mentor_secteurs < $max_mentor_secteurs))
+{
+  if(isset($_POST['mentor_secteur_id']) && ($_POST['mentor_secteur_id'] != ''))
+  {
+    $sid_ajoutee = $_POST['mentor_secteur_id'];
+    if(isset($_POST['mentor_ss_secteur_id']))
+      $ssid_ajoutee = $_POST['mentor_ss_secteur_id'];
+    mysql_query("INSERT INTO mentor_secteurs(uid, secteur, ss_secteur)
+                 VALUES('{$_SESSION['uid']}', '$sid_ajoutee',
+                ".( ($ssid_ajoutee == '')?'NULL':"'$ssid_ajoutee'" ).")");
+    if(mysql_affected_rows() == 1){
+      $nb_mentor_secteurs++;
+      $mentor_sid[$nb_mentor_secteurs] = $sid_ajoutee;
+      $mentor_secteur[$nb_mentor_secteurs] = stripslashes($_POST['mentor_secteur_name']);
+      $mentor_ssid[$nb_mentor_secteurs] = $ssid_ajoutee;
+      $mentor_ss_secteur[$nb_mentor_secteurs] = stripslashes($_POST['mentor_ss_secteur_name']);
+    }
+  }
+}
+//au cas ou le submit du formulaire vient d'un changement du nouveau secteur
+else if(isset($_POST['mentor_secteur_id_new'])){
+  $mentor_secteur_id_new = $_POST['mentor_secteur_id_new'];
+}
+else{
+  $mentor_secteur_id_new = '';
+}
+if(isset($_POST['mentor_expertise'])){
+  $mentor_expertise = stripslashes($_POST['mentor_expertise']);
+  if(!empty($mentor_expertise)){
+      if (strlen(strtok($mentor_expertise,"<>{}~§`|%$^")) < strlen($mentor_expertise)){//TODO: affiner la liste
+           $str_error = $str_error."L'expertise contient un caractère interdit.<BR />";
+       }
+  }
+}
+
+?>
diff --git a/include/profil/verif_poly.inc.php b/include/profil/verif_poly.inc.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/include/profil/verif_skill.inc.php b/include/profil/verif_skill.inc.php
new file mode 100644 (file)
index 0000000..6eff33c
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+
+
+?>
diff --git a/include/tabs.inc.php b/include/tabs.inc.php
new file mode 100644 (file)
index 0000000..0527c30
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+$tabname_array = Array(
+       "general"  => "Informations<br/>générales",
+       "adresses" => "Adresses<br/>personnelles",
+       "poly"     => "Informations<br/>polytechniciennes",
+       "emploi"   => "Informations<br/>professionnelles",
+       "skill"    => "Compétences<br/>diverses",
+       "mentor"   => "Mentoring"
+       );
+       
+$opened_tab = 'general';
+
+$page->assign("onglets",$tabname_array);
+$page->assign("onglet_last",'mentor');
+
+function get_last_tab(){
+       end($GLOBALS['tabname_array']);
+       return key($GLOBALS['tabname_array']);
+}
+
+function get_next_tab($tabname){
+       global $tabname_array;
+       reset($tabname_array);
+       $marker = false;
+       while(list($current_tab,$current_tab_desc) = each($tabname_array)){
+               if($current_tab == $tabname){
+                       $res = key($tabname_array);// each() sets key to the next element
+                       if($res != NULL)// if it was the last call of each(), key == NULL => we return the first key
+                               return $res;
+                       else{
+                               reset($tabname_array);
+                               return key($tabname_array);
+                       }
+               }
+       }
+       // We should not arrive to this point, but at least, we return the first key
+       reset($tabname_array);
+       return key($tabname_array);
+}
+
+function draw_all_tabs(){
+       global $tabname_array, $new_tab;
+       reset($tabname_array);
+?>
+<ul id="onglet">
+<?php
+       while(list($current_tab,$current_tab_desc) = each($tabname_array)){
+               if($current_tab == $new_tab){
+                       draw_tab($current_tab, true);
+               }
+               else{
+                       draw_tab($current_tab, false);
+               }
+       }?>
+</ul>
+<?php
+}
+
+function draw_tab($tab_name, $is_opened){
+       global $tabname_array;
+       if($is_opened){?>
+           <li class="actif">
+              <?php echo $tabname_array["$tab_name"];?>
+           </li>
+  <?php }
+       else{ ?>
+           <li>
+             <A href="<?php echo "{$_SERVER['PHP_SELF']}?old_tab=$tab_name";?>">
+                 <?php echo $tabname_array["$tab_name"];?>
+              </A>
+           </li>
+  <?php }
+}
+
+
+?>
diff --git a/templates/profil.tpl b/templates/profil.tpl
new file mode 100644 (file)
index 0000000..4d92b08
--- /dev/null
@@ -0,0 +1,82 @@
+{config_load file="profil.conf"}
+{literal}
+<style>
+<!--
+div.blocunite {margin: 1em 0em 2em 0em;}
+div.blocunite_tab {margin: 0em 0em 2em 0em;}
+div.bloc {margin: 0em 0.5em 0.5em 0.5em;}
+div.erreur {background-color: #FF3300; padding-left=0.5em; margin: 2px;}
+table.bicol td.cold,td.col {padding-right: 0.5em;}
+table.bicol td.colm {}
+table.bicol td.colg,td.col {padding-left: 0.5em;}
+table.bicol td.dcolm, td.dcolg, td.dcold {padding-bottom: 0.5em;}
+table.bicol td.dcolg {padding-left: 0.5em;}
+table.bicol td.dcold {padding-right: 0.5em;}
+table.bicol td.pflags {}
+table.bicol td.flags {padding-top: 0.5em;}
+table.bicol tr.top {vertical-align: top;}
+table.bicol span.titre {font-weight: bold;}
+table.bicol span.comm {font-size: smaller;}
+table.bicol span.nom {}
+table.bicol span.valeur {font-weight: bold;}
+table.bicol span.lien {font-size: smaller;}
+table.flags td.texte {font-size: smaller; font-weight: bold; padding-left: 0.5em;}
+table.flags td.vert {background-color: green; width: 1.5em; height: 1.5em; text-align: center;}
+table.flags td.orange {background-color: #ff9900; width: 1.5em; height: 1.5em; text-align: center;}
+table.flags td.rouge {background-color: red; width: 1.5em; height: 1.5em; text-align: center;}
+-->
+</style>
+{/literal}
+{dynamic}
+{if $etat_naissance != ''}
+{include file="profil/naissance.tpl"}
+{/if}
+{/dynamic}
+{if $etat_naissance == '' || $etat_naissance == 'ok'}
+
+{dynamic}
+  {if $profil_error != ''}
+    <div class="erreur">
+      {$profil_error}
+    </div>
+  {/if}
+{/dynamic}
+{* dessin des onglets *}
+
+<form action="{$smarty.server.PHP_SELF}" method="POST" name="prof_annu">
+ <input type="hidden" value="" name="binet_op">
+ <input type="hidden" value="" name="binet_id">
+ <input type="hidden" value="" name="groupex_op">
+ <input type="hidden" value="" name="groupex_id">
+ <input type="hidden" value="{dyn x=$onglet}" name="old_tab">
+ <input type="hidden" value="" name="adresse_flag">
+<table class="cadre_a_onglet" border="0" cellpadding="0" cellspacing="0">
+<tr>
+  <td>
+{dynamic}
+   {draw_onglets}
+{/dynamic}
+  </td>
+</tr>
+<tr><td>
+<div class="conteneur_tab">
+<TABLE width="100%">
+<TR><TD colspan=2>
+{dynamic}
+{include file=$onglet_tpl}
+{/dynamic}
+</TD></TR>
+<TR align="center"><TD><input type="submit" value="Valider ces modifications" name="modifier"></TD>
+{dynamic}
+{if $onglet != $onglet_last}
+<TD>
+<input type="submit" value="Valider et passer au prochain onglet" name="modifier+suivant">
+</TD>
+{/if}
+{/dynamic}
+</TR>
+</TABLE>
+</div>
+</td></tr>
+</form>
+{/if}
diff --git a/templates/profil/adresses.tpl b/templates/profil/adresses.tpl
new file mode 100644 (file)
index 0000000..ee2ea5d
--- /dev/null
@@ -0,0 +1,186 @@
+<div class="blocunite_tab">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0"
+    summary="Profil: Adresses personnelles">
+      <tr>
+        <th colspan="5">
+          Adresses personnelles
+        </th>
+      </tr>
+
+{section name=i loop=$nb_adr start=1 max=$nb_adr}
+{*
+  $adrid = $ordre_adrid[$i];
+  $adr = &$adresses[$adrid];
+*}
+  {assign var='adrid' value=$ordre_adrid[i]}
+  {assign var='adr' value=$adresses.$adrid}
+      <tr>
+         <th colspan="5">
+            {if $adr.nouvelle != 'new'}Adresse n°{$smarty.section.i.index}{else}Rentre ici une nouvelle adresse{/if}
+             <input type="hidden" name="adrid[{$adrid}]" value="{$adrid}">
+             {if $adr.nouvelle == 'new'}
+                <input type="hidden" name="numero_formulaire[{$adrid}]" value="0">
+              {else}
+               <input type="hidden" name="numero_formulaire[{$adrid}]" value="{$smarty.section.i.index}">
+              {/if}
+         </th>
+      </tr>
+      <tr>
+       <td align="left">
+       {if $adr.nouvelle != 'new'}
+               <input type="submit" value="La supprimer !" name="adrid_del[{$adrid}]" />
+       {/if}
+&nbsp;
+       </td>
+       <td colspan="4" align="right">
+         <em>c'est à cette adresse que je suis actuellement</em>
+         <input name="adrid_active" type="radio" value="{$adrid}" {if $adr.active}checked{/if} />
+       </td>
+      </tr>
+      <tr>
+       <td colspan="5" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+      <tr>
+        <td class="vert">
+            <input type="checkbox" name="adr_public[{$adrid}]" value="1" {if $adr.adr_public}checked{/if} />
+       </td>
+       <td class="texte">
+           site public
+        </td>
+        <td class="orange">
+            <input type="checkbox" name="adr_ax[{$adrid}]" value="1" {if $adr.adr_ax}checked{/if}>
+       </td>
+       <td class="texte">
+           transmis à l'AX
+        </td>
+             <td class="texte">
+               <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">
+               Quelle couleur ??</a>
+             </td>
+            </tr>
+         </table>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">{if $adr.nouvelle != 'new'}Adresse n°{$smarty.section.i.index}{else}Nouvelle adresse{/if}</span><br />
+        </td>
+        <td class="cold">
+          <input type="text" name="adr1[{$adrid}]" size="43" maxlength="88" value="{$adr.adr1|print_html}">
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+         &nbsp;
+        </td>
+        <td class="cold">
+          <input type="text" name="adr2[{$adrid}]" size="43" maxlength="88" value="{$adr.adr2|print_html}">
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+         &nbsp;
+        </td>
+        <td class="cold">
+          <input type="text" name="adr3[{$adrid}]" size="43" maxlength="88" value="{$adr.adr3|print_html}">
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Code postal / Ville</span><br />
+        </td>
+        <td class="cold">
+          <input type="text" name="cp[{$adrid}]" value="{$adr.cp|print_html}" size="7" maxlength="18">
+         &nbsp;
+          <input type="text" name="ville[{$adrid}]" value="{$adr.ville|print_html}" size="32" maxlength="78">
+        </td>
+      </tr>
+      <tr>
+       <td class="colg">
+         <span class="titre">Pays</span>
+       </td>
+       <td class="cold">
+         <select name="pays[{$adrid}]" onChange="this.form.submit();">
+          {geoloc_pays pays=$adr.pays}
+         </select>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+         <span class="titre">Région ou département</span><br />
+         <span class="comm">(selon pays)</span>
+       </td>
+        <td class="cold">
+         <select name="region[{$adrid}]">
+            {geoloc_region pays=$adr.pays region=$adr.region}
+         </select>
+       </td>
+      </tr>
+         <tr>
+           <td class="colg">
+                 <span class="titre">Cette adresse est :</span>
+               </td>
+               <td class="cold">
+                 <input type="radio" name="temporaire[{$adrid}]" value="0" {if !$adr.temporaire}checked{/if}>
+                 permanente
+                 <input type="radio" name="temporaire[{$adrid}]" value="1" {if $adr.temporaire}checked{/if}>
+                 temporaire
+               </td>
+         </tr>
+         <tr>
+               <td class="colg">
+                 &nbsp;
+               </td>
+               <td class="cold">
+                 <input type="radio" name="secondaire[{$adrid}]" value="0" {if !$adr.secondaire}checked{/if}>
+                 ma résidence principale
+                 <input type="radio" name="secondaire[{$adrid}]" value="1" {if $adr.secondaire}checked{/if}>
+                 une résidence secondaire
+               </td>
+         <tr>
+           <td class="colg">
+                 &nbsp;
+               </td>
+               <td class="cold">
+                 <input type="checkbox" name="courrier[{$adrid}]" value="1" {if $adr.courrier}checked{/if}> on peut m'y envoyer du courrier par la poste
+               </td>
+         </tr>
+      <tr>
+       <td colspan="2" class="flags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="vert">
+               <input type="checkbox" name="tel_public[{$adrid}]" value="1" {if $adr.tel_public}checked{/if}>
+                     </td>
+             <td class="texte">
+               site public
+             </td>
+                     <td class="orange">
+               <input type="checkbox" name="tel_ax[{$adrid}]" value="1" {if $adr.tel_ax}checked{/if}>
+                     </td>
+             <td class="texte">
+               transmis à l'AX
+             </td>
+              <td class="texte">
+                <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">Quelle couleur ??</a>
+              </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr>
+        <td class="colg">
+         <span class="titre">Téléphone associé</span>
+       </td>
+       <td>
+         <input type="text" size="19" maxlength="28" name="tel[{$adrid}]" value="{$adr.tel|print_html}">
+         &nbsp;
+         <span class="titre">Fax</span>
+         <input type="text" size="19" maxlength="28" name="fax[{$adrid}]" value="{$adr.fax|print_html}">
+       </td>
+      </tr>
+         <tr><td colspan="5">&nbsp;</td></tr>
+{/section}
+         <tr><td colspan="5">&nbsp;</td></tr>
+    </table>
+</div>
diff --git a/templates/profil/emploi.tpl b/templates/profil/emploi.tpl
new file mode 100644 (file)
index 0000000..08c08dc
--- /dev/null
@@ -0,0 +1,254 @@
+{section name=adresses_pro loop=2}
+  {assign var='i' value=$smarty.section.adresses_pro.index} 
+
+{if $i == 0}
+  <div class="blocunite_tab">
+{else}
+  <div class="blocunite">
+{/if}
+
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0"
+    summary="Profil: Informations professionnelles - Entreprise n°<?php echo ($i+1);?>">
+      <tr>
+        <th colspan="2">
+          Informations professionnelles - Entreprise n°{$i+1}
+        </th>
+      </tr>
+      <tr>
+       <td colspan="5" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+      <tr>
+        <td class="vert">
+            <input type="checkbox" name="entreprise_public[{$i}]" value="1" {if $entreprise_public.$i}checked{/if} />
+       </td>
+       <td class="texte">
+           site public
+        </td>
+        <td class="orange">
+            <input type="checkbox" name="entreprise_ax[{$i}]" value="1" {if $entreprise_ax.$i}checked{/if}>
+       </td>
+       <td class="texte">
+           transmis à l'AX
+        </td>
+             <td class="texte">
+               <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">
+               Quelle couleur ??</a>
+             </td>
+            </tr>
+         </table>
+        </td>
+     </tr>
+     <tr>
+        <td class="colg">
+          <span class="titre">Entreprise ou organisme</span>
+        </td>
+        <td class="cold">
+          <input type="text" size="35" maxlength="100" name="entreprise[{$i}]"
+          value="{$entreprise.$i|print_html}">
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Secteur d'activité</span>
+        </td>
+        <td class="cold">
+          <select name="secteur[{$i}]" onChange="this.form.submit();">
+           {select_secteur secteur=$secteur.$i}
+          </select>
+        </td>
+      </tr>
+      <tr>
+         <td class="colg">
+           <span class="titre">Sous-Secteur d'activité</span>
+         </td>
+        <td class="cold">
+          <select name="ss_secteur[{$i}]">
+            {select_ss_secteur secteur=$secteur.$i ss_secteur=$ss_secteur.$i}
+          </select>
+        </td> 
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Poste occupé</span>
+        </td>
+        <td class="cold">
+          <input type="text" size="35" maxlength="120" name="poste[{$i}]"
+          value="{$poste.$i|print_html}">
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Fonction occupée</span>
+        </td>
+        <td class="cold">
+          <select name="fonction[{$i}]">
+           {select_fonction fonction=$fonction.$i}
+          </select>
+        </td>
+      </tr>
+      <tr>
+       <td colspan="5" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+      <tr>
+        <td class="vert">
+            <input type="checkbox" name="adrpro_public[{$i}]" value="1" {if $adrpro_public.$i}checked{/if} />
+       </td>
+       <td class="texte">
+           site public
+        </td>
+        <td class="orange">
+            <input type="checkbox" name="adrpro_ax[{$i}]" value="1" {if $adrpro_ax.$i}checked{/if} />
+       </td>
+       <td class="texte">
+           transmis à l'AX
+        </td>
+             <td class="texte">
+               <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">
+               Quelle couleur ??</a>
+             </td>
+            </tr>
+         </table>
+        </td>
+     </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Adresse professionnelle</span>
+        </td>
+        <td class="cold">
+          <input type="text" name="adrpro1[{$i}]" size="40" maxlength="88" value="{$adrpro1.$i|print_html}">
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          &nbsp;
+        </td>
+        <td class="cold">
+          <input type="text" name="adrpro2[{$i}]" size="40" maxlength="88" value="{$adrpro2.$i|print_html}">
+       </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          &nbsp;
+        </td>
+        <td class="cold">
+          <input type="text" name="adrpro3[{$i}]" size="40" maxlength="88" value="{$adrpro3.$i|print_html}">
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Code postal</span><br />
+        </td>
+        <td class="cold">
+          <input type="text" name="cppro[{$i}]" value="{$cppro.$i|print_html}" size=8 maxlength=8>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Ville</span><br />
+        </td>
+        <td class="cold">
+          <input type="text" name="villepro[{$i}]" value="{$villepro.$i|print_html}" size=40 maxlength=50>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Pays</span>
+        </td>
+        <td class="cold">
+          <select name="payspro[{$i}]" onChange="this.form.submit();">
+           {geoloc_pays pays=$payspro.$i}
+          </select>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Région ou département</span><br />
+          <span class="comm">(selon pays)</span>
+        </td>
+        <td class="cold">
+          <select name="regionpro[{$i}]">
+           {geoloc_region pays=$payspro.$i region=$regionpro.$i}
+          </select>
+        </td>
+      </tr>
+      <tr>
+       <td colspan="5" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+      <tr>
+        <td class="vert">
+            <input type="checkbox" name="telpro_public[{$i}]" value="1" {if $telpro_public.$i}checked{/if} />
+       </td>
+       <td class="texte">
+           site public
+        </td>
+        <td class="orange">
+            <input type="checkbox" name="telpro_ax[{$i}]" value="1" {if $telpro_ax.$i}checked{/if} />
+       </td>
+       <td class="texte">
+           transmis à l'AX
+        </td>
+             <td class="texte">
+               <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">
+               Quelle couleur ??</a>
+             </td>
+            </tr>
+         </table>
+        </td>
+     </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Téléphone professionnel</span>
+        </td>
+        <td>
+          <input type="text" size="18" maxlength="18" name="telpro[{$i}]" value="{$telpro.$i|print_html}">
+          &nbsp;
+       </td>
+       </tr>
+       <tr>
+       <td class="colg">
+          <span class="titre">Fax</span>
+       </td>
+       <td>
+          <input type="text" size="18" maxlength="18" name="faxpro[{$i}]" value="{$faxpro.$i|print_html}">
+        </td>
+      </tr>
+    </table>
+  </div>
+
+{/section}
+
+<div class="blocunite">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0"
+        summary="Profil: Informations professionnelles - CV">
+    <tr>
+       <th colspan="2">
+           Informations professionnelles - CV
+       </th>
+    </tr>
+      <tr>
+        <td colspan="2" class="flags">
+          <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+            <tr>
+              <td class="rouge">
+                <input type="checkbox" name="accesCV" checked disabled>
+              </td>
+              <td class="texte">
+                ne peut être ni public ni transmis à l'AX
+              </td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
+        <td class="dcolg">
+          <span class="titre">Curriculum vitae</span><br />
+          <span class="comm">Le CV n'est <b>jamais</b> public.<br />
+          <a href="javascript:x()" onclick="popWin('aide.php#cv','aide_cv','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">
+          Comment remplir mon CV ?</a></span>
+        </td>
+        <td class="dcold">
+          <textarea name="cv" rows="15" cols="33">{$cv|print_html}</textarea>
+        </td>
+      </tr>
+    </table>
+</div>
diff --git a/templates/profil/general.tpl b/templates/profil/general.tpl
new file mode 100644 (file)
index 0000000..cdb2d60
--- /dev/null
@@ -0,0 +1,232 @@
+{include file="applis.js.tpl"}
+<div class="blocunite_tab">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0" 
+    summary="Profil : Informations générales">
+      <tr>
+        <th colspan="2">
+          Informations générales
+        </th>
+      </tr>
+      <tr>
+       <td colspan="2" class="pflags">
+          <table class="flags" border="0" cellspacing="0" summary="Flags">
+            <tr>
+              <td class="vert">
+                <input type="checkbox" disabled checked>
+              </td>
+             <td class="texte">
+               site public
+              </td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+         <span class="titre">Identité</span>
+        </td>
+       <td class="cold">
+         <span class="nom">{$prenom} {$nom} X{$promo}</span>
+       </td>
+      </tr>     
+{if $femme}
+      <tr>
+        <td class="colg">
+         <span class="titre">Nom de mariage</span><br />
+         <span class="comm">(si différent de {$nom} seulement)</span>
+       </td>
+       <td class="cold">
+         <span class="nom">{$epouse|default:"Aucun"}</span>
+         <span class="lien"><a href="epouse.php">modifier</a></span>
+       </td>
+      </tr>
+{/if}
+      <tr>
+        <td class="colg">
+         <span class="titre">Nationalité</span>
+       </td>
+       <td class="cold">
+         <select name="nationalite">
+           {select_db_table table="nationalites" valeur=$nationalite}
+         </select>
+        </td>
+      </tr>
+      <tr>
+        <td class="colg">
+          <span class="titre">Application</span><br />
+         <span class="comm">(4ème année de l'X)</span>
+        </td>
+        <td class="cold">
+          <select name="appli_id1" onChange="fillType(this.form.appli_type1, this.selectedIndex-1);">  
+               {applis_options selected=$appli_id1}
+          </select>
+          <br />
+          <select name="appli_type1">
+           <option value=""></option>
+         </select>
+<script type="text/javascript">
+<!--
+  fillType(document.prof_annu.appli_type1, document.prof_annu.appli_id1.selectedIndex-1);
+  selectType(document.prof_annu.appli_type1, '{dyn x=$appli_type1}');
+//-->
+</script>
+        </td>
+      </tr>
+      <tr>
+        <td class="dcolg">
+         <span class="titre">Post-application</span>
+        </td>
+        <td class="dcold">
+          <select name="appli_id2" onChange="fillType(this.form.appli_type2, this.selectedIndex-1);">   
+           {applis_options selected=$appli_id2}
+         </select>
+          <br />
+          <select name="appli_type2">
+           <option value=""></option>
+         </select>
+<script type="text/javascript">
+<!--
+  fillType(document.prof_annu.appli_type2, document.prof_annu.appli_id2.selectedIndex-1);
+  selectType(document.prof_annu.appli_type2, '{dyn x=$appli_type2}');
+//-->
+</script>
+        </td>
+      </tr>
+    </table>
+  </div>
+
+<div class="bolcunite">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0"
+    summary="Profil: Trombinoscope">
+      <tr>
+        <th colspan="3">
+          Trombinoscope
+        </th>
+      </tr>
+      <tr>
+        <td class="col" colspan="3">
+          Pour profiter de cette fonction intéressante, tu dois disposer 
+         quelque part (sur ton ordinateur ou sur Internet) d'une photo
+         d'identité (dans un fichier au format JPEG, PNG ou GIF).<br />
+         <div align="center">
+           <span class="lien"><a href="javascript:x()" onclick="popWin('trombino.php','trmb','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=750,height=480')">Éditer ta photo</a></span>
+         </div>
+        </td>
+      </tr>
+      <tr>
+        <td class="col" colspan=3>
+          <table cellspacing="0" cellpadding="0" border="0" summary="Trombinoscope">
+           <tr>
+             <td class="dcold">
+               Voilà la photo qui apparaîtra sur la fiche de ton profil (si tu viens
+               de changer ta photo, la photo affichée peut correspondre à ton ancien
+               profil : c'est le cas si elle n'a pas encore été validée par un administrateur du site !
+                <a href="javascript:x()" onclick="popWin('x.php?x={$smarty.session.username}&amp;modif=new','_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=620,height=370')">nouvelle photo</a>).
+             </td>
+             <td class="dcolg">
+               <img src="getphoto.php?x={$smarty.session.uid}{*{if $smarty.cookies|@count == 0}&amp;{php}echo SID;{/php}{/if}*}" width=80 alt=" [ PHOTO ] ">
+             </td>
+           </tr>
+         </table>
+        </td>
+      </tr>
+    </table>
+  </div>
+  <div class="blocunite">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0"
+    summary="Profil: Divers">
+      <tr>
+        <th colspan="2">
+         Divers
+       </th>
+      </tr>
+         <tr>
+          <td colspan="2" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="vert">
+               <input type="checkbox" name="mobile_public" value="V"
+               {if $mobile_public}checked{/if} />
+             </td>
+             <td class="texte">
+               site public
+             </td>
+             <td class="orange">
+               <input type="checkbox" name="mobile_ax" value="O"
+               {if $mobile_ax}checked{/if} />
+             </td>
+             <td class="texte">
+               transmis à l'AX
+             </td>
+              <td class="texte">
+                <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">Quelle couleur ??</a>
+              </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr>
+        <td class="colg">
+         <span class="titre">Téléphone mobile</span>
+       </td>
+        <td class="cold">
+          <input type="text" size="18" maxlength="18" name="mobile"
+           value="{$mobile|print_html}">
+       </td>
+      </tr>
+      <tr>
+       <td colspan="2" class="flags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="vert">
+               <input type="checkbox" name="web_public" value="V"
+               {if $web_public}checked{/if} />
+             </td>
+             <td class="texte">
+               site public
+             </td>
+              <td class="texte">
+                <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">Quelle couleur ??</a>
+              </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr>
+        <td class="dcolg">
+         <span class="titre">Page web Perso</span>
+       </td>
+        <td class="dcold">
+          <input type="text" size="35" maxlength="95" name="web"  
+             value="{$web|print_html}">
+        </td>
+      </tr>
+         <tr>
+       <td colspan="2" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="vert">
+               <input type="checkbox" name="libre_public" value="1"
+               {if $libre_public}checked{/if} />
+                     </td>
+             <td class="texte">
+               site public
+             </td>
+              <td class="texte">
+                <a href="javascript:x()" onclick="popWin('aide.php#flags','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">Quelle couleur ??</a>
+              </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr>
+       <td class="dcolg">
+         <span class="titre">Complément libre</span>
+         <span class="comm">Commentaire? ICQ? etc...</span>
+       </td>
+       <td class="dcold">
+         <textarea name="libre" rows="3" cols="29" >{$libre|print_html}</textarea>
+       </td>
+      </tr>
+    </table>
+</div>
diff --git a/templates/profil/mentor.tpl b/templates/profil/mentor.tpl
new file mode 100644 (file)
index 0000000..47e9ea9
--- /dev/null
@@ -0,0 +1,178 @@
+{literal}
+<script language="JavaScript" type="text/javascript">
+<!--
+
+    function mentor_pays_add()
+    {
+        var selid = document.prof_annu.mentor_pays_id_new.selectedIndex;
+        document.prof_annu.mentor_pays_id.value = document.prof_annu.mentor_pays_id_new.options[selid].value;
+       document.prof_annu.mentor_pays_name.value = document.prof_annu.mentor_pays_id_new.options[selid].text;
+        document.prof_annu.mentor_pays_op.value = "ajouter";
+       document.prof_annu.submit();
+    } // function mentor_pays_add()
+
+    function mentor_pays_del( pid )
+    {
+        document.prof_annu.mentor_pays_id.value = pid;
+        document.prof_annu.mentor_pays_op.value = "retirer";
+        document.prof_annu.submit();
+    } // function mentor_pays_del( pid )
+    
+    function mentor_secteur_add()
+    {
+        var selid_secteur = document.prof_annu.mentor_secteur_id_new.selectedIndex;
+        document.prof_annu.mentor_secteur_id.value = document.prof_annu.mentor_secteur_id_new.options[selid_secteur].value;
+       document.prof_annu.mentor_secteur_name.value = document.prof_annu.mentor_secteur_id_new.options[selid_secteur].text;
+       var selid_ss_secteur = document.prof_annu.mentor_ss_secteur_id_new.selectedIndex;
+        document.prof_annu.mentor_ss_secteur_id.value = document.prof_annu.mentor_ss_secteur_id_new.options[selid_ss_secteur].value;
+       document.prof_annu.mentor_ss_secteur_name.value = document.prof_annu.mentor_ss_secteur_id_new.options[selid_ss_secteur].text;
+        document.prof_annu.mentor_secteur_op.value = "ajouter";
+       document.prof_annu.submit();
+    } // function mentor_secteur_add()
+
+    function mentor_secteur_del( sid )
+    {
+        document.prof_annu.mentor_secteur_id.value = sid;
+        document.prof_annu.mentor_secteur_op.value = "retirer";
+        document.prof_annu.submit();
+    } // function mentor_secteur_del( sid )
+
+//-->
+</script>
+{/literal}
+
+ <p class="normal">
+   Si tu acceptes que ceux de nos camarades qui,
+   <ul>
+     <li>encore jeunes, sont en train de bâtir leur projet professionnel,</li>
+     <li>ou bien, plus âgés, souhaitent réorienter leur carrière,</li>
+   </ul>
+   te contactent afin de te demander conseil, dans les domaines que tu connais
+   bien, et pour lesquels tu pourrais les aider, remplis cette rubrique.<br>
+   Tu peux mentionner ici les domaines de compétences, les expériences 
+   notamment internationales sur la base desquels tu seras identifiable depuis
+   <a href="referent.php">la page de recherche d'un conseil professionnel</a>.
+ </p>
+
+ <div class="blocunite_tab">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0" 
+    summary="Profil: Mentoring">
+      <tr>
+        <th colspan="3">
+         Pays dont tu connais bien la culture professionnelle
+       </th>
+      </tr>
+      <input type="hidden" value="" name="mentor_pays_op">
+      <input type="hidden" value="00" name="mentor_pays_id">
+      <input type="hidden" value="" name="mentor_pays_name">
+      <tr>
+       <td colspan="3" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="rouge">
+               <input type="checkbox" name="accesX" checked disabled>
+             </td>
+             <td class="texte">
+               ne peut être ni public ni transmis à l'AX
+             </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr class="impair">
+        <td class="colg">
+         <span class="titre">Pays</span>
+       </td>
+       <td class="colm">
+          <span class="titre"></span>
+       </td>
+        <td class="cold" width="15%">
+        &nbsp;
+       </td>
+      </tr>
+      {print_pays}
+   </table>
+</div>
+
+<div class="blocunite">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0" 
+    summary="Profil: Mentoring">
+      <tr>
+        <th colspan="3">
+         Secteurs d'activité dans lesquels tu as beaucoup exercé
+       </th>
+      </tr>
+      <input type="hidden" value="" name="mentor_secteur_op">
+      <input type="hidden" value="" name="mentor_secteur_id">
+      <input type="hidden" value="" name="mentor_secteur_name">
+      <input type="hidden" value="" name="mentor_ss_secteur_id">
+      <input type="hidden" value="" name="mentor_ss_secteur_name">
+      <tr>
+       <td colspan="3" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="rouge">
+               <input type="checkbox" name="accesX" checked disabled>
+             </td>
+             <td class="texte">
+               ne peut être ni public ni transmis à l'AX
+             </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr class="impair">
+        <td class="colg">
+         <span class="titre">Secteur</span>
+       </td>
+       <td class="colm">
+          <span class="titre">Sous-Secteur</span>
+       </td>
+        <td class="cold" width="15%">
+        &nbsp;
+       </td>
+      </tr>
+      {print_secteurs_mentor}
+   </table>
+</div>
+
+<div class="blocunite">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0" 
+    summary="Profil: Mentoring">
+      <tr>
+        <th colspan="3">
+         Expérience et expertises que tu acceptes de faire partager
+       </th>
+      </tr>
+      <tr>
+       <td colspan="3" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="rouge">
+               <input type="checkbox" name="accesX" checked disabled>
+             </td>
+             <td class="texte">
+               ne peut être ni public ni transmis à l'AX
+             </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr>
+        <td colspan="3">
+         Dans cette case il te faut indiquer en quelques mots ce qui t'a
+         amené à acquérir l'expérience indiquée, et dans quelle mesure tu
+         veux bien que ceux de nos camarades qui seraient intéressés par un
+         contact avec toi, en prenne l'initiative. <b>Il est obligatoire de
+         remplir cette dernière case pour apparaître dans la base de données
+         des "Mentors".</b>
+         <br />
+        </td>
+      </tr>
+      <tr>
+        <td colspan="3">
+         <textarea rows="8" cols="60" name="mentor_expertise">{$mentor_expertise|print_html}</textarea>
+       </td>
+      </tr>
+   </table>
+</div>
diff --git a/templates/profil/naissance.tpl b/templates/profil/naissance.tpl
new file mode 100644 (file)
index 0000000..3fe58b2
--- /dev/null
@@ -0,0 +1,49 @@
+{if $etat_naissance == 'ok'}
+  <script language="javascript" type="text/javascript">
+  <!--
+    alert ("\nDate de naissance enregistrée.\n\nTu peux maintenant modifier ton profil.");
+  // -->
+  </script>
+{else}
+  {if $etat_naissance == 'erreur'}
+    <p class="erreur">
+     {#profil_naissance_erreur#}
+    </p>
+  {/if}
+
+  <div class="rubrique">
+    {#profil_naissance_titre#}
+  </div>
+
+<form action="profil.php" method="post">
+  <p class="normal">
+    {#profil_naissance_intro#}
+  </p>
+  <br />
+  <div align="center">
+    <table class="bicol" border="0" cellpadding="4" cellspacing="0" summary="Formulaire de naissance" width="60%">
+      <tr>
+        <th colspan="2">
+          {#profil_date_titre#}
+        </th>
+      </tr>
+      <tr>
+        <td>
+         <b>Date</b> (JJMMAAAA)
+        </td>
+        <td>
+          <input type="text" size="8" maxlength="8" name="birth">
+        </td>
+      </tr>
+      <tr>
+        <td align="center" colspan="2">
+          <input type="submit" value="Enregistrer" name="submit">
+        </td>
+      </tr>
+    </table>
+  </div>
+</form>
+
+
+{/if}
+
diff --git a/templates/profil/poly.tpl b/templates/profil/poly.tpl
new file mode 100644 (file)
index 0000000..69ada7a
--- /dev/null
@@ -0,0 +1,134 @@
+{literal}
+<script language="JavaScript" type="text/javascript">
+<!--
+
+/** defgroup user_profile Gestion du profil utilisateur */
+
+    /** ajout d'un binet au profil de l'utilisateur en base de données
+     * le binet est déterminé par binet_id qui est sélectionné dans un SELECT
+     * @ingroup user_profile
+     * @return VOID
+     */
+    function binet_add()
+    {
+        var selid = document.prof_annu.binet_sel.selectedIndex;
+        document.prof_annu.binet_id.value = document.prof_annu.binet_sel.options[selid].value;
+        document.prof_annu.binet_op.value = "ajouter";
+        document.prof_annu.submit();
+    } // function binet_add()
+
+
+
+    /** suppression d'un binet du profil de l'utilisateur en base de données
+     * @ingroup user_profile
+     * @param id INT id du binet
+     * @return VOID
+     */
+    function binet_del( id )
+    {
+        document.prof_annu.binet_id.value = id;
+        document.prof_annu.binet_op.value = "retirer";
+        document.prof_annu.submit();
+    } // END function binet_del( id )
+
+
+
+    /** ajout d'un groupeX au profil de l'utilisateur en base de données
+     * le groupeX est déterminé par groupex_id qui est sélectionné dans un SELECT
+     * @ingroup user_profile
+     * @return VOID
+     */
+    function groupex_add()
+    {
+        var selid = document.prof_annu.groupex_sel.selectedIndex;
+        document.prof_annu.groupex_id.value = document.prof_annu.groupex_sel.options[selid].value;
+        document.prof_annu.groupex_op.value = "ajouter";
+        document.prof_annu.submit();
+    } // END function groupex_add()
+
+    /** suppression d'un groupeX du profil de l'utilisateur en base de données
+     * @ingroup user_profile
+     * @param id INT id du groupeX
+     * @return VOID
+     */
+    function groupex_del( id )
+    {
+        document.prof_annu.groupex_id.value = id;
+        document.prof_annu.groupex_op.value = 'retirer';
+        document.prof_annu.submit();
+    } // END function groupex_del( id )
+
+//-->
+</script>
+{/literal}
+ <div class="blocunite_tab">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0" 
+    summary="Profil: Informations Polytechniciennes">
+      <tr>
+        <th colspan="3">
+         Informations polytechniciennes
+       </th>
+      </tr>
+      <tr>
+       <td colspan="3" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="rouge">
+               <input type="checkbox" name="accesX" checked disabled>
+             </td>
+             <td class="texte">
+               ne peut être ni public ni transmis à l'AX
+             </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr class="top">
+        <td class="colg">
+         <span class="titre">(ex-)Section</span>
+       </td>
+       <td class="colm">
+         <select name="section">
+         {select_db_table table="sections" valeur=$section}
+         </select>
+        </td>
+        <td class="cold">
+         &nbsp;
+        </td>
+      </tr>
+      <!-- Binets -->
+      <tr class="top">
+        <td class="colg">
+          <span class="titre">(ex-)Binet(s)</span>
+        </td>
+        <td class="colm">
+       {print_binets uid=$smarty.session.uid}
+          <select name="binet_sel">
+         {select_db_table table="binets_def" valeur=0 champ="text" pad='1'}
+         </select>
+        </td>
+        <td class="cold">
+         <span class="lien">
+         <a href="javascript:binet_add();">ajouter</a>
+         </span>
+        </td>
+      </tr>
+      <!-- Groupes X -->
+      <tr class="top">
+        <td class="colg">
+          <span class="titre">Groupe(s) X</span>
+        </td>
+       {print_groupex uid=$smarty.session.uid}
+       <td class="colm">
+         <select name="groupex_sel">
+         {select_db_table table="groupesx_def" valeur=0 champ="text" pad='1'}
+         </select>
+        </td>
+        <td class="dcold">
+         <span class="lien">
+         <a href="javascript:groupex_add();">ajouter</a>
+         </span>
+        </td>
+      </tr>
+       </table>
+  </div>
diff --git a/templates/profil/skill.tpl b/templates/profil/skill.tpl
new file mode 100644 (file)
index 0000000..9f5d503
--- /dev/null
@@ -0,0 +1,121 @@
+{literal}
+<script language="JavaScript" type="text/javascript">
+<!--
+
+    function langue_add()
+    {
+        var selectid = document.prof_annu.langue_sel_add.selectedIndex;
+        document.prof_annu.langue_id.value = document.prof_annu.langue_sel_add.options[selectid].value;
+       var selectid_level = document.prof_annu.langue_level_sel_add.selectedIndex;
+        document.prof_annu.langue_level.value = document.prof_annu.langue_level_sel_add.options[selectid_level].value;
+        document.prof_annu.langue_op.value = "ajouter";
+       document.prof_annu.submit();
+    } // function langue_add()
+
+    function langue_del( lid )
+    {
+        document.prof_annu.langue_id.value = lid;
+        document.prof_annu.langue_op.value = "retirer";
+        document.prof_annu.submit();
+    } // function langue_del( id )
+
+    function comppros_add()
+    {
+        var selectid = document.prof_annu.comppros_sel_add.selectedIndex;
+        document.prof_annu.comppros_id.value = document.prof_annu.comppros_sel_add.options[selectid].value;
+       var selectid_level = document.prof_annu.comppros_level_sel_add.selectedIndex;
+        document.prof_annu.comppros_level.value = document.prof_annu.comppros_level_sel_add.options[selectid_level].value;
+        document.prof_annu.comppros_op.value = "ajouter";
+       document.prof_annu.submit();
+    } // function langue_add()
+
+    function comppros_del( cid )
+    {
+        document.prof_annu.comppros_id.value = cid;
+        document.prof_annu.comppros_op.value = "retirer";
+        document.prof_annu.submit();
+    } // function comppros_del( id )
+//-->
+</script>
+{/literal}
+
+<div class="blocunite_tab">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0" 
+    summary="Profil: Compétences professionnelles">
+      <tr>
+        <th colspan="3">
+         Compétences professionnelles
+       </th>
+      </tr>
+      <input type="hidden" value="" name="comppros_op">
+      <input type="hidden" value="" name="comppros_id">
+      <input type="hidden" value="" name="comppros_level">
+      <tr>
+       <td colspan="3" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="rouge">
+               <input type="checkbox" name="accesX" checked disabled>
+             </td>
+             <td class="texte">
+               ne peut être ni public ni transmis à l'AX
+             </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr class="impair">
+        <td class="colg">
+         <span class="titre">Domaine</span>
+       </td>
+       <td class="colm">
+          <span class="titre">Niveau</span>
+       </td>
+        <td class="cold" width="15%">
+        &nbsp;
+       </td>
+      </tr>
+       {print_comppros}
+   </table>
+</div>
+
+
+<div class="blocunite">
+    <table class="bicol" width="98%" cellspacing="0" cellpadding="0" 
+    summary="Profil: Compétences linguistiques">
+      <tr>
+        <th colspan="3">
+         Compétences linguistiques
+       </th>
+      </tr>
+      <input type="hidden" value="" name="langue_op">
+      <input type="hidden" value="" name="langue_id">
+      <input type="hidden" value="" name="langue_level">
+      <tr>
+       <td colspan="3" class="pflags">
+         <table class="flags" summary="Flags" cellpadding="0" cellspacing="0" border="0">
+           <tr>
+             <td class="rouge">
+               <input type="checkbox" name="accesX" checked disabled>
+             </td>
+             <td class="texte">
+               ne peut être ni public ni transmis à l'AX
+             </td>
+           </tr>
+         </table>
+       </td>
+      </tr>
+      <tr class="impair">
+        <td class="colg">
+         <span class="titre">Langue</span>
+       </td>
+       <td class="colm">
+          <span class="titre">Niveau</span>
+       </td>
+        <td class="cold" width="15%">
+         <span class="lien"><a href="javascript:x()" onclick="popWin('aide.php#niveau_langue','remplissage','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=500')">Quel niveau ?</a></span>
+        </td>
+      </tr>
+      {print_langues}
+   </table>
+</div>