Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Unitbarang::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, 'QTY' => $this->QTY, 'SIZE' => $this->SIZE, 'WEIGHT' => $this->WEIGHT, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'KD_UNIT', $this->KD_UNIT])->andFilterWhere(['like', 'NM_UNIT', $this->NM_UNIT])->andFilterWhere(['like', 'COLOR', $this->COLOR])->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]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
 public function getUnitb()
 {
     return $this->hasOne(Unitbarang::className(), ['ID' => 'KD_UNIT']);
 }
Ejemplo n.º 3
0
 /**
  * Finds the Unitbarang model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Unitbarang the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ID)
 {
     if (($model = Unitbarang::findOne($ID)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 4
0
$drop = ArrayHelper::map(Tipebarang::find()->where(['STATUS' => 1])->all(), 'KD_TYPE', 'NM_TYPE');
?>
    <?php 
echo $form->field($model, 'KD_TYPE')->dropDownList($drop, ['prompt' => ' -- Pilih Salah Satu --'])->label('Type Barang');
?>
	
	<?php 
$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']]]);