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

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

ContestResults :

  • Code revision
  • Add Letton (lv_LV) language, thanks to Aivars Baldone
  • Delete display options
  • Fix languages bugs
  • Improve public appearence
File size: 1.9 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);
11}
12
13// +-----------------------------------------------------------------------+
14//                              Affichage des concours
15// +-----------------------------------------------------------------------+
16foreach (array('pending','finished') AS $status) {
17        $result = pwg_query("SELECT id, name, visible, date_begin, date_end, logo
18                FROM " . CR_TABLE_1 . "
19                WHERE status = '" . $status . "'
20                ORDER BY date_begin DESC;");
21
22        while ($contest = pwg_db_fetch_assoc($result)) {
23                $template->append('contests_'.$status, array(
24                        'NAME' => trigger_event('render_CR_content', $contest['name']),
25                        'VISIBLE' => $contest['visible'],
26                        'DATE_BEGIN' => format_date($contest['date_begin']),
27                        'DATE_END' => format_date($contest['date_end']),
28                        'LOGO' => $contest['logo'],
29                        'U_RESULTS' => CR_ADMIN . '&amp;tab=results&amp;contest_id=' . $contest['id'],
30                        'U_EDIT' => CR_ADMIN . '&amp;tab=edit&amp;contest_id=' . $contest['id'],
31                        'U_DELETE' => CR_ADMIN . '&amp;delete_contest=' . $contest['id'],
32                        'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
33                ));
34        }
35}
36
37// +-----------------------------------------------------------------------+
38//                              Template
39// +-----------------------------------------------------------------------+
40$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/manage.tpl'));
41$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
42?>
Note: See TracBrowser for help on using the repository browser.