/**
  * ACTION INDEX
  */
 public function actionIndex()
 {
     /*CNT Barang Prodak*/
     $cntBrgProdak = "SELECT COUNT(KD_BARANG) As KD_BARANG FROM b0001 WHERE PARENT=1";
     $cntBrgPrdk = Barang::findBySql($cntBrgProdak)->one();
     /*CNT Barang Umum*/
     $cntBrgUmum = "SELECT COUNT(KD_BARANG) As KD_BARANG FROM b0001 WHERE PARENT=0";
     $cntBrgUmn = Barang::findBySql($cntBrgUmum)->one();
     /*CNT Barang Type*/
     $cntType = "SELECT  COUNT(NM_TYPE) as NM_TYPE FROM b1001";
     $cntTyp = Tipebarang::findBySql($cntType)->one();
     /*CNT Barang Kategori*/
     $cntCategory = "SELECT COUNT(NM_KATEGORI) as NM_KATEGORI FROM b1002";
     $cntCtg = Kategori::findBySql($cntCategory)->one();
     /*CNT Barang Unit*/
     $cntUnit = "SELECT COUNT(KD_UNIT) as KD_UNIT FROM ub0001";
     $cntUnt = Unitbarang::findBySql($cntUnit)->one();
     /*CNT Supplier*/
     $cntSupplier = "SELECT COUNT(KD_SUPPLIER) as KD_SUPPLIER FROM s1000";
     $cntSpl = Suplier::findBySql($cntSupplier)->one();
     /*CNT Distributor*/
     $cntDistributor = "SELECT COUNT(KD_DISTRIBUTOR) as KD_DISTRIBUTOR FROM d0001";
     $cntDist = Distributor::findBySql($cntDistributor)->one();
     /*CNT Customer*/
     $cntCustomer = "SELECT COUNT(CUST_KD) as CUST_KD FROM c0001";
     $cntCst = Customers::findBySql($cntCustomer)->one();
     //print_r($cntBrgPrdk->KD_BARANG);
     return $this->render('index', ['cntBrgPrdk' => $cntBrgPrdk->KD_BARANG, 'cntBrgUmn' => $cntBrgUmn->KD_BARANG, 'cntTyp' => $cntTyp->NM_TYPE, 'cntCtg' => $cntCtg->NM_KATEGORI, 'cntUnt' => $cntUnt->KD_UNIT, 'cntSpl' => $cntSpl->KD_SUPPLIER, 'cntDist' => $cntDist->KD_DISTRIBUTOR, 'cntCst' => $cntCst->CUST_KD]);
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Tipebarang::find()->where('STATUS <> 3')->groupBy(['PARENT', 'CORP_ID', 'KD_TYPE']);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 20]]);
     $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, 'PARENT' => $this->PARENT, 'CORP_ID' => $this->getAttribute('corp.CORP_NM')]);
     $query->andFilterWhere(['like', 'KD_TYPE', $this->KD_TYPE])->andFilterWhere(['like', 'NM_TYPE', $this->NM_TYPE])->andFilterWhere(['like', 'NOTE', $this->NOTE]);
     //           ->andFilterWhere(['like', 'CREATED_BY', $this->created_by])
     //           ->andFilterWhere(['like', 'UPDATED_BY', $this->updated_by]);
     return $dataProvider;
 }
Beispiel #3
0
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use kartik\builder\Form;
use kartik\widgets\TouchSpin;
use yii\web\JsExpression;
use yii\data\ActiveDataProvider;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\master\models\Barang;
use lukisongroup\hrd\models\Corp;
$userCorp = ArrayHelper::map(Corp::find()->where('CORP_STS<>3')->all(), 'CORP_ID', 'CORP_NM');
$brgUnit = ArrayHelper::map(Unitbarang::find()->where('STATUS<>3')->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT');
$brgType = ArrayHelper::map(Tipebarang::find()->where('PARENT=1 AND STATUS<>3')->orderBy('NM_TYPE')->all(), 'KD_TYPE', 'NM_TYPE');
$brgKtg = ArrayHelper::map(Kategori::find()->where('PARENT=1 AND STATUS<>3')->orderBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$brgProdak = ArrayHelper::map(Barang::find()->where('PARENT=1 AND STATUS<>3')->orderBy('NM_BARANG')->all(), 'KD_BARANG', 'NM_BARANG');
?>


    <?php 
$form = ActiveForm::begin(['id' => 'roInput', 'enableClientValidation' => true, 'method' => 'post', 'action' => ['/purchasing/request-order/simpanfirst']]);
?>
	<?php 
//= $form->errorSummary($model);
?>
	
    <?php 
echo $form->field($roDetail, 'CREATED_AT', ['template' => "{input}"])->hiddenInput(['value' => date('Y-m-d H:i:s'), 'readonly' => true]);
?>
Beispiel #4
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use kartik\grid\GridView;
use yii\bootstrap\Modal;
use lukisongroup\master\models\Barang;
use lukisongroup\hrd\models\Corp;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
$userCorp = ArrayHelper::map(Corp::find()->where('CORP_STS<>3')->all(), 'CORP_ID', 'CORP_NM');
$typeBrg = ArrayHelper::map(Tipebarang::find()->where('STATUS<>3 and PARENT=1')->groupBy('NM_TYPE')->all(), 'KD_TYPE', 'NM_TYPE');
$kat = ArrayHelper::map(Kategori::find()->where('STATUS<>3 and PARENT=1')->groupBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
/*
 * Declaration Componen User Permission
 * Function profile_user
 */
function getPermissionEmp()
{
    if (Yii::$app->getUserOpt->profile_user()) {
        return Yii::$app->getUserOpt->profile_user()->emp;
    } else {
        return false;
    }
}
$this->sideCorp = 'Master Data';
/* Title Select Company pada header pasa sidemenu/menu samping kiri */
$this->sideMenu = 'umum_datamaster';
/* kd_menu untuk list menu pada sidemenu, get from table of database */
$this->title = Yii::t('app', 'Umum - Barang ');
$aryStt = [['STATUS' => 0, 'STT_NM' => 'DISABLE'], ['STATUS' => 1, 'STT_NM' => 'ENABLE']];
 /**
  * DepDrop | CORP-TYPE - KAT
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionCorpType()
 {
     $out = [];
     if (isset($_POST['depdrop_parents'])) {
         $parents = $_POST['depdrop_parents'];
         if ($parents != null) {
             $corp_id = $parents[0];
             $model = Tipebarang::find()->asArray()->where(['CORP_ID' => $corp_id, 'PARENT' => 1])->all();
             foreach ($model as $key => $value) {
                 $out[] = ['id' => $value['KD_TYPE'], 'name' => $value['NM_TYPE']];
             }
             echo json_encode(['output' => $out, 'selected' => '']);
             return;
         }
     }
     echo Json::encode(['output' => '', 'selected' => '']);
 }
Beispiel #6
0
use yii\helpers\ArrayHelper;
use kartik\widgets\DepDrop;
use kartik\widgets\Select2;
use yii\helpers\Url;
use kartik\builder\Form;
use kartik\widgets\TouchSpin;
use yii\web\JsExpression;
use yii\data\ActiveDataProvider;
use lukisongroup\purchasing\models\ro\RodetailSearch;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Barang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\hrd\models\Corp;
$userCorp = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
$brgType = ArrayHelper::map(Tipebarang::find()->where(['PARENT' => 0])->orderBy('NM_TYPE')->all(), 'KD_TYPE', 'NM_TYPE');
$brgUnit = ArrayHelper::map(Unitbarang::find()->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT');
$brgKtg = ArrayHelper::map(Kategori::find()->where(['PARENT' => 0, 'STATUS' => 1])->orderBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$brgUmum = ArrayHelper::map(Barang::find()->where(['PARENT' => 0, 'STATUS' => 1])->orderBy('NM_BARANG')->all(), 'KD_BARANG', 'NM_BARANG');
?>
	<?php 
/*
 * DESCRIPTION FORM AddItem
 * Form Add Items Hanya ada pada Form Edit | ACTION addItem
 * Items Barang tidak bisa di input Duplicated. | Unix by KD_RO dan KD_BARANG
 * @author ptrnov  <*****@*****.**>
 * @since 1.1
 */
?>

	<div  style="padding-top:20">
Beispiel #7
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use kartik\form\ActiveForm;
use kartik\widgets\SwitchInput;
use kartik\widgets\Select2;
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use lukisongroup\hrd\models\Corp;
use lukisongroup\master\models\Tipebarang;
$userCorp = ArrayHelper::map(Corp::find()->where('CORP_STS<>3')->all(), 'CORP_ID', 'CORP_NM');
$typeBrg = ArrayHelper::map(Tipebarang::find()->where('STATUS<>3')->all(), 'KD_TYPE', 'NM_TYPE');
$aryParent = [['PARENT' => 0, 'PAREN_NM' => 'UMUM'], ['PARENT' => 1, 'PAREN_NM' => 'PRODAK']];
$valParent = ArrayHelper::map($aryParent, 'PARENT', 'PAREN_NM');
?>

<div class="kategori-form">

    <?php 
$form = ActiveForm::begin(['id' => 'createkat', 'enableClientValidation' => true, 'type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'action' => ['kategori/simpan']]);
?>

    <?php 
echo $form->field($model, 'PARENT')->dropDownList($valParent, ['id' => 'kategori-parent']);
?>
	
	<?php 
echo $form->field($model, 'CORP_ID')->dropDownList($userCorp, ['id' => 'kategori-kd_corp'])->label('Corporate');
?>
	
Beispiel #8
0
 public function getTypebrg()
 {
     return $this->hasOne(Tipebarang::className(), ['KD_TYPE' => 'KD_TYPE']);
 }
Beispiel #9
0
<?php

use yii\helpers\Html;
use kartik\form\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use kartik\widgets\FileInput;
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\master\models\Suplier;
use lukisongroup\hrd\models\Corp;
$drop = ArrayHelper::map(Corp::find()->where('CORP_STS=1 AND CORP_ID="GSN"')->all(), 'CORP_ID', 'CORP_NM');
$droptype = ArrayHelper::map(Tipebarang::find()->where('STATUS<>3 and PARENT=1')->all(), 'KD_TYPE', 'NM_TYPE');
$dropkat = ArrayHelper::map(Kategori::find()->where('STATUS<>3 and PARENT=1')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$dropunit = ArrayHelper::map(Unitbarang::find()->all(), 'KD_UNIT', 'NM_UNIT');
$dropsup = ArrayHelper::map(Suplier::find()->all(), 'KD_SUPPLIER', 'NM_SUPPLIER');
?>

<div class="barang-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'id' => 'form-prodak-id', 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data']]);
?>
		<?php 
echo $form->field($model, 'PARENT')->hiddenInput(['value' => 1, 'maxlength' => true])->label(false);
?>
		<?php 
echo $form->field($model, 'KD_CORP')->dropDownList($drop, ['id' => 'barang-kd_corp', 'readonly' => true])->label('Perusahaan');
Beispiel #10
0
use yii\helpers\Html;
use kartik\form\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use kartik\widgets\FileInput;
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\master\models\Suplier;
use lukisongroup\hrd\models\Corp;
// 'STATUS' => 1,'PARENT'=>0,'NM_TYPE'=> "<>UNKNOWN"]
$drop = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
$droptype = ArrayHelper::map(Tipebarang::find()->where('STATUS = 1 AND PARENT = 0 AND KD_TYPE <> 30')->all(), 'KD_TYPE', 'NM_TYPE');
$dropkat = ArrayHelper::map(Kategori::find()->where(['STATUS' => 1, 'PARENT' => 0])->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$dropunit = ArrayHelper::map(Unitbarang::find()->all(), 'KD_UNIT', 'NM_UNIT');
$dropsup = ArrayHelper::map(Suplier::find()->all(), 'KD_SUPPLIER', 'NM_SUPPLIER');
?>

<div class="barang-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'id' => 'form-umum-id', 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data']]);
?>
		<?php 
echo $form->field($model, 'PARENT')->hiddenInput(['value' => 0, 'maxlength' => true])->label(false);
?>
		<?php 
echo $form->field($model, 'KD_CORP')->dropDownList($drop, ['id' => 'barang-kd_corp', 'prompt' => ' -- Pilih Salah Satu --'])->label('Perusahaan');
Beispiel #11
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use kartik\grid\GridView;
use yii\bootstrap\Modal;
use lukisongroup\master\models\Barang;
use lukisongroup\hrd\models\Corp;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
$userCorp = ArrayHelper::map(Corp::find()->where('CORP_STS<>3')->all(), 'CORP_ID', 'CORP_NM');
$typeBrg = ArrayHelper::map(Tipebarang::find()->where('STATUS<>3 and PARENT=0 and NM_TYPE <> "UNKNOWN"')->all(), 'KD_TYPE', 'NM_TYPE');
$kat = ArrayHelper::map(Kategori::find()->where('STATUS<>3 and PARENT=0 and NM_KATEGORI <> "UNKNOWN"')->groupBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$this->sideCorp = 'Master Data';
/* Title Select Company pada header pasa sidemenu/menu samping kiri */
$this->sideMenu = 'umum_datamaster';
/* kd_menu untuk list menu pada sidemenu, get from table of database */
$this->title = Yii::t('app', 'Umum - Barang ');
$aryStt = [['STATUS' => 0, 'STT_NM' => 'DISABLE'], ['STATUS' => 1, 'STT_NM' => 'ENABLE']];
$valStt = ArrayHelper::map($aryStt, 'STATUS', 'STT_NM');
$gridColumns = [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style'], 'width' => '10px', 'header' => 'No.', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'Image', 'mergeHeader' => true, 'format' => 'html', 'value' => function ($data) {
    return Html::img(Yii::$app->urlManager->baseUrl . '/upload/barang/' . $data->IMAGE, ['width' => '40']);
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '40px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']]], ['attribute' => 'KD_BARANG', 'label' => 'SKU', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'NM_BARANG', 'label' => 'Item Name', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'unitbrg', 'label' => 'Item Unit', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'HARGA_SPL', 'label' => 'Price', 'hAlign' => 'left', 'vAlign' => 'middle', 'format' => ['decimal', 2], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'corp.CORP_NM', 'label' => 'Corporation', 'filter' => $userCorp, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'tipebrg', 'label' => 'Type', 'filterType' => GridView::FILTER_SELECT2, 'filter' => $typeBrg, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Any author'], 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'nmkategori', 'label' => 'Category', 'filterType' => GridView::FILTER_SELECT2, 'filter' => $kat, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Any author'], 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'STATUS', 'filter' => $valStt, 'format' => 'raw', 'hAlign' => 'center', 'value' => function ($model) {
    if ($model->STATUS == 1) {
        return Html::a('<i class="fa fa-check"></i> &nbsp;Enable', '', ['class' => 'btn btn-success btn-xs', 'title' => 'Aktif']);
    } else {
        if ($model->STATUS == 0) {
            return Html::a('<i class="fa fa-close"></i> &nbsp;Disable', '', ['class' => 'btn btn-danger btn-xs', 'title' => 'Deactive']);
        }
    }
}, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(126, 189, 188, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{view}{update}{price}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['view' => function ($url, $model, $key) {
 /**
  * Finds the Tipebarang model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @param string $kd_type
  * @return Tipebarang the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ID, $KD_TYPE)
 {
     if (($model = Tipebarang::findOne(['ID' => $ID, 'KD_TYPE' => $KD_TYPE])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #13
0
<?php

use yii\helpers\Html;
use kartik\form\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use kartik\widgets\FileInput;
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\master\models\Suplier;
use lukisongroup\hrd\models\Corp;
$drop = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
$droptype = ArrayHelper::map(Tipebarang::find()->where(['STATUS' => 1, 'PARENT' => 0])->all(), 'KD_TYPE', 'NM_TYPE');
$dropkat = ArrayHelper::map(Kategori::find()->where(['STATUS' => 1, 'PARENT' => 0])->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$dropunit = ArrayHelper::map(Unitbarang::find()->all(), 'KD_UNIT', 'NM_UNIT');
$dropsup = ArrayHelper::map(Suplier::find()->all(), 'KD_SUPPLIER', 'NM_SUPPLIER');
?>

<div class="barang-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'id' => 'form-umum-id', 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data']]);
?>
		<?php 
echo $form->field($model, 'PARENT')->hiddenInput(['value' => 0, 'maxlength' => true])->label(false);
?>
		<?php 
echo $form->field($model, 'KD_CORP')->dropDownList($drop, ['id' => 'barang-kd_corp', 'prompt' => ' -- Pilih Salah Satu --'])->label('Perusahaan');
Beispiel #14
0
<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use yii\bootstrap\Modal;
use yii\helpers\ArrayHelper;
use lukisongroup\master\models\Tipebarang;
/* @var $this yii\web\View */
/* @var $searchModel lukisongroup\master\models\BarangaliasSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
/*
 * Declaration Componen User Permission
 * Function profile_user
*/
$datatype = ArrayHelper::map(Tipebarang::find()->where('STATUS<>3')->groupBy('NM_TYPE')->all(), 'KD_TYPE', 'NM_TYPE');
$aryParent = [['PARENT' => 0, 'PAREN_NM' => 'UMUM'], ['PARENT' => 1, 'PAREN_NM' => 'PRODAK']];
$valParent = ArrayHelper::map($aryParent, 'PARENT', 'PAREN_NM');
$gridColumns = [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style'], 'width' => '10px', 'header' => 'No.', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'KD_PARENT', 'label' => 'Parent', 'filter' => $valParent, 'value' => function ($model, $key, $index, $widget) {
    if ($model->KD_PARENT == 1) {
        return 'PRODAK';
    } else {
        return 'UMUM';
    }
}, 'group' => true, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'disnm', 'label' => 'Nama Distributor', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'brgnm', 'label' => 'NM_BARANG', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'KD_ALIAS', 'label' => 'Nama Alias', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '200px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{view}{update}{price}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['view' => function ($url, $model, $key) {
    return '<li>' . Html::a('<span class="fa fa-eye fa-dm"></span>' . Yii::t('app', 'View'), ['/master/barangalias/view', 'id' => $model->ID], ['data-toggle' => "modal", 'data-target' => "#modal-view", 'data-title' => $model->KD_BARANG]) . '</li>' . PHP_EOL;
}, 'update' => function ($url, $model, $key) {
    return '<li>' . Html::a('<span class="fa fa-edit fa-dm"></span>' . Yii::t('app', 'Edit'), ['update', 'id' => $model->ID], ['data-toggle' => "modal", 'data-target' => "#modal-create", 'data-title' => $model->KD_BARANG]) . '</li>' . PHP_EOL;
}], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'height' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]]];
?>
<div class="container-full">
	<div style="padding-left:15px; padding-right:15px">
Beispiel #15
0
/* @var $model lukisongroup\models\master\Barang */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="barang-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]);
?>

    <?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()->all(), 'ID', 'NM_UNIT');
?>