Exemplo n.º 1
0
        } 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 {
                echo "TOPIC_NOT_DELETED_MESSAGE";
            }
        }
    } else {
        $topicParams = array();
        foreach ($_POST as $key => $value) {
            if (array_search($key, EventDatabaseManager::$topicParams)) {
                $topicParams[$key] = mysql_real_escape_string($value);
            }
        }
        if (isset($_GET['topicID']) && is_numeric($_GET['topicID'])) {
            if (EventDatabaseManager::updateTopic($_GET['topicID'], $topicParams)) {
                echo TOPIC_UPDATED_MESSAGE;