Example #1
0
             // name of all event organisers from the DB
             echo '<option>', $head['username'], '</option>';
         }
         // we set a hidden input eventorg to eventorg, so that we know we want to assign an event to organiser
         echo '</select><br><input type="hidden" name="eventorg" value="eventorg"/><input type="submit" value="Assign" /></form>';
     }
     break;
 case 'eventvol':
     // case -> assign event volunteer
     if (isset($_POST['eventvol'])) {
         if (isset($_POST['eventname']) and isset($_POST['headname'])) {
             $e = new Event();
             $h = new Head();
             if ($e->select($_POST['eventname'])) {
                 if ($h->select($_POST['headname'])) {
                     echo $e->addHead($h->getId(), 'vol');
                     // assigning the event to head
                 } else {
                     echo 'Username 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();
         $h = new Head();
         echo '<form method="POST">Select an Event and Head<br><select name="eventname">';