public function Tours()
 {
     $SliderImages = SliderImages::all();
     $tours = Tours::all();
     $country = Country::all();
     return View::make('tours.tours')->with('slider', $SliderImages)->with('tours', $tours)->with('country', $country);
 }
예제 #2
0
 public function personalinfo()
 {
     $driver = User::first(array('id = ?' => $this->user->id));
     if ($driver->cab_driver == 1) {
         $view = $this->getActionView();
         $states = State::all();
         $countries = Country::all();
         $driver = CabDriver::first(array('user_id = ?' => $this->user->id));
         $view->set('states', $states)->set('countries', $countries)->set('driver', $driver);
         if (RequestMethods::post('full_name')) {
             $driver->full_name = RequestMethods::post('full_name');
             $driver->contact = RequestMethods::post('contact');
             $driver->country = RequestMethods::post('country');
             $driver->state = RequestMethods::post('state');
             $driver->pincode = RequestMethods::post('pin');
             $driver->address = RequestMethods::post('address');
             $driver->pinfo_flag = '1';
             if ($driver->validate()) {
                 $driver->save();
                 header("Location: /driver/vehicleinfo");
             } else {
                 $view->set('error', "validation  not good");
             }
         }
     } else {
         header('/');
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //get all the countries
     $countries = Country::all();
     // load the view and pass the countries
     return View::make('countries.index')->with('countries', $countries);
 }
예제 #4
0
 public function Countries()
 {
     $h = new Country();
     echo json_encode($h->all($page = '', $perpage = ''));
     // or render View
     return TRUE;
 }
예제 #5
0
 /**
  * Display a listing of settings
  *
  * @return Response
  */
 public function getIndex()
 {
     $user = Auth::user()->id;
     // Grab user settings
     $setting = User::find($user)->setting;
     $countries = Country::all();
     return View::make('settings.index', compact('setting', 'countries'));
 }
 public function index()
 {
     // init
     $data = array('menu' => $this->_menu, 'title' => 'Negara', 'description' => '', 'breadcrumb' => array('Negara' => route('admin.country')));
     // Set countries
     $data['countries'] = Country::all();
     return View::make('admin.pages.country.index')->with($data);
 }
예제 #7
0
 public function getCountries($view)
 {
     $countries = Country::all();
     if (count($countries) > 0) {
         $options = array_combine($countries->lists('code'), $countries->lists('name'));
     } else {
         $options = array(null, 'No Countries');
     }
     $view->with('countries', $options);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // Se valida si llega u filtro para consultar, de lo contrario se retorna la lista completa.
     if (Input::get(Config::get('constants.QUERY'))) {
         $countriesList = Country::where('countryId', 'LIKE', '%' . Input::get(Config::get('constants.QUERY')) . '%')->orWhere('name', 'LIKE', '%' . Input::get(Config::get('constants.QUERY')) . '%')->get();
     } else {
         $countriesList = Country::all();
     }
     return $this->respondWithCollection($countriesList, new CountryTransformer());
 }
예제 #9
0
 public static function profile()
 {
     if (current_user_can('profile')) {
         $user_id = get_current_user_id();
         $usermeta = \UserMeta::where('user_id', $user_id)->first();
         $cities = self::idandname(\City::all(), "id", "name");
         $provinces = self::idandname(\Province::all(), "id", "name");
         $countries = self::idandname(\Country::all(), "id", "name");
         View::make("site/user/profile", compact('cities', 'provinces', 'countries', 'usermeta'));
         die;
     }
     wp_redirect("/login");
     exit;
 }
예제 #10
0
 public function postSelectPackage()
 {
     //verify the user input and create account
     $validator = Validator::make(Input::all(), array('Package' => 'required'));
     if ($validator->fails()) {
         return Redirect::route('advanced_squeeb-get')->withInput()->with('global', 'Please select a package.');
     } else {
         $package = Input::get('Package');
         View::share('package', $package);
         //check for the world package
         if ($package == 'pkg1') {
             $countries = Country::all();
             View::share('countries', $countries);
             $obj = new BaseController();
             $countryid = 0;
             $countryname = $obj->getCountryName();
             if ($countryname != 'NONE') {
                 $locationcountry = Country::where('name', '=', $countryname);
                 if ($locationcountry->count()) {
                     $countryid = $locationcountry->first()->id;
                     $colleges = Institution::where('country_id', '=', $countryid)->get();
                     View::share('colleges', $colleges);
                 }
             }
             View::share('countryid', $countryid);
             return View::make('guest.advancedselectcollege');
         } else {
             if ($package == 'pkg2') {
                 $countries = Country::all();
                 View::share('countries', $countries);
                 $obj = new BaseController();
                 $countryid = 0;
                 $countryname = $obj->getCountryName();
                 if ($countryname != 'NONE') {
                     $locationcountry = Country::where('name', '=', $countryname);
                     if ($locationcountry->count()) {
                         $countryid = $locationcountry->first()->id;
                     }
                 }
                 View::share('countryid', $countryid);
                 return View::make('guest.advancedpostcountry')->with('msg', 'Country Squeeb Package');
             }
         }
         if ($package == 'pkg3') {
             return View::make('guest.advancedpost')->with('msg', 'World Squeeb Package');
         }
     }
 }
예제 #11
0
 public function postSaveDocument($id_document)
 {
     $return = array('status' => 0, 'message' => 'System Error');
     if (Request::ajax()) {
         $id_document = (int) $id_document;
         $Document = Document::findOrFail($id_document);
         $Document->saveProducts(Input::get('products'));
         $Document->user_id = Auth::user()->id;
         if ($Document->save()) {
             $Countries = Country::all();
             $Products = $Document->AlreadyOffered();
             $ViewData = array('DocumentProducts' => $Products, 'Countries' => $Countries);
             $return = array('status' => 1, 'message' => 'Success!', 'ProductsBlock' => $ViewData);
         }
     }
     return Response::json($return);
 }
예제 #12
0
 public function myaccount()
 {
     $view = $this->getActionView();
     $states = State::all();
     $countries = Country::all();
     $view->set('states', $states)->set('countries', $countries);
     if (RequestMethods::post('update')) {
         $user = User::first(array('id = ?' => $this->user->id));
         $user->full_name = RequestMethods::post('full_name');
         $user->country = RequestMethods::post('country');
         $user->state = RequestMethods::post('state');
         $user->pincode = RequestMethods::post('pin');
         $user->address = RequestMethods::post('address');
         if ($user->validate) {
             $user->save();
         } else {
             echo "validation  not good";
         }
     }
 }
예제 #13
0
 /**
  * Display a list countries
  * POST /countrylist
  *
  * @return Response
  */
 public function countryList()
 {
     $arr = array();
     $countries = Country::all();
     $arr = array();
     if (count($countries) > 0) {
         $arr['Success'] = true;
         $arr['Status'] = 'OK';
         $arr['StatusCode'] = 200;
         $arr['Result'] = array();
         $i = 0;
         foreach ($countries as $country) {
             $arr['Result'][$i]['id'] = $country->country_id;
             $arr['Result'][$i]['name'] = ucfirst($country->name);
             $i++;
         }
     } else {
         $arr['Success'] = false;
         $arr['Status'] = 'Country not found';
         $arr['StatusCode'] = 404;
     }
     return Response::json($arr);
 }
예제 #14
0
 public function editar($id)
 {
     if (!$id) {
         $this->session->set_flashdata('msg', '<div class="notice">El alumno solicitado no existe.</div>');
         redirect('alumnos');
     } elseif ($_POST) {
         $this->load->helper('date');
         $this->load->library('Utils');
         $insert = $_POST;
         $insert['fecha_nacimiento'] = $this->utils->fecha_formato('%Y-%m-%d', $insert['fecha_nacimiento']);
         $insert['fecha_inscripcion'] = $this->utils->fecha_formato('%Y-%m-%d', $insert['fecha_inscripcion']);
         $alumno = Student::find($id);
         $alumno->update_attributes(elements(array('city_id', 'nombre', 'apellido', 'fecha_nacimiento', 'sexo', 'tipo_documento', 'nro_documento', 'domicilio', 'tenencia', 'nacionalidad', 'grupo_sanguineo', 'telefono', 'celular', 'obs_medicas', 'observaciones', 'colegio_procedencia', 'fecha_inscripcion'), $insert));
         if ($alumno->is_valid()) {
             if ($alumno->save()) {
                 $this->session->set_flashdata('msg', '<div class="success">El alumno se guardó correctamente.</div>');
                 redirect($this->agent->referrer());
             } else {
                 $this->session->set_flashdata('msg', '<div class="error">Hubo un error al guardar los datos.</div>');
                 redirect($this->agent->referrer());
             }
         } else {
             $data['errors'] = $alumno->errors;
         }
     } else {
         $data['a'] = Student::find($id);
     }
     $data['paises'] = Country::all();
     $data['provincias'] = State::all();
     $data['ciudades'] = City::all();
     $data['titulo'] = "Editar alumno";
     $data['action'] = "alumnos/editar/" . $id;
     $this->template->write_view('content', 'alumnos/agregar', $data);
     $this->template->render();
 }
예제 #15
0
<?php

use Intervention\Image\ImageManagerStatic as Image;
include __DIR__ . '/vendor/autoload.php';
$filesystem = new Illuminate\Filesystem\Filesystem();
$flags = $filesystem->files('input');
$countries = Country::all();
foreach ($flags as $flag) {
    $country = basename($flag, '.png');
    if (isset($countries[$country])) {
        $path = strtolower('output/' . $countries[$country] . '.png');
        $img = Image::make($flag);
        $img->resize(16, null, function ($constraint) {
            $constraint->aspectRatio();
        });
        $img->save($path);
    }
}
 public function pricesearch()
 {
     $index = SliderImages::all();
     $country = Country::all();
     $city = City::all();
     $gallery = Gallery::all();
     $startdatae_search = strtotime(Input::get('startdatae_search'));
     $startdatae_search = date('Y-m-d H:i:s', $startdatae_search);
     $enddate_search = strtotime(Input::get('enddate_search'));
     $enddate_search = date('Y-m-d H:i:s', $enddate_search);
     $country_search = Input::get('country_search');
     $price_search_start = Input::get('price_search_start');
     $price_search_end = Input::get('price_search_end');
     if ($enddate_search == '1970-01-01 00:00:00') {
         $enddate_search = '2038-01-19 00:00:00';
     }
     if (empty($price_search_start)) {
         $price_search_start = '0';
     }
     if (empty($price_search_end)) {
         $res = DB::select(DB::raw('select max(price) as max_price from tours'));
         foreach ($res as $value) {
             $price_search_end = (int) $value->max_price + 1;
         }
     }
     $tours = new Tours();
     if ($startdatae_search != '1970-01-01 00:00:00') {
         $tours = $tours->where('start_date', '>', $startdatae_search);
     }
     if ($enddate_search != '1970-01-01 00:00:00') {
         $tours = $tours->where('end_date', '<', $enddate_search);
     }
     $tours = $tours->where('country', '=', $country_search);
     if (!empty($price_search_start)) {
         $tours = $tours->where('price', '>', $price_search_start);
     }
     if (!empty($price_search_end)) {
         $tours = $tours->where('price', '<', $price_search_end);
     }
     $tours = $tours->get();
     return View::make('main.search')->with('tours', $tours)->with('country', $country)->with('gallery', $gallery)->with('slider', $index);
 }
 /**
  * Return all countries.
  *
  * @return mixed
  */
 public function all()
 {
     return Country::all();
 }
예제 #18
0
 public function getContact()
 {
     $data['countries'] = Country::all();
     $data['physician'] = User::find(Auth::user()->id)->physician;
     return View::make('website.provider.contact')->with($data);
 }
예제 #19
0
 public function editar($id)
 {
     if ($this->session->userdata('grupo') == 'admin' or $this->session->userdata('id') == $id) {
         if (!$id) {
             $this->session->set_flashdata('msg', '<div class="notice">El usuario solicitado no existe.</div>');
             redirect('usuarios');
         } elseif ($_POST) {
             $this->load->helper('date');
             $this->load->library('Utils');
             $insert = $_POST;
             $usuario = User::find($id);
             $usuario->update_attributes(elements(array('nombre', 'apellido', 'direccion', 'telefono', 'email', 'celular', 'usuario', 'grupo', 'password'), $insert));
             if ($usuario->is_valid()) {
                 if ($usuario->save()) {
                     $this->session->set_flashdata('msg', '<div class="success">El usuario se guardó correctamente.</div>');
                     redirect($this->agent->referrer());
                 } else {
                     $this->session->set_flashdata('msg', '<div class="error">Hubo un error al guardar los datos.</div>');
                     redirect($this->agent->referrer());
                 }
             } else {
                 $data['errors'] = $usuario->errors;
             }
         } else {
             $data['a'] = User::find($id);
         }
         $data['paises'] = Country::all();
         $data['provincias'] = State::all();
         $data['ciudades'] = City::all();
         $data['titulo'] = "Editar usuario";
         $data['action'] = "usuarios/editar/" . $id;
         $this->template->write_view('content', 'usuarios/agregar', $data);
         $this->template->render();
     } else {
         $this->session->set_flashdata('msg', '<div class="error">No tiene privilegios para realizar esta acción.</div>');
         redirect('usuarios/index/');
     }
 }
 public function getCategory()
 {
     $categorys = Category::all();
     $countrys = Country::all();
     return View::make('admin.categorys')->with('categorys', $categorys)->with('countrys', $countrys);
 }
예제 #21
0
 public function editar($id)
 {
     if (!$id) {
         $this->session->set_flashdata('msg', '<div class="error">El provincia solicitada no existe.</div>');
         redirect('provincias');
     } elseif ($_POST) {
         $this->load->helper('date');
         $this->load->library('Utils');
         $provincia = State::find($id);
         $provincia->update_attributes(elements(array('provincia', 'country_id'), $_POST));
         if ($provincia->is_valid()) {
             if ($provincia->save()) {
                 $this->session->set_flashdata('msg', '<div class="success">La provincia se guardó correctamente.</div>');
                 redirect('provincias');
             } else {
                 $this->session->set_flashdata('msg', '<div class="error">Hubo un error al guardar los datos.</div>');
                 redirect('provincias/editar/' . $id);
             }
         } else {
             $data['errors'] = $provincia->errors;
         }
     } else {
         $data['a'] = State::find($id);
     }
     $data['paises'] = Country::all();
     $data['titulo'] = "Editar provincia";
     $data['action'] = "provincias/editar/" . $id;
     $this->template->write_view('content', 'provincias/agregar', $data);
     $this->template->render();
 }
예제 #22
0
<?php

// Billers form
View::composer('billers/form', function ($view) {
    $view->with('countries', Country::all());
});
// Clients form
View::composer('clients/form', function ($view) {
    $view->with('countries', Country::all());
});
예제 #23
0
function Hotels($page = '', $per_page = '')
{
    $htl = new Country();
    if (!$page || $per_page) {
        return json_encode($htl->all());
    } else {
        return json_encode($htl->all($page, $per_page));
    }
}
예제 #24
0
 /**
  * Show the form for editing the specified resource.
  * GET /invoices/{id}/edit
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $invoice = Invoice::find($id);
     $user = Auth::user();
     $clients = $user->client;
     $billers = $user->biller;
     $tax_rates = TaxRate::where('user_id', $user->id)->get();
     $items = $invoice->item;
     $countries = Country::all();
     $currency = Country::where('id', $invoice->currency_id)->pluck('currency_code');
     return View::make('invoices.edit', compact('invoice', 'clients', 'billers', 'tax_rates', 'items', 'countries', 'currency'));
 }