Ejemplo n.º 1
0
include 'foodrun.logic.php';
$biggame = new Lan_timetable();
$biggame->type = "food";
if (isset($_GET["tid"])) {
    $user = new Lan_users();
    $biggame->joinAdd($user, "LEFT");
    if ($biggame->get($biggame->escape($_GET["tid"]))) {
        $biggame->fetch();
        //Find sign ups
        $tts = new Lan_timetable_signups();
        $user = new Lan_users();
        $tts->joinAdd($user);
        $tts->timetable_id = $biggame->id;
        $list = array();
        $tts->find();
        $currentUserSignedUp = false;
        $signups = 0;
        while ($tts->fetch()) {
            if (streq($tts->user_id, getCurrentUID())) {
                $currentUserSignedUp = true;
            }
            $list[] = clone $tts;
            $signups++;
        }
        $biggame->signups = $signups;
        $game = new Lan_games();
        if (1 == $game->get($biggame->game)) {
            $master->Smarty->assign("image", "images/games/" . $game->picture);
            $master->Smarty->assign("gamename", $game->name);
        }
Ejemplo n.º 2
0
                        $signup = new Lan_timetable_signups();
                        $signup->timetable_id = $biggame->id;
                        $signup->user_id = getCurrentUID();
                        if ($signup->count() == 0) {
                            $signup->insert();
                        } else {
                            $error = "You are already signed up to this event!";
                        }
                    } else {
                        $error = "Unknown big game?";
                    }
                } else {
                    $error = "No event id set?";
                }
            }
            break;
        case "remsignup":
            if (isset($_GET["tid"])) {
                $signup = new Lan_timetable_signups();
                $signup->timetable_id = $signup->escape($_GET["tid"]);
                $signup->user_id = getCurrentUID();
                $signup->find();
                if ($signup->count() != 0) {
                    $signup->delete();
                }
            } else {
                $error = "No event id set?";
            }
            break;
    }
}