]>
src.bluestatic.org Git - bugdar.git/blob - status.php
58ce00aef910dd1c8e6843f0822a8dd054e0457d
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Renapsus [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # All parts of this file are ©2003-[#]year[#] Iris Studios, Inc. No # ||
7 || # part of this file may be reproduced in any way: part or whole. # ||
8 || # --------------------------------------------------------------- # ||
9 || # ©2003 - [#]year[#] Iris Studios, Inc. | http://www.iris-studios.com # ||
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 sanitize ( array ( 'statusid' => INT ));
33 $DB_sql- > query ( "DELETE FROM " . TABLE_PREFIX
. "status WHERE statusid = $vars [statusid]" );
35 $admin- > redirect ( 'status.php?do=modify' );
38 // ###################################################################
40 if ( $_REQUEST [ 'do' ] == 'delete' )
42 sanitize ( array ( 'statusid' => INT ));
43 $admin- > page_confirm ( phrase ( 'confirm_delete_status' ), 'status.php?do=kill&statusid=' . $vars [ 'statusid' ]);
46 // ###################################################################
48 if ( $_POST [ 'do' ] == 'insert' )
50 sanitize ( array ( 'status' => STR
, 'displayorder' => INT ));
51 $DB_sql- > query ( "INSERT INTO " . TABLE_PREFIX
. "status (status, displayorder) VALUES ('" . addslasheslike ( $vars [ 'status' ]) . "', $vars [displayorder])" );
53 $admin- > redirect ( 'status.php?do=modify' );
56 // ###################################################################
58 if ( $_REQUEST [ 'do' ] == 'add' )
60 $admin- > page_start ( phrase ( 'add_new_status' ));
62 $admin- > form_start ( 'status.php' , 'insert' );
63 $admin- > table_start ();
64 $admin- > table_head ( phrase ( 'new_status' ));
65 $admin- > row_input ( phrase ( 'status_title' ), 'status' );
66 $admin- > row_input ( phrase ( 'status_display_order' ), 'displayorder' );
74 // ###################################################################
76 if ( $_POST [ 'do' ] == 'update' )
78 sanitize ( array ( 'statusid' => INT , 'status' => STR
, 'displayorder' => INT ));
79 $DB_sql- > query ( "UPDATE " . TABLE_PREFIX
. "status SET status = '" . addslasheslike ( $vars [ 'status' ]) . "', displayorder = $vars [displayorder] WHERE statusid = $vars [statusid]" );
81 $admin- > redirect ( 'status.php?do=modify' );
84 // ###################################################################
86 if ( $_REQUEST [ 'do' ] == 'edit' )
88 sanitize ( array ( 'statusid' => INT ));
90 $status = $DB_sql- > query_first ( "SELECT * FROM " . TABLE_PREFIX
. "status WHERE statusid = $vars [statusid]" );
91 if (! is_array ( $status ))
96 $admin- > page_start ( phrase ( 'edit_status' ));
98 $admin- > form_start ( 'status.php' , 'update' );
99 $admin- > form_hidden_field ( 'statusid' , $status [ 'statusid' ]);
100 $admin- > table_start ();
101 $admin- > table_head ( phrase ( 'edit_status_title' , $status [ 'status' ], $status [ 'statusid' ]));
102 $admin- > row_input ( phrase ( 'status_title' ), 'status' , $status [ 'status' ]);
103 $admin- > row_input ( phrase ( 'status_display_order' ), 'displayorder' , $status [ 'displayorder' ]);
104 $admin- > row_submit ();
111 // ###################################################################
113 if ( $_REQUEST [ 'do' ] == 'modify' )
115 $admin- > page_start ( 'Status Manager' );
117 $statuses = $DB_sql- > query ( "SELECT * FROM " . TABLE_PREFIX
. "status" );
119 $admin- > form_start ( 'status.php' , 'null' );
120 $admin- > table_start ();
121 $admin- > table_head ( 'Status Manager' );
123 while ( $status = $DB_sql- > fetch_array ( $statuses ))
125 $admin- > row_text ( " $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] \" >" . phrase ( 'edit_wraplink' ) . "</a> <a href= \" status.php?do=delete&statusid= $status [statusid] \" >" . phrase ( 'delete_wraplink' ) . "</a>" );
127 $DB_sql- > free_result ( $statuses );
129 $admin- > row_span ( '<input type="button" name="addug" value=" ' . phrase ( 'add_new_status' ) . ' " onclick="window.location = \' status.php?do=add \' ;" />' , 'tfoot' , 'center' , 3 );
136 /*=====================================================================*\
137 || ###################################################################
140 || ###################################################################
141 \*=====================================================================*/