/**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Empleado('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Empleado'])) {
         $model->attributes = $_GET['Empleado'];
     }
     if (Util::getRolUser(Yii::app()->user->id) == 'OPERADOR') {
         if (count($model->activos()->searchSubAlterno(Empleado::model()->find('userid=:idUser', array(':idUser' => Yii::app()->user->id))->id, true)->getData()) > 0) {
             $this->render('admin', array('model' => $model));
         } else {
             $this->render('empty', array('model' => $model));
         }
     } else {
         if (count($model->activos()->noUser()->findAll()) > 0) {
             $this->render('admin', array('model' => $model));
         } else {
             $this->render('empty', array('model' => $model));
         }
     }
 }
Example #2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Empleado('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Empleado'])) {
         $model->attributes = $_GET['Empleado'];
     }
     $this->render('admin', array('model' => $model));
 }