예제 #1
0
 public function viewNoResult()
 {
     // Filtering
     $filter_excursion = Tour::get();
     $filter_cities = City::get();
     return array('filter_excursion' => $filter_excursion, 'filter_cities' => $filter_cities);
 }
예제 #2
0
 public function indexCity()
 {
     $cities = City::get();
     $this->layout->tab_id = 3;
     $this->layout->sidebar = View::make('admin.manage.sidebar', ["page_id" => 1]);
     $this->layout->main = View::make('admin.manage.cities.list', ["cities" => $cities]);
 }
예제 #3
0
 public function generate()
 {
     date_default_timezone_set('Europe/London');
     $this->cities = City::get('cities.txt');
     $this->create_image();
     $this->create_background();
     $this->create_text();
 }
예제 #4
0
 public function privacyAndPolicy()
 {
     if (Session::has('st_date')) {
         $st_date = Session::get('st_date');
     } else {
         $st_date = date("Y/m/d");
     }
     //Session::flush();
     if (Session::has('ed_date')) {
         $ed_date = Session::get('ed_date');
     } else {
         $ed_date = date("Y/m/d", strtotime($st_date . ' + 2 days'));
     }
     $filter_tours = Tour::get();
     $filter_cities = City::get();
     $path = array();
     //        dd(DB::getQueryLog());
     return View::make('pages.privacy_policy')->with(array('path' => $path, 'st_date' => $st_date, 'ed_date' => $ed_date, 'filter_tours' => $filter_tours, 'filter_cities' => $filter_cities));
 }
예제 #5
0
 function insertCity(City $city)
 {
     return $this->bd->insert($this->tabla, $city->get());
 }
예제 #6
0
start("Select all");
repeat(20, function () {
    City::all();
});
finish();
// ----------------------------------------------
$cities = City::all();
start("Select each by ID");
foreach ($cities as $city) {
    City::get($city->id);
}
finish();
// ----------------------------------------------
start("Select each by name");
foreach ($cities as $city) {
    City::get($city->id);
}
finish();
// ----------------------------------------------z
start("Update all");
repeat(20, function () {
    City::objects()->update(['population' => 1]);
});
finish();
// ----------------------------------------------z
$cities = City::all();
start("Update each (update)");
foreach ($cities as $city) {
    $city->population += 1;
    $city->update();
}
예제 #7
0
    $request = \Slim\Slim::getInstance()->request();
    $user = json_decode($request->getBody());
    $userDAO = new User();
    $userDAO->update($user);
    echo '{"result":"ok"}';
});
$app->delete('/user', function () {
    $request = \Slim\Slim::getInstance()->request();
    $user = json_decode($request->getBody());
    $userDAO = new User();
    $userDAO->delete($user);
    echo '{"result":"ok"}';
});
$app->get('/city', function () {
    $cityDAO = new City();
    $result = $cityDAO->get();
    echo json_encode($result);
});
$app->post('/city', function () {
    $request = \Slim\Slim::getInstance()->request();
    $city = json_decode($request->getBody());
    $cityDAO = new City();
    $cityDAO->insert($city);
    echo '{"result":"ok"}';
});
$app->put('/city', function () {
    $request = \Slim\Slim::getInstance()->request();
    $city = json_decode($request->getBody());
    $cityDAO = new City();
    $cityDAO->update($city);
    echo '{"result":"ok"}';