Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Customs::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, 'customs_office_id' => $this->customs_office_id]);
     $query->andFilterWhere(['like', 'customs_name', $this->customs_name])->andFilterWhere(['like', 'customs_prv', $this->customs_prv])->andFilterWhere(['like', 'customs_amp', $this->customs_amp])->andFilterWhere(['like', 'customs_zipcode', $this->customs_zipcode])->andFilterWhere(['like', 'customs_tel', $this->customs_tel]);
     return $dataProvider;
 }
Example #2
0
    <div class="box box-default">
        <div class="box-header with-border">
            <h3 class="box-title"><i class="glyphicon glyphicon-cog"></i> Master Configuration</h3>
        </div>
        <div class="box-body">
            <div class="row">
                <div class="col-md-4 col-sm-6 col-xs-12">
                    <div class="edusec-link-box">
                        <span class="edusec-link-box-icon bg-light-blue-active"><i class="fa fa-flag"></i></span>
                        <div class="edusec-link-box-content">
                            <span class="edusec-link-box-text"><?php 
echo Html::a('ด่านศุลกากร', ['/configuration/customs/index']);
?>
</span>
                            <span class="edusec-link-box-number"><?php 
echo Customs::find()->count();
?>
</span>
                            <span class="edusec-link-box-desc">ข้อมูลด่านศุลกากร</span>
                            <span class="edusec-link-box-bottom"><?php 
echo Html::a('<i class="fa fa-plus-square"></i> Create New', ['/configuration/customs/create']);
?>
</span>
                        </div><!-- /.info-box-content -->
                    </div><!-- /.info-box -->
                </div>
                <div class="col-md-4 col-sm-6 col-xs-12">
                    <div class="edusec-link-box">
                        <span class="edusec-link-box-icon bg-light-blue-active"><i class="glyphicon glyphicon-list-alt"></i></span>
                        <div class="edusec-link-box-content">
                            <span class="edusec-link-box-text"><?php 
Example #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCustoms()
 {
     return $this->hasMany(Customs::className(), ['customs_office_id' => 'id']);
 }
 /**
  * Finds the Customs model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Customs the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Customs::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }