Esempio n. 1
0
 public function getUncategorized()
 {
     require_once _lms_ . '/lib/lib.kbres.php';
     $kbres = new KbRes();
     $start_index = Get::req('startIndex', DOTY_INT, 0);
     $results = Get::req('results', DOTY_MIXED, Get::sett('visuItem', 25));
     $sort = Get::req('sort', DOTY_MIXED, 'title');
     $dir = Get::req('dir', DOTY_MIXED, 'asc');
     $type = Get::req('type', DOTY_STRING, "");
     $filter_text = Get::req('filter_text', DOTY_STRING, "");
     $where = !empty($filter_text) ? "items.title LIKE '%" . $filter_text . "%'" : '';
     $limit = $start_index . ', ' . $results;
     $data_arr = $kbres->getUnCategorizedResourcesByType($type, $where, $limit);
     $tot = $data_arr['tot'];
     $result = array('totalRecords' => $tot, 'startIndex' => $start_index, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $results, 'results' => count($data_arr), 'records' => $data_arr['data']);
     $data = $this->json->encode($result);
     echo $data;
 }