Esempio n. 1
0
            }
        }
    } else {
        if (isset($_GET['mandantID']) && is_numeric($_GET['mandantID'])) {
            EventDatabaseManager::updateMandant($_GET['mandantID'], mysql_real_escape_string($_POST['company']));
            $locations = EventDatabaseManager::getAllLocations();
            foreach ($locations as $id => $locationName) {
                if (isset($_POST['location_' . $id])) {
                    EventDatabaseManager::addLocationToMandant($_GET['mandantID'], $id);
                } else {
                    EventDatabaseManager::removeLocationFromMandant($_GET['mandantID'], $id);
                }
            }
        } else {
            if (!isset($_GET['mandantID'])) {
                if (EventDatabaseManager::addMandant(mysql_real_escape_string($_POST['company']))) {
                    echo MANDANT_ADDED_MESSAGE;
                }
            }
        }
    }
}
/*
 * Add, edit or delete topic
 */
if (isset($_POST['Name'])) {
    if (isset($_POST['deleteEvent']) && $_POST['deleteEvent'] == 'yes') {
        if (is_numeric($_GET['topicID'])) {
            if (EventDatabaseManager::deleteTopic($_GET['topicID'])) {
                echo "TOPIC_DELETED_MESSAGE";
            } else {