public function showMyTechSupportRequests() { $calls = TechSupportRequest::my()->take($this->getQlimit(30))->skip($this->getQOffset())->orderBy('updated_at', 'desc')->get(); $recordsCount = TechSupportRequest::my()->count(); $pages = RenderEngine::makePagination($recordsCount, $this->getQlimit(30), 'route'); return $this->render("lk/showMyTsCalls", compact("calls", 'pages')); }
public function show($rootId = 1) { Auth::isAdminOrDie(App::$instance); if (self::isContainer($rootId)) { $points = Attendance::where('parent_id', $rootId)->with('childs')->take($this->getQlimit(30))->skip($this->getQOffset())->orderBy('container', 'desc')->orderBy($this->getQOrder('name'), $this->getQVector('asc'))->get(); $recordsCount = Attendance::where('parent_id', $rootId)->count(); $breadCrumps = self::fullParentInfo($rootId); $pages = RenderEngine::makePagination($recordsCount, $this->getQlimit(30), 'route'); $this->render('attendance/v2/show', compact('points', 'breadCrumps', 'pages')); } else { $this->error('404'); } }
public function index($eventType = false) { Auth::isAdminOrDie(App::$instance); if (!$eventType) { $logList = LogRecord::take($this->getQlimit(50))->skip($this->getQOffset())->orderBy($this->getQOrder(), $this->getQVector())->with("user")->get(); } else { $logList = LogRecord::where('event_type', $eventType)->take($this->getQlimit(50))->skip($this->getQOffset())->orderBy($this->getQOrder(), $this->getQVector())->with("user")->get(); } //define event type foreach ($logList as $log) { $log->humanized = new stdClass(); $log->humanized->event_type = $this->defineLogType($log->event_type); } $eventType = $this->defineLogType($eventType); $recordsCount = LogRecord::all()->count(); //pages $pages = RenderEngine::makePagination($recordsCount, $this->getQlimit(50), 'route'); $this->render("logs/index", compact('logList', 'pages', 'eventType')); }
function notApproved() { Auth::isAdminOrDie(App::$instance); $vcc = new VksVersion_controller(); $vksList = Vks::notApproved()->take($this->getQlimit(30))->skip($this->getQOffset())->orderBy($this->getQOrder(), $this->getQVector())->full()->get(); foreach ($vksList as $vks) { $this->humanize($vks); $vksLasVersion = $vcc->pullLastVersion($vks->id); $vks->again = $vksLasVersion && $vks->owner->id == $vksLasVersion->changed_by ? true : false; } $recordsCount = Vks::notApproved()->count(); //pages $pages = RenderEngine::makePagination($recordsCount, $this->getQlimit(30), 'route'); $this->render("vksSubmissions/index", compact('vksList', 'pages')); }