Esempio n. 1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $this->data['discount'] = Discount::where('date_to', '>=', date('Y-m-d'))->get();
     $this->data['transfer_type'] = TransferType::all()->lists('transfer', 'id');
     $this->data['direction'] = array('arrivals' => 'Прилет', 'departure' => 'Вылет');
     return $this->render('discount.list');
 }
Esempio n. 2
0
 /**
  * Форма нового заказа
  */
 public function getNewOrder($user_id = null)
 {
     $this->page->title = 'Новый заказ';
     $this->page->desc = 'Оформление заказа';
     if ($user_id != null && is_numeric($user_id)) {
         $this->data['person'] = Person::findOrFail($user_id);
     } else {
         $this->data['person'] = null;
     }
     $this->data['price'] = Price::all();
     // Список операторов
     $this->data['operators'] = Operator::where('user_id', '=', $this->user->id)->lists('name', 'id');
     // Список аэропортов
     $this->data['airports'] = Airport::all()->lists('airport', 'id');
     // Кол-во пассажиров
     $this->data['passengers'] = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10);
     $transfer = TransferType::all();
     foreach ($transfer as $key => $value) {
         $this->data['transfer_out_' . $value->id] = Discount::where('type', '=', $value->id)->where('date_to', '>=', date('Y-m-d'))->where('date_from', '<=', date('Y-m-d'))->where('direction', '=', 'departure')->first();
     }
     $transfer = TransferType::all();
     foreach ($transfer as $key => $value) {
         $this->data['transfer_in_' . $value->id] = Discount::where('type', '=', $value->id)->where('date_to', '>=', date('Y-m-d'))->where('date_from', '<=', date('Y-m-d'))->where('direction', '=', 'arrivals')->first();
     }
     return $this->render('order.new');
 }
Esempio n. 3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $this->data['price'] = Price::get();
     $this->data['transfer_type'] = TransferType::all()->lists('transfer', 'id');
     return $this->render('price.list');
 }