public function fabricType()
 {
     $ids = DB::table('tblFabricType')->select('strFabricTypeID')->orderBy('created_at', 'desc')->orderBy('strFabricTypeID', 'desc')->take(1)->get();
     $ID = $ids["0"]->strFabricTypeID;
     $newID = $this->smartCounter($ID);
     $fabricType = FabricType::all();
     $reason = ReasonFabricType::all();
     $fabricType = DB::table('tblFabricType')->leftJoin('tblReasonFabricType', 'tblFabricType.strFabricTypeID', '=', 'tblReasonFabricType.strInactiveFabricTypeID')->select('tblFabricType.*', 'tblReasonFabricType.strInactiveFabricTypeID', 'tblReasonFabricType.strInactiveReason')->orderBy('created_at')->get();
     return View::make('fabricAndMaterialsFabricType')->with('fabricType', $fabricType)->with('reason', $reason)->with('newID', $newID);
 }
 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);
 }