當前位置: 首頁>>代碼示例>>PHP>>正文


PHP redirect::back方法代碼示例

本文整理匯總了PHP中redirect::back方法的典型用法代碼示例。如果您正苦於以下問題:PHP redirect::back方法的具體用法?PHP redirect::back怎麽用?PHP redirect::back使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在redirect的用法示例。


在下文中一共展示了redirect::back方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['numbers' => 'required|max:255', 'letters' => 'required|max:255', 'housenr' => 'required|max:255']);
     $zipcode = Zipcode::where('pnum', $request->input('numbers'))->where('pchar', $request->input('letters'))->firstOrFail();
     switch ($zipcode->numbertype) {
         case 'even':
             if ($request->input('housenr') % 2 == 0) {
                 if ($this->between($request->input('housenr'), $zipcode->minnumber, $zipcode->maxnumber)) {
                     return response()->json($zipcode);
                 } else {
                     return redirect::back()->with('error', 'uw huisnr bestaat niet i.c.m. deze postcode');
                 }
             }
             break;
         case 'odd':
             if ($request->input('housenr') % 2 == 1) {
                 if ($this->between($request->input('housenr'), $zipcode->minnumber, $zipcode->maxnumber)) {
                     return response()->json($zipcode);
                 } else {
                     return redirect::back()->with('error', 'uw huisnr bestaat niet i.c.m. deze postcode');
                 }
             }
             break;
         case 'mixed':
             if ($this->between($request->input('housenr'), $zipcode->minnumber, $zipcode->maxnumber)) {
                 return response()->json($zipcode);
             } else {
                 return redirect::back()->with('error', 'uw huisnr bestaat niet i.c.m. deze postcode');
             }
             break;
         default:
             return redirect::back()->with('error', 'uw huisnr bestaat niet i.c.m. deze postcode');
     }
 }
開發者ID:reshadf,項目名稱:postcode_checker,代碼行數:40,代碼來源:ZipcodeController.php

示例2: checkLogin

 function checkLogin()
 {
     $data = Input::all();
     $partner = Partner::check_login($data['PARTNER_USERNAME'], md5($data['PARTNER_PASSWORD']))->where('PARTNER_TYPE_ID', '=', $data['PARTNER_TYPE_ID'])->first();
     print_r($partner);
     if (sizeof($partner) > 0) {
         if ($partner['PARTNER_TYPE_ID'] == 1) {
             Session(['id' => $partner['PARTNER_ID'], 'hak' => 'partner_travel']);
             return redirect::to('travelpartner');
         } else {
             if ($partner['PARTNER_TYPE_ID'] == 2) {
                 Session(['id' => $partner['PARTNER_ID'], 'hak' => 'partner_rent']);
                 return redirect::to('rentpartner');
             } else {
                 Session(['id' => $partner['PARTNER_ID'], 'hak' => 'partner_ticket']);
                 return redirect::to('ticketpartner');
             }
         }
     } else {
         $member = ['MEMBER_USERNAME' => $data['PARTNER_USERNAME'], 'MEMBER_PASSWORD' => md5($data['PARTNER_PASSWORD'])];
         $member = Member::check_login($member)->get();
         if (sizeof($member) > 0) {
             echo "member";
         } else {
             Session::flash('message', 'Password yang anda masukkan salah');
             return redirect::back();
         }
     }
 }
開發者ID:artcakstudio,項目名稱:tiketsaya,代碼行數:29,代碼來源:RegistrasiController.php

示例3: transaksiSubmit

 function transaksiSubmit()
 {
     $data = Input::all();
     $flag = $data['flag'];
     print_r($data);
     $schedule = Travelschedule::findschedule($data['TRAVEL_SCHEDULE_ID'])->first();
     unset($data['_token']);
     $schedule_id = $data['TRAVEL_SCHEDULE_ID'];
     unset($data['_token'], $data['flag']);
     $costumer = $data;
     unset($data['COSTUMER_EMAIL'], $data['COSTUMER_NAME'], $data['COSTUMER_TELP']);
     if (!is_null(Session::get('id')) and Session::get('hak') == 'COSTUMER') {
         $data['MEMBER_ID'] = Session::get('id');
     } else {
         unset($costumer['TRAVEL_SCHEDULE_ID'], $costumer['TRAVEL_TRANSACTION_PASSENGER'], $costumer['TRAVEL_TRANSACTION_PRICE']);
         Costumer::insert($costumer);
         $id = DB::getPdo()->lastInsertId();
         $data['COSTUMER_ID'] = $id;
     }
     $data['TRAVEL_TRANSACTION_STATUS_ID'] = 1;
     Traveltransaction::insert($data);
     $idtransaksi = DB::getPdo()->lastInsertId();
     $code = DB::select('select travel_code() as code');
     $code = $code[0]->code;
     $code_transaksi = ['TRAVEL_TRANSACTION_CODE' => $code];
     $transaksi = Traveltransaction::where('TRAVEL_TRANSACTION_ID', '=', $idtransaksi);
     $transaksi->update($code_transaksi);
     if ($flag == 1) {
         return redirect::back();
     } else {
         return redirect::to('/');
     }
 }
開發者ID:artcakstudio,項目名稱:tiketsaya,代碼行數:33,代碼來源:TravelpageController.php

示例4: destroy

 function destroy()
 {
     $id = Input::get('TRAVEL_SCHEDULE_ID');
     $travel = travelschedule::findSchedule($id);
     $travel->delete();
     return redirect::back()->with('tanggal');
 }
開發者ID:artcakstudio,項目名稱:tiketsaya,代碼行數:7,代碼來源:TravelController.php

示例5: getAdd

 public function getAdd($id)
 {
     $record = Customer::find($id);
     if (count($record) < 0) {
         return redirect::back();
     }
     return view(vw('theme.work.add'), compact('record'))->withTitle('İş Ekle');
 }
開發者ID:osmanyilmazco,項目名稱:customer,代碼行數:8,代碼來源:WorkController.php

示例6: index

 public function index()
 {
     $objLibFilter = kernel::single('topc_item_filter');
     $params = $objLibFilter->decode(input::get());
     $params['use_platform'] = '0,1';
     //判斷自營  自營是1,非自營是0
     if ($params['is_selfshop'] == '1') {
         $pagedata['isself'] = '0';
     } else {
         $pagedata['isself'] = '1';
     }
     //如果不是從分類進入,並且沒有關鍵字搜索則不能進入列表頁
     $params['search_keywords'] = trim($params['search_keywords']);
     if (empty($params['cat_id']) && empty($params['search_keywords'])) {
         return redirect::back();
     }
     //默認圖片
     $pagedata['image_default_id'] = app::get('image')->getConf('image.set');
     //搜索或者篩選獲取商品
     $searchParams = $this->__preFilter($params);
     $searchParams['fields'] = 'item_id,title,image_default_id,price,promotion.ids';
     $itemsList = app::get('topc')->rpcCall('item.search', $searchParams);
     //檢測是否有參加團購活動
     if ($itemsList['list']) {
         $itemsList['list'] = array_bind_key($itemsList['list'], 'item_id');
         $itemIds = array_keys($itemsList['list']);
         $activityParams['item_id'] = implode(',', $itemIds);
         $activityParams['status'] = 'agree';
         $activityParams['end_time'] = 'bthan';
         $activityParams['start_time'] = 'sthan';
         $activityParams['fields'] = 'activity_id,item_id,activity_tag,price,activity_price';
         $activityItemList = app::get('topc')->rpcCall('promotion.activity.item.list', $activityParams);
         if ($activityItemList['list']) {
             foreach ($activityItemList['list'] as $key => $value) {
                 $itemsList['list'][$value['item_id']]['activity'] = $value;
                 $itemsList['list'][$value['item_id']]['price'] = $value['activity_price'];
             }
         }
     }
     //根據條件搜索出最多商品的分類,進行顯示漸進式篩選項
     $filterItems = app::get('topc')->rpcCall('item.search.filterItems', $params);
     //漸進式篩選的數據
     $pagedata['screen'] = $filterItems;
     $pagedata['items'] = $itemsList['list'];
     //根據條件搜索出的商品
     $pagedata['count'] = $itemsList['total_found'];
     //根據條件搜索到的總數
     //已有的搜索條件
     $tmpFilter = $params;
     unset($tmpFilter['pages']);
     $pagedata['filter'] = $objLibFilter->encode($tmpFilter);
     //分頁
     $pagedata['pagers'] = $this->__pages($params['pages'], $pagedata['count'], $pagedata['filter']);
     //已選擇的搜索條件
     $pagedata['activeFilter'] = $params;
     return $this->page('topc/list/index.html', $pagedata);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:57,代碼來源:list.php

示例7: add

 public function add($id)
 {
     $bag = new Bag();
     $bag->productId = $id;
     $bag->inBag = 0;
     $bag->save();
     $bag->users()->attach(Auth::user()->id);
     $bag->products()->attach($id);
     return redirect::back();
 }
開發者ID:rubenwouters,項目名稱:Hello-Maternity,代碼行數:10,代碼來源:HeartBagController.php

示例8: eliminarDelCarrito

 public static function eliminarDelCarrito($id)
 {
     $ldv = \App\LineaDeVenta::find(Carrito::find($id)->idLineaDeVenta);
     $carrito = Carrito::find($id);
     //Eliminar la relación en el carrito
     $carrito->delete($id);
     //Eliminar la linea de venta
     $ldv->delete($ldv);
     return redirect::back();
 }
開發者ID:jpetris,項目名稱:AgroGrain-WebApp,代碼行數:10,代碼來源:Carrito.php

示例9: index

 public function index()
 {
     if (Auth::check()) {
         if (Auth::user()->tipoDeUsuario == 2) {
             $cntPedidos = Pedido::pedidosPendientes();
             return view('empleado.principal', compact('cntPedidos'));
         } else {
             return redirect::back();
         }
     } else {
         return redirect::to('/');
     }
 }
開發者ID:jpetris,項目名稱:AgroGrain-WebApp,代碼行數:13,代碼來源:EmpleadoController.php

示例10: index

 public function index()
 {
     $postdata = input::get();
     $pagedata = $this->__getItems($postdata);
     if (!$pagedata) {
         return redirect::back();
     }
     if ($pagedata['screen']['shopInfo']) {
         $pagedata['shopDsrData'] = $this->__getShopDsr($pagedata['screen']['shopInfo']['shop_id']);
     }
     $pagedata['title'] = "搜索結果";
     return $this->page('topm/list/index.html', $pagedata);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:13,代碼來源:list.php

示例11: store

 function store()
 {
     $data = Input::all();
     unset($data['_token']);
     $data['VEHICLE_PHOTO'] = md5(time()) . '.jpg';
     $data['VEHICLE_STATUS_ID'] = '1';
     $destPath = public_path() . '/Assets/vehiclePhoto';
     Input::file('VEHICLE_PHOTO')->move($destPath, $data['VEHICLE_PHOTO']);
     $data['VEHICLE_CREATEBY'] = session::get('id');
     print_r($data);
     Vehicle::insert($data);
     return redirect::back();
 }
開發者ID:artcakstudio,項目名稱:tiketsaya,代碼行數:13,代碼來源:VehicleController.php

示例12: index

 public function index()
 {
     $keyword = input::get('keyword');
     $searchType = input::get('searchtype');
     if (!empty($keyword)) {
         if ($searchType == 'shop') {
             return redirect::action('topc_ctl_shopcenter@search', array('n' => $keyword));
         } else {
             return redirect::action('topc_ctl_list@index', array('n' => $keyword));
         }
     } else {
         return redirect::back();
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:14,代碼來源:search.php

示例13: login

 public function login()
 {
     $data = Input::all();
     $data['password'] = md5($data['password']);
     $user = User::checklogin($data)->get();
     if (sizeof($user) > 0) {
         $rule = User::getHakAkses($user[0]['USERS_ID'])->get();
         session(['hak' => 'admin', 'name' => $user[0]['USERS_NAME'], 'id' => $user[0]['USERS_ID']]);
         return redirect::to('usermanagement');
     } else {
         Session::flash('error', "Password dan Username yang anda masukkan salah");
         return redirect::back();
     }
 }
開發者ID:artcakstudio,項目名稱:tiketsaya,代碼行數:14,代碼來源:AuthController.php

示例14: store

 public function store()
 {
     $data = Input::all();
     unset($data['_token']);
     $data['RENT_SCHEDULE_CREATEBY'] = session::get('id');
     $data['RENT_SCHEDULE_DATE'] = date('Y-m-d', strtotime($data['RENT_SCHEDULE_DATE']));
     print_r($data);
     $flag = Rentschedule::whereDate('RENT_SCHEDULE_DATE', '=', date('Y-m-d', strtotime($data['RENT_SCHEDULE_DATE'])))->where('VEHICLE_ID', '=', $data['VEHICLE_ID'])->count();
     if ($flag == 0) {
         Rentschedule::insert($data);
     } else {
         Session::flash("error", "Ada jadwal yang bentrok, mohon periksa kembali");
     }
     return redirect::back();
 }
開發者ID:artcakstudio,項目名稱:tiketsaya,代碼行數:15,代碼來源:RentController.php

示例15: add

 public function add($id)
 {
     $bag = Auth::user()->bags->where('productId', $id)->where('inBag', 1);
     if (count($bag) > 0) {
         return redirect()->action('BagController@index');
     }
     $bag = new Bag();
     $bag->productId = $id;
     $bag->inBag = 1;
     $bag->save();
     $bag->users()->attach(Auth::user()->id);
     $bag->products()->attach($id);
     if (count(Auth::user()->bags->where('productId', $id)->where('inBag', 0)) != 0 && Auth::user()->bags->where('productId', $id)->where('inBag', 0)->first()->exists()) {
         return redirect('heartbag/remove/' . $id);
     }
     return redirect::back();
 }
開發者ID:rubenwouters,項目名稱:Hello-Maternity,代碼行數:17,代碼來源:BagController.php


注:本文中的redirect::back方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。