Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Plan::find();
     $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;
     }
     $query->andFilterWhere(['idPlan' => $this->idPlan, 'idFacultad' => $this->idFacultad]);
     $query->andFilterWhere(['like', 'nombrep', $this->nombrep]);
     return $dataProvider;
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPlans()
 {
     return $this->hasMany(Plan::className(), ['idFacultad' => 'idFacultad']);
 }
Beispiel #3
0
 public function getIdPlan0()
 {
     return $this->hasOne(Plan::className(), ['idPlan' => 'idPlan']);
 }
Beispiel #4
0
 /**
  * Finds the Plan model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Plan the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Plan::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #5
0
<div class="grupo-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'idDocente')->widget(Select2::classname(), ['data' => ArrayHelper::map(Docentes::find()->all(), 'idDocente', 'nombres'), 'language' => 'en', 'options' => ['placeholder' => ''], 'pluginOptions' => ['allowClear' => true]]);
?>

      <?php 
echo $form->field($model, 'idAsignatura')->widget(Select2::classname(), ['data' => ArrayHelper::map(Asignatura::find()->all(), 'idAsignatura', 'nombrea'), 'language' => 'en', 'options' => ['placeholder' => ''], 'pluginOptions' => ['allowClear' => true]]);
?>

        <?php 
echo $form->field($model, 'idPlan')->widget(Select2::classname(), ['data' => ArrayHelper::map(Plan::find()->all(), 'idPlan', 'nombrep'), 'language' => 'en', 'options' => ['placeholder' => ''], 'pluginOptions' => ['allowClear' => true]]);
?>


    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Guardar' : 'Actualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>