public static function addLocation($dataArray, $season_id) { for ($i = 0; $i < count($dataArray); $i++) { if ($dataArray[$i] != '') { $location_data = new location(); $location_data->season_id = $season_id; $location_data->location_name = $dataArray[$i]; $location_data->franchisee_id = Session::get('franchiseId'); $location_data->created_by = Session::get('userId'); $location_data->created_at = date("Y-m-d H:i:s"); $location_data->save(); } } }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show(Request $request) { $groups = group::lists('name', 'group_id'); $locations = location::orderBy('location_id')->lists('location', 'location_id'); //$locations = array_merge($locations, array('0', 'National')); $group_id = $request->input('group_id'); $location_id = $request->input('location_id'); if (!isset($group_id)) { $group_id = 1; } if (!isset($location_id)) { $location_id = 0; } /* $rankings = \DB::table('rankings') ->join('players', 'rankings.player_id', '=', 'players.player_id') ->join('groups', 'rankings.group_id', '=', 'groups.group_id') ->join('locations', 'rankings.location_id', '=', 'locations.location_id') ->where('ranking_date', '=', $latest_date) ->where('rankings.group_id', '=', $group_id) ->where('rankings.location_id', '=', $location_id) ->distinct() ->get(); */ $ranking = new Ranking(); $rankings = $ranking->getlatestRankings($group_id, $location_id); return view('pages/rankings', compact('rankings', 'groups', 'locations')); }
public function locations_precontroller($paramName = null, $paramValue = null) { $location = new location(); $result = null; switch ($paramName) { case self::ID: try { $result = json_encode($location->updateLocation(Input::post('locationid'), Input::post('name'), Input::post('polygon'))); } catch (InputIOException $e) { $location->getLocationByID($paramValue); $result = $location->json(); } break; case null: try { $result = json_encode($location->insertNewLocation(Input::post('name'), Input::post('polygon'))); } catch (InputIOException $e) { $result = json_encode($location->getAllLocations()); } break; default: header('HTTP/1.1 400 Bad API Request'); } $this->jsonPrecontroller(); echo $result; }
/** * testLocationClass' method. * This method test that location's constructor, the set and get method are working fine. */ public function testLocationClass() { $olapic_id = "X5000GXB"; $olapic_latitude = "-31.4256195"; $olapic_longitude = "-64.1876011"; $olapic_name = "Olapic Argentina S.A"; $olapic_address = "Santiago Derqui 33, Córdoba, Argentina"; $olapic_map = "http://maps.googleapis.com/maps/api/staticmap?center=-31.4256195%20-64.1876011&zoom=15&scale=false&size=640x480&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:0xff3900%7Clabel:A%7C-31.4256195%20-64.1876011"; $olapic_location = new location(null, $olapic_latitude, $olapic_longitude, $olapic_name, $olapic_address, $olapic_map); $olapic_location->__set("id", $olapic_id); $this->assertEquals($olapic_id, $olapic_location->__get("id")); $this->assertEquals($olapic_latitude, $olapic_location->__get("latitude")); $this->assertEquals($olapic_longitude, $olapic_location->__get("longitude")); $this->assertEquals($olapic_name, $olapic_location->__get("name")); $this->assertEquals($olapic_address, $olapic_location->__get("address")); $this->assertEquals($olapic_map, $olapic_location->__get("image")); }
if (heyu_running()) { $dirname = dirname(__FILE__); require_once $dirname . DIRECTORY_SEPARATOR . 'include_globals.php'; ## Load mod group types if ($config['themeview'] == 'typed') { $modgrouptypes =& $_SESSION['frontObj']->getTypedGroups()->getVisibleGroups(); } else { $modgrouptypes =& $_SESSION['frontObj']->getGroups()->getVisibleGroups(); } $tpl->set('groups', $modgrouptypes); if (!isset($_SESSION['configChecked']) || !$_SESSION['configChecked']) { header("Location: utility/setupverify.php?from=index"); exit; } require_once CLASS_FILE_LOCATION . 'location.class.php'; $locations = new location($heyuconf); // if any action set, act on it if (isset($_GET['action'])) { try { $theState = ''; $theCurr = ''; $theReq = ''; if (isset($_GET["state"])) { $theState = $_GET["state"]; } if (isset($_GET["curr"])) { $theCurr = $_GET["curr"]; } if (isset($_GET["req"])) { $theReq = $_GET["req"]; }
unset($titles); $title1 = ''; $title2 = ''; $title3 = ''; $title4 = ''; $title = $currentPlace->title; $titles[] = $title; $lng = ''; $lat = ''; if ($data[11] != '') { $lat = (double) $data[11]; } if ($data[12] != '') { $lng = (double) $data[12]; } $location = new location(); $location->set($lat, $lng); if (strpos($title, '-') !== FALSE) { $title1 = str_replace('-', ' ', $title); $titles[] = $title1; if (strpos($title1, 'Saint') !== FALSE) { $title2 = str_replace('Saint', 'St', $title1); $titles[] = $title2; //echo strpos($title,'Saint'); } } if (strpos($title, 'Saint') !== FALSE) { $title3 = str_replace('Saint', 'St', $title); $titles[] = $title3; if (strpos($title3, '-') !== FALSE) { $title4 = str_replace('-', ' ', $title3);
/** * Gets the scenes by location in the floorplan * @url GET /scenesloc/$label/$visible * @url GET /scenesloc/$label * @url GET /scenesloc */ public function getScenesByLocation($label = null, $visible = "false") { ## error_log("Enter getAliasesByLocation"); require_once '.' . DIRECTORY_SEPARATOR . 'apiinclude.php'; require_once '.' . DIRECTORY_SEPARATOR . 'include_globals.php'; $theLocation = new location($heyuconf); if ($label == null) { $label = "unknown"; } $passVisible = false; if ($visible == "true") { $passVisible = true; } return array($label => $theLocation->getAliasesByLocation($label, $this->myLogin->getUser(), true, $passVisible, false, true)); }
public function selectbannerlocation($agent_id, $country_id) { $bannerlocation = location::join('banners', 'location_id', '=', 'id')->where('banners.agent_id', '=', $agent_id)->where('country_id', '=', $country_id)->orderby('banners.banner_id', 'Desc')->get(array('banners.banner_id', 'banners.image', 'banners.location_id', 'banners.position', DB::raw('CONCAT(name, " ", country) loc_name'))); return $bannerlocation; }
echo $form->labelEx($model, 'email'); ?> <?php echo $form->textField($model, 'email', array('size' => 35, 'maxlength' => 35)); ?> <?php echo $form->error($model, 'email'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'fk_location'); ?> <?php echo $form->dropDownList($model, 'fk_location', CHtml::listData(location::model()->findAll(array('order' => 'name ASC')), 'id', 'name'), array('prompt' => 'Select Location')); ?> <?php echo $form->error($model, 'fk_location'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'payrollNo'); ?> <?php echo $form->textField($model, 'payrollNo', array('size' => 15, 'maxlength' => 15)); ?> <?php echo $form->error($model, 'payrollNo');
<?php error_reporting(E_ALL & ~E_NOTICE); error_reporting(0); ob_start(); header("Access-Control-Allow-Origin: *"); header('Content-Type: application/json'); include_once "core/location.php"; $loc = new location(); try { if (!isset($_GET['type']) || empty($_GET['type'])) { throw new exception("g"); } $type = $_GET['type']; if ($type == 'getCoordenadas') { $idMunicipio = $_GET['idMunicipio']; $data = $loc->getCoordenadas($idMunicipio); } if ($type == 'getInstituciones') { $municipio = $_GET['municipio']; $data = $loc->getInstituciones($municipio); } if ($type == 'getMunicipios') { $proId = $_GET['proId']; $data = $loc->getMunicipios($proId); } if ($type == 'getMunicipiosAll') { $data = $loc->getMunicipiosAll(); } if ($type == 'getProvincias') { $data = $loc->getProvincias();