Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = ClnSport::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(['SPORT_GEN_NO' => $this->SPORT_GEN_NO, 'CREATE_DATE' => $this->CREATE_DATE, 'UPDATE_DATE' => $this->UPDATE_DATE, 'VERSION' => $this->VERSION]);
     $query->andFilterWhere(['like', 'SPORT_CODE', $this->SPORT_CODE])->andFilterWhere(['like', 'SPORT_NAME', $this->SPORT_NAME])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY])->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]);
     return $dataProvider;
 }
Esempio n. 2
0
 /**
  * Updates an existing ClnTranInj model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModel($id);
     $modelClnDiagnose = ClnDiagnose::findOne(['TRAN_INJ_GEN_NO' => $id]);
     $sportItems = ArrayHelper::map(ClnSport::find()->all(), 'SPORT_GEN_NO', 'SPORT_NAME');
     $causeItems = ArrayHelper::map(ClnCauseInj::find()->all(), 'CAUSE_GEN_NO', 'CAUSE_NAME');
     $bondItems = ArrayHelper::map(ClnBoundaryInj::find()->all(), 'BOND_GEN_NO', 'BOND_NAME');
     $searchClnMedicineTestSearchModel = new \app\models\ClnMedicineTestSearch();
     $queryParams = array();
     $queryParams = Yii::$app->request->queryParams;
     $queryParams['ClnMedicineTestSearch']['TRAN_INJ_GEN_NO'] = $id;
     $dataClnMedicineTestProvider = $searchClnMedicineTestSearchModel->search($queryParams);
     //Yii::$app->request->queryParams);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->TRAN_INJ_GEN_NO]);
     } else {
         return $this->render('update', ['model' => $model, 'modelClnDiagnose' => $modelClnDiagnose, 'sportItems' => $sportItems, 'causeItems' => $causeItems, 'bondItems' => $bondItems, 'searchClnMedicineTestSearchModel' => $searchClnMedicineTestSearchModel, 'dataClnMedicineTestProvider' => $dataClnMedicineTestProvider]);
     }
 }
Esempio n. 3
0
 /**
  * Finds the ClnSport model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return ClnSport the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = ClnSport::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Esempio n. 4
0
                    <?php 
echo $form->field($model, 'REGISTER_GEN_NO')->hiddenInput()->label(false);
?>
     
                    
                    <?php 
echo $form->field($model, 'DIAGNOSE_TYPE')->radioList(['1' => 'กีฬา', '2' => 'ทั่วไป'], ['separator' => '<span style="padding: 0 40px">&nbsp;</span>', 'tabindex' => 3]);
?>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                            
                            <?php 
echo $form->field($model, 'SPORT_GEN_NO')->widget(Select2::classname(), ['data' => ArrayHelper::map(ClnSport::find()->all(), 'SPORT_GEN_NO', 'SPORT_NAME'), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
                            <?php 
echo $form->field($model, 'CAUSE_GEN_NO')->widget(Select2::classname(), ['data' => ArrayHelper::map(ClnCauseInj::find()->all(), 'CAUSE_GEN_NO', 'CAUSE_NAME'), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
   

                            <?php 
echo $form->field($model, 'BOND_GEN_NO')->widget(Select2::classname(), ['data' => ArrayHelper::map(ClnBoundaryInj::find()->all(), 'BOND_GEN_NO', 'BOND_NAME'), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
                                                                                      
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                            <?php