示例#1
0
 */
$thisPageName = basename(__FILE__);
require_once FILE_PATH . '/lang/' . CURRENT_LANGUAGE . '.php';
require_once FILE_PATH . '/lang/' . CURRENT_LANGUAGE . '/create/' . $thisPageName;
/**
 * Page specific logic
 */
if (isset($_POST['submit'])) {
    //  Grab all expected request variables and validate them.
    $expected_post = array('e_name' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_NAME, 'max_length' => MAX_LENGTH_EVENT_NAME), 'e_date_time' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_DATETIME, 'max_length' => MAX_LENGTH_EVENT_DATETIME), 'e_location' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_LOCATION, 'max_length' => MAX_LENGTH_EVENT_LOCATION), 'e_notes' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_NOTES, 'max_length' => MAX_LENGTH_EVENT_NOTES));
    $val = new validator();
    require "./../extract_vars.php";
    $args = array('e_name' => $e_name, 'e_date_time' => $e_date_time, 'e_location' => $e_location, 'e_notes' => $e_notes);
    $eventMgr = new eventMgr($mdb2);
    try {
        if ($e_url = $eventMgr->createEvent($args)) {
            //  Grab event details and send user to the event page
            header("location:" . WEB_PATH . "events/?id={$e_url}");
        }
    } catch (sqlException $e) {
        header("location:" . ERROR_PAGE . "?e=1");
    } catch (Exception $e) {
        header("location:" . ERROR_PAGE);
    }
}
/**
 * Language
 */
/**
 * Page display
 */