Exemplo n.º 1
0
 public function items()
 {
     if ($this->uri->segment(1) == 'products-category') {
         $fields = array('id' => array('w' => 5, 'title' => 'No'), 'name' => array('w' => 30, 'title' => 'Category Name'), 'status' => array('w' => 10, 'title' => 'Active'), 'actions' => array('w' => 5, 'title' => 'Action'));
     } else {
         $fields = $this->tableFields;
     }
     // 	    if( $this->type == 'product'){
     //             unset($fields['position']);
     // 	    }
     // 	    if( $this->uri->suffix == 'json' ){
     // 	        if( $this->type == 'product'){
     // 	            $where['position']= 'product';
     // 	        }else {
     // 	            $where['position !=']= 'product';
     // 	        }
     // 	        $data = $this->Category_Model->ajax($this->form->ajaxTableField($fields),$where);
     // 	        return json_datatable($data);
     // 	    }
     if ($this->type == 'product') {
         $where['position'] = 'product';
     } else {
         $where['position !='] = 'product';
     }
     $items = $this->Category_Model->list_view($this->form->ajaxTableField($fields), $where);
     // bug($items);die;
     $this->smarty->assign('buttons', array('create_new' => $this->uri->segment(1) . '/add'));
     $this->smarty->view('blocks/tablenoajax', array('fields' => $fields, 'json' => uri_suffix('json'), 'items' => $items));
 }
Exemplo n.º 2
0
 public function items()
 {
     $fields = $this->tableFields;
     if ($this->uri->suffix == 'json') {
         $data = $this->Languages_Model->ajax($this->form->ajaxTableField($fields));
         return json_datatable($data);
     }
     $this->smarty->assign('buttons', array('create_new' => 'languages/add'));
     $this->smarty->view('blocks/tableajax', array('fields' => $fields, 'json' => uri_suffix('json')));
 }
Exemplo n.º 3
0
 public function slides()
 {
     if ($this->uri->segment(3) == 'add') {
         return self::form(0, 'slide');
     } elseif ($this->uri->segment(3) == 'edit') {
         return self::form($this->uri->segment(4), 'slide');
     } else {
         $fields = $this->slideTableFields;
         if ($this->uri->suffix == 'json') {
             $data = $this->Data_Model->ajax($this->form->ajaxTableField($fields), array('d.type' => 'slide'), 'slide');
             return json_datatable($data);
         }
         $this->smarty->assign('buttons', array('create_new' => 'data/slides/add'));
         $this->smarty->view('blocks/tableajax', array('fields' => $fields, 'json' => uri_suffix('json')));
     }
 }