本文整理汇总了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');
}
}
示例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();
}
}
}
示例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('/');
}
}
示例4: destroy
function destroy()
{
$id = Input::get('TRAVEL_SCHEDULE_ID');
$travel = travelschedule::findSchedule($id);
$travel->delete();
return redirect::back()->with('tanggal');
}
示例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');
}
示例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);
}
示例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();
}
示例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();
}
示例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('/');
}
}
示例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);
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}