Ejemplo n.º 1
0
<?php

session_start();
require_once __DIR__ . '/autoload.php';
$users_controller = new UsersController();
if (!$users_controller->isAuthUser()) {
    if (!$users_controller->isNotAuthUser()) {
        $_SESSION['outh'] = false;
    } else {
        $_SESSION['outh'] = true;
    }
}
$ads_controller = new AdvertsController();
if (!isset($_GET['ads_id'])) {
    $items = $ads_controller->actionAll();
    include __DIR__ . '/views/ads/allAds.php';
} else {
    $item = $ads_controller->actionOne();
    include __DIR__ . '/views/ads/oneAd.php';
    $id = $ads_controller->getUserId()->user_id;
    $data = $users_controller->nameAndPhone($id);
    include __DIR__ . '/views/ads/addInfo.php';
}