Example #1
0
                     // assigning the event to catagory
                 } else {
                     echo 'Catagory Does Not Exist';
                 }
             } else {
                 echo 'Event Does Not Exist';
             }
         } else {
             echo 'Please check your entries';
         }
     } else {
         // displaying the list of all events and heads
         $e = new Event();
         $c = new Catagory();
         echo '<form method="POST">Select an Event and Head<br><select name="eventname">';
         foreach ($e->getList() as $event) {
             // name of all events from the DB
             echo '<option>', $event['name'], '</option>';
         }
         echo '</select><br><select name="catname">';
         foreach ($c->getList() as $cat) {
             // name of all event catagories from the DB
             echo '<option>', $cat['name'], '</option>';
         }
         // we set a hidden input eventcat to eventcat, so that we know we want to assign an event to Catagory
         echo '</select><br><input type="hidden" name="eventcat" value="eventcat"/><input type="submit" value="Assign" /></form>';
     }
     break;
 case 'rmcathead':
     // case -> remove catagory head
     if (isset($_POST['rmcathead'])) {