Пример #1
0
                }
            }
        }
    }
}
/**
 * Adding, editing or deleting the event
 */
if (isset($_POST['eventType'])) {
    daschug_load_user_settings();
    /*
     * Deleting the event
     */
    if (isset($_POST['deleteEvent']) && $_POST['deleteEvent'] == 'yes') {
        $eventID = mysql_real_escape_string($_GET['eventID']);
        if (EventDatabaseManager::deleteEvent($eventID)) {
            MessageHandling::m(EVENT_DELETED_MESSAGE);
        } else {
            MessageHandling::m(EVENT_NOT_DELETED_MESSAGE);
        }
    } else {
        if ($_POST['event_action'] == 'add_event') {
            //        daschug_load_user_settings();
            $eventParams = array();
            foreach ($_POST as $key => $value) {
                if (array_search($key, Event::$eventParamsNames)) {
                    $eventParams[$key] = mysql_real_escape_string($value);
                }
            }
            $eventParams['date_time'] = $_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day'] . " " . $_POST['hour'] . ':' . $_POST['min'];
            /**