]>
src.bluestatic.org Git - bugdar.git/blob - admin/status.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 require_once('./global.php');
14 require_once('./includes/functions_datastore.php');
16 if (!can_perform('canadminfields'))
21 // ###################################################################
23 if (empty($_REQUEST['do']))
25 $_REQUEST['do'] = 'modify';
28 // ###################################################################
30 if ($_REQUEST['do'] == 'kill')
32 $db->query("DELETE FROM " . TABLE_PREFIX
. "status WHERE statusid = " . intval($bugsys->in
['statusid']));
34 $admin->redirect('status.php?do=modify');
37 // ###################################################################
39 if ($_REQUEST['do'] == 'delete')
41 $admin->page_confirm(lang
::p('confirm_delete_status'), 'status.php?do=kill&statusid=' . intval($bugsys->in
['statusid']));
44 // ###################################################################
46 if ($_POST['do'] == 'insert')
48 $db->query("INSERT INTO " . TABLE_PREFIX
. "status (status, displayorder, color) VALUES ('" . $bugsys->in
['status'] . "', " . intval($bugsys->in
['displayorder']) . ", '" . $bugsys->in
['color'] . "')");
50 $admin->redirect('status.php?do=modify');
53 // ###################################################################
55 if ($_REQUEST['do'] == 'add')
57 $admin->page_start(lang
::p('add_new_status'));
59 $admin->form_start('status.php', 'insert');
60 $admin->table_start();
61 $admin->table_head(lang
::p('new_status'));
62 $admin->row_input(lang
::p('status_title'), 'status');
63 $admin->row_input(lang
::p('status_display_order'), 'displayorder');
64 $admin->row_input(phraes('status_color'), 'color');
72 // ###################################################################
74 if ($_POST['do'] == 'update')
76 $db->query("UPDATE " . TABLE_PREFIX
. "status SET status = '" . $bugsys->in
['status'] . "', displayorder = " . intval($bugsys->in
['displayorder']) . ", color = '" . $bugsys->in
['color'] . "' WHERE statusid = " . intval($bugsys->in
['statusid']));
78 $admin->redirect('status.php?do=modify');
81 // ###################################################################
83 if ($_REQUEST['do'] == 'edit')
85 $status = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "status WHERE statusid = " . intval($bugsys->in
['statusid']));
86 if (!is_array($status))
88 $admin->error(lang
::p('error_invalid_id'));
91 $admin->page_start(lang
::p('edit_status'));
93 $admin->form_start('status.php', 'update');
94 $admin->form_hidden_field('statusid', $status['statusid']);
95 $admin->table_start();
96 $admin->table_head(lang
::p('edit_status_title', $status['status'], $status['statusid']));
97 $admin->row_input(lang
::p('status_title'), 'status', $status['status']);
98 $admin->row_input(lang
::p('status_display_order'), 'displayorder', $status['displayorder']);
99 $admin->row_input(lang
::p('status_color'), 'color', $status['color']);
100 $admin->row_submit();
107 // ###################################################################
109 if ($_REQUEST['do'] == 'modify')
111 $admin->page_start('Status Manager');
113 $statuses = $db->query("SELECT * FROM " . TABLE_PREFIX
. "status");
115 $admin->form_start('status.php', 'null');
116 $admin->table_start();
117 $admin->table_head('Status Manager');
119 while ($status = $db->fetch_array($statuses))
121 $colourblock = '<span style="float: right"><div style="height: 12px; width: 12px; background-color: ' . $status['color'] . '; border: 1px black solid"></div></span>';
122 $admin->row_text("$colourblock$status[displayorder]: <a href=\"status.php?do=edit&statusid=$status[statusid]\">$status[status]</a>", "(statusid: $status[statusid]) <a href=\"status.php?do=edit&statusid=$status[statusid]\">" . lang
::p('edit_wraplink') . "</a> <a href=\"status.php?do=delete&statusid=$status[statusid]\">" . lang
::p('delete_wraplink') . "</a>");
124 $db->free_result($statuses);
126 $admin->row_span('<input type="button" name="addug" value=" ' . lang
::p('add_new_status') . ' " onclick="window.location = \'status.php?do=add\';" />', 'tfoot', 'center', 3);
133 /*=====================================================================*\
134 || ###################################################################
137 || ###################################################################
138 \*=====================================================================*/