first reimport from platal
[platal.git] / include / profil / get_emploi.inc.php
1 <?php
2 /***************************************************************************
3 * Copyright (C) 2003-2004 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
21
22 require_once('geoloc.inc.php');
23 require_once('secteur.emploi.inc.php');
24 require_once('fonction.emploi.inc.php');
25
26 $res = $globals->xdb->iterRow("SELECT entrid, entreprise, secteur, ss_secteur, poste, fonction,
27 adr1, adr2, adr3, postcode, city, country, region, tel, fax, mobile,
28 pub, adr_pub, tel_pub, email, email_pub, web
29 FROM entreprises
30 WHERE uid = {?} ORDER BY entrid",Session::getInt('uid', -1));
31
32 $nb_res = $res->total();
33 for($i = 0; $i < $nb_res ; $i++){
34 list($endrid[$i], $entreprise[$i], $secteur[$i], $ss_secteur[$i], $poste[$i], $fonction[$i],
35 $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $postcodeppro[$i], $citypro[$i], $countrypro[$i], $regionpro[$i],
36 $telpro[$i], $faxpro[$i], $mobilepro[$i], $pubpro[$i], $adr_pubpro[$i],
37 $tel_pubpro[$i], $emailpro[$i], $email_pubpro[$i], $webpro[$i]) = $res->next();
38 }
39 //limite dure a 2
40 for($i = $nb_res; $i < 2 ; $i++){
41 $endrid[$i] = $i;
42 $entreprise[$i] = '';
43 $secteur[$i] = '';
44 $ss_secteur[$i] = '';
45 $poste[$i] = '';
46 $fonction[$i] = '0';
47 $adrpro1[$i] = '';
48 $adrpro2[$i] = '';
49 $adrpro3[$i] = '';
50 $postcodepro[$i] = '';
51 $citypro[$i] = '';
52 $countrypro[$i] = '00';
53 $regionpro[$i] = '';
54 $telpro[$i] = '';
55 $faxpro[$i] = '';
56 $mobilepro[$i] = '';
57 $pubpro[$i] = '';
58 $adr_pubpro[$i] = '';
59 $tel_pubpro[$i] = '';
60 $emailpro[$i] = '';
61 $email_pubpro[$i] = '';
62 $webpro[$i] = '';
63 }
64
65 //recuperation des donnees sur les secteurs :
66
67 $res = $globals->xdb->iterRow("SELECT id, label FROM emploi_secteur");
68
69 while(list($tmp_secteur_id, $tmp_secteur_label) = $res->next()){
70 $secteurs[$tmp_secteur_id] = $tmp_secteur_label;
71 }
72
73 //recuperation des donnees sur les fonctions :
74 $res = $globals->xdb->iterRow("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) FROM fonctions_def ORDER BY id");
75
76 while(list($tmp_fonction_id, $tmp_fonction_label, $tmp_fonction_titre) = $res->next()){
77 $fonctions[$tmp_fonction_id] = $tmp_fonction_label;
78 $fonctions_titre[$tmp_fonction_id] = $tmp_fonction_titre;
79 }
80
81 //recuperation du CV
82 $res = $globals->xdb->query("SELECT cv FROM auth_user_md5 WHERE user_id = {?}", Session::getInt('uid', -1));
83 $cv = $res->fetchOneCell();
84
85 ?>