当前位置: 首页>>代码示例>>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;未经允许,请勿转载。