Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Student::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(['student_id' => $this->student_id, 'program_id' => $this->program_id, 'campus_id' => $this->campus_id]);
     $query->andFilterWhere(['like', 'student_matrix', $this->student_matrix])->andFilterWhere(['like', 'student_name', $this->student_name])->andFilterWhere(['like', 'student_phone', $this->student_phone])->andFilterWhere(['like', 'student_email', $this->student_email]);
     return $dataProvider;
 }
Exemplo n.º 2
0
/* @var $model backend\models\MedicalCertificate */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="medical-certificate-form">

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

    <?php 
echo $form->field($model, 'mc_serial')->textInput(['maxlength' => true], ['value' => 'mc_serial']);
?>

    <?php 
echo $form->field($model, 'student_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Student::find()->all(), 'student_id', 'student_matrix', 'program.program_name'), 'language' => 'en', 'options' => ['placeholder' => 'Insert Student Matrix Number', 'id' => 'matrixNumber'], 'pluginOptions' => ['allowClear' => true]]);
?>

     <?php 
echo "<input type='text' name='show1' id='student_name' size='40' /> ";
?>

     <?php 
echo "<input type='text' name='show2' id='student_email' size='40' /> ";
?>

    <?php 
echo $form->field($model, 'mc_problem')->textInput(['maxlength' => true]);
?>

    <?php