Example #1
0
 /**
  * Show a list of all of the application's users.
  *
  * @return Response
  */
 public function index()
 {
     $vendor = DB::table('vendors')->get();
     $lap_jenis = tipe_lap::lists('tipe', 'id');
     $vendor_name = Vendor::lists('nama', 'id');
     return view('admin.views', ['vendor' => $vendor], compact('lap_jenis', 'vendor_name'));
 }
Example #2
0
 public function lapanganRegister(Request $request)
 {
     $rules = array('harga' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         // get the error messages from the validator
         $messages = $validator->messages();
         // redirect our user back to the form with the errors from the validator
         return view('views')->withErrors($validator);
     } else {
         $input = $request->all();
         $register = lapangan::create($input);
         $tipe_lapangan = $input['tipe_id'];
         $data = ['tipe_id' => $input['tipe_id'], 'harga' => $input['harga'], 'vendor_id' => $input['vendor_id']];
         $vendor = DB::table('vendors')->get();
         $lap_jenis = tipe_lap::lists('tipe', 'id');
         $vendor_name = Vendor::lists('nama', 'id');
         return view('admin.views', ['vendor' => $vendor], compact('lap_jenis', 'vendor_name'))->withSuccess('Lapangan Berhasil Ditambahkan');
     }
 }