Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = LgKendaraan::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(['kode' => $this->kode, 'tahun_pembelian' => $this->tahun_pembelian, 'jenis_transportasi' => $this->jenis_transportasi, 'penanggung_jawab' => $this->penanggung_jawab, 'berat_muatan' => $this->berat_muatan, 'status_pemakaian' => $this->status_pemakaian]);
     $query->andFilterWhere(['like', 'nomor_polisi', $this->nomor_polisi])->andFilterWhere(['like', 'bahan_bakar', $this->bahan_bakar]);
     return $dataProvider;
 }
Beispiel #2
0
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\models\logistic\LgKendaraan;
/* @var $this yii\web\View */
/* @var $model app\models\logistic\LgStatusKendaraan */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="lg-status-kendaraan-form">

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

    <?php 
echo $form->field($model, 'kendaraan')->dropdownList(LgKendaraan::find()->select(['nomor_polisi', 'kode'])->indexBy('kode')->column(), ['prompt' => 'Select Kendaraan', 'disabled' => true]);
?>

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

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

    <?php 
echo $form->field($model, 'tanggal_solusi')->textInput(['readonly' => true, 'value' => date("Y-m-h")]);
?>

    <?php