/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = AccionCentralizadaVariableEjecucion::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'id_programacion' => $this->id_programacion, 'id_usuario' => $this->id_usuario, 'fecha' => $this->fecha, 'enero' => $this->enero, 'febrero' => $this->febrero, 'marzo' => $this->marzo, 'abril' => $this->abril, 'mayo' => $this->mayo, 'junio' => $this->junio, 'julio' => $this->julio, 'agosto' => $this->agosto, 'septiembre' => $this->septiembre, 'octubre' => $this->octubre, 'noviembre' => $this->noviembre, 'diciembre' => $this->diciembre]);
     return $dataProvider;
 }
 /**
  * Lists all AccionCentralizadaDesbloqueoMes models.
  * @return mixed
  */
 public function actionIndex($id)
 {
     $searchModel = new AccionCentralizadaDesbloqueoMesSearch();
     $ejecucion = AccionCentralizadaVariableEjecucion::find()->innerjoin('accion_centralizada_variable_programacion', 'accion_centralizada_variable_programacion.id=accion_centralizada_variable_ejecucion.id_programacion')->where(['accion_centralizada_variable_programacion.id_localizacion' => $id])->one();
     //print_r($programacion); exit();
     $model = AccionCentralizadaDesbloqueoMes::find();
     if ($ejecucion != null) {
         $model->andFilterWhere(['id_ejecucion' => $ejecucion->id]);
     } else {
         $model->andFilterWhere(['id' => -1]);
     }
     $dataProvider = new ActiveDataProvider(['query' => $model]);
     $searchModel = '';
     // return $dataProvider;
     //$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     Yii::$app->response->format = Response::FORMAT_JSON;
     return ['title' => "Desbloqueo Por Mes Variables", 'content' => $this->renderAjax('index', ['searchModel' => $searchModel, 'id_ejecucion' => $ejecucion, 'dataProvider' => $dataProvider])];
 }
 /**
  * Finds the AccionCentralizadaVariableEjecucion model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return AccionCentralizadaVariableEjecucion the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = AccionCentralizadaVariableEjecucion::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdEjecucion()
 {
     return $this->hasOne(AccionCentralizadaVariableEjecucion::className(), ['id' => 'id_ejecucion']);
 }