Esempio n. 1
0
/* @var $searchModel lukisongroup\master\models\DraftPlanSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->sideCorp = 'PT.Effembi Sukses Makmur';
/* Title Select Company pada header pasa sidemenu/menu samping kiri */
$this->sideMenu = 'esm_customers';
/* kd_menu untuk list menu pada sidemenu, get from table of database */
$this->title = Yii::t('app', 'ESM - Produk');
/* title pada header page */
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="draft-plan-index">



<?php 
$data_draft = DraftPlan::find()->all();
$dynamick = new DraftPlan();
//     /*converting obejct to array*/
$data = ArrayHelper::toArray($data_draft, ['lukisongroup\\master\\models\\DraftPlan' => ['ID' => function ($dynamick) {
    return $dynamick->IdDinamikScdl;
}, 'GEO_ID', 'LAYER_ID', 'DAY_ID', 'DAY_VALUE']]);
foreach ($data as $value) {
    # code...
    // echo $value['ID'];
    $dua[] = Jadwal::getArrayDateCust('2016', 'C', '1', '1', '', $value['ID'], '66');
}
// print_r($dynamick->IdDinamikScdl);
// die();
// print_r($dua);
// die();
// $dua= DraftPlan::getDateVal();
Esempio n. 2
0
 public function searchEmpty($params)
 {
     $query = DraftPlan::find()->where('STATUS=100');
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 0]]);
     return $dataProvider;
 }
 /**
  * Finds the DraftPlan model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return DraftPlan the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = DraftPlan::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Esempio n. 4
0
                 return Html::a('<i class="fa fa-close"></i> &nbsp;DRAFT', '', ['class' => 'btn btn-danger btn-xs', 'title' => 'Deactive']);
             }
         }
     }, 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } elseif ($value[$key]['FIELD'] == 'CustNm') {
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => GridView::FILTER_SELECT2, 'filter' => $dropcus, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Pilih'], 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } elseif ($value[$key]['FIELD'] == 'YEAR') {
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => GridView::FILTER_SELECT2, 'filter' => DraftPlan::getYearsList(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Pilih'], 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } elseif ($value[$key]['FIELD'] == 'GanjilGenap') {
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => GridView::FILTER_SELECT2, 'filter' => $pekan, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Pilih'], 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } elseif ($value[$key]['FIELD'] == 'LayerNm') {
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => GridView::FILTER_SELECT2, 'filter' => $layer, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Pilih'], 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } elseif ($value[$key]['FIELD'] == 'GeoNm') {
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => GridView::FILTER_SELECT2, 'filter' => $drop, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Pilih'], 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } elseif ($value[$key]['FIELD'] == 'DayNm') {
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => GridView::FILTER_SELECT2, 'filter' => DraftPlan::getDay(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Pilih'], 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } elseif ($value[$key]['FIELD'] == 'DAY_ID') {
     # code...
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filter' => true, 'hAlign' => 'right', 'vAlign' => 'middle', 'format' => 'raw', 'value' => function ($model) {
         //$label = $model->DAY_ID != ''?$model->DAY_ID:'Day';
         if (!$model->GEO_ID or !$model->LAYER_ID) {
             $label = 'Data Not Compelte';
             return $label;
         } else {
             $label = 'SETUP SCHEDULE';
             return Html::a(Yii::t('app', $label, ['modelClass' => 'DayName']), ['/master/draft-plan/set-scdl-fday', 'id' => $model->ID], ['data-toggle' => "modal", 'data-target' => "#modal-day-draft", 'class' => 'btn btn-default btn-xs']);
         }
     }, 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
 } else {
     # code...
     $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filter' => true, 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['width' => $value[$key]['SIZE'], 'text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];