1 rizwank 1.1 <?php
2
3 if ((!isset($HTTP_GET_VARS['stage'])) || ($HTTP_GET_VARS['stage'] == "1")) {
4 print "Click on the name of the category that you would like to edit.<br /><br />";
5
6 $results = mysql_list_tables($mysqdb['name']) or die("Invalid request: " . mysql_error());
7
8 while ($row = mysql_fetch_row($results)) {
9 $cats[] = $row[0];
10 }
11
12 for ($i = 0; $i < count($cats); $i++) {
13 $funkychars = rawurlencode($cats[$i]);
14 print "<a href=\"?func=2&stage=2&edit_category=" . $funkychars . "\"> • " . $cats[$i] . "</a><br />\n";
15 }
16
17 mysql_free_result($results);
18
19 } elseif (($HTTP_GET_VARS['stage'] == 2) && ($HTTP_GET_VARS['edit_category'] != "")) {
20
21 print "You are editing the properties of your category <em><strong>" . $HTTP_GET_VARS['edit_category'] . "</strong></em>. You may change it's name or description on this page.<br />\n";
22 rizwank 1.1 print "<span class=\"error\">Please check your changes before clicking Save, as there is no option to undo.</span><br /><br />";
23
24 // getting the category description
25
26 $query = "SHOW TABLE STATUS LIKE '$HTTP_GET_VARS[edit_category]'";
27 $results = mysql_query($query) or die("Invalid query: " . mysql_error());
28 while ($row = mysql_fetch_array($results)) {
29 $description = $row['Comment'];
30 }
31
32 mysql_free_result($results);
33 $inc = $mysqvars['path'] . "/lib/admin_editcat_form.php";
34 include($inc);
35 }
36
37 ?>
|