Пример #1
0
            $attendees = new Lan_attendees();
            $users = new Lan_users();
            $teams = new Lan_timetable_teams();
            $signups = new Lan_timetable_signups();
            $members = new Lan_timetable_team_members();
            $attendees->query("SELECT DISTINCT ({$users->__table}.user_id), {$users->__table}.username " . "FROM {$attendees->__table} " . "LEFT JOIN {$users->__table} ON {$attendees->__table}.user_id = {$users->__table}.user_id " . "WHERE {$attendees->__table}.user_id NOT IN (" . "SELECT DISTINCT ( user_id) " . "FROM {$teams->__table} CENTER JOIN {$members->__table} " . "WHERE timetable_id = '{$biggame->id}' )" . "AND username IS NOT NULL");
            while ($attendees->fetch()) {
                $addableusers[] = clone $attendees;
            }
            $master->Smarty->assign("addableusers", $addableusers);
            //Captain: Find all pug players
            $addableusers = array();
            $attendees = new Lan_attendees();
            $users = new Lan_users();
            $teams = new Lan_timetable_teams();
            $signups = new Lan_timetable_signups();
            $members = new Lan_timetable_team_members();
            $attendees->query("SELECT {$users->__table}.user_id, {$users->__table}.username " . "FROM {$signups->__table} " . "LEFT JOIN {$users->__table} ON {$signups->__table}.user_id = {$users->__table}.user_id " . "WHERE {$signups->__table}.user_id NOT IN (" . "SELECT DISTINCT ( user_id) " . "FROM {$teams->__table} CENTER JOIN {$members->__table} " . "WHERE timetable_id = '{$biggame->id}' )" . "AND username IS NOT NULL " . "AND {$signups->__table}.timetable_id = '{$biggame->id}'");
            while ($attendees->fetch()) {
                $addableusers[] = clone $attendees;
            }
            $master->Smarty->assign("pugplayers", $addableusers);
        }
        $master->Smarty->assign("currentUserSignedUp", $currentUserSignedUp);
        $biggame->occurs = date("l jS H:i", strtotime($biggame->occurs));
        $master->Smarty->assign("biggame", $biggame);
        //$master->Smarty->assign("signups",$list);
        return;
    }
}
$error = "Unknown event!";
Пример #2
0
                $seats->x = 20;
                $seats->y = 20;
                $seats->seat_name = "";
                $seats->type = 0;
                $seats->insert();
            }
            break;
        case "getusers":
            if (isset($_GET["lan"])) {
                $users = new Lan_attendees();
                $seats = new Lan_seats();
                $lanid = $users->escape($_GET["lan"]);
                $user_id = $users->escape($_GET["user_id"]);
                $applicable = array();
                $Frontend = new FrontEnd();
                $users->query("SELECT * FROM {$users->__table} WHERE `lan_id` = " . $lanid . " AND `user_id` NOT IN (SELECT `user_id` FROM {$seats->__table} WHERE `lan_id` = '" . $lanid . "') ");
                echo "<option value=\"0\"></option>";
                if ($user_id != '0') {
                    $applicable[$user_id] = $Frontend->getName($user_id);
                }
                while ($users->fetch()) {
                    $applicable[$users->user_id] = $Frontend->getName($users->user_id);
                }
                foreach ($applicable as $key => $val) {
                    echo "<option value=\"" . $key . "\">" . $val . "</option>";
                }
                $Frontend->disconnect();
            }
            break;
    }
}