<?php /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_user.php'; include_once 'class/model_tracker.php'; $objTracker = new Model_Tracker($objConnection); $objUser = new Model_User($objConnection); global_common::cors(); $request_body = file_get_contents("php://input"); //echo $request_body; if ($request_body && global_common::isJson($request_body)) { $_pgR = json_decode($request_body, true); } if ($_pgR["act"] == Model_Tracker::ACT_ADD) { $userName = $_pgR[global_mapping::UserName]; $user = $objUser->getUserByName($userName); $trackType = $_pgR[global_mapping::TrackType]; $value = $_pgR["Value"]; $description = $_pgR["Description"]; $trackerID = $objTracker->insert($user[global_mapping::UserID], $trackType, $value, $description); echo json_encode($trackerID); } else { if ($_pgR["act"] == Model_Tracker::ACT_GET_USER) { $userName = $_pgR[global_mapping::UserName]; $user = $objUser->getUserByName($userName); $storeID = $_pgR[global_mapping::StoreID]; $tracker = $objTracker->getTrackerUser($user[global_mapping::UserID], $storeID); echo json_encode($tracker); } else { if ($_pgR["act"] == 15) {
include_once 'class/model_store.php'; include_once 'class/model_user.php'; include_once 'class/model_articletype.php'; include_once 'class/model_storecategory.php'; include_once 'class/model_city.php'; include_once 'class/model_article.php'; include_once 'class/model_user.php'; include_once 'class/model_district.php'; include_once 'class/model_tracker.php'; $objArticleType = new Model_ArticleType($objConnection); $objCity = new Model_City($objConnection); $objUser = new Model_User($objConnection); $objDistrict = new Model_District($objConnection); $objStore = new Model_Store($objConnection); $objStoreCategory = new Model_Storecategory($objConnection); $objTracker = new Model_Tracker($objConnection); global_common::cors(); //print_r($allStores); //return; //header('Access-Control-Allow-Origin: *'); //header('Access-Control-Allow-Methods: GET, POST'); //header('Content-Type: application/json'); $request_body = file_get_contents("php://input"); //echo $request_body; if ($request_body && global_common::isJson($request_body)) { $_pgR = json_decode($request_body, true); } if ($_pgR["act"] == 1) { //echo $_gmapAPI; $address = $_pgR["keyword"]; $distance = $_pgR["distance"];