- // Checkout the CV
- $res = XDB::query("SELECT cv
- FROM profiles
- WHERE pid = {?}",
- $this->pid());
- $this->values['cv'] = $res->fetchOneCell();
-
- // Checkout the corps
- $res = XDB::query("SELECT original_corpsid AS original, current_corpsid AS current,
- rankid AS rank, corps_pub AS pub
- FROM profile_corps
- WHERE uid = {?}",
- $this->pid());
- $this->values['corps'] = $res->fetchOneAssoc();
-
- // Build the jobs tree
- $res = XDB::iterRow("SELECT j.id, je.name, j.functionid, j.sectorid, j.subsectorid,
- j.subsubsectorid, j.description, e.adr1, e.adr2, e.adr3,
- e.postcode, e.city, e.cityid, e.region, e.regiontxt,
- e.country, gc.countryFR, pa.accuracy,
- j.email, j.url, j.pub,
- e.adr_pub, j.email_pub,
- e.glat, e.glng, s.name
- FROM profile_job AS j
- LEFT JOIN profile_job_enum AS je ON (j.jobid = je.id)
- LEFT JOIN entreprises AS e ON (j.uid = e.uid AND j.id = e.entrid)
- LEFT JOIN geoloc_countries AS gc ON (gc.iso_3166_1_a2 = e.country)
- LEFT JOIN profile_job_subsubsector_enum AS s ON (s.id = j.subsubsectorid)
- WHERE j.uid = {?}
- ORDER BY entrid", $this->pid());
- $this->values['jobs'] = array();
- while (list($id, $name, $function, $secteur, $ss_secteur, $sss_secteur, $description,
- $w_adr1, $w_adr2, $w_adr3, $w_postcode, $w_city, $w_cityid,
- $w_region, $w_regiontxt, $w_country, $w_countrytxt,
- $w_checked, $w_email, $w_web,
- $pub, $w_adr_pub, $w_email_pub, $w_glat, $w_glng, $sss_secteur_name
- ) = $res->next()) {
- $this->values['jobs'][] = array('id' => $id,
- 'name' => $name,
- 'fonction' => $function,
- 'secteur' => $secteur,
- 'ss_secteur' => $ss_secteur,
- 'sss_secteur' => $sss_secteur,
- 'sss_secteur_name' => $sss_secteur_name,
- 'description' => $description,
- 'w_adr' => array('adr1' => $w_adr1,
- 'adr2' => $w_adr2,
- 'adr3' => $w_adr3,
- 'postcode' => $w_postcode,
- 'city' => $w_city,
- 'cityid' => $w_cityid,
- 'region' => $w_region,
- 'regiontxt' => $w_regiontxt,
- 'country' => $w_country,
- 'countrytxt' => $w_countrytxt,
- 'pub' => $w_adr_pub,
- 'checked' => (($w_checked == 0)? true : false),
- 'precise_lat' => $w_glat,
- 'precise_lon' => $w_glng),
- 'w_email' => $w_email,
- 'w_web' => $w_web,
- 'pub' => $pub,
- 'w_email_pub' => $w_email_pub);
- }
-
- $res = XDB::iterator("SELECT link_id AS jobid, tel_type AS type, pub, display_tel AS tel, comment
- FROM profile_phones
- WHERE uid = {?} AND link_type = 'pro'
- ORDER BY link_id",
- $this->pid());
- $i = 0;
- $jobNb = count($this->values['jobs']);
- while ($tel = $res->next()) {
- $jobid = $tel['jobid'];
- unset($tel['jobid']);
- while ($i < $jobNb && $this->values['jobs'][$i]['id'] < $jobid) {
- $i++;
- }
- if ($i >= $jobNb) {
- break;
- }
- $job =& $this->values['jobs'][$i];
- if (!isset($job['w_tel'])) {
- $job['w_tel'] = array();
- }
- if ($job['id'] == $jobid) {
- $job['w_tel'][] = $tel;
- }
- }
- foreach ($this->values['jobs'] as $id=>&$job) {
- if (!isset($job['w_tel'])) {
- $job['w_tel'] = array();
- }
- unset($job['id']);