public function swatch() { $ids = DB::table('tblSwatches')->select('strSwatchID')->orderBy('created_at', 'desc')->orderBy('strSwatchID', 'desc')->take(1)->get(); $ID = $ids["0"]->strSwatchID; $newID = $this->smartCounter($ID); $fabricType = FabricType::all(); $reason = ReasonSwatches::all(); $swatch = DB::table('tblSwatches')->join('tblFabricType', 'tblSwatches.strSwatchFabricTypeName', '=', 'tblFabricType.strFabricTypeID')->leftJoin('tblReasonSwatches', 'tblSwatches.strSwatchID', '=', 'tblReasonSwatches.strInactiveSwatchID')->select('tblSwatches.*', 'tblFabricType.strFabricTypeName', 'tblReasonSwatches.strInactiveSwatchID', 'tblReasonSwatches.strInactiveReason')->get(); return View::make('fabricAndMaterialsSwatches')->with('swatch', $swatch)->with('fabricType', $fabricType)->with('reason', $reason)->with('newID', $newID); }
public function reactFabricType() { $id = Input::get('reactID'); $isAdded = FALSE; if (!$isAdded) { $fabricType = FabricType::find($id); $reas = Input::get('reactInactiveFabric'); $reason = DB::table('tblReasonFabricType')->where('strInactiveFabricTypeID', '=', $reas)->delete(); $fabricType->boolIsActive = 1; $fabricType->save(); return Redirect::to('/utilities/inactiveData?successRec=true'); } else { return Redirect::to('/utilities/inactiveData?successRec=false'); } }