Beispiel #1
0
 public function getIndex()
 {
     $getSearch = Session::get('catgorysearch');
     $statusSearch = Session::get('statussearchc');
     $recordlist = Session::get('recordlistc');
     $approveornot = Session::get('approveornotc');
     $statut = $this->category_gestion->getStatut();
     $orderbrBY = "id";
     $orderDe = "DESC";
     $orderbrBY = Session::get('catorderby') ? Session::get('catorderby') : 'id';
     $orderDe = Session::get('catorderde') ? Session::get('catorderde') : 'DESC';
     if (!empty($approveornot)) {
         if (!empty($getSearch)) {
             $categorylist = $this->category_gestion->getsearchdata($this->paginationlimit, $statusSearch, $getSearch, $orderbrBY, $orderDe);
         } else {
             $categorylist = $this->category_gestion->getsearchdata($this->paginationlimit, $statusSearch, '', $orderbrBY, $orderDe);
         }
     } else {
         if (!empty($getSearch)) {
             $categorylist = $this->category_gestion->getstatsearchdata($this->paginationlimit, '', $getSearch, $orderbrBY, $orderDe);
         } else {
             $categorylist = $this->category_gestion->index($this->paginationlimit, $orderbrBY, $orderDe);
         }
     }
     $links = str_replace('/?', '?', $categorylist->render());
     $actctng = $this->category_gestion->recordcounting(1);
     $deactctng = $this->category_gestion->recordcounting(0);
     if ($orderbrBY == "name") {
         $o_name = "sort-" . $orderDe;
         $o_slug = "unsorted";
         $o_date = "unsorted";
     } elseif ($orderbrBY == "category_slug") {
         $o_name = "unsorted";
         $o_slug = "sort-" . $orderDe;
         $o_date = "unsorted";
     } elseif ($orderbrBY == "updated_at") {
         $o_name = "unsorted";
         $o_slug = "unsorted";
         $o_date = "sort-" . $orderDe;
     } else {
         $o_name = "unsorted";
         $o_slug = "unsorted";
         $o_date = "unsorted";
     }
     return view('admin.category.index', compact('categorylist', 'links', 'getSearch', 'recordlist', 'actctng', 'deactctng', 'o_name', 'o_slug', 'o_date'));
 }