Ejemplo n.º 1
0
         }
     } else {
         echo '<form method ="POST" name="addeventform" >Add a new Event<br><table><tr><td>Name</td><td><input type="text" name="name" /></td></tr><tr><td>Info</td><td><textarea name="info" rows="10" cols="50"></textarea></td></tr><tr><td>Team Event</td><td><select name="team"><option>no</option><option>yes</option></select></td></tr></table><input type="button" value="Add" onclick="checkAddEventInput()"/><input type="hidden" name="addevent" value="addevent" /></form>';
     }
     break;
 case 'addcat':
     // case addevent
     if (isset($_POST['addcat'])) {
         if (isset($_POST['name']) and isset($_POST['info']) and isset($_POST['team'])) {
             $c = new Catagory();
             if ($_POST['team'] == 'yes') {
                 $team = 1;
             } else {
                 $team = 0;
             }
             $result = $c->add($_POST['name'], $_POST['info'], $team);
             echo $result;
         } else {
             echo 'Please check your entries';
         }
     } else {
         echo '<form method ="POST" name="addeventform" >Add a new Catagory<br><table><tr><td>Name</td><td><input type="text" name="name" /></td></tr><tr><td>Info</td><td><textarea name="info" rows="10" cols="50"></textarea></td></tr></table><input type="button" value="Add" onclick="checkAddEventInput()"/><input type="hidden" name="addcat" value="addcat" /></form>';
         // checkAddEventInput will also work for this
     }
     break;
 case 'rmhead':
     // case rmhead
     if (isset($_POST['rmhead'])) {
         if (isset($_POST['name'])) {
             $h = new Head();
             $result = $h->rem($_POST['name']);