示例#1
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$lat = 0;
if (!empty($_GET['lat'])) {
    $lat = $_GET['lat'];
}
$lon = 0;
if (!empty($_GET['lon'])) {
    $lon = $_GET['lon'];
}
$radius = 0;
if (!empty($_GET['radius'])) {
    $radius = $_GET['radius'];
}
$category_id = 0;
if (!empty($_GET['category_id'])) {
    $category_id = $_GET['category_id'];
}
$api_key = "";
if (!empty($_GET['api_key'])) {
    $api_key = $_GET['api_key'];
}
if ($lat != 0 && $lon != 0 && $radius > 0 && Constants::API_KEY == $api_key && $category_id > 0) {
    $results = $controllerRest->getResultCategoryDeals($radius, $lat, $lon, $category_id);
    $no_of_rows = $results->rowCount();
    $arrayJSON = array();
    $arrayJSON['result_count'] = "" . $no_of_rows . "";
    $ind = 0;
    $arrayObs = array();
示例#2
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$resultNews = $controllerRest->getResultNews();
$resultCategories = $controllerRest->getResultCategories();
$resultStores = $controllerRest->getResultStores();
header("content-type: text/json");
// header("Content-Type: application/text; charset=ISO-8859-1");
echo "{";
// NEWS
echo "\"news\" : [";
$no_of_rows = $resultNews->rowCount();
$ind = 0;
$count = $resultNews->columnCount();
foreach ($resultNews as $row) {
    echo "{";
    $inner_ind = 0;
    foreach ($row as $columnName => $field) {
        $val = trim(strip_tags($field));
        if ($columnName == "news_content") {
            $val1 = preg_replace('~[\\r\\n]+~', '', $val);
            $val = htmlspecialchars(trim(strip_tags($val1)));
        }
        if (!is_numeric($columnName)) {
            echo "\"{$columnName}\" : \"{$val}\"";
            if ($inner_ind < $count - 1) {
                echo ",";
            }
            ++$inner_ind;
        }
示例#3
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$resultCategories = $controllerRest->getResultCategories();
header("content-type: text/json");
header("Content-Type: application/text; charset=ISO-8859-1");
echo "{";
// CATEGORIES
echo "\"categories\" : [";
$no_of_rows = $resultCategories->rowCount();
$ind = 0;
$count = $resultCategories->columnCount();
foreach ($resultCategories as $row) {
    echo "{";
    $inner_ind = 0;
    foreach ($row as $columnName => $field) {
        $val = trim(strip_tags($field));
        if (!is_numeric($columnName)) {
            echo "\"{$columnName}\" : \"{$val}\"";
            if ($inner_ind < $count - 1) {
                echo ",";
            }
            ++$inner_ind;
        }
    }
    if ($count > $inner_ind) {
        echo "\"slug\" : \"slug\"";
    }
    echo "}";
    if ($ind < $no_of_rows - 1) {
示例#4
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$resultTicket = $controllerRest->getResultTicket();
header("content-type: text/json");
// header("Content-Type: application/text; charset=ISO-8859-1");
echo "{";
// TICKET
echo "\"ticket\" : [";
$no_of_rows = $resultTicket->rowCount();
$ind = 0;
$count = $resultTicket->columnCount();
foreach ($resultTicket as $row) {
    echo "{";
    $inner_ind = 0;
    foreach ($row as $columnName => $field) {
        $val = trim(strip_tags($field));
        if (!is_numeric($columnName)) {
            echo "\"{$columnName}\" : \"{$val}\"";
            if ($inner_ind < $count - 1) {
                echo ",";
            }
            ++$inner_ind;
        }
    }
    if ($count > $inner_ind) {
        echo "\"slug\" : \"slug\"";
    }
    echo "}";
    if ($ind < $no_of_rows - 1) {
 function __construct()
 {
     parent::__construct();
     $this->subscriptionDao = new SubscriptionDAO();
 }
示例#6
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$controllerUser = new ControllerUser();
if (empty($_GET['store_id'])) {
    $json = "{ \"status\" : { \"status_code\" : \"3\", \"status_text\" : \"Invalid Access.\" } }";
    echo $json;
} else {
    $store_id = $_GET['store_id'];
    $count = $_GET['count'];
    $resultReviews = $controllerRest->getResultReviewsCount($count, $store_id);
    // header ("content-type: text/json");
    // header("Content-Type: application/text; charset=ISO-8859-1");
    echo "{";
    $no_of_rows = $resultReviews->rowCount();
    $total_row_count = $controllerRest->getResultReviewsTotalCount($store_id);
    $json = " \"request_count\" : \"{$count}\", \"return_count\" : \"{$no_of_rows}\", \"total_row_count\" : \"{$total_row_count}\", ";
    echo $json;
    // REVIEWS
    echo "\"reviews\" : [";
    $ind = 0;
    $count = $resultReviews->columnCount();
    foreach ($resultReviews as $row) {
        echo "{";
        $inner_ind = 0;
        foreach ($row as $columnName => $field) {
            $val = trim(strip_tags($field));
            if ($columnName == "review") {
                $val1 = preg_replace('~[\\r\\n]+~', '', $val);
                $val = htmlspecialchars(trim(strip_tags($val1)));
示例#7
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$lat = 0;
if (!empty($_GET['lat'])) {
    $lat = $_GET['lat'];
}
$lon = 0;
if (!empty($_GET['lon'])) {
    $lon = $_GET['lon'];
}
$radius = 0;
if (!empty($_GET['radius'])) {
    $radius = $_GET['radius'];
}
$api_key = "";
if (!empty($_GET['api_key'])) {
    $api_key = $_GET['api_key'];
}
if ($lat != 0 && $lon != 0 && $radius > 0 && Constants::API_KEY == $api_key) {
    $results = $controllerRest->getResultFeaturedDeals($radius, $lat, $lon);
    $no_of_rows = $results->rowCount();
    $arrayJSON = array();
    $arrayJSON['result_count'] = "" . $no_of_rows . "";
    $ind = 0;
    $arrayObs = array();
    foreach ($results as $row) {
        $arrayObj = array();
        foreach ($row as $columnName => $field) {
            if (!is_numeric($columnName)) {
 function __construct()
 {
     parent::__construct();
     $this->languageDao = new LanguageDAO();
 }
 function __construct()
 {
     parent::__construct();
     $this->userRoleDao = new UserRoleDAO();
 }
示例#10
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$resultPhoto = $controllerRest->getPhotosResult();
$resultAgents = $controllerRest->getAgentsResult();
$resultRealEstates = $controllerRest->getRealEstateResult();
$resultPropertyType = $controllerRest->getPropertyTypeResult();
header("content-type: text/xml");
// header("Content-Type: application/xml; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<data>";
// PHOTOS
echo "<photos>";
foreach ($resultPhoto as $row) {
    echo "<item>";
    foreach ($row as $columnName => $field) {
        $val = trim(strip_tags($field));
        if (!is_numeric($columnName)) {
            echo "<{$columnName}>{$val}</{$columnName}>";
        }
    }
    echo "</item>";
}
echo "</photos>";
// AGENTS
echo "<agents>";
foreach ($resultAgents as $row) {
    echo "<item>";
    foreach ($row as $columnName => $field) {
        $val = trim(strip_tags($field));
示例#11
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$controllerUser = new ControllerUser();
$controllerRating = new ControllerRating();
$user_id = 0;
if (!empty($_POST['user_id'])) {
    $user_id = $_POST['user_id'];
}
$store_id = 0;
if (!empty($_POST['store_id'])) {
    $store_id = $_POST['store_id'];
}
$login_hash = 0;
if (!empty($_POST['login_hash'])) {
    $login_hash = $_POST['login_hash'];
}
$rating = 0;
if (!empty($_POST['rating'])) {
    $rating = $_POST['rating'];
}
if (!empty($user_id) && !empty($store_id) && !empty($login_hash) && !empty($rating)) {
    if (!$controllerUser->isUserIdExistAndHash($user_id, $login_hash)) {
        $json = "{ \"status\" : { \"status_code\" : \"3\", \"status_text\" : \"Invalid Access\" } }";
        echo $json;
    } else {
        $itm = new Rating();
        $itm->rating = $rating;
        $itm->store_id = $store_id;
        $itm->user_id = $user_id;
示例#12
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$controllerUser = new ControllerUser();
$api_key = "";
if (!empty($_GET['api_key'])) {
    $api_key = $_GET['api_key'];
}
$lat = 0;
if (!empty($_GET['lat'])) {
    $lat = $_GET['lat'];
}
$lon = 0;
if (!empty($_GET['lon'])) {
    $lon = $_GET['lon'];
}
$user_id = 0;
if (!empty($_GET['user_id'])) {
    $user_id = $_GET['user_id'];
}
$login_hash = "";
if (!empty($_GET['login_hash'])) {
    $login_hash = $_GET['login_hash'];
}
if (Constants::API_KEY != $api_key) {
    $jsonArray = array();
    $jsonArray['status'] = array('status_code' => "3", 'status_text' => "Invalid Access. Please relogin.");
    echo json_encode($jsonArray);
} else {
    if ($lat != 0 && $lon != 0 && $user_id != 0) {
示例#13
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$controllerDeal = new ControllerDeal();
$controllerCategory = new ControllerCategory();
$controllerCatDealAssoc = new ControllerCatDealAssoc();
$controllerUser = new ControllerUser();
$categories = array();
if (!empty($_POST['category_ids'])) {
    $categories = explode(",", $_POST['category_ids']);
}
$deal_id = 0;
if (!empty($_POST['deal_id'])) {
    $deal_id = $_POST['deal_id'];
}
$desc = "";
if (!empty($_POST['desc'])) {
    $desc = $_POST['desc'];
}
$no_of_days_expire = "";
if (!empty($_POST['no_of_days_expire'])) {
    $no_of_days_expire = $_POST['no_of_days_expire'];
}
$photo_url = "";
if (!empty($_POST['photo_url'])) {
    $photo_url = $_POST['photo_url'];
}
$price = "";
if (!empty($_POST['price'])) {
    $price = $_POST['price'];
示例#14
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$lat = -1;
if (!empty($_POST['lat'])) {
    $lat = $_POST['lat'];
}
$lon = -1;
if (!empty($_POST['lon'])) {
    $lon = $_POST['lon'];
}
$radius = -1;
if (!empty($_POST['radius'])) {
    $radius = $_POST['radius'];
}
$api_key = "";
if (!empty($_POST['api_key'])) {
    $api_key = $_POST['api_key'];
}
$category_ids = "";
if (!empty($_POST['category_ids'])) {
    $category_ids = $_POST['category_ids'];
}
$keywords = "";
if (!empty($_POST['keywords'])) {
    $keywords = $_POST['keywords'];
}
if (Constants::API_KEY == $api_key) {
    $results = $controllerRest->getResultSearchDeals($radius, $lat, $lon, $keywords, $category_ids);
    $no_of_rows = $results->rowCount();
示例#15
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$controllerUser = new ControllerUser();
$controllerReview = new ControllerReview();
$user_id = 0;
if (!empty($_POST['user_id'])) {
    $user_id = $_POST['user_id'];
}
$store_id = 0;
if (!empty($_POST['store_id'])) {
    $store_id = $_POST['store_id'];
}
$login_hash = 0;
if (!empty($_POST['login_hash'])) {
    $login_hash = $_POST['login_hash'];
}
$review = "";
if (!empty($_POST['review'])) {
    $review = $_POST['review'];
}
if (!empty($user_id) && !empty($store_id) && !empty($login_hash) && !empty($review)) {
    if (!$controllerUser->isUserIdExistAndHash($user_id, $login_hash)) {
        $json = "{ \"status\" : { \"status_code\" : \"3\", \"status_text\" : \"Invalid Access\" } }";
        echo $json;
    } else {
        $itm = new Review();
        $itm->review = $review;
        $itm->store_id = $store_id;
        $itm->user_id = $user_id;
示例#16
0
<?php

require '../header_rest.php';
$controllerRest = new ControllerRest();
$resultPhotos = $controllerRest->getResultPhotos();
$resultCategories = $controllerRest->getResultCategories();
$resultStores = $controllerRest->getResultStores();
header("content-type: text/json");
// header("Content-Type: application/text; charset=ISO-8859-1");
echo "{";
// PHOTOS
echo "\"photos\" : [";
$no_of_rows = $resultPhotos->rowCount();
$ind = 0;
$count = $resultPhotos->columnCount();
foreach ($resultPhotos as $row) {
    echo "{";
    $inner_ind = 0;
    foreach ($row as $columnName => $field) {
        $val = trim(strip_tags($field));
        if (!is_numeric($columnName)) {
            echo "\"{$columnName}\" : \"{$val}\"";
            if ($inner_ind < $count - 1) {
                echo ",";
            }
            ++$inner_ind;
        }
    }
    if ($count > $inner_ind) {
        echo "\"slug\" : \"slug\"";
    }