Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = AppCar::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, 'car_type' => $this->car_type, 'owner_type' => $this->owner_type, 'gender' => $this->gender, 'age' => $this->age, 'province' => $this->province, 'country' => $this->country, 'start_date' => $this->start_date, 'end_date' => $this->end_date, 'start_province' => $this->start_province, 'start_border_point' => $this->start_border_point, 'target_province' => $this->target_province, 'out_province' => $this->out_province, 'out_border_point' => $this->out_border_point, 'request_chanel' => $this->request_chanel, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'cretaed_by' => $this->cretaed_by, 'updated_by' => $this->updated_by, 'approve_status' => $this->approve_status, 'approve_by' => $this->approve_by, 'approve_date' => $this->approve_date, 'approve_comment' => $this->approve_comment, 'dlt_office' => $this->dlt_office, 'dlt_br' => $this->dlt_br, 'brands' => $this->brands, 'weight' => $this->weight, 'total_weight' => $this->total_weight, 'seat' => $this->seat, 'car_color' => $this->car_color, 'carbody_no' => $this->carbody_no]);
     $query->andFilterWhere(['like', 'fullname', $this->fullname])->andFilterWhere(['like', 'passport', $this->passport])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'telephone', $this->telephone])->andFilterWhere(['like', 'car_enroll_country', $this->car_enroll_country])->andFilterWhere(['like', 'plates_number', $this->plates_number])->andFilterWhere(['like', 'appearance', $this->appearance])->andFilterWhere(['like', 'models', $this->models])->andFilterWhere(['like', 'car_color', $this->car_color])->andFilterWhere(['like', 'engine_no', $this->engine_no]);
     return $dataProvider;
 }
Esempio n. 2
0
$form = ActiveForm::begin(['id' => $model->formName(), 'options' => ['class' => 'inline', 'enctype' => 'multipart/form-data']]);
$request = Yii::$app->request;
$get = $request->get();
$id = $request->get('id');
?>
    <?php 
echo $form->errorSummary($model);
?>
    <?php 
echo $form->field($model, 'ref')->hiddenInput()->label(false);
?>
    <div class="row">
        <div class="col-md-4">

            <?php 
echo $form->field($model, 'drivers_title')->label('คำนำหน้า')->dropDownList(AppCar::itemAlias('prefixs'));
?>
        </div>
        <div class="col-md-4">
            <?php 
echo $form->field($model, 'drivers_name')->textInput(['maxlength' => true]);
?>
        </div>
        <div class="col-md-4">
            <?php 
echo $form->field($model, 'drivers_lastname')->textInput(['maxlength' => true]);
?>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4"><?php 
Esempio n. 3
0
<div class="panel panel-info">
    <div class="panel-heading">##</div>
    <div class="panel-body">

        <?php 
$form = ActiveForm::begin();
?>
        <div class="row">
            <div class="row">
                <?php 
echo $form->errorSummary($model2);
?>
            </div>
            <div class="col-md-3 col-xs-3">
                คำนำหน้า<?php 
echo $form->field($model2, 'drivers_title')->inline()->label(false)->radioList(AppCar::itemAlias('prefixs'));
?>
            </div> 
            <div class="col-md-4 col-xs-4">
                ชื่อ<?php 
echo $form->field($model2, 'drivers_name')->textInput(['maxlength' => true])->label(false);
?>
            </div>
            <div class="col-md-4 col-xs-4">
                นามสกุล<?php 
echo $form->field($model2, 'drivers_lastname')->textInput(['maxlength' => true])->label(false);
?>
            </div>
            <div></div>
        </div>
        <div class="row">
Esempio n. 4
0
                <div class="col-md-4 col-xs-4  divbox-dlt">
                    <span>ประเภทรถ</span><?php 
echo $form->field($model, 'car_type')->inline()->label(false)->radioList(AppCar::itemAlias('cartype'));
?>
                </div>
                <div class="col-md-1"></div>
                <div class="col-md-4 col-xs-4 divbox-dlt">
                    <span>ผู้ขออนุญาต</span><?php 
echo $form->field($model, 'owner_type')->inline()->label(false)->radioList(AppCar::itemAlias('ownertype'));
?>
                </div>
            </div><hr/>
            <div class="row">
                <div class="col-md-2 col-xs-2">
                    <span>คำนำหน้า</span>   <?php 
echo $form->field($model, 'gender')->label(false)->dropDownList(AppCar::itemAlias('prefixs'));
?>
                </div>
                <div class="col-md-4 col-xs-4">
                    <span>ข้าพเจ้า </span><?php 
echo $form->field($model, 'fullname')->textInput(['maxlength' => true, 'placeholder' => 'ชื่อ - นามสกุล'])->label(false);
?>
                </div>
                <div class="col-md-2 col-xs-2">
                    <span>อายุ</span><?php 
echo $form->field($model, 'age')->textInput(['maxlength' => true, 'placeholder' => '0'])->label(false);
?>
                </div>
                <div class="col-md-4 col-xs-4">
                    <span>เลขที่หนังสือหนังสือเดินทาง</span><?php 
echo $form->field($model, 'passport')->widget(\yii\widgets\MaskedInput::classname(), ['mask' => '99-9999-9999'])->label(false);
Esempio n. 5
0
echo $form->field($model, 'confirm_password')->passwordInput(['maxlength' => true]);
?>
        </div>
    </div>
<?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>
    <div class="panel panel-info">
        <div class="panel-heading">
            ข้อมูลส่วนตัว
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-3">
                    <span>คำนำหน้า</span>   <?php 
echo $form->field($modelUser, 'title')->label(false)->radioList(AppCar::itemAlias('prefixs'));
?>
                </div>
                <div class="col-md-3">
<?php 
echo $form->field($modelUser, 'name')->textInput(['maxlength' => true]);
?>
                </div>
                <div class="col-md-3">
<?php 
echo $form->field($modelUser, 'lname')->textInput(['maxlength' => true]);
?>
                </div>
                <div class="col-md-3">
<?php 
echo $form->field($modelUser, 'id_no')->textInput();
Esempio n. 6
0
 /**
  * Finds the AppCar model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return AppCar the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = AppCar::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }