* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ function __autoload($class_name) { require_once $class_name . '.php'; } $connection = new Connection(); $user = new User(); $page = new Webpage("Test View Event", $user); $event = $page->_GET_checkEventID($_GET['event'], $connection); if ($event == NULL) { exit(0); } $page->printEvent($event); echo "<center>"; echo "<div id=\"addBox\">"; if ($user->is_User()) { // figure out if the event is already in the user's schedule $eventID = $event->getEventID(); $userID = $user->get_UserID(); $query = "\n\t\tSELECT us_eventID \n\t\tFROM userSchedule \n\t\tWHERE us_eventID = {$eventID}\n\t\t\tAND us_userID = {$userID};"; $connection->query($query); if ($connection->result_size() == 0) { $page->addURL("addUserEvent.php?event={$eventID}", "Add this event to your schedule."); echo "<br><br>";
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ function __autoload($class_name) { require_once $class_name . '.php'; } $user = new User(); $page = new Webpage("Delete Event", $user); $connection = new Connection(); $eventID = $page->_GET_checkEventID($_GET['event'], $connection, FALSE); if (!isset($eventID)) { exit(0); } if ($user->is_Admin()) { if (isset($_GET['confirm'])) { // they want to delete it so lets delete it $query = "DELETE FROM events WHERE e_eventID = {$eventID};"; $connection->query($query); //also remove the event from user schedules $query = "DELETE FROM userSchedule WHERE us_eventID = {$eventID};"; $connection->query($query); $page->printError("Event successfully deleted."); echo "<center>"; $page->addURL("index.php", "Return to event schedule."); echo "</center>";
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ function __autoload($class_name) { require_once $class_name . '.php'; } $user = new User(); $page = new Webpage("Remove User Event", $user); $C = new Connection(); $eID = $page->_GET_checkEventID($_GET['event'], $C, FALSE); if (!isset($eID)) { exit(0); } $uID = $user->get_UserID(); if (isset($_GET['confirm'])) { // they have confirmed they wish to delete the event $q = "DELETE FROM userSchedule WHERE us_userID = {$uID} AND us_eventID = {$eID};"; $C->query($q); $page->printError("Event removed successfully."); echo "<center>"; $page->addURL("userSchedule.php", "Return to your custom schedule."); echo "<br /><br />"; $page->addURL("index.php", "Return to event schedule."); echo "</center>"; } else {
require_once $class_name . '.php'; } $C = new Connection(); $user = new User(); $page = new Webpage("Add User Event", $user); // make sure the visitor is a forum user if (!$user->is_User()) { $page->printError("You must be a forum user to create your own schedule."); echo "<center>"; $page->addURL("http://www.mewcon.com/forum/index.php", "Go to the forums to Register or Sign In."); echo "<br /><br />"; $page->addURL("index.php", "Return to the event schedule."); echo "</center>"; exit(0); } $reqEvent = $page->_GET_checkEventID($_GET['event'], $C); if (!isset($reqEvent)) { exit(0); } $uID = $user->get_UserID(); $eID = $reqEvent->getEventID(); // check if we're processing from the conflict resolution form if (isset($_POST['submit'])) { $keepReq = $C->validate_string($_POST['keepReq']); $cc = $C->validate_string($_POST['conflictCount']); $page->printError("Conflicts resolved!"); echo "<center>"; // go ahead and insert the req. event if the user wanted to if ($keepReq == "TRUE") { $q = "INSERT INTO userSchedule(us_userID, us_eventID) VALUES ({$uID}, {$eID});"; $C->query($q);