Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Corp::find()->Where('u0001.CORP_STS<>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(['CORP_STS' => $this->CORP_STS, 'SORT' => $this->SORT]);
     $query->andFilterWhere(['like', 'CORP_ID', $this->CORP_ID])->andFilterWhere(['like', 'CORP_NM', $this->CORP_NM])->andFilterWhere(['like', 'CORP_AVATAR', $this->CORP_AVATAR])->andFilterWhere(['like', 'CORP_DCRP', $this->CORP_DCRP]);
     return $dataProvider;
 }
Example #2
0
 /**
  * Lists all Berita models.
  * @return mixed
  */
 public function actionIndex()
 {
     /* outbox dataprovider*/
     $searchModelOutbox = new BeritaSearch();
     $dataProviderOutbox = $searchModelOutbox->searchBeritaOutbox(Yii::$app->request->queryParams);
     /* inbox dataprovider */
     $searchModelInbox = new BeritaSearch();
     $dataProviderInbox = $searchModelInbox->searchBeritaInbox(Yii::$app->request->queryParams);
     /* History dataprovider */
     $searchModelHistory = new BeritaSearch();
     $dataProviderHistory = $searchModelHistory->searchBeritaClose(Yii::$app->request->queryParams);
     /* filter corp */
     $selectCorp = ArrayHelper::map(Corp::find()->where('CORP_STS<>3')->all(), 'CORP_ID', 'CORP_NM');
     /* filter Dept */
     $selectdept = ArrayHelper::map(Dept::find()->where('DEP_STS<>3')->all(), 'DEP_ID', 'DEP_NM');
     /* filter Status */
     $aryStt = [['STATUS' => 0, 'STT_NM' => 'UNREAD'], ['STATUS' => 1, 'STT_NM' => 'READ']];
     $valStt = ArrayHelper::map($aryStt, 'STATUS', 'STT_NM');
     return $this->render('index', ['searchModelOutbox' => $searchModelOutbox, 'dataProviderOutbox' => $dataProviderOutbox, 'searchModelInbox' => $searchModelInbox, 'dataProviderInbox' => $dataProviderInbox, 'searchModelHistory' => $searchModelHistory, 'dataProviderHistory' => $dataProviderHistory, 'selectCorp' => $selectCorp, 'selectdept' => $selectdept, 'valStt' => $valStt]);
 }
 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();
 }
Example #4
0
 public function actionEditTitel($id)
 {
     $model = $this->findModel($id);
     $datacorp = ArrayHelper::map(Corp::find()->orderBy('SORT')->asArray()->all(), 'CORP_ID', 'CORP_NM');
     $datadep = ArrayHelper::map(Dept::find()->orderBy('SORT')->asArray()->all(), 'DEP_ID', 'DEP_NM');
     $aryGrpFnc = ArrayHelper::map(Groupfunction::find()->orderBy('SORT')->asArray()->all(), 'GF_ID', 'GF_NM');
     $arySeqID = ArrayHelper::map(Groupseqmen::find()->orderBy('SEQ_NM')->asArray()->all(), 'SEQ_ID', 'SEQ_NM');
     $emp_sts = ArrayHelper::map(Status::find()->orderBy('SORT')->asArray()->all(), 'STS_ID', 'STS_NM');
     if (!$model->load(Yii::$app->request->post())) {
         return $this->renderAjax('_form_edit_title', ['model' => $model, 'datacorp' => $datacorp, 'datadep' => $datadep, 'aryGrpFnc' => $aryGrpFnc, 'arySeqID' => $arySeqID, 'emp_sts' => $emp_sts]);
     } else {
         if (Yii::$app->request->isAjax) {
             $model->load(Yii::$app->request->post());
             return Json::encode(\yii\widgets\ActiveForm::validate($model));
         } else {
             if ($model->load(Yii::$app->request->post())) {
                 //$model->save();
                 $image = $model->uploadImage();
                 if ($model->save()) {
                     // upload only if valid uploaded file instance found
                     if ($image !== false) {
                         $path = $model->getImageFile();
                         $image->saveAs($path);
                     }
                 }
                 return $this->redirect(['index', 'id' => $model->EMP_ID]);
             }
         }
     }
 }
Example #5
0
 public function getCorp()
 {
     # code...
     return $this->hasOne(Corp::className(), ['CORP_ID' => 'PRINCIPAL_KD']);
 }
Example #6
0
/*get ID Sparator Array , Author: -ptr.nov-*/
//$sql = 'SELECT max(EMP_ID) as EMP_ID FROM a0001';
//$cnt= Employe::findBySql($sql)->one();
///$arySplit=explode('.',$cnt->EMP_ID);
//$str_id_cnt=trim($arySplit[2]);
//print_r($str_id_cnt+1);
//$id_cnt=$str_id_cnt+1;
/*Combine String and Digit Author: -ptr.nov- */
//$digit=str_pad($id_cnt,4,"0",STR_PAD_LEFT);
//$thn=date("Y");
//$nl='LG'.'.'.$thn.'.'.$digit;
/*Author: Eka Side Menu */
//$side_menu=\yii\helpers\Json::decode(M1000::find()->findMenu('hrd')->one()->jval);
?>

    <?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['pluginOptions' => ['browseIcon' => '<i class="glyphicon glyphicon-folder-open"></i>', 'overwriteInitial' => true, 'showCaption' => false, 'showClose' => false, 'browseLabel' => '', 'removeLabel' => '', 'removeIcon' => '<i class="glyphicon glyphicon-remove"></i>', 'removeTitle' => 'Cancel or reset changes', 'showUpload' => false, 'defaultPreviewContent' => '<img src="https://www.mautic.org/media/images/default_avatar.png" alt="Your Avatar" style="width:160px">']]);
?>


<?php 
$EmployeeInput = FormGrid::widget(['model' => $model, 'form' => $form, 'autoGenerateColumns' => true, 'rows' => [['columns' => 1, 'attributes' => ['employe_identity' => ['label' => 'GENERATE CODE BY COORPORATE :', 'attributes' => ['EMP_CORP_ID' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(Corp::find()->orderBy('SORT')->asArray()->all(), 'CORP_ID', 'CORP_NM'), 'options' => ['id' => 'cat-id'], 'columnOptions' => ['colspan' => 1]]]]]], ['contentBefore' => '<legend class="text-info"><small>EMPLOYEE IDENTITY</small></legend>', 'columns' => 1, 'autoGenerateColumns' => false, 'attributes' => ['employe_identity' => ['label' => 'Employee.ID', 'attributes' => ['EMP_ID' => ['disabled' => true, 'type' => Form::INPUT_WIDGET, 'widgetClass' => 'kartik\\widgets\\DepDrop', 'options' => ['options' => ['id' => 'subcat-id', 'readonly' => true, 'selected' => false], 'pluginOptions' => ['depends' => ['cat-id'], 'url' => Url::to(['/hrd/employe/subcat']), 'initialize' => true, 'placeholder' => false]], 'columnOptions' => ['colspan' => 3]], 'EMP_NM' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter First Name...'], 'columnOptions' => ['colspan' => 1]], 'EMP_NM_BLK' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Last Name...'], 'columnOptions' => ['colspan' => 1]]]]]], ['attributes' => ['actions' => ['type' => Form::INPUT_RAW, 'value' => '<div style="text-align: right; margin-top: 20px">' . Html::resetButton('Reset', ['class' => 'btn btn-default']) . ' ' . Html::submitButton('Submit', ['class' => 'btn btn-primary']) . '</div>']]]]]);
?>

<?php 
echo Html::listGroup([['content' => 'IINPUT DATA KARYAWAN', 'url' => '#', 'badge' => '', 'active' => true], ['content' => $EmployeeInput]]);
?>


<?php 
ActiveForm::end();
Example #7
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use kartik\form\ActiveForm;
use kartik\widgets\SwitchInput;
use lukisongroup\hrd\models\Corp;
$userCorp = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
$aryParent = [['PARENT' => 0, 'PAREN_NM' => 'UMUM'], ['PARENT' => 1, 'PAREN_NM' => 'PRODAK']];
$valParent = ArrayHelper::map($aryParent, 'PARENT', 'PAREN_NM');
?>

<div class="tipebarang-form">

    <?php 
$form = ActiveForm::begin(['id' => 'createtipe', 'enableClientValidation' => true, 'type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'action' => ['tipebarang/simpan']]);
?>
	<?php 
echo $form->field($model, 'CORP_ID')->dropDownList($userCorp, ['id' => 'rodetail-kd_type'])->label('Perusahaan');
?>
	<?php 
echo $form->field($model, 'PARENT')->dropDownList($valParent);
?>
    <?php 
echo $form->field($model, 'NM_TYPE')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'NOTE')->textarea(['rows' => 6]);
?>
Example #8
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')->andWhere('CORP_ID="SSS" OR CORP_ID="MM"')->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');
$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(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'nmcorp', '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(97, 211, 96, 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(97, 211, 96, 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, 'group' => true, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Any author'], 'hAlign' => 'left', 'vAlign' => 'middle', 'groupFooter' => function ($model, $key, $index, $widget) {
    return ['mergeColumns' => [[1, 11]], 'content' => [4 => 'Group ' . $model->nmkategori], 'contentOptions' => [4 => ['style' => 'font-variant:small-caps'], 4 => ['style' => 'text-align:left']], 'options' => ['class' => 'danger', 'style' => 'font-weight:bold;']];
}, '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_BARANG', 'label' => 'SKU', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '100px', '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' => '400px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '400px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'unitbrg', 'label' => 'Item Unit', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'HARGA_PABRIK', 'label' => 'Pabrik', 'hAlign' => 'left', 'vAlign' => 'middle', 'format' => ['decimal', 2], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'HARGA_LG', 'label' => 'Lukison', 'hAlign' => 'left', 'vAlign' => 'middle', 'format' => ['decimal', 2], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'HARGA_DIST', 'label' => 'Distributor', 'hAlign' => 'left', 'vAlign' => 'middle', 'format' => ['decimal', 2], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'HARGA_SALES', 'label' => 'Sales LG', 'hAlign' => 'left', 'vAlign' => 'middle', 'format' => ['decimal', 2], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '80px', '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(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]]];
Example #9
0
 protected function findModel($id)
 {
     if (($model = Corp::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #10
0
/*GROUP-FUNCTION*/
if (count($Gf_MDL) == 0) {
    $Val_GF = 'none';
} else {
    $Val_GF = $Gf_MDL->GF_NM;
}
/*GROUP-SEQUEN*/
if (count($GSeqmen_MDL) == 0) {
    $Val_SQMEN = 'none';
} else {
    $Val_SQMEN = $GSeqmen_MDL->SEQ_NM;
}
/*JOBGRADE*/
if (count($Jabatan_MDL) == 0) {
    $Val_Jabatan = 'none';
} else {
    $Val_Jabatan = $Jabatan_MDL->JOBGRADE_NM;
}
/*STATUS*/
if (count($Status_MDL) == 0) {
    $Val_Status = 'none';
} else {
    $Val_Status = $Status_MDL->STS_NM;
}
/*ADDITIONAL SELECTED DEPDOWN VALUE HTML FOR JS -Auth ptr.nov*/
echo Html::hiddenInput('selected-subdept', $model->DEP_SUB_ID, ['id' => 'selected-subdept']);
echo Html::hiddenInput('selected-grading', $model->JOBGRADE_ID, ['id' => 'selected-grading']);
$attribute = [['group' => true, 'label' => 'Employee Identification', 'rowOptions' => ['class' => 'info']], ['attribute' => 'upload_file', 'label' => '', 'value' => Yii::getAlias('@HRD_EMP_UploadUrl') . '/' . $model->EMP_IMG, 'format' => ['image', ['width' => '100', 'height' => '120']], 'type' => DetailView::INPUT_FILEINPUT, 'widgetOptions' => ['pluginOptions' => ['showPreview' => true, 'showCaption' => false, 'showRemove' => false, 'showUpload' => false]]], ['attribute' => 'EMP_ID', 'options' => ['readonly' => true]], ['attribute' => 'EMP_NM'], ['attribute' => 'EMP_NM_BLK'], ['group' => true, 'label' => 'Coorporate Information', 'rowOptions' => ['class' => 'info']], ['label' => 'Coorporate', 'attribute' => 'EMP_CORP_ID', 'format' => 'raw', 'value' => Html::a($Val_Corp, '#', ['class' => 'kv-author-link']), 'type' => DetailView::INPUT_SELECT2, 'widgetOptions' => ['data' => ArrayHelper::map(Corp::find()->orderBy('SORT')->asArray()->all(), 'CORP_ID', 'CORP_NM'), 'options' => ['placeholder' => 'Select ...'], 'pluginOptions' => ['allowClear' => true]]], ['label' => 'Department', 'attribute' => 'DEP_ID', 'format' => 'raw', 'value' => Html::a($Val_Dept, '#', ['class' => 'kv-author-link']), 'type' => DetailView::INPUT_SELECT2, 'widgetOptions' => ['data' => ArrayHelper::map(Dept::find()->orderBy('SORT')->asArray()->all(), 'DEP_ID', 'DEP_NM'), 'options' => ['id' => 'dept-id']]], ['label' => 'Department Sub', 'attribute' => 'DEP_SUB_ID', 'format' => 'raw', 'value' => Html::a($Val_DeptSub, '#', ['class' => 'kv-author-link']), 'type' => DetailView::INPUT_DEPDROP, 'widgetOptions' => ['options' => ['id' => 'subdept-id'], 'pluginOptions' => ['depends' => ['dept-id'], 'url' => Url::to(['/hrd/employe/subdept']), 'initialize' => true, 'params' => ['selected-subdept'], 'loadingText' => 'Sub Department ...']]], ['label' => 'Group Function', 'attribute' => 'GF_ID', 'format' => 'raw', 'value' => Html::a($Val_GF, '#', ['class' => 'kv-author-link']), 'type' => DetailView::INPUT_SELECT2, 'widgetOptions' => ['data' => ArrayHelper::map(Groupfunction::find()->orderBy('SORT')->asArray()->all(), 'GF_ID', 'GF_NM'), 'options' => ['id' => 'Groupfnc-id']]], ['label' => 'Group Seqmen', 'attribute' => 'SEQ_ID', 'format' => 'raw', 'value' => Html::a($Val_SQMEN, '#', ['class' => 'kv-author-link']), 'type' => DetailView::INPUT_SELECT2, 'widgetOptions' => ['data' => ArrayHelper::map(Groupseqmen::find()->orderBy('SEQ_NM')->asArray()->all(), 'SEQ_ID', 'SEQ_NM'), 'options' => ['id' => 'Groupseq-id']]], ['label' => 'Grading', 'attribute' => 'JOBGRADE_ID', 'format' => 'raw', 'value' => Html::a($Val_Jabatan, '#', ['class' => 'kv-author-link']), 'type' => DetailView::INPUT_DEPDROP, 'widgetOptions' => ['options' => ['id' => 'grading-id'], 'pluginOptions' => ['depends' => ['Groupfnc-id', 'Groupseq-id'], 'url' => Url::to(['/hrd/employe/grading']), 'initialize' => true, 'params' => ['selected-grading'], 'loadingText' => 'Sub Department ...']]], ['attribute' => 'EMP_STS', 'format' => 'raw', 'value' => Html::a($Val_Status, '#', ['class' => 'kv-author-link']), 'type' => DetailView::INPUT_SELECT2, 'widgetOptions' => ['data' => ArrayHelper::map(Status::find()->orderBy('SORT')->asArray()->all(), 'STS_ID', 'STS_NM'), 'options' => ['placeholder' => 'Select ...'], 'pluginOptions' => ['allowClear' => true]]], ['id' => 'my_datepicker', 'attribute' => 'EMP_JOIN_DATE', 'format' => 'date', 'type' => DetailView::INPUT_DATE, 'widgetOptions' => ['pluginOptions' => ['format' => 'yyyy-mm-dd'], 'pluginEvents' => ['show' => "function(e) {show}"]]], ['attribute' => 'EMP_RESIGN_DATE', 'format' => 'date', 'type' => DetailView::INPUT_DATE, 'widgetOptions' => ['pluginOptions' => ['format' => 'yyyy-mm-dd'], 'pluginEvents' => ['show' => "function(e) {show}"]]], ['group' => true, 'label' => 'Employee Data Information', 'rowOptions' => ['class' => 'info']], ['attribute' => 'EMP_KTP'], ['attribute' => 'EMP_ALAMAT'], ['attribute' => 'EMP_ZIP'], ['attribute' => 'EMP_TLP'], ['attribute' => 'EMP_HP'], ['attribute' => 'EMP_GENDER'], ['attribute' => 'EMP_TGL_LAHIR', 'format' => 'date', 'type' => DetailView::INPUT_DATE, 'widgetOptions' => ['pluginOptions' => ['format' => 'yyyy-mm-dd'], 'pluginEvents' => ['show' => "function(e) {show}"]], 'inputWidth' => '40%'], ['attribute' => 'EMP_EMAIL']];
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_VERTICAL, 'id' => 'viewedit', 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data']]);
echo DetailView::widget(['id' => 'dv-view-emp', 'model' => $model, 'condensed' => true, 'hover' => true, 'mode' => DetailView::MODE_VIEW, 'panel' => ['heading' => $model->EMP_NM . ' ' . $model->EMP_NM_BLK, 'type' => DetailView::TYPE_INFO], 'attributes' => $attribute, 'deleteOptions' => ['url' => ['delete', 'id' => $model->EMP_ID], 'data' => ['confirm' => Yii::t('app', 'Are you sure to deleted this record Name =' . $model->EMP_NM . '?'), 'method' => 'post']]]);
ActiveForm::end();
Example #11
0
 public function aryData_Corp()
 {
     return ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
 }
Example #12
0
use lukisongroup\hrd\models\Groupfunction;
use lukisongroup\hrd\models\Groupseqmen;
use lukisongroup\hrd\models\Jobgrade;
use lukisongroup\hrd\models\Status;
use lukisongroup\hrd\models\Employe;
use yii\helpers\Url;
use kartik\widgets\DepDrop;
//use lukisongroup\models\system\side_menu\M1000;
//use kartik\sidenav\SideNav;
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_VERTICAL, 'options' => ['enctype' => 'multipart/form-data'], 'id' => 'emp-form1-create', 'enableClientValidation' => true]);
//$form = ActiveForm::begin(['type'=>ActiveForm::TYPE_HORIZONTAL]);
//$form = ActiveForm::begin(['type'=>ActiveForm::TYPE_VERTICAL]);
/*Author: -ptr.nov- Generate digit EMP_ID */
/*Get Id count Author:-ptr.nov-*/
//$cnt= (Employe::find()->count())+1;
/*get ID Sparator Array , Author: -ptr.nov-*/
//$sql = 'SELECT max(EMP_ID) as EMP_ID FROM a0001';
//$cnt= Employe::findBySql($sql)->one();
///$arySplit=explode('.',$cnt->EMP_ID);
//$str_id_cnt=trim($arySplit[2]);
//print_r($str_id_cnt+1);
//$id_cnt=$str_id_cnt+1;
/*Combine String and Digit Author: -ptr.nov- */
//$digit=str_pad($id_cnt,4,"0",STR_PAD_LEFT);
//$thn=date("Y");
//$nl='LG'.'.'.$thn.'.'.$digit;
/*Author: Eka Side Menu */
//$side_menu=\yii\helpers\Json::decode(M1000::find()->findMenu('hrd')->one()->jval);
$EmployeeInput = FormGrid::widget(['model' => $model, 'form' => $form, 'autoGenerateColumns' => true, 'rows' => [['columns' => 1, 'attributes' => ['employe_identity' => ['label' => 'GENERATE CODE BY COORPORATE :', 'attributes' => ['EMP_CORP_ID' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(Corp::find()->orderBy('SORT')->asArray()->all(), 'CORP_ID', 'CORP_NM'), 'options' => ['id' => 'cat-id'], 'columnOptions' => ['colspan' => 1]]]]]], ['contentBefore' => '<legend class="text-info"><small>EMPLOYEE IDENTITY</small></legend>', 'columns' => 1, 'autoGenerateColumns' => false, 'attributes' => ['employe_identity' => ['label' => 'Employee.ID', 'attributes' => ['EMP_ID' => ['disabled' => true, 'type' => Form::INPUT_WIDGET, 'widgetClass' => 'kartik\\widgets\\DepDrop', 'options' => ['options' => ['id' => 'subcat-id', 'readonly' => true, 'selected' => false], 'pluginOptions' => ['depends' => ['cat-id'], 'url' => Url::to(['/hrd/employe/subcat']), 'initialize' => true, 'placeholder' => false]], 'columnOptions' => ['colspan' => 3]], 'EMP_NM' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter First Name...'], 'columnOptions' => ['colspan' => 1]], 'EMP_NM_BLK' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Last Name...'], 'columnOptions' => ['colspan' => 1]]]]]], ['contentBefore' => '<legend class="text-info"><small>COORPORATE IDENTITY</small></legend>', 'columns' => 1, 'autoGenerateColumns' => false, 'attributes' => ['employe_identity' => ['attributes' => ['EMP_CORP_ID' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(Corp::find()->orderBy('SORT')->asArray()->all(), 'CORP_ID', 'CORP_NM'), 'options' => ['placeholder' => 'Select Coorporate...'], 'hint' => 'Pilih Perusahaan', 'columnOptions' => ['colspan' => 12]], 'DEP_ID' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(Dept::find()->orderBy('SORT')->asArray()->all(), 'DEP_ID', 'DEP_NM'), 'options' => ['id' => 'dept-id'], 'hint' => 'Pilih Department', 'columnOptions' => ['colspan' => 12]], 'DEP_SUB_ID' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\DepDrop', 'options' => ['id' => 'subdept-id', 'pluginOptions' => ['depends' => ['dept-id'], 'url' => Url::to(['/hrd/employe/subdept']), 'initialize' => true, 'params' => [''], 'loadingText' => 'Sub Department ...']], 'hint' => 'Pilih Sub Department', 'columnOptions' => ['colspan' => 12]], 'GF_ID' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(Groupfunction::find()->orderBy('SORT')->asArray()->all(), 'GF_ID', 'GF_NM'), 'options' => ['id' => 'Groupfnc-id'], 'hint' => 'Pilih Group Function', 'columnOptions' => ['colspan' => 12]], 'SEQ_ID' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(Groupseqmen::find()->orderBy('SEQ_NM')->asArray()->all(), 'SEQ_ID', 'SEQ_NM'), 'options' => ['id' => 'Groupseq-id'], 'hint' => 'Pilih Group Sequen', 'columnOptions' => ['colspan' => 12]], 'JOBGRADE_ID' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\DepDrop', 'options' => ['id' => 'grading-id', 'pluginOptions' => ['depends' => ['Groupfnc-id', 'Groupseq-id'], 'url' => Url::to(['/hrd/employe/grading']), 'initialize' => true, 'params' => [''], 'loadingText' => 'Sub Department ...']], 'hint' => 'Pilih Grading Karyawan ', 'columnOptions' => ['colspan' => 12]], 'EMP_STS' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(Status::find()->orderBy('SORT')->asArray()->all(), 'STS_ID', 'STS_NM'), 'hint' => 'Pilih Status Karyawan', 'columnOptions' => ['colspan' => 12]], 'EMP_JOIN_DATE' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\DatePicker', 'options' => ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'enableonreadonly' => false, 'todayHighlight' => true], 'pluginEvents' => ['show' => "function(e) {show}"]], 'hint' => 'Enter Join Date (yyyy-mm-dd)', 'columnOptions' => ['colspan' => 12]], 'EMP_RESIGN_DATE' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\DatePicker', 'options' => ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'todayHighlight' => true], 'pluginEvents' => ['show' => "function(e) {show}"]], 'hint' => 'Enter Resign Date (yyyy-mm-dd)', 'columnOptions' => ['colspan' => 12]]]]]], ['contentBefore' => '<legend class="text-info"><small>EMPLOYEE PROFILE</small></legend>', 'columns' => 1, 'autoGenerateColumns' => false, 'attributes' => ['address_detail' => ['label' => 'Address', 'attributes' => ['EMP_KTP' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter NO KTP...'], 'columnOptions' => ['colspan' => 12]], 'EMP_ALAMAT' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => 'kartik\\markdown\\MarkdownEditor', 'value' => '<span class="text-justify"><em>' . $model->EMP_ALAMAT . '</em></span>', 'columnOptions' => ['colspan' => 12]], 'EMP_ZIP' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Zip...'], 'columnOptions' => ['colspan' => 6]], 'EMP_HP' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Phone...'], 'columnOptions' => ['colspan' => 6]], 'EMP_TGL_LAHIR' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\DatePicker', 'options' => ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'startView' => true], 'pluginEvents' => ['show' => "function(e) {show}"]], 'hint' => 'Enter birthday  (yyyy-mm-dd)', 'columnOptions' => ['colspan' => 6]], 'EMP_GENDER' => ['type' => Form::INPUT_RADIO_LIST, 'items' => ['Male' => 'Male', 'Female' => 'Female'], 'options' => ['inline' => 'Male'], 'columnOptions' => ['colspan' => 6]], 'EMP_EMAIL' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => '*****@*****.**', 'addon' => ['prepend' => ['content' => '@']]], 'columnOptions' => ['colspan' => 6]]]]]], ['columns' => 3, 'attributes' => ['address_detail' => ['label' => 'Picture', 'columns' => 6, 'attributes' => ['upload_file' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\FileInput', 'options' => ['pluginOptions' => ['showPreview' => true, 'showCaption' => false, 'showRemove' => false, 'showUpload' => false]], 'columnOptions' => ['colspan' => 2]]]]]], ['attributes' => ['actions' => ['type' => Form::INPUT_RAW, 'value' => '<div style="text-align: right; margin-top: 20px">' . Html::resetButton('Reset', ['class' => 'btn btn-default']) . ' ' . Html::submitButton('Submit', ['class' => 'btn btn-primary']) . '</div>']]]]]);
echo Html::listGroup([['content' => 'IINPUT DATA KARYAWAN', 'url' => '#', 'badge' => '', 'active' => true], ['content' => $EmployeeInput]]);
ActiveForm::end();
Example #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()->where('CORP_STS=1 AND (CORP_ID="SSS" OR CORP_ID="MM")')->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'])->label('Perusahaan');
Example #14
0
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()]);
?>

    <?php 
echo $form->field($model, 'NM_TERM', $config)->widget(LabelInPlace::classname());
 /**
  * Index
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionIndex()
 {
     // component user
     $profile = Yii::$app->getUserOpt->Profile_user();
     /*inbox tab ||index*/
     $searchModel = new RequesttermheaderSearch();
     $dataProviderInbox = $searchModel->searchRtInbox(Yii::$app->request->queryParams);
     /*outbox tab ||index*/
     $searchmodel = new RequesttermheaderSearch();
     $dataProviderOutbox = $searchmodel->searchRtOutbox(Yii::$app->request->queryParams);
     /*history tab ||index*/
     $searchmodelHistory = new RequesttermheaderSearch();
     $dataproviderHistory = $searchmodelHistory->searchRthistory(Yii::$app->request->queryParams);
     // data for search index Rt//
     $AryCorp = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
     $Combo_Dept = ArrayHelper::map(Dept::find()->orderBy('SORT')->asArray()->all(), 'DEP_NM', 'DEP_NM');
     // ** //
     $datachecked = Requesttermheader::find()->where("STATUS = 101 AND STATUS <> 3 AND USER_CC='" . $profile->emp->EMP_ID . "'")->count();
     $datacreate = Requesttermheader::find()->where("STATUS <> 3 AND STATUS = 0 AND ID_USER = '******'")->count();
     $dataapprove = Requesttermheader::find()->where("STATUS = 102 AND  STATUS <>3 AND KD_DEP='" . $profile->emp->DEP_ID . "' OR STATUS = 5")->count();
     $dataAprrove = new ActiveDataProvider(['query' => Requesttermheader::find()->where("STATUS = 102 AND STATUS<>3  AND KD_DEP='" . $profile->emp->DEP_ID . "'OR STATUS = 5"), 'pagination' => ['pageSize' => 5]]);
     $dataChecked = new ActiveDataProvider(['query' => Requesttermheader::find()->where("STATUS = 101 AND USER_CC='" . $profile->emp->EMP_ID . "'"), 'pagination' => ['pageSize' => 5]]);
     $dataCreate = new ActiveDataProvider(['query' => Requesttermheader::find()->where("STATUS <> 3 AND STATUS = 0 AND ID_USER = '******'"), 'pagination' => ['pageSize' => 5]]);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProviderInbox' => $dataProviderInbox, 'searchmodel' => $searchmodel, 'dataProviderOutbox' => $dataProviderOutbox, 'searchmodelHistory' => $searchmodelHistory, 'dataproviderHistory' => $dataproviderHistory, 'datachecked' => $datachecked, 'datacreate' => $datacreate, 'dataCreate' => $dataCreate, 'dataapprove' => $dataapprove, 'dataAprrove' => $dataAprrove, 'dataChecked' => $dataChecked, 'Combo_Dept' => $Combo_Dept, 'AryCorp' => $AryCorp]);
 }
Example #16
0
			</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>

 private function aryCorpID()
 {
     $datacorp = ArrayHelper::map(Corp::find()->orderBy('SORT')->asArray()->all(), 'CORP_NM', 'CORP_NM');
     return $datacorp;
 }
Example #18
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');
Example #19
0
<?php

/* extensions */
use yii\helpers\Html;
use kartik\form\ActiveForm;
use kartik\widgets\FileInput;
/* namespace models */
use lukisongroup\hrd\models\Corp;
$drop = ArrayHelper::map(Corp::find()->where(['CORP_STS' => 1])->all(), 'CORP_ID', 'CORP_NM');
?>

<div class="profile-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'id' => $model->formName(), 'enableClientValidation' => true]);
?>

    <div class="row">
      <div class="col-sm-6">

      </div>
     <div class="col-sm-6">
    <?php 
echo $form->field($model, 'KD_DISTRIBUTOR')->widget(Select2::classname(), ['data' => $drop, 'options' => ['placeholder' => 'Pilih Perusahaan ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

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

    </div>
Example #20
0
 public function getCorp()
 {
     return $this->hasOne(Corp::className(), ['CORP_ID' => 'KD_CORP']);
 }
Example #21
0
use kartik\grid\GridView;
use yii\widgets\ActiveForm;
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 
 /**
  * Index
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionIndex()
 {
     //Check componen generate kode RO
     //print_r(\Yii::$app->ambilkonci->getRoCode());
     //function getPermission(){
     //return Yii::$app->getUserOpt->Modul_akses(1);
     //}
     //$getPermission=Yii::$app->getUserOpt->Modul_akses(1);
     $searchModel = new RequestorderSearch();
     /*  if (isset($_GET['param'])){
     			  $dataProvider = $searchModel->searchChildRo(Yii::$app->request->queryParams,$_GET['param']);
     		}else{
     			$dataProvider = $searchModel->searchChildRo(Yii::$app->request->queryParams);
     		}  */
     //$searchModel->KD_RO ='2015.12.04.RO.0070';
     $dataProvider = $searchModel->searchRo(Yii::$app->request->queryParams);
     $dataProviderInbox = $searchModel->searchRoInbox(Yii::$app->request->queryParams);
     $dataProviderOutbox = $searchModel->searchRoOutbox(Yii::$app->request->queryParams);
     $profile = Yii::$app->getUserOpt->Profile_user();
     // data for search index RO//
     $AryCorp = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
     $Combo_Dept = ArrayHelper::map(Dept::find()->orderBy('SORT')->asArray()->all(), 'DEP_NM', 'DEP_NM');
     // ** //
     $datachecked = Requestorder::find()->where("PARENT_ROSO = 0 AND STATUS = 101 AND STATUS <> 3 AND USER_CC='" . $profile->emp->EMP_ID . "'")->count();
     $datacreate = Requestorder::find()->where("PARENT_ROSO = 0 AND STATUS <> 3 AND STATUS = 0 AND ID_USER = '******'")->count();
     $dataapprove = Requestorder::find()->where("PARENT_ROSO = 0 AND STATUS = 102 AND  STATUS <>3 AND KD_DEP='" . $profile->emp->DEP_ID . "' OR STATUS = 5")->count();
     $dataAprrove = new ActiveDataProvider(['query' => Requestorder::find()->where("PARENT_ROSO = 0 AND STATUS = 102 AND STATUS<>3  AND KD_DEP='" . $profile->emp->DEP_ID . "'OR STATUS = 5"), 'pagination' => ['pageSize' => 5]]);
     $dataChecked = new ActiveDataProvider(['query' => Requestorder::find()->where("PARENT_ROSO = 0 AND  STATUS = 101 AND USER_CC='" . $profile->emp->EMP_ID . "'"), 'pagination' => ['pageSize' => 5]]);
     $dataCreate = new ActiveDataProvider(['query' => Requestorder::find()->where("PARENT_ROSO = 0 AND STATUS <> 3 AND STATUS = 0 AND ID_USER = '******'"), 'pagination' => ['pageSize' => 5]]);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'dataProviderInbox' => $dataProviderInbox, 'dataProviderOutbox' => $dataProviderOutbox, 'datachecked' => $datachecked, 'datacreate' => $datacreate, 'dataCreate' => $dataCreate, 'dataapprove' => $dataapprove, 'dataAprrove' => $dataAprrove, 'dataChecked' => $dataChecked, 'Combo_Dept' => $Combo_Dept, 'AryCorp' => $AryCorp]);
 }