Changeset 9419 for extensions/ContestResults/admin/new.php
- Timestamp:
- Feb 28, 2011, 3:49:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContestResults/admin/new.php
r9200 r9419 9 9 // +-----------------------------------------------------------------------+ 10 10 if (isset($_POST['new_submit'])) { 11 // Modification d'un concours 12 if (isset($_GET['contest_id'])) { 13 pwg_query("UPDATE " . CR_TABLE_1 . " SET 14 `name` = '" . $_POST['name'] ."', 15 `status` = '" . $_POST['status'] ."', 16 `visible` = '" . $_POST['visible'] ."', 17 `date_begin` = '" . $_POST['date_begin'] ."', 18 `date_end` = '" . $_POST['date_end'] ."', 19 `logo` = '" . $_POST['logo'] ."', 20 `banner` = '" . $_POST['banner'] ."', 21 `summary` = '" . $_POST['summary'] ."', 22 `presentation` = '" . $_POST['presentation'] ."', 23 `rules` = '" . $_POST['rules'] ."', 24 `prices` = '" . $_POST['prices'] ."', 25 `final` = '" . $_POST['final'] ."' 26 WHERE `id` = " . $_GET['contest_id'] .";"); 27 28 // redirige vers la page du concours si on en viens 29 if (isset($_GET['redirect']) AND $_GET['redirect'] == 'page') { 30 redirect(CR_PUBLIC . $_GET['contest_id'] . '-' . str2url(trigger_event('render_CR_content', $_POST['name']))); 11 if ($_POST['name'] != null) { 12 // Modification d'un concours 13 if (isset($_GET['contest_id'])) { 14 pwg_query("UPDATE " . CR_TABLE_1 . " SET 15 `name` = '" . $_POST['name'] ."', 16 `status` = '" . $_POST['status'] ."', 17 `visible` = '" . $_POST['visible'] ."', 18 `date_begin` = '" . $_POST['date_begin'] ."', 19 `date_end` = '" . $_POST['date_end'] ."', 20 `logo` = '" . $_POST['logo'] ."', 21 `banner` = '" . $_POST['banner'] ."', 22 `summary` = '" . $_POST['summary'] ."', 23 `presentation` = '" . $_POST['presentation'] ."', 24 `rules` = '" . $_POST['rules'] ."', 25 `prices` = '" . $_POST['prices'] ."', 26 `final` = '" . $_POST['final'] ."' 27 WHERE `id` = " . $_GET['contest_id'] .";"); 28 29 // redirige vers la page du concours si on en viens 30 if (isset($_GET['redirect']) AND $_GET['redirect'] == 'page') { 31 redirect(CR_PUBLIC . $_GET['contest_id'] . '-' . str2url(trigger_event('render_CR_content', $_POST['name']))); 32 } else { 33 redirect(CR_ADMIN .'&tab=manage&msg=saved'); 34 } 35 36 // Ajout d'un concours 31 37 } else { 32 redirect(CR_ADMIN); 38 pwg_query("INSERT INTO " . CR_TABLE_1 . " 39 ( 40 name, 41 date_begin, 42 date_end, 43 status, 44 visible, 45 logo, 46 banner, 47 summary, 48 presentation, 49 rules, 50 prices, 51 final 52 ) 53 VALUES( 54 '" . $_POST['name'] ."', 55 '" . $_POST['date_begin'] ."', 56 '" . $_POST['date_end'] ."', 57 '" . $_POST['status'] ."', 58 '" . $_POST['visible'] ."', 59 '" . $_POST['logo'] ."', 60 '" . $_POST['banner'] ."', 61 '" . $_POST['summary'] ."', 62 '" . $_POST['presentation'] ."', 63 '" . $_POST['rules'] ."', 64 '" . $_POST['prices'] ."', 65 '" . $_POST['final'] ."' 66 );"); 67 redirect(CR_ADMIN .'&tab=manage&msg=added'); 33 68 } 34 69 35 // Ajout d'un concours36 70 } else { 37 pwg_query("INSERT INTO " . CR_TABLE_1 . " 38 ( 39 name, 40 date_begin, 41 date_end, 42 status, 43 visible, 44 logo, 45 banner, 46 summary, 47 presentation, 48 rules, 49 prices, 50 final 51 ) 52 VALUES( 53 '" . $_POST['name'] ."', 54 '" . $_POST['date_begin'] ."', 55 '" . $_POST['date_end'] ."', 56 '" . $_POST['status'] ."', 57 '" . $_POST['visible'] ."', 58 '" . $_POST['logo'] ."', 59 '" . $_POST['banner'] ."', 60 '" . $_POST['summary'] ."', 61 '" . $_POST['presentation'] ."', 62 '" . $_POST['rules'] ."', 63 '" . $_POST['prices'] ."', 64 '" . $_POST['final'] ."' 65 );"); 66 redirect(CR_ADMIN); 71 array_push($page['errors'], l10n('CR_name_empty')); 67 72 } 68 73 } … … 71 76 // +-----------------------------------------------------------------------+ 72 77 // Définition des variables template 73 // +-----------------------------------------------------------------------+ 78 // +-----------------------------------------------------------------------+ 79 // Formulaire incomplet 80 if ($page['errors']) { 81 $template->assign(array( 82 'NAME' => $_POST['name'], 83 'STATUS' => $_POST['status'], 84 'VISIBLE' => $_POST['visible'], 85 'DATE_BEGIN' => $_POST['date_begin'], 86 'DATE_END' => $_POST['date_end'], 87 'LOGO' => $_POST['logo'], 88 'BANNER' => $_POST['banner'], 89 'SUMMARY' => $_POST['summary'], 90 )); 91 92 foreach ($textareas AS $key) { 93 $template->assign(strtoupper($key), $_POST[$key]); 94 } 95 74 96 // Edition d'un concours 75 if (isset($_GET['contest_id'])) {97 } else if (isset($_GET['contest_id'])) { 76 98 $query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";"; 77 99 $contest = pwg_db_fetch_assoc(pwg_query($query));
Note: See TracChangeset
for help on using the changeset viewer.