From: x2000habouzit Date: Tue, 31 Aug 2004 15:12:37 +0000 (+0000) Subject: skill done X-Git-Tag: xorg/old~1655 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=90acda779d6bafb96738a40e366d37c79fd5935f;p=platal.git skill done --- diff --git a/include/profil/profil_skill.inc.php b/include/profil/assign_skill.inc.php similarity index 51% rename from include/profil/profil_skill.inc.php rename to include/profil/assign_skill.inc.php index 84e3af9..2360951 100644 --- a/include/profil/profil_skill.inc.php +++ b/include/profil/assign_skill.inc.php @@ -18,23 +18,23 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: profil_skill.inc.php,v 1.5 2004-08-31 13:59:43 x2000habouzit Exp $ + $Id: assign_skill.inc.php,v 1.1 2004-08-31 15:12:37 x2000habouzit Exp $ ***************************************************************************/ function select_comppros_name($cproname){ - global $comppros_def, $comppros_title; - reset($comppros_def); - echo ""; - foreach( $comppros_def as $cid => $cname){ - if($comppros_title[$cid] == 1){ - //c'est un titre de categorie - echo ""; - } - else{ - echo ""; - } - } + global $comppros_def, $comppros_title; + reset($comppros_def); + echo ""; + foreach( $comppros_def as $cid => $cname){ + if($comppros_title[$cid] == 1){ + //c'est un titre de categorie + echo ""; + } + else{ + echo ""; + } + } } function _select_comppros_name($params){ select_comppros_name($params['competence']); @@ -42,12 +42,12 @@ function _select_comppros_name($params){ $page->register_function('select_competence', '_select_comppros_name'); function select_langue_name($lgname){ - global $langues_def; - reset($langues_def); - echo ""; - foreach( $langues_def as $lid => $lname){ - echo ""; - } + global $langues_def; + reset($langues_def); + echo ""; + foreach( $langues_def as $lid => $lname){ + echo ""; + } } function _select_langue_name($params){ select_langue_name($params['langue']); @@ -79,93 +79,19 @@ function _select_cppro_level($params){ } $page->register_function('select_competence_level', '_select_cppro_level'); -if(isset($_REQUEST['langue_op']) && !$no_update_bd){ - if($_REQUEST['langue_op']=='retirer'){ - $globals->db->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'] != '')) - $globals->db->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'){ - $globals->db->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'] != '')) - $globals->db->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; $page->assign('nb_lg_max', $nb_lg_max); $page->assign('nb_cpro_max', $nb_cpro_max); - -$res = $globals->db->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); -} $page->assign('nb_lg', $nb_lg); $page->assign_by_ref('langue_id', $langue_id); $page->assign_by_ref('langue_name', $langue_name); $page->assign_by_ref('langue_level', $langue_level); - -$res = $globals->db->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); -} $page->assign('nb_cpro', $nb_cpro); $page->assign_by_ref('cpro_id', $cpro_id); $page->assign_by_ref('cpro_name', $cpro_name); $page->assign_by_ref('cpro_level', $cpro_level); - -//Definitions des tables de correspondances id => nom - -$langues_levels = Array( - 1 => "1", - 2 => "2", - 3 => "3", - 4 => "4", - 5 => "5", - 6 => "6" -); $page->assign_by_ref('langues_level',$langues_level); - -$res = $globals->db->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; -} $page->assign_by_ref('langues_def',$langues_def); - -$comppros_levels = Array( - 'initié' => 'initié', - 'bonne connaissance' => 'bonne connaissance', - 'expert' => 'expert' -); $page->assign_by_ref('comppros_level',$comppros_level); - -$res = $globals->db->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; -} $page->assign_by_ref('comppros_def',$comppros_def); $page->assign_by_ref('comppros_title',$comppros_title); diff --git a/include/profil/get_skill.inc.php b/include/profil/get_skill.inc.php new file mode 100644 index 0000000..0a8802c --- /dev/null +++ b/include/profil/get_skill.inc.php @@ -0,0 +1,97 @@ +db->query("delete from langues_ins where uid='{$_SESSION['uid']}' and lid='{$_REQUEST['langue_id']}'"); + } elseif($_REQUEST['langue_op'] == 'ajouter'){ + if(isset($_REQUEST['langue_id']) && ($_REQUEST['langue_id'] != '')) + $globals->db->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'){ + $globals->db->query("delete from competences_ins where uid='{$_SESSION['uid']}' and cid='{$_REQUEST['comppros_id']}'"); + } elseif($_REQUEST['comppros_op'] == 'ajouter') { + if(isset($_REQUEST['comppros_id']) && ($_REQUEST['comppros_id'] != '')) + $globals->db->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 = $globals->db->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 = $globals->db->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 = $globals->db->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 = $globals->db->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; +} + +?>