示例#1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Kategori::find()->where('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(['CREATED_AT' => $this->CREATED_AT, 'UPDATED_AT' => $this->UPDATED_AT, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'KD_KATEGORI', $this->KD_KATEGORI])->andFilterWhere(['like', 'NM_KATEGORI', $this->NM_KATEGORI])->andFilterWhere(['like', 'NOTE', $this->NOTE]);
     //            ->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])
     //            ->andFilterWhere(['like', 'UPDATED_BY', $this->UPDATED_BY]);
     return $dataProvider;
 }
示例#2
0
文件: _update.php 项目: C12D/advanced
?>

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

	<?php 
$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()->where(['STATUS' => 1])->all(), 'KD_UNIT', 'NM_UNIT');
?>
    <?php 
echo $form->field($model, 'KD_UNIT')->dropDownList($drop, ['prompt' => ' -- Pilih Salah Satu --'])->label('Unit');
?>

	<?php 
$drop = ArrayHelper::map(Suplier::find()->where(['STATUS' => 1])->all(), 'KD_SUPPLIER', 'NM_SUPPLIER');
?>
示例#3
0
 /**
  * Deletes an existing Kategori model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param string $id
  * @param string $kd_kategori
  * @return mixed
  */
 public function actionDelete($ID, $KD_KATEGORI)
 {
     $model = Kategori::find()->where(['ID' => $ID, 'KD_KATEGORI' => $KD_KATEGORI])->one();
     $model->STATUS = 3;
     $model->UPDATED_BY = Yii::$app->user->identity->username;
     $model->save();
     // equivalent to $model->update();
     //$this->findModel($ID, $KD_KATEGORI)->delete();
     return $this->redirect(['index']);
 }