/**
  * Lists all models.
  */
 public function actionIndex()
 {
     $model = new Department('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Department'])) {
         $model->attributes = $_GET['Department'];
     }
     $this->render('index', array('model' => $model));
 }
 public function actionExport()
 {
     $model = new Department();
     $model->unsetAttributes();
     // clear any default values
     if (isset($_POST['Department'])) {
         $model->attributes = $_POST['Department'];
     }
     $exportType = $_POST['fileType'];
     $this->widget('ext.heart.export.EHeartExport', array('title' => 'List of Department', 'dataProvider' => $model->search(), 'filter' => $model, 'grid_mode' => 'export', 'exportType' => $exportType, 'columns' => array('department_id', 'name')));
 }
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     date_default_timezone_set("Asia/Manila");
     $activity = new Activity();
     $activity->act_desc = 'Viewed Department List';
     $activity->act_datetime = date('Y-m-d G:i:s');
     $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id;
     $activity->save();
     $model = new Department('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Department'])) {
         $model->attributes = $_GET['Department'];
     }
     $this->render('admin', array('model' => $model));
 }