public function actionIndex()
 {
     $dorder = '';
     $modelName = $this->modelName;
     if ($modelName::model()->hasAttribute('sort_order')) {
         $dorder = 't.sort_order ASC';
     } else {
         if ($modelName::model()->hasAttribute('id')) {
             $dorder = 't.id DESC';
         }
     }
     $criteriaWith = $attr = array();
     $attr[] = '*';
     $sort = array('defaultOrder' => $dorder, 'attributes' => $attr);
     parent::index($this->modelName, $sort, $criteriaWith);
 }
 public function actionIndex()
 {
     parent::index($this->modelName);
 }
示例#3
0
文件: Surveys.php 项目: lkho/comp3421
 public function index()
 {
     $url = site_url(uri_string() . '/response') . '/';
     $this->db->select(array('*', "concat('<a href=\"{$url}',id,'\"><button>View</button></a><a href=\"{$url}',id,'/csv\"><button>Download CSV</button></a>') as response"));
     parent::index();
 }
 public function actionIndex()
 {
     $dorder = '';
     $modelName = $this->modelName;
     if ($modelName::model()->hasAttribute('sort_order')) {
         $dorder = 't.sort_order ASC';
     } else {
         if ($modelName::model()->hasAttribute('id')) {
             $dorder = 't.id DESC';
         }
     }
     $criteriaWith = $attr = array();
     $criteriaWith = array('cGroupDescriptions' => array('together' => true));
     $attr['name'] = array('asc' => 'cGroupDescriptions.name ASC', 'desc' => 'cGroupDescriptions.name DESC');
     $attr[] = '*';
     $sort = array('defaultOrder' => $dorder, 'attributes' => $attr);
     parent::index($this->modelName, $sort, $criteriaWith);
 }
示例#5
0
 public function index($survey_id = 0)
 {
     check_access(TRUE, TRUE);
     $this->db->where('survey_id', $survey_id)->order_by('order');
     parent::index();
 }