Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Level::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'level_name', $this->level_name]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
 /**
  * Finds the Level model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Level the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Level::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 3
0
 public function getLevel()
 {
     return $this->hasOne(Level::className(), ['level_id' => 'level_id']);
 }
Ejemplo n.º 4
0
?>
                <?php 
echo $form->field($model, 'address');
?>
                <?php 
echo $form->field($model, 'email');
?>
                <!-- <?php 
echo $form->field($model, 'level_id')->dropDownList(ArrayHelper::map(Level::find()->all(), 'id', 'level_name'), ['prompt' => "Select Grade Level", 'onChange' => '
                            $.post( "index.php?r=site/lists&id=' . '"+$(this).val(), function(data) {
                                $( "select#signupform-section_id" ).html(data);
                            });']);
?>
 -->
                <?php 
echo $form->field($model, 'level_id')->dropDownList(ArrayHelper::map(Level::find()->all(), 'id', 'level_name'), ['prompt' => "Select Grade Level"]);
?>
                <?php 
echo $form->field($model, 'section_id')->dropDownList(ArrayHelper::map(Section::find()->all(), 'id', 'section_name', 'level_desc'), ['prompt' => "Select Section Name"]);
?>
                <?php 
echo $form->field($model, 'password')->passwordInput();
?>
                <div class="form-group">
                    <?php 
echo Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']);
?>
                </div>
            <?php 
ActiveForm::end();
?>