- $res = XDB::iterRow("SELECT applis_def.text, applis_def.url, applis_ins.type
- FROM applis_ins
- INNER JOIN applis_def ON applis_def.id = applis_ins.aid
- WHERE uid={?}
- ORDER BY ordre", $uid);
-
- $user['applis_fmt'] = Array();
- $user['formation'] = Array();
- while (list($txt, $url, $type) = $res->next()) {
- $user['formation'][] = $txt." ".$type;
- require_once('applis.func.inc.php');
- $user['applis_fmt'][] = applis_fmt($type, $txt, $url);
+ $res = XDB::iterRow("SELECT en.name AS name, en.url AS url, d.degree AS degree,
+ ed.grad_year AS grad_year, f.field AS field, ed.program AS program
+ FROM profile_education AS ed
+ LEFT JOIN profile_education_enum AS en ON (en.id = ed.eduid)
+ LEFT JOIN profile_education_degree_enum AS d ON (d.id = ed.degreeid)
+ LEFT JOIN profile_education_field_enum AS f ON (f.id = ed.fieldid)
+ WHERE uid = {?} AND NOT FIND_IN_SET('primary', flags)
+ ORDER BY ed.grad_year", $uid);
+
+ if (list($name, $url, $degree, $grad_year, $field, $program) = $res->next()) {
+ require_once('education.func.inc.php');
+ $user['education'][] = education_fmt($name, $url, $degree, $grad_year, $field, $program, $user['sexe'], true);
+ }
+ while (list($name, $url, $degree, $grad_year, $field, $program) = $res->next()) {
+ $user['education'][] = education_fmt($name, $url, $degree, $grad_year, $field, $program, $user['sexe'], true);
+ }
+
+ if (has_user_right($user['corps_pub'], $view)) {
+ $res = XDB::query("SELECT e1.name AS original, e2.name AS current, r.name AS rank
+ FROM profile_corps AS c
+ LEFT JOIN profile_corps_enum AS e1 ON (c.original_corpsid = e1.id)
+ LEFT JOIN profile_corps_enum AS e2 ON (c.current_corpsid = e2.id)
+ LEFT JOIN profile_corps_rank_enum AS r ON (c.rankid = r.id)
+ WHERE c.uid = {?} AND c.original_corpsid != 1", $uid);
+ if ($res = $res->fetchOneRow()) {
+ list($original, $current, $rank) = $res;
+ $user['corps'] = "Corps d'origine : " . $original . ", corps actuel : " . $current . ", grade : " . $rank;
+ }