public function upload()
 {
     $input_value = array('img_url' => Input::file('image'), 'name' => Input::get('name'), 'description' => Input::get('description'));
     $input_check = array('img_url' => array('required', 'mimes:png,gif,jpeg,jpg'), 'name' => array('required'), 'description' => array('required'));
     $validator = Validator::make($input_value, $input_check);
     if ($validator->fails()) {
         $error = $validator->messages()->toArray();
         $index = SliderImages::all();
         return View::make('admin.slider.sliderAdd')->with('slider', $index)->with('error', $error);
     } else {
         $type = Input::file('image')->getClientOriginalExtension();
         $fileName = rand(1111111, 9999999) . time() . "." . $type;
         $path = 'upload';
         $upload = Input::file('image')->move($path, $fileName);
         // var_dump($upload);die;
         if ($upload) {
             $index = new SliderImages();
             $index->img_url = $fileName;
             $index->name = Input::get('name');
             $index->description = Input::get('description');
             $index->save();
             return Redirect::to('slider')->with('save_img', 'save');
         }
     }
 }
 public function Contacts()
 {
     $SliderImages = SliderImages::all();
     return View::make('contacts.contacts')->with('slider', $SliderImages);
 }
 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);
 }