Example #1
0
} elseif ($uri == 'logout') {
    // Выход
    $control = new UsersController();
    $response = $control->logout_action();
} elseif ($uri == 'admin' and $access_granted) {
    // Административная часть
    $control = new UsersController();
    $response = $control->admin_action();
} elseif ($uri == 'add' and $access_granted) {
    // Новое мероприятие
    $control = new EventsController();
    $response = $control->add_action();
} elseif ($uri == 'event' and $access_granted and isset($_REQUEST["remove"])) {
    // Удаление мероприятия
    $control = new EventsController();
    $response = $control->remove_action($_REQUEST['remove']);
} elseif ($uri == 'event' and $access_granted and isset($_REQUEST["lock"])) {
    // Открытие/закрытие мероприятия
    $control = new EventsController();
    $response = $control->lock_action($_REQUEST['lock'], $_REQUEST['flag']);
} elseif ($uri == 'event' and $access_granted and isset($_REQUEST["edit"])) {
    // Изменить мероприятие
    $control = new EventsController();
    $response = $control->edit_action($_REQUEST["edit"]);
} elseif ($uri == 'event' and isset($_REQUEST["show"])) {
    // Просмотр мероприятия
    $control = new EventsController();
    $response = $control->show_action($_REQUEST['show']);
} else {
    // Страница не существует
    $control = new EventsController();