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


PHP redirect::to方法代碼示例

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


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

示例1: transaksiSubmit

 function transaksiSubmit()
 {
     $data = Input::all();
     $schedule = Rentschedule::findRentschedule($data['RENT_SCHEDULE_ID'])->first();
     unset($data['_token']);
     $schedule_id = $data['RENT_SCHEDULE_ID'];
     unset($data['RENT_SCHEDULE_ID']);
     $costumer = $data;
     $data['RENT_TRANSACTION_PRICE'] = $schedule['RENT_SCHEDULE_PRICE'];
     unset($data['_token']);
     $data['RENT_TRANSACTION_DATE'] = date('y-m-d');
     $data['RENT_TRANSACTION_CREATEBY'] = Session::get('id');
     unset($data['COSTUMER_EMAIL'], $data['COSTUMER_NAME'], $data['COSTUMER_TELP']);
     $data['RENT_TRANSACTION_PRICE'] = Session::get('duration');
     if (!is_null(Session::get('id')) and Session::get('hak') == 'COSTUMER') {
         $data['MEMBER_ID'] = Session::get('id');
     } else {
         Costumer::insert($costumer);
         $id = DB::getPdo()->lastInsertId();
         $data['COSTUMER_ID'] = $id;
     }
     Renttransaction::insert($data);
     $detail_transaksi = ['RENT_TRANSACTION_ID' => DB::getPdo()->lastInsertId(), 'RENT_SCHEDULE_ID' => $schedule_id];
     Renttransactiondetail::insert($detail_transaksi);
     return redirect::to('/');
 }
開發者ID:artcakstudio,項目名稱:tiketsaya,代碼行數:26,代碼來源:RentpageController.php

示例2: link

 public function link(Request $request)
 {
     // validation
     $this->validate($request, ['tag' => 'required|string|max:16']);
     // retrieve item for tagging
     $item = myCloset\Item::find($request->item_id);
     // Error checking for if the item already has this tag.
     $newTag = strtolower($request->tag);
     $tags = $item->tags;
     foreach ($tags as $tag) {
         if (strcmp($tag->name, $newTag) == 0) {
             \Session::flash('flash_message', 'This item already has this tag.');
             return redirect::to('/items/' . $request->item_id);
         }
     }
     // So as to actually reuse already created tags and save database space.
     $needle = strtolower($request->tag);
     $allTags = myCloset\Tag::lists('name')->toArray();
     if (in_array($needle, $allTags)) {
         // tag exists in the database, get it and save the relationship
         $tag = myCloset\Tag::where('name', $needle)->first();
     } else {
         // tag doesn't yet exist in the database.
         $tag = new myCloset\Tag();
         $tag->name = strtolower($request->tag);
         $tag->save();
     }
     // create the pivot table relationship
     $item->tags()->attach($tag);
     return redirect::to('/items/' . $request->item_id);
 }
開發者ID:eluvish,項目名稱:myCloset,代碼行數:31,代碼來源:TagsController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $user_id = Auth::User()->id;
     if (Input::file()) {
         $file_image = array('image' => Input::file('file_image'));
         $rules = array('image' => 'required');
         $validator = validator::make($file_image, $rules);
         if ($validator->fails()) {
             return redirect::to('photo')->withInput()->withErrors($validator);
         } else {
             if (Input::file('file_image')->isValid()) {
                 $path = '../public/images';
                 $extension = Input::file('file_image')->getClientOriginalExtension();
                 $fileName = rand() . '.' . $extension;
                 Input::file('file_image')->move($path, $fileName);
                 Image::create(array('user_id' => $user_id, 'path' => $fileName));
                 Session::flash('success', 'Upload successfully');
                 return Redirect::to('photo');
             } else {
                 Session::flash('error', 'uploaded file is not valid');
                 return Redirect::to('photo');
             }
         }
     }
 }
開發者ID:GrigorAtaryan,項目名稱:Social_network,代碼行數:31,代碼來源:ImageController.php

示例4: main

 public static function main()
 {
     $root_url = dirname($_SERVER['PHP_SELF']);
     $method = Request::input('submit');
     if (isset($method) && !empty($method)) {
         $call_id = Request::input('id');
         $comment = Request::input('comment');
         $hashtag = Request::input('hashtag');
         $input_customer_id = Request::input('customer_id');
         $input_assigned_id = Request::input('assigned_id');
         $id_all = Manage_callreport::getdata_id($input_customer_id, $input_assigned_id);
         if (!empty($id_all["customer_id"]) && $id_all["customer_id"] != 0) {
             $data = ["comment" => $comment, "hashtag" => $hashtag, "customer_id" => $id_all["customer_id"], "assigned_id" => $id_all["assigned_id"], "call_id" => $call_id];
             if ($method == "add_call") {
                 if (Manage_callreport::add($data)) {
                     return redirect::to(".." . $root_url . '/call_report')->with('status', "บันทึกสำเร็จ");
                 } else {
                     return redirect::to(".." . $root_url . '/add_call_report')->withInput(Request::all())->withErrors("เกิดข้อผิดพลาด - ไม่สามารถบันทึกได้");
                 }
             } else {
                 if ($method == "edit_call") {
                     if (Manage_callreport::edit($data)) {
                         return redirect::to(".." . $root_url . '/call_report')->with('status', "บันทึกสำเร็จ");
                     } else {
                         return redirect::to(".." . $root_url . '/edit_call_report')->withInput(Request::all())->withErrors("เกิดข้อผิดพลาด - ไม่สามารถบันทึกได้");
                     }
                 }
             }
         } else {
             return redirect::to(".." . $root_url . '/add_call_report')->withInput(Request::all())->withErrors("เกิดข้อผิดพลาด - ไม่สามารถบันทึกได้");
         }
     } else {
         return redirect::to(".." . $root_url . '/add_call_report')->withInput(Request::all())->withErrors("เกิดข้อผิดพลาด - ไม่สามารถบันทึกได้");
     }
 }
開發者ID:geniuspom,項目名稱:4oj,代碼行數:35,代碼來源:Manage_callreport.php

示例5: 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

示例6: handle

 /**
  * Run the request filter.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @param  string  $role
  * @return mixed
  */
 public function handle($request, Closure $next, $role)
 {
     if (Auth::check() && Auth::user()->UserRoles->role >= $role) {
         return $next($request);
     }
     return redirect::to('/admin/login');
 }
開發者ID:szwork2013,項目名稱:laravel-angular-cms,代碼行數:15,代碼來源:RoleMiddleware.php

示例7: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $permiso = Permission::find($id);
     $permiso->fill($request->all());
     $permiso->save();
     return redirect::to('/permisos');
 }
開發者ID:landylu,項目名稱:imprenta,代碼行數:14,代碼來源:PermisosController.php

示例8: login

 /**
  * @return Redirect
  */
 public function login()
 {
     $rules = array('email' => 'required', 'password' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return redirect('/')->withErrors($validator);
     } else {
         $user = array('email' => Input::get('email'), 'password' => Input::get('password'));
         if (Auth::validate($user)) {
             if (Auth::attempt($user)) {
                 // Grab Authenticated User's Data Once
                 $user_data = Auth::user();
                 Session::put('user_id', $user_data->id);
                 Session::put('name', $user_data->name);
                 Session::put('email_id', $user_data->email);
                 return redirect::to('settings');
             }
         } else {
             /*Session::flash('message','Login Failed');
               return redirect('auth/login');*/
             return Redirect::back()->withInput()->withErrors('That Email/password does not exist.');
         }
     }
     /* $email = Input::get('email');
             $password = Input::get('password');
     
             if (Auth::attempt(['email' => $email, 'password' => $password]))
             {
                 return Redirect::intended('/settings/index');
             }
     
             return Redirect::back()
                 ->withInput()
                 ->withErrors('That Email/password combo does not exist.');*/
 }
開發者ID:kanagaraj1305,項目名稱:sample-login-in-laravel-5,代碼行數:38,代碼來源:LoginController.php

示例9: register

 public function register(Request $request)
 {
     $validate = validateuser::validate(Request::all());
     if ($validate->passes()) {
         $user = new Member();
         $user->email = $request::input('email');
         $user->password = \Hash::make($request::input('password'));
         $user->name = $request::input('name');
         $user->surname = $request::input('surname');
         $user->nickname = $request::input('nickname');
         $user->phone = $request::input('phone');
         $user->id_card = $request::input('id_card');
         $user->bank = $request::input('bank');
         $user->account_no = $request::input('account');
         $user->education = $request::input('education');
         $user->institute = $request::input('institute');
         $user->reference = $request::input('reference');
         $link = '';
         if ($user->save()) {
             $userinfo = $request::only('email', 'password');
             if (Auth::attempt($userinfo)) {
                 $link = '/';
             }
             //ส่ง email
             //จบส่ง email
         } else {
             $link = 'register';
         }
         return Redirect::to($link);
     } else {
         return redirect::to('register')->withInput(Request::except('password'))->withErrors($validate->messages());
     }
 }
開發者ID:geniuspom,項目名稱:4oj-back,代碼行數:33,代碼來源:LoginController.php

示例10: 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

示例11: s

 function s($sponsor = NULL)
 {
     if ($sponsor == NULL) {
         redirect::to(BASE_PATH, TRUE);
     } else {
         $this->model->s($sponsor);
     }
 }
開發者ID:kronxblue,項目名稱:1stg,代碼行數:8,代碼來源:r.php

示例12: surtirPedido

 public function surtirPedido($id)
 {
     $pedido = Pedido::find($id);
     $pedido->completado = true;
     $pedido->numero_de_rastreo = \App\Rastreo::generarCodigo();
     $pedido->save();
     return redirect::to('empleado_pedidos_pendientes');
 }
開發者ID:jpetris,項目名稱:AgroGrain-WebApp,代碼行數:8,代碼來源:EmpleadoController.php

示例13: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $sucursal = SucursalModel::find($id);
     $sucursal->fill($request->all());
     $sucursal->save();
     //        Session::flash('message', 'Usuario Editado Correctamente');
     return redirect::to('/sucursal');
 }
開發者ID:landylu,項目名稱:imprenta,代碼行數:15,代碼來源:SucursalController.php

示例14: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $roles = Role::find($id);
     $roles->fill($request->all());
     $roles->save();
     Session::flash('message', 'Usuario Editado Correctamente');
     return redirect::to('/roles');
 }
開發者ID:landylu,項目名稱:imprenta,代碼行數:15,代碼來源:RolesController.php

示例15: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $tiposm = TipoMaterialModel::find($id);
     $tiposm->fill($request->all());
     $tiposm->save();
     //        Session::flash('message', 'Usuario Editado Correctamente');
     return redirect::to('/material-tipo/');
 }
開發者ID:landylu,項目名稱:imprenta,代碼行數:15,代碼來源:TipoMaterialController.php


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