$hash = ""; $account_id = $account !== false ? $account : 0; $public = isset($_POST["public"]); $hidden = isset($_POST["hidden"]); if ($_POST["type"] == "open") { $hash = create_event($_POST["name"], $_POST["start"], $_POST["end"], $_POST["desc"], $_POST["type"], $account_id, $public, $hidden); header('Location: view?event=' . $hash); } else { if ($_POST["type"] == "centered") { $hash = create_event($_POST["name"], date("Y-m-d H:i:s", 0), date("Y-m-d H:i:s", PHP_INT_MAX), $_POST["desc"], $_POST["type"], $account_id, $public, $hidden); $id = get_event($hash)["id"]; $processor = new NaturalLanguageProcessor($_POST["proposal"], date("Y-m-d H:i:s", 0), date("Y-m-d H:i:s", PHP_INT_MAX)); if ($account !== false) { put_schedule("", $processor->Process(), $id, $account, $_POST["proposal"]); } else { put_schedule($_POST["username"], $processor->Process(), $id, $_POST["proposal"]); } header('Location: view?event=' . $hash . "#share"); } } } } } $title = "Create Event"; require_once "header.php"; ?> <h2>Create Event</h2> <div class="tabs"> <ul class="tab-links"> <li class="active"><a href="#open">Open Scheduling</a></li>
echo "Please enter your name"; } else { if ($_POST["text"] == "") { echo "Please enter your availability"; } else { $processor = new NaturalLanguageProcessor($_POST["text"], $event["range_start"], $event["range_end"]); $p = $processor->Process(); if ($p !== false) { $userid = 0; if ($account !== false) { $userid = put_schedule("", $p, $event["id"], $account, $_POST["text"]); } else { if ($event["public"] == 0) { $userid = put_schedule(isset($_POST["name"]) ? $_POST["name"] : "", $p, $event["id"], 0, $_POST["text"], $_GET["key"]); } else { $userid = put_schedule(isset($_POST["name"]) ? $_POST["name"] : "", $p, $event["id"], 0, $_POST["text"]); } } if ($event["public"] == 0) { if ($account !== false) { update_invite_account($event["id"], $account, $userid); } else { update_invite($event["id"], $_GET["key"], $userid); } } } } } } if ($event["public"] == 0 && isset($_GET["key"])) { header("Location: view?event=" . $_GET["event"] . "&key=" . $_GET["key"] . "#attendees");