Esempio n. 1
0
$goBack = "<a href='regcat.php?id={$_GET['id']}'>Back</a>";
$r = new Registeration();
if (True) {
    //$level from sidebar.php
    if ($level != "error") {
        // for anything except error, i.e all logged in users
        $c = new Catagory();
        if (isset($_GET['id'])) {
            $c->setId($_GET['id']);
        }
        if (isset($_COOKIE['user'])) {
            $cookieUser = $_COOKIE['user'];
        } else {
            $cookieUser = '';
        }
        if ($c->hasPermission($cookieUser) or $level == "admin") {
            if (isset($_POST['go']) and isset($_POST['event'])) {
                // when the event has been selected
                $e = new Event();
                $eventInfo = $e->getInfo($_POST['event']);
                // display the event info
                echo '<h3>', ucwords($eventInfo['name']), ' Regestration</h3>';
                if ($e->isTeamEvent($_POST['event'])) {
                    // if the event is a team event we ask user to enter the team number
                    echo 'Team Event<br />';
                    echo 'Enter Team number<form method="POST">';
                    echo '<input type="input" name="teamno" /><br>';
                    echo '<input type="hidden" name="event" value="', $_POST['event'], '"/>';
                    echo '<input type="submit" name="regteam" value="Register"/><input type="submit" value="Cancel" />';
                    echo '</form>';
                } else {