]> git.treefish.org Git - banana.git/blobdiff - admin/prefs.php
...
[banana.git] / admin / prefs.php
diff --git a/admin/prefs.php b/admin/prefs.php
new file mode 100644 (file)
index 0000000..76e14d7
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+  require 'include/head.inc';
+  require 'include/db.inc';
+  require 'include/common.inc';
+  require 'include/prefs.inc';
+
+  if(isset($_POST['submit']) && $_POST['exname']!="" && $_POST['groupname']!="") {
+    $db->query("DELETE FROM prefs WHERE key='exname'");
+    $db->query("INSERT INTO prefs (key,value) VALUES ('exname','" . trim($_POST['exname']) . "')");
+
+    $db->query("DELETE FROM prefs WHERE key='groupname'");
+    $db->query("INSERT INTO prefs (key,value) VALUES ('groupname','" . trim($_POST['groupname']) . "')");
+
+    block("lightgreen", "set preferences");
+    break;
+  }
+
+?>
+
+<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
+  <?php block("black", "preferences"); ?>
+
+  <table>
+    <tr>  
+      <th align="left">Exercise Name:</th> <th><input type="text" name="exname" value="<?php echo $PREFS['exname'] ?>"></th>
+    </tr>
+
+    <tr>  
+      <th align="left">Group Name:</th> <th><input type="text" name="groupname" value="<?php echo $PREFS['groupname'] ?>"></th>
+    </tr>
+  
+    <tr>
+      <th></th><th align="right"><input type="submit" name="submit" value="Set"></th>
+    </tr>
+  </table>
+</form>
\ No newline at end of file