Beispiel #1
0
function submit_schedule($plexid, $dayid, $slotid, $corpid, $pilotid)
{
    global $ft;
    $ft->dbh->_do_query('INSERT INTO tbl:schedule (schedid, plexid, dayid, slotid, corpid, pilotid, ranattime) ' . 'VALUES (NULL, ?, ?, ?, ?, ?, NULL)', array($plexid, $dayid, $slotid, $corpid, $pilotid));
    $run = load_run($plexid, $dayid, $slotid);
    return $run;
}
    return $ft->igberrorpage('Sorry, you must provide a valid complex id.');
}
# load this complex
$plex = load_complex($id);
if (is_null($plex)) {
    return $ft->igberrorpage('Sorry, that complex was not found.');
}
# validate their id
$dayid = $_GET['dayid'] + 0;
$slotid = $_GET['slotid'] + 0;
$time = slot_to_date($dayid);
if (is_null($time) || $time <= 0 || $slotid <= 0) {
    return $ft->igberrorpage('Sorry, that does not appear to be a valid dayid and/or slotid.');
}
# get run information
$run = load_run($id, $dayid, $slotid);
if ($run) {
    return $ft->igberrorpage('Sorry, that run is already scheduled by <font color="#ff0000">' . get_corp_name($run->corpid) . '</font>.');
}
# see if they are allowed to reserve spots
# FIXME: implement
if (0) {
    return $ft->igberrorpage('Sorry, you must be an accountant or director in your corporation in order to schedule a run.');
}
# store output here
$out = "<center><b><font color='#ffff00'>Plexer - The Complex Scheduler</font></b><br />";
$out .= "<font color='#ff0000'><b>{$plex->name}</b> in <b>{$plex->system}</b> rated <b>{$plex->rating}/10</b></font><br />";
$out .= "[ <a href='{$_WEB_URL}/'>Back to Top</a> ] [ <a href='{$_WEB_URL}/igb-showcomplex.php?id={$id}'>Back to Complex</a> ]";
$out .= "</center><br />";
# if they're trying to confirm
if ($_GET['confirm'] == 1) {