Fixes missing braket.
[platal.git] / modules / profile / jobs.inc.php
CommitLineData
3950bc21
FB
1<?php
2/***************************************************************************
9f5bd98e 3 * Copyright (C) 2003-2010 Polytechnique.org *
3950bc21
FB
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
12bcf04b 22class ProfileSettingJob extends ProfileSettingGeocoding
37d44b3b
FB
23{
24 private $pub;
541e8d03
SJ
25 private $email_new;
26 private $email;
27 private $url;
f93fb300 28 private $bool;
37d44b3b
FB
29 private $checks;
30
31 public function __construct()
32 {
12bcf04b 33 $this->pub = new ProfileSettingPub();
541e8d03
SJ
34 $this->email
35 = $this->email_new
12bcf04b
RB
36 = new ProfileSettingEmail();
37 $this->url = new ProfileSettingWeb();
38 $this->bool = new ProfileSettingBool();
541e8d03
SJ
39 $this->checks = array('url' => array('w_url'),
40 'email' => array('w_email'),
41 'pub' => array('pub', 'w_email_pub'),
42 );
37d44b3b
FB
43 }
44
afaa2cc7
SJ
45 public function emptyJob()
46 {
47 return array(
48 'id' => '0',
49 'jobid' => '',
50 'pub' => 'private',
51 'name' => '',
52 'hq_acronym' => '',
53 'hq_url' => '',
54 'hq_email' => '',
55 'hq_address' => array(
56 'text' => '',
57 'accuracy' => '',
58 'postalText' => '',
59 'postalCode' => '',
60 'administrativeAreaId' => '',
61 'subAdministrativeAreaId' => '',
62 'localityId' => '',
63 'countryId' => '',
64 'latitude' => '',
65 'longitude' => '',
66 'north' => '',
67 'south' => '',
68 'east' => '',
69 'west' => '',
70 'cedex' => '',
71 'updateTime' => '',
72 'changed' => '0',
73 'removed' => '0',
74 ),
0b6c8b36 75 'hq_fixed' => '',
afaa2cc7
SJ
76 'hq_fax' => '',
77 'subSubSectorName' => null,
78 'sector' => '0',
79 'subSector' => '0',
80 'subSubSector' => '0',
81 'description' => '',
82 'w_url' => '',
83 'w_address' => array(
84 'pub' => 'private',
85 'text' => '',
86 'accuracy' => '',
87 'postalText' => '',
88 'postalCode' => '',
89 'administrativeAreaId' => '',
90 'subAdministrativeAreaId' => '',
91 'localityId' => '',
92 'countryId' => '',
93 'latitude' => '',
94 'longitude' => '',
95 'north' => '',
96 'south' => '',
97 'east' => '',
98 'west' => '',
99 'cedex' => '',
100 'updateTime' => '',
101 'changed' => '0',
102 'removed' => '0',
103 ),
104 'w_email' => '',
105 'w_email_pub' => 'private',
106 'w_email_new' => '',
107 'w_phone' => array(0 => array(
108 'type' => 'fixed',
109 'tel' => '',
110 'pub' => 'private',
111 'comment' => '',
3ac45f10
PC
112 ),
113 'terms' => array()),
afaa2cc7
SJ
114 );
115 }
116
b814a8b8 117 private function cleanJob(ProfilePage &$page, $jobid, array &$job, &$success)
37d44b3b
FB
118 {
119 $success = true;
541e8d03
SJ
120 if ($job['w_email'] == "new@example.org") {
121 $job['w_email'] = $job['w_email_new'];
122 }
37d44b3b
FB
123 foreach ($this->checks as $obj=>&$fields) {
124 $chk =& $this->$obj;
125 foreach ($fields as $field) {
126 $job[$field] = $chk->value($page, $field, $job[$field], $s);
127 if (!$s) {
128 $success = false;
129 $job[$field . '_error'] = true;
130 }
131 }
132 }
541e8d03 133 if (!$job['subSubSectorName']) {
c7139c07
SJ
134 $res = XDB::query("SELECT name
135 FROM profile_job_subsubsector_enum
136 WHERE id = {?}",
541e8d03
SJ
137 $job['subSubSector']);
138 $job['subSubSectorName'] = $res->fetchOneCell();
c7139c07
SJ
139 } else {
140 $res = XDB::query("SELECT sectorid, subsectorid, id
141 FROM profile_job_subsubsector_enum
142 WHERE name = {?}",
541e8d03 143 $job['subSubSectorName']);
c7139c07
SJ
144 if ($res->numRows() != 1) {
145 $success = false;
146 $job['sector_error'] = true;
147 } else {
541e8d03 148 list($job['sector'], $job['subSector'], $job['subSubSector']) = $res->fetchOneRow();
c7139c07
SJ
149 }
150 }
3ac45f10
PC
151 if (count($job['terms'])) {
152 $termsid = array();
153 foreach ($job['terms'] as $term) {
154 if (!$term['full_name']) {
155 $termsid[] = $term['jtid'];
156 }
157 }
158 if (count($termsid)) {
159 $res = XDB::query("SELECT jtid, full_name
160 FROM profile_job_term_enum
161 WHERE jtid IN {?}",
162 $termsid);
163 $term_id_to_name = $res->fetchAllAssoc('jtid', false);
164 foreach ($job['terms'] as &$term) {
165 if (!$term['full_name']) {
166 $term['full_name'] = $term_id_to_name[$term['jtid']];
167 }
168 }
169 }
170 }
b814a8b8 171 if ($job['name']) {
c7139c07
SJ
172 $res = XDB::query("SELECT id
173 FROM profile_job_enum
174 WHERE name = {?}",
175 $job['name']);
176 if ($res->numRows() != 1) {
4d7d27fc
SJ
177 $this->geocodeAddress($job['hq_address'], $s);
178 if (!$s) {
179 $gmapsGeocoder = new GMapsGeocoder();
180 $job['hq_address'] = $gmapsGeocoder->stripGeocodingFromAddress($job['hq_address']);
181 }
024ec1e5 182 $req = new EntrReq(S::user(), $page->profile, $jobid, $job['name'], $job['hq_acronym'], $job['hq_url'],
4d7d27fc 183 $job['hq_email'], $job['hq_fixed'], $job['hq_fax'], $job['hq_address']);
b814a8b8
SJ
184 $req->submit();
185 $job['jobid'] = null;
858a5b42 186 sleep(1);
c7139c07
SJ
187 } else {
188 $job['jobid'] = $res->fetchOneCell();
189 }
190 }
541e8d03 191 $job['w_address']['pub'] = $this->pub->value($page, 'address_pub', $job['w_address']['pub'], $s);
0b6c8b36 192 $job['w_phone'] = Phone::formatFormArray($job['w_phone'], $s);
afaa2cc7 193
37d44b3b
FB
194 unset($job['removed']);
195 unset($job['new']);
37d44b3b
FB
196 }
197
198 public function value(ProfilePage &$page, $field, $value, &$success)
199 {
a6483c12 200 require_once 'validations.inc.php';
024ec1e5 201 $entreprise = ProfileValidate::get_typed_requests($page->pid(), 'entreprise');
b814a8b8
SJ
202 $entr_val = 0;
203
37d44b3b
FB
204 $init = false;
205 if (is_null($value)) {
206 $value = $page->values['jobs'];
207 $init = true;
208 }
209 $success = true;
a6483c12 210 foreach ($value as $key => &$job) {
b814a8b8 211 $job['name'] = trim($job['name']);
a6483c12 212 if ($job['name'] == '' && $entreprise) {
b814a8b8 213 $job['tmp_name'] = $entreprise[$entr_val]->name;
a6483c12
SJ
214 ++$entr_val;
215 } else if ($job['name'] == '') {
ba6ee875
SJ
216 if ($job['subSubSectorName'] == '' && $job['description'] == '' && $job['w_url'] == ''
217 && $job['w_address']['text'] == '' && $job['w_email'] == ''
218 && count($job['w_phone']) == 1 && $job['w_phone']['tel'] == '') {
219 array_splice($value, $key, 1);
220 continue;
221 }
222
a6483c12
SJ
223 $job['name_error'] = true;
224 $success = false;
b814a8b8 225 }
b94719c1 226
541e8d03 227 if (isset($job['removed']) && $job['removed']) {
b94719c1
SJ
228 if ($job['name'] == '' && $entreprise) {
229 $entreprise[$entr_val - 1]->clean();
230 }
ed01acac 231 array_splice($value, $key, 1);
37d44b3b 232 }
8768e5af
SJ
233 foreach (array('sectorid', 'subsectorid', 'subsubsectorid') as $key) {
234 if ($job[$key] == 0) {
235 $job[$key] = null;
236 }
b139d0e6 237 }
37d44b3b 238 }
a6483c12 239 foreach ($value as $key => &$job) {
37d44b3b 240 $ls = true;
541e8d03 241 $this->geocodeAddress($job['w_address'], $s);
37d44b3b 242 $ls = ($ls && $s);
bde2be3b 243 $this->cleanJob($page, $key, $job, $s);
37d44b3b
FB
244 $ls = ($ls && $s);
245 if (!$init) {
246 $success = ($success && $ls);
247 }
248 }
249 return $value;
250 }
251
252 public function save(ProfilePage &$page, $field, $value)
253 {
0b6c8b36 254 // TODO: use address class to update profile_job_enum once it is done.
c7139c07 255 XDB::execute("DELETE FROM profile_job
ce0b2c6f 256 WHERE pid = {?}",
a6483c12 257 $page->pid());
541e8d03
SJ
258 XDB::execute("DELETE FROM profile_addresses
259 WHERE pid = {?} AND type = 'job'",
a6483c12 260 $page->pid());
0b6c8b36 261 Phone::deletePhones($page->pid(), Phone::LINK_JOB);
3ac45f10 262 $terms_values = array();
a6483c12 263 foreach ($value as $id => &$job) {
afaa2cc7
SJ
264 if (isset($job['name']) && $job['name']) {
265 if (isset($job['jobid']) && $job['jobid']) {
ce0b2c6f 266 XDB::execute("INSERT INTO profile_job (pid, id, description, sectorid, subsectorid,
afaa2cc7
SJ
267 subsubsectorid, email, url, pub, email_pub, jobid)
268 VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
a6483c12 269 $page->pid(), $id, $job['description'], $job['sector'], $job['subSector'],
afaa2cc7
SJ
270 $job['subSubSector'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub'], $job['jobid']);
271 } else {
ce0b2c6f 272 XDB::execute("INSERT INTO profile_job (pid, id, description, sectorid, subsectorid,
afaa2cc7
SJ
273 subsubsectorid, email, url, pub, email_pub)
274 VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
a6483c12 275 $page->pid(), $id, $job['description'], $job['sector'], $job['subSector'],
afaa2cc7
SJ
276 $job['subSubSector'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub']);
277 }
12bcf04b 278 $address = new ProfileSettingAddress();
a6483c12 279 $address->saveAddress($page->pid(), $id, $job['w_address'], 'job');
0b6c8b36 280 Phone::savePhones($job['w_phone'], $page->pid(), Phone::LINK_JOB, $id);
3ac45f10
PC
281 if (isset($job['terms'])) {
282 foreach ($job['terms'] as $term) {
283 $terms_values[] = '('.XDB::escape($page->pid()).', '. XDB::escape($id).', '.XDB::escape($term['jtid']).', "original")';
284 }
285 }
b814a8b8 286 }
37d44b3b 287 }
3ac45f10
PC
288 if (count($terms_values) > 0) {
289 XDB::execute('INSERT INTO profile_job_term (pid, jid, jtid, computed)
290 VALUES '.implode(', ', $terms_values));
291 }
37d44b3b 292 }
a0fce0c6
SJ
293
294 public function getText($value) {
295 $jobs = array();
296 foreach ($value as $id => $job) {
297 $address = new ProfileSettingAddress();
0b6c8b36 298 $phones = Phone::formArrayToString($job['w_phone']);
a0fce0c6
SJ
299 $jobs[] = 'Entreprise : ' . $job['name'] . ', secteur : ' . $job['subSubSectorName']
300 . ', description : ' . $job['description'] . ', web : ' . $job['w_url']
301 . ', email : ' . $job['w_email']
0b6c8b36 302 . ($phones ? ', ' . $phones : '') . ', ' . $address->getText($job['w_address']);
a0fce0c6
SJ
303 }
304 return implode(' ; ' , $jobs);
305 }
37d44b3b
FB
306}
307
603aeb6c
SJ
308class ProfileSettingCorps implements ProfileSetting
309{
310 public function value(ProfilePage &$page, $field, $value, &$success)
311 {
312 $success = true;
313 if (is_null($value)) {
314 $res = XDB::query("SELECT original_corpsid AS original, current_corpsid AS current,
315 rankid AS rank, corps_pub AS pub
316 FROM profile_corps
317 WHERE pid = {?}",
318 $page->pid());
319 return $res->fetchOneAssoc();
320 }
321 return $value;
322 }
323
324 public function save(ProfilePage &$page, $field, $value)
325 {
326 XDB::execute('REPLACE INTO profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid)
327 VALUES ({?}, {?}, {?}, {?}, {?})',
328 $value['original'], $value['current'], $value['rank'], $value['pub'], $page->pid());
329 }
330
331 public function getText($value)
332 {
333 $corpsList = DirEnum::getOptions(DirEnum::CORPS);
334 $rankList = DirEnum::getOptions(DirEnum::CORPSRANKS);
335 return 'Corps actuel : ' . $corpsList[$value['current']] . ' , rang : ' . $corpsList[$value['rank']]
336 . ' , corps d\'origine : ' . $corpsList[$value['original']] . ' , affichage : ' . $value['pub'];
337 }
338}
339
12bcf04b 340class ProfileSettingJobs extends ProfilePage
3950bc21
FB
341{
342 protected $pg_template = 'profile/jobs.tpl';
343
344 public function __construct(PlWizard &$wiz)
345 {
346 parent::__construct($wiz);
37d44b3b 347 $this->settings['cv'] = null;
603aeb6c 348 $this->settings['corps'] = new ProfileSettingCorps();
12bcf04b 349 $this->settings['jobs'] = new ProfileSettingJob();
72e96bc0 350 $this->watched = array('cv' => true, 'jobs' => true, 'corps' => true);
37d44b3b
FB
351 }
352
7c2e0f0d 353 protected function _fetchData()
37d44b3b 354 {
37d44b3b
FB
355 // Checkout the CV
356 $res = XDB::query("SELECT cv
e5bcd851
FB
357 FROM profiles
358 WHERE pid = {?}",
359 $this->pid());
37d44b3b
FB
360 $this->values['cv'] = $res->fetchOneCell();
361
362 // Build the jobs tree
563f86f5 363 $res = XDB::iterRow("SELECT j.id, j.jobid, je.name, j.sectorid, j.subsectorid, j.subsubsectorid,
541e8d03
SJ
364 s.name, j.description, j.email, j.email_pub, j.url, j.pub,
365 je.acronym, je.url, je.email,
366 aw.accuracy, aw.text, aw.postalText, aw.postalCode, aw.localityId,
367 aw.subAdministrativeAreaId, aw.administrativeAreaId, aw.countryId,
368 aw.latitude, aw.longitude, aw.pub, aw.updateTime,
369 aw.north, aw.south, aw.east, aw.west,
370 ah.accuracy, ah.text, ah.postalText, ah.postalCode, ah.localityId,
371 ah.subAdministrativeAreaId, ah.administrativeAreaId, ah.countryId,
372 ah.latitude, ah.longitude, ah.pub, ah.updateTime,
373 ah.north, ah.south, ah.east, ah.west
c7139c07
SJ
374 FROM profile_job AS j
375 LEFT JOIN profile_job_enum AS je ON (j.jobid = je.id)
c7139c07 376 LEFT JOIN profile_job_subsubsector_enum AS s ON (s.id = j.subsubsectorid)
ce0b2c6f 377 LEFT JOIN profile_addresses AS aw ON (aw.pid = j.pid AND aw.type = 'job'
4d7d27fc 378 AND aw.id = j.id)
541e8d03 379 LEFT JOIN profile_addresses AS ah ON (ah.jobid = j.jobid AND ah.type = 'hq')
ce0b2c6f 380 WHERE j.pid = {?}
541e8d03 381 ORDER BY j.id",
a6391000 382 $this->pid());
37d44b3b 383 $this->values['jobs'] = array();
bde2be3b 384
afaa2cc7
SJ
385 if ($res->numRows() > 0) {
386 while (list($id, $jobid, $name, $sector, $subSector, $subSubSector,
387 $subSubSectorName, $description, $w_email, $w_emailPub, $w_url, $pub,
388 $hq_acronym, $hq_url, $hq_email,
389 $w_accuracy, $w_text, $w_postalText, $w_postalCode, $w_localityId,
390 $w_subAdministrativeAreaId, $w_administrativeAreaId, $w_countryId,
391 $w_latitude, $w_longitude, $w_pub, $w_updateTime,
392 $w_north, $w_south, $w_east, $w_west,
393 $hq_accuracy, $hq_text, $hq_postalText, $hq_postalCode, $hq_localityId,
394 $hq_subAdministrativeAreaId, $hq_administrativeAreaId, $hq_countryId,
395 $hq_latitude, $hq_longitude, $hq_pub, $hq_updateTime,
396 $hq_north, $hq_south, $hq_east, $hq_west,
397 ) = $res->next()) {
398 $this->values['jobs'][] = array(
399 'id' => $id,
400 'jobid' => $jobid,
401 'name' => $name,
402 'sector' => $sector,
403 'subSector' => $subSector,
404 'subSubSector' => $subSubSector,
405 'subSubSectorName' => $subSubSectorName,
406 'description' => $description,
407 'pub' => $pub,
408 'w_email' => $w_email,
409 'w_email_pub' => $w_emailPub,
410 'w_url' => $w_url,
411 'hq_acronym' => $hq_acronym,
412 'hq_url' => $hq_url,
413 'hq_email' => $hq_email,
414 'w_address' => array(
415 'accuracy' => $w_accuracy,
416 'text' => $w_text,
417 'postalText' => $w_postalText,
418 'postalCode' => $w_postalCode,
419 'localityId' => $w_localityId,
420 'subAdministrativeAreaId' => $w_subAdministrativeAreaId,
421 'administrativeAreaId' => $w_administrativeAreaId,
422 'countryId' => $w_countryId,
423 'latitude' => $w_latitude,
424 'longitude' => $w_longitude,
425 'pub' => $w_pub,
426 'updateTime' => $w_updateTime,
427 'north' => $w_north,
428 'south' => $w_south,
429 'east' => $w_east,
430 'west' => $w_west,
431 ),
432 'hq_address' => array(
433 'accuracy' => $hq_accuracy,
434 'text' => $hq_text,
435 'postalText' => $hq_postalText,
436 'postalCode' => $hq_postalCode,
437 'localityId' => $hq_localityId,
438 'subAdministrativeAreaId' => $hq_subAdministrativeAreaId,
439 'administrativeAreaId' => $hq_administrativeAreaId,
440 'countryId' => $hq_countryId,
441 'latitude' => $hq_latitude,
442 'longitude' => $hq_longitude,
443 'pub' => $hq_pub,
444 'updateTime' => $hq_updateTime,
445 'north' => $hq_north,
446 'south' => $hq_south,
447 'east' => $hq_east,
448 'west' => $hq_west,
449 ),
450 );
bde2be3b 451 }
afaa2cc7 452
0b6c8b36
SJ
453 $it = Phone::iterate(array($this->pid()), array(Phone::LINK_JOB));
454 while ($phone = $it->next()) {
455 $this->values['jobs'][$phone->linkId()]['w_phone'][$phone->id()] = $phone->toFormArray();
bde2be3b 456 }
3ac45f10
PC
457 $res = XDB::iterator("SELECT e.jtid, e.full_name, j.jid AS jobid
458 FROM profile_job_term_enum AS e
459 INNER JOIN profile_job_term AS j USING(jtid)
460 WHERE pid = {?}
461 ORDER BY j.jid",
462 $this->pid());
463 $i = 0;
464 $jobNb = count($this->values['jobs']);
465 while ($term = $res->next()) {
466 $jobid = $term['jobid'];
467 while ($i < $jobNb && $this->values['jobs'][$i]['id'] < $jobid) {
468 $i++;
469 }
470 if ($i >= $jobNb) {
471 break;
472 }
473 $job =& $this->values['jobs'][$i];
474 if ($job['id'] != $jobid) {
475 continue;
476 }
477 if (!isset($job['terms'])) {
478 $job['terms'] = array();
479 }
480 $job['terms'][] = $term;
481 }
482
afaa2cc7 483 foreach ($this->values['jobs'] as $id => &$job) {
0b6c8b36 484 $phone = new Phone();
afaa2cc7 485 if (!isset($job['w_phone'])) {
0b6c8b36 486 $job['w_phone'] = array(0 => $phone->toFormArray());
afaa2cc7 487 }
bde2be3b 488 }
aab2ffdd 489
afaa2cc7 490 $job['w_email_new'] = '';
0b6c8b36
SJ
491 if (!isset($job['hq_fixed'])) {
492 $job['hq_fixed'] = '';
bde2be3b 493 }
afaa2cc7
SJ
494 if (!isset($job['hq_fax'])) {
495 $job['hq_fax'] = '';
bde2be3b 496 }
afaa2cc7
SJ
497 if (!isset($job['w_email_pub'])) {
498 $job['w_email_pub'] = 'private';
bde2be3b 499 }
afaa2cc7
SJ
500 if (!$job['hq_address']['text']) {
501 $job['hq_address'] = array(
502 'text' => '',
503 'accuracy' => '',
504 'postalText' => '',
505 'postalCode' => '',
506 'administrativeAreaId' => '',
507 'subAdministrativeAreaId' => '',
508 'localityId' => '',
509 'countryId' => '',
510 'latitude' => '',
511 'longitude' => '',
512 'north' => '',
513 'south' => '',
514 'east' => '',
515 'west' => '',
516 'cedex' => '',
517 'updateTime' => '',
518 'changed' => '0',
519 'removed' => '0',
520 );
521 }
522 $job['w_address']['cedex'] = '';
523 $job['w_address']['changed'] = '0';
524 $job['w_address']['removed'] = '0';
525 } else {
526 $this->values['jobs'][] = $this->settings['jobs']->emptyJob();
bde2be3b 527 }
37d44b3b
FB
528 }
529
7c2e0f0d 530 protected function _saveData()
37d44b3b
FB
531 {
532 if ($this->changed['cv']) {
e5bcd851 533 XDB::execute("UPDATE profiles
37d44b3b 534 SET cv = {?}
e5bcd851
FB
535 WHERE pid = {?}",
536 $this->values['cv'], $this->pid());
37d44b3b 537 }
3950bc21 538 }
2dcac0f5 539
04334c61 540 public function _prepare(PlPage &$page, $id)
2dcac0f5 541 {
a6483c12 542 require_once 'emails.combobox.inc.php';
4e698dc9 543 fill_email_combobox($page, $this->owner);
b715c1e1 544
33b6f5a0
SJ
545 $res = XDB::query("SELECT id, name AS label
546 FROM profile_job_sector_enum");
541e8d03 547 $page->assign('sectors', $res->fetchAllAssoc());
72e96bc0
SJ
548
549 $res = XDB::iterator("SELECT id, name
550 FROM profile_corps_enum
551 ORDER BY id = 1 DESC, name");
552 $page->assign('original_corps', $res->fetchAllAssoc());
553
554 $res = XDB::iterator("SELECT id, name
555 FROM profile_corps_enum
556 WHERE still_exists = 1
557 ORDER BY id = 1 DESC, name");
558 $page->assign('current_corps', $res->fetchAllAssoc());
559
560 $res = XDB::iterator("SELECT id, name
e489faf7
SJ
561 FROM profile_corps_rank_enum
562 ORDER BY id = 1 DESC, name");
72e96bc0 563 $page->assign('corps_rank', $res->fetchAllAssoc());
2dcac0f5 564 }
3950bc21
FB
565}
566
567// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
568?>