2 require 'include/head.inc';
3 require 'include/db.inc';
4 require 'include/common.inc';
6 if(isset($_POST['submit']) && $_POST['stime']!="" && $_POST['examples']!="") {
7 $db->query("INSERT INTO sessions (id,examples,nexamples) VALUES (" . strtotime(trim($_POST['stime'])) . ",'" . $_POST['examples'] . "','" . count(explode(',',$_POST['examples'])) . "')");
8 block("lightgreen", "added session");
11 if($_GET['delete']!="") {
12 $db->query("DELETE FROM sessions WHERE id=" . $_GET['delete']);
13 block("red", "deleted session");
16 require 'include/session.inc';
18 block("black", "add session");
21 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
24 <th align="left">Time:</th> <th><input type="text" name="stime"></th><th></th><th>(e.g. 10.9.2012 10:30)</th>
27 <th align="left">Examples:</th> <th><input type="text" name="examples"></th>
28 <th><input type="submit" name="submit" value="Add"></th><th>(e.g. 1a,1b,1c,2,3a,3b)</th>
34 block("black", "session overview");
37 foreach ($SESSIONS as $session) {
39 print "<td>" . $session['id'] . " </td>";
40 print "<td>" . $session['timestr'] . " </td>";
41 print "<td>" . $session['examples'] . "(" . $session['nexamples'] . ")" . " </td>";
42 if ($session['workdone'] == 0) {
43 print "<td><a href='sessions.php?delete=" . $session['id'] . "'>delete</a></td>";
45 else { print "<td>locked</td>"; }