/** * 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; }
?> <?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(); ?>