public function maintenanceCustomer() { $ids = DB::table('tblCustomer')->select('strCustId')->orderBy('created_at', 'desc')->orderBy('strCustId', 'desc')->take(1)->get(); $ID = $ids["0"]->strCustId; $newID = $this->smart($ID); $cust = MCustomer::all(); $carmodel = MCarModel::all(); return View::make('customerMaintenance')->with('customers', $cust)->with('carmodel', $carmodel)->with('newID', $newID); }
public function carDetails() { $sum = 0; $label = ''; $custid = Input::get('customerId'); $custcar = DB::table('tblCustCar')->join('tblCustomer', 'tblCustCar.strCCCust', '=', 'tblCustomer.strCustId')->join('tblCarModel', 'tblCustCar.strCCModel', '=', 'tblCarModel.strCarModelId')->join('tblCarType', 'tblCarModel.strCMType', '=', 'tblCarType.strCarTypeId')->join('tblCarBrand', 'tblCarModel.strCMBrand', '=', 'tblCarBrand.strCarBrandId')->select('tblCustCar.*', 'tblCarModel.strCarModelDesc', 'tblCustomer.strCustFName', 'tblCustomer.strCustMInit', 'tblCustomer.strCustLName', 'tblCarType.strCarTypeName', 'tblCarBrand.strCarBrandDesc')->get(); $carmodel = MCarModel::all(); return View::make('custcarMaintenance')->with('custcars', $custcar)->with('custid', $custid)->with('carmodels', $carmodel); }