本文整理汇总了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('/');
}
示例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);
}
示例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');
}
}
}
}
示例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("เกิดข้อผิดพลาด - ไม่สามารถบันทึกได้");
}
}
示例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('/');
}
}
示例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');
}
示例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');
}
示例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.');*/
}
示例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());
}
}
示例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();
}
}
}
示例11: s
function s($sponsor = NULL)
{
if ($sponsor == NULL) {
redirect::to(BASE_PATH, TRUE);
} else {
$this->model->s($sponsor);
}
}
示例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');
}
示例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');
}
示例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');
}
示例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/');
}