コード例 #1
0
ファイル: view.html.php プロジェクト: phucdnict/cbcc_05062015
 public function getDanhsach()
 {
     $data = $this->inputData();
     $vName = JRequest::getString('view');
     AdminThontoHelper::addSubmenu($vName);
     AdminThontoHelper::addButton($vName);
     $this->mainframe = JFactory::getApplication();
     $this->option = JRequest::getWord('option');
     $uri = JFactory::getURI();
     $status = $this->mainframe->getUserStateFromRequest($this->option . 'status', 'status', '', 'string');
     $filter_order = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order', 'filter_order', 'ten', 'cmd');
     $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $this->mainframe->getUserStateFromRequest($this->option . 'search', 'search', '', 'string');
     if (strpos($search, '"') !== false) {
         $search = str_replace(array('=', '<'), '', $search);
     }
     $search = JString::strtolower($search);
     if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
         $filter_order_Dir = '';
     }
     $javascript = 'onchange="document.adminForm.submit()"';
     $lists['status'] = JHTML::_('select.genericlist', array(array('value' => '', 'text' => '--Trạng thái--'), array('value' => '1', 'text' => 'Sử dụng'), array('value' => '0', 'text' => 'Không sử dụng')), 'status', $javascript . ' class="inputbox" size="1"', 'value', 'text', $status);
     $model = JModelLegacy::getInstance('Loaibhyt', 'ThontoModel');
     $items = $model->listDanhsach($data['table']);
     $totals = $model->getTotal($data['table']);
     $pagination = $model->getPagination($data['table']);
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $lists['search'] = $search;
     $this->sidebar = JHtmlSidebar::render();
     $this->assignRef('data', $data);
     $this->assignRef('lists', $lists);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: phucdnict/cbcc_05062015
 public function display($tpl = null)
 {
     $task = JFactory::getApplication()->input->get('task');
     $task = $task == null ? 'default' : strtoupper($task);
     $this->setLayout(strtolower($task));
     $vName = JRequest::getString('view');
     switch ($task) {
         default:
             $this->_initDefaultPage();
             break;
     }
     AdminThontoHelper::addSubmenu($vName);
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }