]> git.treefish.org Git - banana.git/blob - admin/prefs.php
...
[banana.git] / admin / prefs.php
1 <?php
2   require 'include/head.inc';
3   require 'include/db.inc';
4   require 'include/common.inc';
5   require 'include/prefs.inc';
6
7   if(isset($_POST['submit']) && $_POST['exname']!="" && $_POST['groupname']!="") {
8     $db->query("DELETE FROM prefs WHERE key='exname'");
9     $db->query("INSERT INTO prefs (key,value) VALUES ('exname','" . trim($_POST['exname']) . "')");
10
11     $db->query("DELETE FROM prefs WHERE key='groupname'");
12     $db->query("INSERT INTO prefs (key,value) VALUES ('groupname','" . trim($_POST['groupname']) . "')");
13
14     block("lightgreen", "set preferences");
15     exit;
16   }
17
18 ?>
19
20 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
21   <?php block("black", "preferences"); ?>
22
23   <table>
24     <tr>  
25       <th align="left">Exercise Name:</th> <th><input type="text" name="exname" value="<?php echo $PREFS['exname'] ?>"></th>
26     </tr>
27
28     <tr>  
29       <th align="left">Group Name:</th> <th><input type="text" name="groupname" value="<?php echo $PREFS['groupname'] ?>"></th>
30     </tr>
31   
32     <tr>
33       <th></th><th align="right"><input type="submit" name="submit" value="Set"></th>
34     </tr>
35   </table>
36 </form>