function addReservation()
{
    $reservation = new Reservations();
    $Sessions = new Sessions();
    $reservation->setValues($_REQUEST);
    $reservation->setReservationClientId($Sessions->getClientId());
    if ($Sessions->clientIsLogged()) {
        $id = $reservation->newReservations();
        if ($id != 0) {
            Common::jsonSuccess(array("id" => $id));
        } else {
            Common::jsonError("Error");
        }
    } else {
        $Sessions->setReservationsDetails($_REQUEST);
        Common::jsonError(array("login" => 500));
    }
}
示例#2
0
        if ($admin->password() == md5($password)) {
            $session = new Sessions();
            $session->setAdminLoginSessions($admin->id(), $admin->name(), $admin->email());
            Common::jsonSuccess("Success");
        } else {
            Common::jsonError("Login Error");
        }
    } else {
        Common::jsonError("Login Error");
    }
}
if ($_REQUEST['queryString']) {
    if ($_REQUEST['queryString'] == 'checklogin') {
        if (Sessions::memberIsLogged()) {
            echo 1;
        }
        if (Sessions::clientIsLogged()) {
            echo 1;
        }
        if (Sessions::hotelsIsLogged()) {
            echo 1;
        }
    } else {
        if ($_REQUEST['queryString'] == 'logoutFromAll') {
            Sessions::logoutMember();
            Sessions::logoutClient();
            Sessions::logoutHotels();
            echo 'redirect';
        }
    }
}