pending commit, finished during MQ/S download ...
[platal.git] / include / profil / get_mentor.inc.php
index 08333e3..0034c12 100644 (file)
@@ -26,7 +26,7 @@ $max_mentor_pays = 10;
 $max_mentor_secteurs = 10;
 
 //recuperation de l'expertise
-$res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", Session::getInt('uid',-1));
+$res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", S::v('uid',-1));
 
 $mentor_expertise = $res->fetchOneCell();
 $mentor_expertise_bd = $mentor_expertise;
@@ -35,14 +35,14 @@ $mentor_expertise_bd = $mentor_expertise;
 if(Post::get('mentor_pays_op', '') == 'retirer') {
     if(Post::has('mentor_pays_id')) {
         $id_supprimee = Post::get('mentor_pays_id', '00');
-        XDB::execute("DELETE FROM mentor_pays WHERE uid = {?} AND pid = {?} LIMIT 1", Session::getInt('uid', -1), $id_supprimee);
+        XDB::execute("DELETE FROM mentor_pays WHERE uid = {?} AND pid = {?} LIMIT 1", S::v('uid', -1), $id_supprimee);
     }
 }
 
 //recuperation des pays
 $res = XDB::iterRow("SELECT m.pid, p.pays 
                     FROM mentor_pays AS m
-                   LEFT JOIN geoloc_pays AS p ON(m.pid = p.a2) WHERE m.uid = {?} LIMIT {?}", Session::getInt('uid', -1), $max_mentor_pays);
+                   LEFT JOIN geoloc_pays AS p ON(m.pid = p.a2) WHERE m.uid = {?} LIMIT {?}", S::v('uid', -1), $max_mentor_pays);
 $nb_mentor_pays = $res->total();
 $mentor_pid = $mentor_pays = Array();
 for($i = 1; $i <= $nb_mentor_pays ; $i++) list($mentor_pid[$i], $mentor_pays[$i]) = $res->next();
@@ -51,7 +51,7 @@ for($i = 1; $i <= $nb_mentor_pays ; $i++) list($mentor_pid[$i], $mentor_pays[$i]
 if((Post::get('mentor_pays_op', '') == 'ajouter') && ($nb_mentor_pays < $max_mentor_pays)) {
     if(Post::get('mentor_pays_id', '00') != '00') {
        $id_ajoutee = Post::get('mentor_pays_id', '00');
-       XDB::execute("INSERT INTO mentor_pays(uid, pid) VALUES({?}, {?})", Session::getInt('uid', -1), $id_ajoutee);
+       XDB::execute("INSERT INTO mentor_pays(uid, pid) VALUES({?}, {?})", S::v('uid', -1), $id_ajoutee);
        $nb_mentor_pays++;
        $mentor_pid[$nb_mentor_pays] = $id_ajoutee;
        $mentor_pays[$nb_mentor_pays] = Post::get('mentor_pays_name', '');
@@ -64,7 +64,7 @@ if((Post::get('mentor_pays_op', '') == 'ajouter') && ($nb_mentor_pays < $max_men
 if(Post::get('mentor_secteur_op', '') == 'retirer') {
     if(Post::has('mentor_secteur_id')) {
         $id_supprimee = Post::get('mentor_secteur_id', '');
-        XDB::execute("DELETE FROM mentor_secteurs WHERE uid = {?} AND secteur = {?} LIMIT 1", Session::getInt('uid', -1), $id_supprimee);
+        XDB::execute("DELETE FROM mentor_secteurs WHERE uid = {?} AND secteur = {?} LIMIT 1", S::v('uid', -1), $id_supprimee);
     }
 }
 
@@ -74,7 +74,7 @@ $res = XDB::iterRow("SELECT m.secteur, s.label, m.ss_secteur, ss.label
                    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 = {?}
-                   LIMIT {?}", Session::getInt('uid', -1), $max_mentor_pays);
+                   LIMIT {?}", S::v('uid', -1), $max_mentor_pays);
 $nb_mentor_secteurs = $res->total();
 $mentor_sid = $mentor_secteur = $mentor_ssid = $mentor_ss_secteur = Array();
 for($i = 1; $i <= $nb_mentor_secteurs ; $i++)
@@ -89,7 +89,7 @@ if((Post::get('mentor_secteur_op', '')== 'ajouter') && ($nb_mentor_secteurs < $m
        if(Post::has('mentor_ss_secteur_id'))
            $ssid_ajoutee = Post::get('mentor_ss_secteur_id', '');
        XDB::execute("INSERT INTO mentor_secteurs (uid, secteur, ss_secteur)
-                                   VALUES({?}, {?}, {?})", Session::getInt('uid', -1), $sid_ajoutee, ($ssid_ajoutee == '')?null:$ssid_ajoutee);
+                                   VALUES({?}, {?}, {?})", S::v('uid', -1), $sid_ajoutee, ($ssid_ajoutee == '')?null:$ssid_ajoutee);
        $nb_mentor_secteurs++;
        $mentor_sid[$nb_mentor_secteurs] = $sid_ajoutee;
        $mentor_secteur[$nb_mentor_secteurs] = Post::get('mentor_secteur_name', '');