public function maintenanceCarmodel() { $ids = DB::table('tblCarModel')->select('strCarModelId')->orderBy('created_at', 'desc')->orderBy('strCarModelId', 'desc')->take(1)->get(); $ID = $ids["0"]->strCarModelId; $newID = $this->smart($ID); $models = DB::table('tblCarModel')->join('tblCarBrand', 'tblCarModel.strCMBrand', '=', 'tblCarBrand.strCarBrandId')->join('tblCarType', 'tblCarModel.strCMType', '=', 'tblCarType.strCarTypeId')->select('tblCarModel.*', 'tblCarType.strCarTypeName', 'tblCarBrand.strCarBrandDesc')->get(); $types = MCarType::all(); $brands = MCarBrand::all(); //$types = MCarType::lists('strCarTypeId', 'strCarTypeName'); //$brands = MCarBrand::lists('strCarBrandId', 'strCarBrandDesc'); return View::make('carmodelMaintenance')->with('carModels', $models)->with('carTypes', $types)->with('carBrands', $brands)->with('newID', $newID); }
public function maintenanceService() { $ids = DB::table('tblServ')->select('strServId')->orderBy('created_at', 'desc')->orderBy('strServId', 'desc')->take(1)->get(); $ID = $ids["0"]->strServId; $newID = $this->smart($ID); $ids2 = DB::table('tblServPrice')->select('strServPriceId')->orderBy('created_at', 'desc')->orderBy('strServPriceId', 'desc')->take(1)->get(); $ID2 = $ids2["0"]->strServPriceId; $priceID = $this->smart($ID); $category = MProdServCat::all(); $cartype = MCarType::all(); $products = DB::table('tblProduct')->join('tblUOM', 'tblProduct.strPUOM', '=', 'tblUOM.strUOMId')->select('tblProduct.*', 'tblUOM.strUOMDesc')->get(); $ids3 = DB::table('tblServProd')->select('strServProd')->orderBy('created_at', 'desc')->orderBy('strServProd', 'desc')->take(1)->get(); $ID3 = $ids3["0"]->strServProd; $spID = $this->smart($ID3); $price = DB::table('tblServPrice')->join('tblServ', 'tblServPrice.strSPServ', '=', 'tblServ.strServId')->select('tblServPrice.*')->orderBy('tblServPrice.dtmServPrice', 'asc')->get(); $var = 0; $service = DB::table('tblServ')->join('tblProdSerCat', 'tblServ.strSServCat', '=', 'tblProdSerCat.strCategId')->join('tblCarType', 'tblServ.strSCarType', '=', 'tblCarType.strCarTypeId')->select('tblServ.*', 'tblProdSerCat.strCategName', 'tblCarType.strCarTypeName')->get(); return View::make('serviceMaintenance')->with('newID', $newID)->with('spID', $spID)->with('categories', $category)->with('cartypes', $cartype)->with('services', $service)->with('servprice', $price)->with('var', $var)->with('priceId', $priceID)->with('product', $products); }