示例#1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Professor::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(['ID' => $this->ID, 'Telefone' => $this->Telefone]);
     $query->andFilterWhere(['like', 'Nome', $this->Nome])->andFilterWhere(['like', 'Email', $this->Email]);
     return $dataProvider;
 }
示例#2
0
 -->

    <?php 
echo $form->field($model, 'idDisciplina')->dropDownList(ArrayHelper::map(Disciplina::find()->orderBy('nomeDisciplina')->asArray()->all(), 'id', 'nomeDisciplina'), ['prompt' => 'Selecione uma disciplina', 'style' => 'width:600px']);
?>

    <?php 
echo $form->field($model, 'codTurma')->textInput(['maxlength' => true, 'style' => 'width:130px']);
?>

    <?php 
echo $form->field($model, 'idCurso')->dropDownList(ArrayHelper::map(Curso::find()->orderBy('nome')->asArray()->all(), 'ID', 'nome'), ['prompt' => 'Selecione um curso', 'style' => 'width:300px']);
?>

    <?php 
echo $form->field($model, 'idProfessor')->dropDownList(ArrayHelper::map(Professor::find()->orderBy('Nome')->asArray()->all(), 'ID', 'Nome'), ['prompt' => 'Selecione o professor', 'style' => 'width:600px']);
?>

    <?php 
echo $form->field($model, 'nomeUnidade')->textInput(['maxlength' => true, 'style' => 'width:600px']);
?>

    <?php 
echo $form->field($model, 'qtdVagas')->textInput(['style' => 'width:130px']);
?>

    <?php 
echo $form->field($model, 'numPeriodo')->textInput(['style' => 'width:130px']);
?>

    <?php