Esempio n. 1
0
 case 'rmcathead':
     // case -> remove catagory head
     if (isset($_POST['rmcathead'])) {
         if (isset($_POST['catname']) or isset($_POST['headname'])) {
             $c = new Catagory();
             $h = new Head();
             // add here
         } else {
             echo 'Please check your entries';
         }
     } else {
         // displaying the list of all catagories and heads
         $c = new Catagory();
         $h = new Head();
         echo '<form method="POST" >Select a Catagory or Head<br><select name="catname">';
         foreach ($c->getList() as $cat) {
             // name of all catagories from the DB
             echo '<option>', $cat['name'], '</option>';
         }
         echo '</select><br><select name="headname">';
         foreach ($h->getHeads('chead') as $head) {
             // name of all catagory heads from the DB
             echo '<option>', $head['username'], '</option>';
         }
         // we set a hidden input cathead to rcathead, so that we know we want to assign a catagory to head
         echo '</select><br><input type="hidden" name="cathead" value="cathead"/><input type="submit" value="Assign" /></form>';
     }
     break;
 default:
     // if none of the above we simply ask to select something
     echo "Sorry you selected something that does not exist";
Esempio n. 2
0
} else {
    $auth = $main->login($_POST['username'], $_POST['password']);
    if ($auth[0] == "error") {
        echo '<br>Wrong Username/Password<br>', $loginText;
        $level = 'error';
    } else {
        $level = $auth[0];
        echo 'Welcome <b>', $_POST['username'], '</b><br><a href="index.php?logout=1">log out</a><br><br>';
        setcookie("user", $_POST['username'], time() + 3600);
        setcookie("key", $auth[1], time() + 3600);
    }
}
echo '</center><a href="index.php">Home</a><br>';
echo '<a href="register.php">Main Registeration</a><br>';
echo '<a href="#" onclick="toggleCat()">Registeration</a><br><div id="sidebar-catagory"><br>';
$catagories = $c->getList();
foreach ($catagories as $cat) {
    echo '<a href="regcat.php?id=', $cat['catid'], '">', ucwords($cat['name']), '</a><br>';
}
echo '<br></div><a href="#" onclick="toggleCatInfo()">Information</a><br><div id="sidebar-catagoryinfo"><br>';
foreach ($catagories as $cat) {
    echo '<a href="catagory.php?id=', $cat['catid'], '">', ucwords($cat['name']), '</a><br>';
}
echo '<br></div><a href="details.php">Reg Details</a><br><a href="#" onclick="toggleAdmin()">Admin</a><br><div id="sidebar-admin"><br>';
if ($level == 'admin') {
    echo '<a href="#" onclick="toggleAssign()">Do Assignment</a><br>';
    echo '<div id ="sidebar-assign"><br>';
    echo '<a href="admin.php?do=cathead">Catagory Head</a><br>';
    echo '<a href="admin.php?do=eventhead">Event Head</a><br>';
    echo '<a href="admin.php?do=eventorg">Organiser</a><br>';
    echo '<a href="admin.php?do=eventvol">Volunteer</a><br>';