protected function findModelcust($id)
 {
     if (($model = Customers::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 2
0
					'style'=>[
						 'text-align'=>'center',
						 'width'=>'30px',
						 'font-family'=>'tahoma',
						 'font-size'=>'8pt',
						 'background-color'=>'rgba(0, 95, 218, 0.3)',								
					 ]
				 ],
			], 
		]
	]; */
/* 0 | KODE CUSTOMER ALIAS TOTAL SUM
 * Key-FIND : AttStatic
 */
$attDinamik[] = ['attribute' => 'CUST_GRP', 'value' => function ($model) {
    $nmCustomer = Customers::find()->where(['CUST_KD' => $model['CUST_GRP']])->one();
    return $nmCustomer->CUST_NM;
    /* if ($nmCustomer->CUST_NM=='GIANT (DC CBT JKT GRO-GMS CONV)'){
    				$headerNm="GIANT";
    			}elseif($nmCustomer->CUST_NM=='STAR (BELTWAY OFFICE PARK)'){
    				$headerNm="STARMART";
    			}elseif($nmCustomer->CUST_NM=='HARI HARI SWALAYAN (LOKASARI)'){
    				$headerNm="HARI HARI";
    			}elseif($nmCustomer->CUST_NM=='ROBINSON (MALL TATURA PALU)'){
    				$headerNm="ROBINSON";
    			}
    			return $headerNm; */
    /* 'value'=>function($model){
    			if ($model['CUST_NM']='GIANT (DC CBT JKT GRO-GMS CONV)'){
    				return $headerNm="GIANT";
    			}elseif($model['CUST_NM']='STAR (BELTWAY OFFICE PARK)'){
Exemplo n.º 3
0
 /**
  * EXPORT DATA CUSTOMER TO EXCEL USING AJAX
  * export_data
  * @author wawan
  */
 public function actionExportDataErp()
 {
     if (Yii::$app->request->isAjax) {
         Yii::$app->response->format = Response::FORMAT_JSON;
         $request = Yii::$app->request;
         $dataKeySelect = $request->post('keysSelect');
         foreach ($dataKeySelect as $key => $value) {
             $array[] = $value;
         }
     }
     $data_cus = Customers::find()->select('CUST_KD,CUST_NM,(SELECT CUST_KTG_NM FROM c0001k WHERE CUST_KTG=CUST_TYPE limit 1) AS TYPE_NM, ALAMAT,TLP1,PIC')->orderBy('CUST_NM ASC')->where(['CUST_KD' => $array])->asArray()->all();
     $cusDataProviderMTI = new ArrayDataProvider(['key' => 'CUST_KD', 'allModels' => $data_cus]);
     $aryCusDataProviderMTI = $cusDataProviderMTI->allModels;
     $excel_data = Postman4ExcelBehavior::excelDataFormat($aryCusDataProviderMTI);
     $excel_title = $excel_data['excel_title'];
     $excel_ceils = $excel_data['excel_ceils'];
     $excel_content = [['sheet_name' => 'MTI CUSTOMER', 'sheet_title' => $excel_title, 'ceils' => $excel_ceils, 'headerColor' => Postman4ExcelBehavior::getCssClass("header"), 'headerColumnCssClass' => ['CUST_KD' => Postman4ExcelBehavior::getCssClass('header'), 'CUST_NM' => Postman4ExcelBehavior::getCssClass('header'), 'TYPE_NM' => Postman4ExcelBehavior::getCssClass('header'), 'ALAMAT' => Postman4ExcelBehavior::getCssClass('header'), 'TLP1' => Postman4ExcelBehavior::getCssClass('header'), 'PIC' => Postman4ExcelBehavior::getCssClass('header')], 'oddCssClass' => Postman4ExcelBehavior::getCssClass("odd"), 'evenCssClass' => Postman4ExcelBehavior::getCssClass("even")]];
     $excel_file = "CustomerData";
     // $this->export2excel($excel_content, $excel_file,1);
     $this->export4excel($excel_content, $excel_file);
     return true;
 }
Exemplo n.º 4
0
 /**
  * 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]);
 }
Exemplo n.º 5
0
 public function getCust()
 {
     return $this->hasOne(Customers::className(), ['CUST_KD' => 'CUST_ID']);
 }
Exemplo n.º 6
0
 public function searchNoo($params)
 {
     // $query = Customers::find()->joinWith('cus',true,'JOIN')
     // 				  ->where('c0001.STATUS <> 3');
     $query = Customers::find()->where("STATUS<>3 AND CUST_GRP='CUS.2016.000637'");
     // ->orderBy(['CUST_KD'=>SORT_ASC]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 50]]);
     $dataProvider->sort->attributes['cus.CUST_KTG_NM'] = ['asc' => ['c0001k.CUST_KTG_NM' => SORT_ASC], 'desc' => ['c0001k.CUST_KTG_NM' => SORT_DESC]];
     $dataProvider->sort->attributes['custype.CUST_KTG_NM'] = ['asc' => ['c0001k.CUST_KTG_NM' => SORT_ASC], 'desc' => ['c0001k.CUST_KTG_NM' => SORT_DESC]];
     $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(['like', 'CUST_KD', $this->CUST_KD])->andFilterWhere(['like', 'CUST_KD_ALIAS', $this->CUST_KD_ALIAS])->andFilterWhere(['like', 'TLP1', $this->TLP1])->andFilterWhere(['like', 'TLP2', $this->TLP2])->andFilterWhere(['like', 'FAX', $this->FAX])->andFilterWhere(['like', 'CUST_KTG', $this->getAttribute('c0001k.CUST_KTG')])->andFilterWhere(['like', 'CUST_TYPE', $this->getAttribute('custype.CUST_KTG_NM')])->andFilterWhere(['like', 'CUST_NM', $this->CUST_NM])->andFilterWhere(['like', 'CUST_GRP', 'CUS.2016.000637'])->andFilterWhere(['like', 'MAP_LAT', $this->MAP_LAT])->andFilterWhere(['like', 'MAP_LNG', $this->MAP_LNG])->andFilterWhere(['like', 'PIC', $this->PIC])->andFilterWhere(['like', 'ALAMAT', $this->ALAMAT])->andFilterWhere(['like', 'EMAIL', $this->EMAIL])->andFilterWhere(['like', 'WEBSITE', $this->WEBSITE])->andFilterWhere(['like', 'NOTE', $this->NOTE])->andFilterWhere(['like', 'NPWP', $this->NPWP])->andFilterWhere(['like', 'DATA_ALL', $this->DATA_ALL])->andFilterWhere(['like', 'JOIN_DATE', $this->JOIN_DATE])->andFilterWhere(['like', 'CUST_GRP', $this->parentName])->andFilterWhere(['like', 'LAYER', $this->LAYER])->andFilterWhere(['like', 'GEO', $this->GEO])->andFilterWhere(['like', 'c0001.STATUS', $this->STATUS])->andFilterWhere(['like', 'c0001.DC_STATUS', $this->DC_STATUS]);
     // ->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])
     // ->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])
     // ->andFilterWhere(['like', 'UPDATED_BY', $this->UPDATED_BY]);
     $query->orderby(['CUST_GRP' => SORT_ASC]);
     //SORT PENTING UNTUK RECURSIVE BIAR TREE BISA URUTAN, save => (IF (PATENT =0) {SORT=ID}, ELSE {SORT=PATENT}, note Parent=ID header
     return $dataProvider;
 }
Exemplo n.º 7
0
 public function getCuslayer()
 {
     return $this->hasOne(Customers::className(), ['LAYER' => 'LAYER_ID']);
 }
Exemplo n.º 8
0
 public function getCustTbl()
 {
     return $this->hasOne(Customers::className(), ['CUST_KD' => 'KD_CUSTOMER']);
 }
 public function actionJsoncalendar_add()
 {
     if (Yii::$app->request->isAjax) {
         $request = Yii::$app->request;
         $model = new Scheduleheader();
         $profile = Yii::$app->getUserOpt->Profile_user();
         $usercreate = $profile->username;
         $end = $request->post('tgl2');
         $start = $request->post('tgl1');
         $scdl_group = $request->post('scdl_group');
         $user_id = $request->post('user_id');
         $note = $request->post('note');
         $model->TGL1 = $start;
         $model->TGL2 = $end;
         $model->CREATE_BY = $usercreate;
         $model->CREATE_AT = date("Y-m-d H:i:s");
         $model->NOTE = $note;
         $model->SCDL_GROUP = $scdl_group;
         $model->USER_ID = $user_id;
         $carisdl = ScheduleDetail::find()->where(['TGL' => $model->TGL1, 'SCDL_GROUP' => $scdl_group])->one();
         // print_r($carisdl);
         // die();
         // if exist data customers
         if ($carisdl) {
             echo 2;
         } else {
             if ($model->save()) {
                 // foreach date :author wawan
                 for ($date = strtotime($start); $date < strtotime($end); $date = strtotime("+1 day", $date)) {
                     $tgl = date("Y-m-d", $date);
                     $Customers = Customers::find()->where(['SCDL_GROUP' => $scdl_group])->asArray()->all();
                     foreach ($Customers as $key => $value) {
                         # code...
                         $connection = Yii::$app->db_esm;
                         $connection->createCommand()->batchInsert('c0002scdl_detail', ['TGL', 'CUST_ID', 'SCDL_GROUP', 'USER_ID'], [[$tgl, $value['CUST_KD'], $scdl_group, $user_id]])->execute();
                     }
                 }
             }
         }
     }
     return true;
 }
Exemplo n.º 10
0
 public function actionCreateGroup($tgl1, $tgl2)
 {
     $ary = [['id' => 0, 'UBAH_NM' => 'permanen'], ['id' => 1, 'UBAH_NM' => 'Update']];
     $val = ArrayHelper::map($ary, 'id', 'UBAH_NM');
     $post = Yii::$app->request->post();
     $post['Scheduleheadertemp']['STT_UBAH'];
     // if equal 1 then update else save
     if ($post['Scheduleheadertemp']['STT_UBAH'] == 1) {
         $model = Scheduleheadertemp::find()->where(['TGL1' => $tgl1])->one();
         if ($model->load(Yii::$app->request->post())) {
             $model->TGL1 = $tgl1;
             $model->TGL2 = $tgl2;
             // cari group nama
             $cari_groupName = Schedulegroup::find()->where(['ID' => $model->SCDL_GROUP])->asArray()->one();
             /* split array author : wawan*/
             $temp = explode(" ", $cari_groupName['SCDL_GROUP_NM']);
             $result = '';
             foreach ($temp as $t) {
                 $result .= $t[0];
             }
             //$model->NOTE = $result;
             $model->NOTE = $cari_groupName['SCDL_GROUP_NM'];
             /*Update by ptr.nov*/
             $model->save();
             return $this->redirect(['index']);
         } else {
             return $this->renderAjax('_formschedule', ['model' => $model, 'datagroup' => $datagroup, 'datauser' => $datauser, 'val' => $val, 'tgl1' => $tgl1]);
         }
     } else {
         $model = new Scheduleheadertemp();
         // data select2 for USER_ID where CRM and STATUS 10(active)
         $connection = \Yii::$app->db_esm;
         $querycariuser = '******' . $tgl1 . '") AND POSITION_SITE = "CRM" AND STATUS = 10';
         $user = $connection->createCommand($querycariuser)->queryAll();
         $datauser = ArrayHelper::map($user, 'id', 'username');
         // data select2 for SCDL_GROUP
         $connection = \Yii::$app->db_esm;
         $model1 = $connection->createCommand('SELECT * from c0007 where ID NOT IN (SELECT DISTINCT(SCDL_GROUP) FROM c0002scdl_detail_temp  WHERE TGL="' . $tgl1 . '")');
         $query = $model1->queryAll();
         $datagroup = ArrayHelper::map($query, 'ID', 'SCDL_GROUP_NM');
         //componen user option
         $profile = Yii::$app->getUserOpt->Profile_user();
         $usercreate = $profile->username;
         //proses save
         if ($model->load(Yii::$app->request->post())) {
             $model->TGL1 = $tgl1;
             $model->TGL2 = $tgl2;
             // cari group nama
             $cari_groupName = Schedulegroup::find()->where(['ID' => $model->SCDL_GROUP])->asArray()->one();
             /* split array author : wawan*/
             $temp = explode(" ", $cari_groupName['SCDL_GROUP_NM']);
             $result = '';
             foreach ($temp as $t) {
                 $result .= $t[0];
             }
             //$model->NOTE = $result;
             $model->NOTE = $cari_groupName['SCDL_GROUP_NM'];
             /*Update by ptr.nov*/
             $model->CREATE_BY = $usercreate;
             $model->CREATE_AT = date("Y-m-d H:i:s");
             if ($model->save()) {
                 // foreach date :author wawan
                 for ($date = strtotime($tgl1); $date <= strtotime($tgl2); $date = strtotime("+1 day", $date)) {
                     $tgl = date("Y-m-d", $date);
                     //batch insert customers author :wawan
                     $Customers = Customers::find()->where(['SCDL_GROUP' => $model->SCDL_GROUP])->asArray()->all();
                     foreach ($Customers as $key => $value) {
                         # code...
                         $connection = Yii::$app->db_esm;
                         $connection->createCommand()->batchInsert('c0002scdl_detail_temp', ['TGL', 'CUST_ID', 'SCDL_GROUP', 'USER_ID'], [[$tgl, $value['CUST_KD'], $model->SCDL_GROUP, $model->USER_ID]])->execute();
                     }
                 }
             }
             return $this->redirect(['index']);
         } else {
             return $this->renderAjax('_formschedule', ['model' => $model, 'datagroup' => $datagroup, 'datauser' => $datauser, 'val' => $val, 'tgl1' => $tgl1]);
         }
     }
 }
Exemplo n.º 11
0
 public function getCusheader()
 {
     return $this->hasOne(Customers::className(), ['CUST_GRP' => 'CUST_ID_PARENT']);
 }
Exemplo n.º 12
0
 public function aryData_cus()
 {
     return ArrayHelper::map(Customers::find()->where('STATUS<>3')->all(), 'CUST_KD', 'CUST_NM');
 }
Exemplo n.º 13
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use lukisongroup\master\models\Customers;
use kartik\widgets\Select2;
use yii\helpers\BaseHtml;
use lukisongroup\assets\LocateAsset;
LocateAsset::register($this);
/* @var $this yii\web\View */
/* @var $model lukisongroup\esm\models\Map */
/* @var $form yii\widgets\ActiveForm */
$datacus = ArrayHelper::map(Customers::find()->all(), 'CUST_KD', 'CUST_NM');
?>

<div class="map-form">

    <?php 
$form = ActiveForm::begin(['id' => $model->formName()]);
?>

     <?php 
echo $form->field($model, 'CUST_ID')->widget(Select2::classname(), ['data' => $datacus, 'options' => ['placeholder' => 'Pilih Nama Customers ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <div id="preSearch" class="center">
    <p><br /></p>  <?php 
echo Html::a('IN', ['lookup'], ['class' => 'btn btn-success', 'onclick' => "javascript:beginSearch();return false;"]);
?>
    </div>
Exemplo n.º 14
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\Select2;
use lukisongroup\master\models\Customers;
use lukisongroup\hrd\models\Corp;
use lukisongroup\master\models\Distributor;
use kartik\label\LabelInPlace;
use lukisongroup\master\models\Terminvest;
use kartik\money\MaskMoney;
/* @var $this yii\web\View */
/* @var $model lukisongroup\master\models\Termcustomers */
/* @var $form yii\widgets\ActiveForm */
$data = Customers::find()->where('CUST_KD = CUST_GRP')->all();
$to = "CUST_KD";
$from = "CUST_NM";
$data1 = Corp::find()->all();
$to1 = "CORP_ID";
$from1 = "CORP_NM";
$data2 = Distributor::find()->all();
$to2 = 'KD_DISTRIBUTOR';
$from2 = "NM_DISTRIBUTOR";
$config = ['template' => "{input}\n{error}\n{hint}"];
?>
<div class="termcustomers-form">

    <?php 
$form = ActiveForm::begin(['id' => $model->formName()]);
?>
Exemplo n.º 15
0
<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use yii\bootstrap\Modal;
use yii\helpers\ArrayHelper;
use lukisongroup\master\models\Customers;
$this->params['breadcrumbs'][] = $this->title;
$this->sideCorp = 'Customers';
/* Title Select Company pada header pasa sidemenu/menu samping kiri */
$this->sideMenu = $sideMenu_control;
//'umum_datamaster';   	 /* kd_menu untuk list menu pada sidemenu, get from table of database */
$this->title = Yii::t('app', 'Customers');
/* title pada header page */
$datatype = ArrayHelper::map(Customers::find()->where('STATUS<>3')->groupBy('CUST_NM')->all(), 'CUST_KD', 'CUST_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.9)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]], ['attribute' => 'disnm', 'label' => 'Distributor', 'hAlign' => 'left', 'vAlign' => 'middle', 'filterType' => GridView::FILTER_SELECT2, 'filter' => $cus_dis, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'contentOptions' => ['style' => ['text-align' => 'left', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]]], 'filterInputOptions' => ['placeholder' => 'Select'], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '210px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.9)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '210px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]], ['attribute' => 'custpnma', 'label' => ' Customers.Parent', 'hAlign' => 'left', 'vAlign' => 'middle', 'group' => true, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $cus_data, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'contentOptions' => ['style' => ['text-align' => 'left', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]]], 'filterInputOptions' => ['placeholder' => 'Select'], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '250px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.9)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '250px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]], ['attribute' => 'custnm', 'label' => 'Customers', 'hAlign' => 'left', 'vAlign' => 'middle', 'filterType' => GridView::FILTER_SELECT2, 'filter' => $child, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'contentOptions' => ['style' => ['text-align' => 'left', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]]], 'filterInputOptions' => ['placeholder' => 'Select'], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '250px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.9)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '250px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]], ['attribute' => 'KD_ALIAS', 'label' => ' Alias Code', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.9)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]], ['attribute' => 'KD_CUSTOMERS', 'label' => ' ESM.Code', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.9)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{update}{delete}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['update' => function ($url, $model, $key) {
    return '<li>' . Html::a('<span class="fa fa-edit fa-dm"></span>' . Yii::t('app', 'Edit'), ['update-alias', 'id' => $model->KD_CUSTOMERS], ['data-toggle' => "modal", 'data-target' => "#modal-create", 'data-title' => $model->KD_CUSTOMERS]) . '</li>';
}, 'delete' => function ($url, $model, $key) use($id_term) {
    return '<li>' . Html::a('<span class="fa fa-trash fa-dm"></span>' . Yii::t('app', 'delete'), ['delete-alias', 'id' => $model->ID], []) . '</li>' . PHP_EOL;
}], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(126, 189, 188, 0.9)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]]];
?>
<div class="container-full">
	<div style="padding-left:15px; padding-right:15px">
		<?php 
echo $grid = GridView::widget(['id' => 'gv-brg-alias', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterRowOptions' => ['style' => 'background-color:rgba(126, 189, 188, 0.9); align:center'], 'columns' => $gridColumns, 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-brg-prodak']], 'toolbar' => ['{export}'], 'panel' => ['heading' => '<h7 class="panel-title">DISTRIBUTOR ALIAS CODE</h7>', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('app', 'Plus', ['modelClass' => 'Customersalias']), '/master/customers/tambah-alias-customers', ['class' => 'btn btn-primary', 'data-toggle' => "modal", 'id' => 'aliasmod', 'data-target' => "#modal-create", 'class' => 'btn btn-primary btn-sm']) . ' ' . Html::a('<i class="glyphicon glyphicon-off"></i> ' . Yii::t('app', 'Back', ['modelClass' => 'Customersalias']), '/master/customers', ['class' => 'btn btn-success btn-sm']), 'showFooter' => false], 'export' => ['target' => GridView::TARGET_BLANK], 'exportConfig' => [GridView::PDF => ['filename' => 'Alias' . '-' . date('ymdHis')], GridView::EXCEL => ['filename' => 'Alias' . '-' . date('ymdHis')]]]);
?>
	</div>
</div>
<?php 
/*Create and edit*/
$this->registerJs("\r\n   \$.fn.modal.Constructor.prototype.enforceFocus = function(){};\r\n   \$('#modal-create').on('show.bs.modal', function (event) {\r\n    var button = \$(event.relatedTarget)\r\n    var modal = \$(this)\r\n    var title = button.data('title')\r\n    var href = button.attr('href')\r\n    //modal.find('.modal-title').html(title)\r\n    modal.find('.modal-body').html('<i class=\"fa fa-spinner fa-spin\"></i>')\r\n    \$.post(href)\r\n      .done(function( data ) {\r\n        modal.find('.modal-body').html(data)\r\n      });\r\n    })\r\n", $this::POS_READY);
Exemplo n.º 16
0
use kartik\helpers\Html;
use kartik\grid\GridView;
use yii\bootstrap\Modal;
use kartik\nav\NavX;
use lukisongroup\master\models\Customers;
use yii\helpers\ArrayHelper;
// use lukisongroup\assets\MapAsset;       /* CLASS ASSET CSS/JS/THEME Author: -wawan-*/
// MapAsset::register($this);
$this->params['breadcrumbs'][] = $this->title;
$this->sideCorp = 'Customers';
/* Title Select Company pada header pasa sidemenu/menu samping kiri */
$this->sideMenu = $sideMenu_control;
//'umum_datamaster';   	 /* kd_menu untuk list menu pada sidemenu, get from table of database */
$this->title = Yii::t('app', 'Customers');
/* title pada header page */
$parent = ArrayHelper::map(Customers::find()->where('STATUS<>3 and CUST_KD=CUST_GRP')->all(), 'CUST_KD', 'CUST_NM');
function tombolCustomers()
{
    $title1 = Yii::t('app', 'Customers');
    $options1 = ['id' => 'setting', 'style' => 'text-align:left'];
    $icon1 = '<span class="fa fa-cogs fa-md"></span>';
    $label1 = $icon1 . ' ' . $title1;
    $url1 = Url::toRoute(['/master/customers/esm-index']);
    //,'kd'=>$kd]);
    $content = Html::a($label1, $url1, $options1);
    return $content;
}
/**
 * New|Change|Reset| Password Login
 * @author ptrnov  <*****@*****.**>
 * @since 1.1
Exemplo n.º 17
0
 public function actionCetakpdf($id)
 {
     # code...
     $data = Termcustomers::find()->where(['ID_TERM' => $id])->one();
     $datainternal = Jobgrade::find()->where(['JOBGRADE_ID' => $data['JOBGRADE_ID']])->asArray()->one();
     $datacus = Customers::find()->where(['CUST_KD' => $data->CUST_KD])->asArray()->one();
     // $term = Termgeneral::find()->where(['ID'=>$data['GENERAL_TERM']])->asArray()
     //                                                     ->one();
     $datadis = Distributor::find()->where(['KD_DISTRIBUTOR' => $data->DIST_KD])->asArray()->one();
     $datacorp = Corp::find()->where(['CORP_ID' => $data->PRINCIPAL_KD])->asArray()->one();
     $sql = "SELECT c.INVES_TYPE,c.ID_TERM,c.BUDGET_PLAN,c.BUDGET_ACTUAL,c.PERIODE_START,c.PERIODE_END,b.TARGET_VALUE from c0005 c LEFT JOIN c0003 b on c.ID_TERM = b.ID_TERM   where c.ID_TERM='" . $id . "'";
     $data1 = Termbudget::findBySql($sql)->all();
     $sqlsum = "SELECT SUM(BUDGET_PLAN) as BUDGET_PLAN,SUM(BUDGET_ACTUAL) as BUDGET_ACTUAL from c0005 where ID_TERM='" . $id . "'";
     $datasum = Termbudget::findBySql($sqlsum)->one();
     $dataProvider = new ArrayDataProvider(['key' => 'ID_TERM', 'allModels' => $data1, 'pagination' => ['pageSize' => 20]]);
     $content = $this->renderPartial('_pdf', ['data' => $data, 'datainternal' => $datainternal, 'datacus' => $datacus, 'datadis' => $datadis, 'datacorp' => $datacorp, 'datasum' => $datasum, 'dataProvider' => $dataProvider]);
     $pdf = new Pdf(['mode' => Pdf::MODE_CORE, 'format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_PORTRAIT, 'destination' => Pdf::DEST_BROWSER, 'content' => $content, 'cssFile' => '@lukisongroup/web/widget/pdf-asset/kv-mpdf-bootstrap.min.css', 'cssInline' => '.kv-heading-1{font-size:12px}', 'options' => ['title' => 'Term-Customers', 'subject' => 'Term'], 'methods' => ['SetHeader' => ['Copyright@LukisonGroup ' . date("r")], 'SetFooter' => ['{PAGENO}']]]);
     return $pdf->render();
 }
Exemplo n.º 18
0
 public function actionParentCus()
 {
     $out = [];
     if (isset($_POST['depdrop_parents'])) {
         $parents = $_POST['depdrop_parents'];
         if ($parents != null) {
             $parentCus = $parents[0];
             $model = Customers::find()->asArray()->where(['CUST_GRP' => $parentCus])->andwhere('CUST_KD<> CUST_GRP')->all();
             foreach ($model as $key => $value) {
                 $out[] = ['id' => $value['CUST_KD'], 'name' => $value['CUST_NM']];
             }
             echo json_encode(['output' => $out, 'selected' => '']);
             return;
         }
     }
     echo Json::encode(['output' => '', 'selected' => '']);
 }
Exemplo n.º 19
0
			<div class="col-md-12">
				<hr style="height:10px;margin-top: 1px; margin-bottom: 1px;color:#94cdf0">
			</div>

		</div>
	</div>

	<!-- PARTIES/PIHAK !-->
	<div class="row">
		<div class="col-xs-6 col-sm-6 col-md-6" style="font-family: tahoma ;font-size: 9pt;padding-left:30px">
			<div>
				 <!-- echo pihak($model); ?> -->
			</div>
			<dl>
				<?php 
$data = Customers::find()->where(['CUST_KD' => $model->CUST_KD])->asArray()->one();
$datadis = Distributor::find()->where(['KD_DISTRIBUTOR' => $model->DIST_KD])->asArray()->one();
$datacorp = Corp::find()->where(['CORP_ID' => $model->PRINCIPAL_KD])->asArray()->one();
?>
				<dt><h6><u><b>PARTIES/PIHAK BERSANGKUTAN :</b></u></h6></dt>

				<dd>1 :	<?php 
echo $data['CUST_NM'];
?>
</dd>


				<dd>2 :	<?php 
echo $datadis['NM_DISTRIBUTOR'];
?>
</dd>
Exemplo n.º 20
0
 public function getCus()
 {
     # code...
     return $this->hasOne(Customers::className(), ['CUST_KD' => 'CUST_KD_PARENT']);
 }
Exemplo n.º 21
0
 private function aryCustID()
 {
     $dataCust = ArrayHelper::map(Customers::find()->orderBy('CUST_NM')->asArray()->all(), 'CUST_KD', 'CUST_NM');
     return $dataCust;
 }
Exemplo n.º 22
0
 public function aryData_Customers($cust_kd)
 {
     return ArrayHelper::map(Customers::find()->where('STATUS<>3')->andwhere(['CUST_GRP' => $cust_kd])->all(), 'CUST_NM', 'CUST_NM');
 }