Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Distributor::find()->where('d0001.STATUS <> 3');
     $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, 'TLP1' => $this->TLP1, 'TLP2' => $this->TLP2, 'FAX' => $this->FAX, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'KD_DISTRIBUTOR', $this->KD_DISTRIBUTOR])->andFilterWhere(['like', 'NM_DISTRIBUTOR', $this->NM_DISTRIBUTOR])->andFilterWhere(['like', 'ALAMAT', $this->ALAMAT])->andFilterWhere(['like', 'PIC', $this->PIC])->andFilterWhere(['like', 'EMAIL', $this->EMAIL])->andFilterWhere(['like', 'WEBSITE', $this->WEBSITE])->andFilterWhere(['like', 'NOTE', $this->NOTE])->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])->andFilterWhere(['like', 'CREATED_AT', $this->CREATED_AT])->andFilterWhere(['like', 'UPDATED_AT', $this->UPDATED_AT])->andFilterWhere(['like', 'DATA_ALL', $this->DATA_ALL]);
     return $dataProvider;
 }
Example #2
0
 public function getDbtr()
 {
     return $this->hasOne(Distributor::className(), ['KD_DISTRIBUTOR' => 'KD_DISTRIBUTOR']);
 }
Example #3
0
 /**
  * Finds the Distributor model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Distributor the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Distributor::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #4
0
$drop = ArrayHelper::map(Kategori::find()->where(['STATUS' => 1])->all(), 'KD_KATEGORI', 'NM_KATEGORI');
?>
    <?php 
echo $form->field($model, 'KD_KATEGORI')->dropDownList($drop, ['prompt' => ' -- Pilih Salah Satu --'])->label('Kategori');
?>
	
	
	<?php 
$drop = ArrayHelper::map(Unitbarang::find()->all(), 'KD_UNIT', 'NM_UNIT');
?>
    <?php 
echo $form->field($model, 'KD_UNIT')->dropDownList($drop, ['prompt' => ' -- Pilih Salah Satu --']);
?>
	
	<?php 
$drop = ArrayHelper::map(Distributor::find()->all(), 'KD_DISTRIBUTOR', 'NM_DISTRIBUTOR');
?>
    <?php 
echo $form->field($model, 'KD_DISTRIBUTOR')->dropDownList($drop, ['prompt' => ' -- Pilih Salah Satu --']);
?>

	
	<?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png']]]);
?>

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

    <?php