1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | global $template; |
---|
6 | |
---|
7 | // Show concours list in 3 cases : |
---|
8 | // 1-> prepared concours (not actived) |
---|
9 | // 2-> active concours |
---|
10 | // 3-> closed concours |
---|
11 | |
---|
12 | $prepared_concours = get_inactive_concours(); |
---|
13 | $active_concours = get_active_concours(); |
---|
14 | $closed_concours = get_closed_concours(); |
---|
15 | |
---|
16 | // 1 prepared concours |
---|
17 | foreach ($prepared_concours as $concours) |
---|
18 | { |
---|
19 | $template->append('prepared_concours', array( |
---|
20 | 'ID' => $concours['id'], |
---|
21 | 'CREATE_DATE' => $concours['create_date'], |
---|
22 | 'NAME' => $concours['name'], |
---|
23 | 'DESC' => $concours['descr'], |
---|
24 | 'BEGIN_DATE' => $concours['begin_date'], |
---|
25 | 'END_DATE' => $concours['end_date'], |
---|
26 | |
---|
27 | 'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=modify', |
---|
28 | 'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=del' : '', |
---|
29 | )); |
---|
30 | |
---|
31 | } |
---|
32 | // 2 active concours |
---|
33 | foreach ($active_concours as $concours) |
---|
34 | { |
---|
35 | $template->append('active_concours', array( |
---|
36 | 'ID' => $concours['id'], |
---|
37 | 'CREATE_DATE' => $concours['create_date'], |
---|
38 | 'NAME' => $concours['name'], |
---|
39 | 'DESC' => $concours['descr'], |
---|
40 | 'BEGIN_DATE' => $concours['begin_date'], |
---|
41 | 'END_DATE' => $concours['end_date'], |
---|
42 | |
---|
43 | 'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=modify', |
---|
44 | 'U_AUDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Faudit.php&concours=' . $concours['id'], |
---|
45 | 'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=del': '', |
---|
46 | )); |
---|
47 | |
---|
48 | } |
---|
49 | // 3 closed concours |
---|
50 | foreach ($closed_concours as $concours) |
---|
51 | { |
---|
52 | if ($concours['id'] != 0) // Default are not display |
---|
53 | { |
---|
54 | $filename = has_file($concours['id']); |
---|
55 | $template->append('closed_concours', array( |
---|
56 | 'ID' => $concours['id'], |
---|
57 | 'CREATE_DATE' => $concours['create_date'], |
---|
58 | 'NAME' => $concours['name'], |
---|
59 | 'DESC' => $concours['descr'], |
---|
60 | 'BEGIN_DATE' => $concours['begin_date'], |
---|
61 | 'END_DATE' => $concours['end_date'], |
---|
62 | |
---|
63 | 'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=edit', |
---|
64 | 'U_AUDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Faudit.php&concours=' . $concours['id'], |
---|
65 | 'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=del' : '', |
---|
66 | 'U_RESULT' => (!is_adviser() and !has_result($concours['id']) )? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=result' : '', |
---|
67 | 'U_FILE' => !is_adviser() |
---|
68 | ? ($filename ? CONCOURS_ADMIN_PATH . 'file.php?file=' . $filename |
---|
69 | : (has_result($concours['id']) ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $concours['id'].'&action=file' : '')) |
---|
70 | : '', |
---|
71 | )); |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | $template->assign('IMG_URL', CONCOURS_IMG_PATH); |
---|
76 | |
---|
77 | |
---|
78 | |
---|
79 | $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl'); |
---|
80 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
81 | |
---|
82 | ?> |
---|