$long = decodeInput($_REQUEST['long']); if (!is_numeric($lat) || !is_numeric($long)) { redirectIndex(); } else { $location = $lat . "," . $long; $category = new Category(); $category->setSubCategory("custom"); $poi->init($name, "Nepal", $location, $category, "NA", "NA", "NA", "", new User()); } } else { redirectIndex(); } } else { if ($prefix == "p") { if (is_numeric($postfix)) { $poiController = new PoiController(); $poi = $poiController->find($postfix); if ($poi) { } else { redirectIndex(); } } else { redirectIndex(); } } } } else { redirectIndex(); } } } else {
<?php /** * Created by Yogesh on 12/2/2015. * */ session_start(); require_once "../config/Route.php"; require_once "../model/UsersController.php"; require_once "../model/PoiController.php"; if (array_key_exists('userId', $_SESSION)) { $poiController = new PoiController(); $userController = new UsersController(); $userId = $_SESSION['userId']; $user = $userController->find($userId); if ($user) { if (array_key_exists('post', $_GET)) { $id = test_input($_GET['post']); $poi = $poiController->find($id); if ($poi) { $poiController->delete($id); Route::redirect($_SERVER['HTTP_REFERER']); //Route::getBackend("locations/"); } else { Route::get404Error(); } } else { Route::get404Error(); } } else { Route::get404Error();
require_once "../../config/Route.php"; require_once "../../model/MetaController.php"; require_once "../../model/PoiController.php"; require_once "../../model/objects/POI.php"; require_once "../../model/objects/User.php"; require_once "../../model/UsersController.php"; require_once "Helpers.php"; header('Content-Type: text/event-stream'); // recommended to prevent caching of event data. header('Cache-Control: no-cache'); $userController = new UsersController(); $userId = $_SESSION['userId']; $user = $userController->find($userId); if ($user->getPrevilege() == 1) { $metaController = new MetaController(); $poiController = new PoiController(); //get the last date of creation of search file $lastCreation = $metaController->getSearchMetaRecent(); $lastCreationDate = "2014-01-01"; if ($lastCreation) { $lastCreationDate = $lastCreation['date']; } $poiList = $poiController->getByDate($lastCreationDate); if ($poiList) { $totalPois = count($poiList); //create the file name and the url for the route $path = "../../assets/files/search/"; $filename = "sdf_" . date('Ymd') . ".txt"; $completePath = $path . $filename; $url = Route::getAdminDirectory() . "assets/files/search/" . $filename; $outputFile = fopen($completePath, "w");
*/ include_once "../model/objects/POI.php"; include_once "../model/CategoryController.php"; include_once "../model/PoiController.php"; include_once "../model/ContributionController.php"; include_once "../model/UsersController.php"; $userId = $_SESSION['userId']; if ($_SERVER['REQUEST_METHOD'] == 'POST' || $_SERVER['REQUEST_METHOD'] == 'post') { /* get all the post data from */ $id = decodeInput($_POST['id']); $poiName = decodeInput($_POST['poiName']); $poiAddress = decodeInput($_POST['poiAddress']); $poiCategory = decodeInput($_POST['poiCategory']); $poiPhone = decodeInput($_POST['poiPhone']); $poiEmail = decodeInput($_POST['poiEmail']); $poiWebsite = decodeInput($_POST['poiWebsite']); $poiLatitude = decodeInput($_POST['poiLat']); $poiLongitude = decodeInput($_POST['poiLong']); $poiPosition = $poiLatitude . "," . $poiLongitude; $poiContribution = decodeInput($_POST['poiContribution']); $userController = new UsersController(); $poiController = new PoiController(); $categoryController = new CategoryController(); $contributionController = new ContributionController(); /* since we are letting the validation of the data on the client side, we will skip the validation here and just go on with insertion */ /* so first create the poi object, also the required objects to initialize the poi */ $poi = new POI(); $poi->initWithId($id, $poiName, $poiAddress, $poiPosition, $categoryController->find($poiCategory), $poiPhone, $poiEmail, $poiWebsite, "", "", new Contribution(), $userController->find($user->getId())); $poiController->update($poi); }
include_once "../model/UsersController.php"; $userId = $_SESSION['userId']; if ($_SERVER['REQUEST_METHOD'] == 'POST' || $_SERVER['REQUEST_METHOD'] == 'post') { /* get all the post data from */ $poiName = decodeInput($_POST['poiName']); $poiAddress = decodeInput($_POST['poiAddress']); $poiCategory = decodeInput($_POST['poiCategory']); $poiPhone = decodeInput($_POST['poiPhone']); $poiEmail = decodeInput($_POST['poiEmail']); $poiWebsite = decodeInput($_POST['poiWebsite']); $poiLatitude = decodeInput($_POST['poiLat']); $poiLongitude = decodeInput($_POST['poiLong']); $poiPosition = $poiLatitude . "," . $poiLongitude; $poiContribution = decodeInput($_POST['poiContribution']); $userController = new UsersController(); $poiController = new PoiController(); $categoryController = new CategoryController(); $contributionController = new ContributionController(); /* since we are letting the validation of the data on the client side, we will skip the validation here and just go on with insertion */ /* so first create the poi object, also the required objects to initialize the poi */ $poi = new POI(); $poi->init($poiName, $poiAddress, $poiPosition, $categoryController->find($poiCategory), $poiPhone, $poiEmail, $poiWebsite, "", $userController->find($user->getId())); if ($poiContribution != 0) { if (is_numeric($poiContribution)) { if ($contribution = $contributionController->find($poiContribution)) { $poi->setContribution($contribution); } } } $poiController->add($poi);
<?php include "../header.php"; require_once "../model/objects/Category.php"; require_once "../model/objects/ParentCategory.php"; require_once "../model/CategoryController.php"; require_once "../model/ParentCategoryController.php"; require_once "../model/PoiController.php"; $poiController = new PoiController(); $categoryController = new CategoryController(); $parentController = new ParentCategoryController(); ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Categories </h1> </section> <style type="text/css"> .form-box{ padding: 15px 30px; } .form-box label { font-weight: unset !important; } </style> <!-- Main content --> <section class="content">
<?php include "../header.php"; include_once "../model/PoiController.php"; include_once "../model/UsersController.php"; require_once "../model/CategoryController.php"; include_once "../model/objects/User.php"; include_once "../model/objects/POI.php"; $categoryController = new CategoryController(); $poiController = new PoiController(); $filterCatId = 0; $searchKey = ""; if (array_key_exists("category", $_REQUEST)) { if (is_numeric(decodeInput($_REQUEST['category']))) { $filterCatId = decodeInput($_REQUEST['category']); } } if (array_key_exists("search", $_REQUEST)) { $searchKey = decodeInput($_REQUEST['search']); } // by default we show first page $rowsPerPage = 100; $pageNum = 1; $offset = 0; if (isset($_GET['page'])) { $pageNum = $_GET['page']; $offset = ($pageNum - 1) * $rowsPerPage; } ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper">
<?php include "../header.php"; require_once "../model/MetaController.php"; require_once "../model/PoiController.php"; if ($user->getPrevilege() == 1) { $metaController = new MetaController(); $poiController = new PoiController(); ?> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Services </h1> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-xs-12"> <div style="display: none;"> <i>Extract data from json file into database. This should be carried out only during the initialization of the database.</i> <br> <div id="startInitializarion" style="display: none;"> <br> <i class="fa fa-refresh fa-spin" id="spinner"></i> <i><b id="progressText">0</b> pois found.</i> <br> <br>
<?php include "../header.php"; require_once "../model/WebHitController.php"; require_once "../model/PoiController.php"; $poiController = new PoiController(); $webHitController = new WebHitController(); ?> <link rel="stylesheet" href="<?php echo Route::getStyleSheetDirectory(); ?> plugins/morris/morris.css"> <style type="text/css"> .nav.nav-pills.nav-stacked > li { padding: 5px 15px; } </style> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Webpage Statistics </h1> </section> <section class="content"> <div class="row"> <div class="col-xs-6"> <i>Total unique Landing Page hits. (<b><?php echo $webHitController->countHits(PAGE_ID::LANDING_PAGE);
<?php include "../header.php"; include_once "../model/PoiController.php"; require_once "../model/CategoryController.php"; include_once "../model/objects/POI.php"; include "../controller/location/EditController.php"; $poiController = new PoiController(); $categoryController = new CategoryController(); if (isset($_REQUEST['post'])) { $postID = $_REQUEST['post']; if (is_numeric($postID)) { //TODO: filter and validate the get data before inserting into the query. if ($currentPoi = $poiController->find($postID)) { ?> <script type="text/javascript" src="<?php echo Route::getStyleSheetDirectory(); ?> js/validator.js"></script> <script type="text/javascript" src='http://maps.google.com/maps/api/js?sensor=false&libraries=places'></script> <script type="text/javascript" src="<?php echo Route::getStyleSheetDirectory(); ?> js/locationpicker.jquery.js"></script> <div class="content-wrapper"> <section class="content-header"> <h1> Edit location <a class="btn btn-default" href="<?php echo Route::getAdminDirectory() . "locations/delete.php?post=" . $postID;
require_once "../../config/Route.php"; require_once "../../model/MetaController.php"; require_once "../../model/PoiController.php"; require_once "../../model/objects/POI.php"; require_once "../../model/objects/User.php"; require_once "../../model/UsersController.php"; require_once "Helpers.php"; header('Content-Type: text/event-stream'); // recommended to prevent caching of event data. header('Cache-Control: no-cache'); $userController = new UsersController(); $userId = $_SESSION['userId']; $user = $userController->find($userId); if ($user->getPrevilege() == 1) { $metaController = new MetaController(); $poiController = new PoiController(); //get the last date of creation of search file $lastCreation = $metaController->getSearchMetaRecent(); $lastCreationDate = "2014-01-01"; if ($lastCreation) { $lastCreationDate = $lastCreation['date']; } $totalPois = $poiController->countByDate($lastCreationDate); if ($totalPois > 0) { //create the file name and the url for the route $path = "../../assets/files/search/"; $filename = "sdf_" . date('Ymd') . ".txt"; $completePath = $path . $filename; $url = Route::getAdminDirectory() . "assets/files/search/" . $filename; $outputFile = fopen($completePath, "w"); if ($outputFile) {
<?php include "../header.php"; require_once "../model/MetaController.php"; require_once "../model/PoiController.php"; if ($user->getPrevilege() == 1) { $metaController = new MetaController(); $poiController = new PoiController(); /*get the latest creation date of the search data file */ $lastCreation = $metaController->getSearchMetaRecent(); $lastCreationDate = "2014-01-01"; if ($lastCreation) { $lastCreationDate = $lastCreation['date']; } $poiCount = $poiController->countByDate($lastCreationDate); ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Prepare search data file </h1> </section> <!-- Main content --> <section class="content"> <div class="row"> <button class="btn btn-success" onclick="startTask()" id="startButton">Start</button> <div class="col-xs-12" id="contentDiv" style="display: none;"> <hr>