/**
  * @todo Search city by name
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function ajaxSearchLocation(Request $request)
 {
     //Only accept ajax request
     if ($request->ajax()) {
         $city_name = $request->get('location_keyword');
         $results = locations(trim($city_name));
         return pong(1, ['data' => $results]);
     }
 }
예제 #2
0
<?php

// locations.php
// allows the user to add a new site
if (!isset($inIndex) || !$inIndex) {
    include "../../redirect.php";
} elseif (!$loggedUser) {
    throw new Exception(LangException002);
} else {
    locations();
}
function locations()
{
    global $baseURL, $loggedUser, $loggedUserName, $sites, $objLocation, $objObserver, $objPresentations, $objUtil;
    $sort = $objUtil->checkRequestKey('sort', 'name');
    $sites = $objLocation->getSortedLocations($sort, $loggedUser);
    echo "<div id=\"main\">";
    echo "<h4>" . LangOverviewSiteTitle . " " . $loggedUserName . "</h4>";
    echo "<hr />";
    echo "<form role=\"form\" action=\"" . $baseURL . "index.php\" method=\"post\"><div>";
    echo "<input type=\"hidden\" name=\"indexAction\" value=\"add_location\" />";
    echo "<input type=\"submit\" class=\"btn btn-success pull-right tour4\" name=\"add\" value=\"" . LangAddSiteButton . "\" />&nbsp;";
    echo "</form>";
    $objLocation->showLocationsObserver();
    echo "<br /><br />";
    echo "</div></form>";
    echo "</div>";
}
예제 #3
0
파일: univ.php 프로젝트: hellopsm/robot
 function province($id)
 {
     $locations = locations();
     foreach ($locations['province'] as $province) {
         if ($province['id'] == $id) {
             return $province['name'];
         }
     }
     return null;
 }
예제 #4
0
파일: ILocation.php 프로젝트: newset/robot
 public function province_and_city()
 {
     return ss(locations());
 }