/** * Outputs the list of all the events in system */ function edit_events() { if (isset($_GET['order'])) { $orderAttribute = mysql_real_escape_string($_GET['order']); } else { $orderAttribute = ""; } $attributes = array(); if (isset($_GET['mandant']) && is_numeric($_GET['mandant'])) { $attributes['mandantID'] = $_GET['mandant']; } if (isset($_GET['topic']) && is_numeric($_GET['topic'])) { $attributes['topicID'] = $_GET['topic']; } $events = EventDatabaseManager::getEventsByAttributes($attributes, $orderAttribute); $mandants = EventDatabaseManager::getAllMandants(); $topics = EventDatabaseManager::getAllTopics(); View::outputAllEvents('manage_events', 'edit_event', 'edit_participants', $events, $mandants, $topics, $attributes); View::linkToAddEvent(); }
/** * Outputs the form for editing existing mandant */ function edit_mandants() { View::loadScripts(); if (isset($_GET['order'])) { $orderAttribute = mysql_real_escape_string($_GET['order']); } else { $orderAttribute = "mandantID"; } $mandants = EventDatabaseManager::getAllMandants($orderAttribute); View::outputAllMandants('edit_mandants', $mandants); View::linkToAddMandant(); if (isset($_GET['mandantID']) && is_numeric($_GET['mandantID'])) { $mandant = EventDatabaseManager::getMandant($_GET['mandantID']); $locations = EventDatabaseManager::getAllLocations(); $mandantLocations = EventDatabaseManager::getMandantLocations($_GET['mandantID']); View::mandantFormOutput($mandant['mandantID'], $mandant['company'], $locations, $mandantLocations); } else { if (isset($_GET['mandantID'])) { echo MANDANT_ID_INCORRECT_MESSAGE; } } }
/** * Returns the output string for event form field * * @param String $param * @param String $defaultValue * @return String */ public static function eventFormFieldsOutput($param, $defaultValue = "") { if ($param == 'topicID') { $topicsValues = EventDatabaseManager::getAllTopics(); return View::outputOptions('topicID', $topicsValues, $defaultValue, true, 'validate'); } else { if ($param == 'mandantID') { $mandants = EventDatabaseManager::getAllMandants(); return View::outputOptions('mandantID', $mandants, $defaultValue, true, 'validate'); } else { if ($param == 'addressID') { return "<b>" . CHOOSE_EXISTING_ADDRESS . ": </b>" . View::existingAddressesOutput($defaultValue, true) . "</br> <b>" . ENTER_NEW_ADDRESS . ": </b>" . View::newAddressFormOutput(); } else { if ($param == 'date_time') { if ($defaultValue != "") { $date = date_parse($defaultValue); return View::timeFormOutput("", $date['year'], $date['month'], $date['day'], $date['hour'], $date['minute']); } else { return View::timeFormOutput(""); } } else { if ($param == 'event_visible') { if ($defaultValue != '1' && $defaultValue != 1) { $defaultValue = ""; } return View::checkboxFormOutput('event_visible', '1', $defaultValue); } else { if ($param == 'eventType') { if ($defaultValue == '') { $defaultValue = 'offline'; } return View::outputOptions('eventType', Event::$eventTypes, $defaultValue, true, 'validate'); } else { if ($param == 'invitation_text') { return View::textAreaFormOutput($param, $defaultValue, 'validate'); } else { return View::textFormOutput($param, $defaultValue, 'validate'); } } } } } } } }