Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Distributor::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_Distributor' => $this->ID_Distributor]);
     $query->andFilterWhere(['like', 'Nama', $this->Nama]);
     return $dataProvider;
 }
Beispiel #2
0
?>

    <?php 
echo $form->field($model, 'Kode_PO')->textInput();
?>

    <?php 
echo $form->field($model, 'Kode_Barang')->dropDownList(ArrayHelper::map(Barang::find()->all(), 'Kode_Barang', 'Nama_Barang'), ['prompt' => 'Select Barang']);
?>

    <?php 
echo $form->field($model, 'Jumlah')->textInput();
?>

    <?php 
echo $form->field($model, 'Distributor_ID')->dropDownList(ArrayHelper::map(Distributor::find()->all(), 'ID_Distributor', 'Nama'), ['prompt' => 'Select Distributor']);
?>

   
 <?php 
echo $form->field($model, 'Tanggal_Order')->textInput(['maxlength' => 255, 'class' => 'form-control input-datepicker class'])->label('Tanggal Order');
?>
    <?php 
echo $form->field($model, 'Status')->textInput();
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
 public function actionDistributordelete($id)
 {
     $model = Distributor::findOne($id)->delete();
     $this->layout = $this->CheckSession();
     return $this->redirect(['warehouse/distributorindex']);
 }
Beispiel #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDistributor()
 {
     return $this->hasOne(Distributor::className(), ['ID_Distributor' => 'Distributor_ID']);
 }
Beispiel #5
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use app\models\warehouse\Distributor;
$roleModel = new Distributor();
/* @var $this yii\web\View */
/* @var $searchModel app\models\DistributorSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Data Distributor';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="side">
    <div class="sub-sidebar-wrapper">
      <ul class="nav">
      <?php 
echo Nav::widget(['items' => [['label' => 'Barang', 'url' => ['/warehouse/barangindex']], ['label' => 'Kemasan', 'url' => ['/warehouse/kemasanindex']], ['label' => 'Jenis Barang', 'url' => ['/warehouse/jenisbarangindex']], ['label' => 'Gudang', 'url' => ['/warehouse/gudangindex']], ['label' => 'Blok', 'url' => ['/warehouse/blokindex']], ['label' => 'Distributor', 'url' => ['warehouse/distributorindex']]]]);
?>
      </ul>
    </div>
</div>
<div class="col-md-12">
    <div class="widget widget-green">
        <div class="widget-title">
            <div class="widget-controls">
                <a href="#" class="widget-control widget-control-full-screen" data-toggle="tooltip" data-placement="top" title="" data-original-title="Full Screen"><i class="fa fa-expand"></i></a>
                <a href="#" class="widget-control widget-control-full-screen widget-control-show-when-full" data-toggle="tooltip" data-placement="left" title="" data-original-title="Exit Full Screen"><i class="fa fa-expand"></i></a>
                <a href="#" class="widget-control widget-control-refresh" data-toggle="tooltip" data-placement="top" title="" data-original-title="Refresh"><i class="fa fa-refresh"></i></a>
                <a href="#" class="widget-control widget-control-minimize" data-toggle="tooltip" data-placement="top" title="" data-original-title="Minimize"><i class="fa fa-minus-circle"></i></a>