public function actionPagar($temporada_id, $empleado_id, $fecha)
 {
     $temporada = TemporadaSearch::findOne(['temporada_id' => $temporada_id]);
     $empleado = EmpleadoSearch::findOne(['empleado_id' => $empleado_id]);
     $modelCosechadia = new CosechadiaSearch();
     if ($_SESSION['flag'] == 0) {
         $dataCosechaEmpleados = $modelCosechadia->find()->where(['temporada_id' => $temporada_id, 'empleado_id' => $empleado_id, 'pagado' => 0])->andWhere(['<=', 'fecha', $fecha])->all();
         $_SESSION['dataCosechaEmpleados'] = $dataCosechaEmpleados;
     } else {
         $dataCosechaEmpleados = $_SESSION['dataCosechaEmpleados'];
     }
     date_default_timezone_set('America/Santiago');
     $fechaImpresion = date('d/m/Y h:i:s a', time());
     return $this->render('pagar', ['temporada' => $temporada, 'empleado' => $empleado, 'fecha' => $fecha, 'dataCosechaEmpleados' => $dataCosechaEmpleados, 'fechaImpresion' => $fechaImpresion]);
 }
Example #2
0
 /**
  * Lists all Cosechadia models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new CosechadiaSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }