Example #1
0
 public function search($params)
 {
     $query = OrgnModel::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id_orgn' => $this->id_orgn, 'create_by' => $this->create_by, 'update_by' => $this->update_by]);
     $query->andFilterWhere(['like', 'cd_orgn', $this->cd_orgn])->andFilterWhere(['like', 'nm_orgn', $this->nm_orgn])->andFilterWhere(['like', 'create_at', $this->create_at])->andFilterWhere(['like', 'update_at', $this->update_at]);
     return $dataProvider;
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdOrgn()
 {
     return $this->hasOne(Orgn::className(), ['id_orgn' => 'id_orgn']);
 }
 /**
  * Finds the Orgn model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param  integer               $id
  * @return Orgn                  the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Orgn::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #4
0
 public static function getOrgnList($id_orgn = null)
 {
     if ($id_orgn === null) {
         return ArrayHelper::map(Orgn::find()->all(), 'id_orgn', 'nm_orgn');
     }
 }
Example #5
0
 * @var yii\widgets\ActiveForm $form
 */
?>

<div class="branch-form col-lg-6" style="padding-left: 0px;">

    <?php 
$form = ActiveForm::begin();
?>
    <div class="panel panel-primary">
        <div class="panel-heading">
            Branch
        </div>
        <div class="panel-body">
            <?php 
echo $form->field($model, 'id_orgn')->dropDownList(ArrayHelper::map(Orgn::find()->all(), 'id_orgn', 'nm_orgn'), ['style' => 'width:200px;']);
?>

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

            <?php 
echo $form->field($model, 'nm_branch')->textInput(['maxlength' => 32]);
?>
        </div>
    </div>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);