示例#1
0
 /**
  * Lists all Peserta models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PesertaSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
示例#2
0
 public function actionExport()
 {
     $searchModel = new PesertaSearch();
     $id = Yii::$app->request->get('id_event');
     // $query = new Query;
     // $query = $query->from('absensi')->innerJoin('peserta','id_peserta = peserta.id', $id);
     $dataProvider = $searchModel->searchByEvent($id);
     ExcelView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'fullExportType' => 'xlsx', 'grid_mode' => 'export', 'columns' => [['class' => 'yii\\grid\\serialColumn'], 'id', 'nama', 'universitas', 'jurusan']]);
     // }
 }