source: extensions/ContestResults/admin/manage.php @ 9419

Last change on this file since 9419 was 9419, checked in by mistic100, 13 years ago

[extensions] ContestResults

  • add messages on admin pages
File size: 2.1 KB
Line 
1<?php
2if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4// +-----------------------------------------------------------------------+
5//                              Suppression d'un concours
6// +-----------------------------------------------------------------------+
7if (isset($_GET['delete_contest'])) {
8        pwg_query('DELETE FROM ' . CR_TABLE_1 . ' WHERE id = ' . $_GET['delete_contest'] . ';');
9        pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['delete_contest'] . ';');
10        redirect(CR_ADMIN .'&amp;tab=manage&amp;msg=deleted');
11}
12
13if (isset($_GET['msg'])){
14        array_push($page['infos'], l10n('CR_contest_'. $_GET['msg']));
15}
16
17// +-----------------------------------------------------------------------+
18//                              Affichage des concours
19// +-----------------------------------------------------------------------+
20foreach (array('pending','finished') AS $status) {
21        $result = pwg_query("SELECT id, name, visible, date_begin, date_end, logo
22                FROM " . CR_TABLE_1 . "
23                WHERE status = '" . $status . "'
24                ORDER BY date_begin DESC;");
25
26        while ($contest = pwg_db_fetch_assoc($result)) {
27                $template->append('contests_'.$status, array(
28                        'NAME' => trigger_event('render_CR_content', $contest['name']),
29                        'VISIBLE' => $contest['visible'],
30                        'DATE_BEGIN' => format_date($contest['date_begin']),
31                        'DATE_END' => format_date($contest['date_end']),
32                        'LOGO' => $contest['logo'],
33                        'U_RESULTS' => CR_ADMIN . '&amp;tab=results&amp;contest_id=' . $contest['id'],
34                        'U_EDIT' => CR_ADMIN . '&amp;tab=edit&amp;contest_id=' . $contest['id'],
35                        'U_DELETE' => CR_ADMIN . '&amp;delete_contest=' . $contest['id'],
36                        'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
37                ));
38        }
39}
40
41// +-----------------------------------------------------------------------+
42//                              Template
43// +-----------------------------------------------------------------------+
44$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/manage.tpl'));
45$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
46?>
Note: See TracBrowser for help on using the repository browser.