/** * Lists all CustomerVisitImage models. * @return mixed */ public function actionIndex() { $searchModel = new CustomerVisitImageSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
$attDinamik[] = ['class' => 'kartik\\grid\\ExpandRowColumn', 'width' => '50px', 'value' => function ($model, $key, $index, $column) { return GridView::ROW_COLLAPSED; }, 'detail' => function ($model, $key, $index, $column) { $dataInventory = Yii::$app->db_esm->createCommand("CALL ERP_CUSTOMER_VISIT_inventory('" . $model->TGL . "','" . $model->CUST_ID . "','" . $model->USER_ID . "')")->queryAll(); $inventoryProvider = new ArrayDataProvider(['allModels' => $dataInventory, 'pagination' => ['pageSize' => 50]]); /*INFO*/ $modelInfo = $model; /*INVENTORY*/ //Sot2Search //$modelInvntory =Sot2::find()->where('TGL="'.$model->TGL.'" AND CUST_KD="'.$model->CUST_ID.'" AND USER_ID="'.$model->USER_ID.'"')->All(); $modelInvntory = Sot2::find()->where('TGL="' . $model->TGL . '" AND USER_ID="' . $model->USER_ID . '"')->All(); //$modelInvntory =Sot2::find()->where('USER_ID="'.$model->USER_ID.'"')->all(); //$modelImage =CustomerVisitImage::find()->where('ID="'.$model->ID.'"')->One(); $aryDataProvider = new ArrayDataProvider(['key' => 'ID', 'allModels' => $modelInvntory]); /*IMAGE VISIT*/ $searchModel = new CustomerVisitImageSearch(['ID_DETAIL' => '' . $model->ID . '']); $dataProviderImage = $searchModel->search(Yii::$app->request->queryParams); return Yii::$app->controller->renderPartial('indexExpand', ['cust_id' => $model->ID, 'modelInfo' => $modelInfo, 'dataProviderInventory' => $aryDataProvider, 'searchModelImage' => $searchModel, 'inventoryProvider' => $inventoryProvider, 'dataProviderImage' => $dataProviderImage]); }, 'headerOptions' => ['class' => 'kartik-sheet-style'], 'expandOneOnly' => false, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(74, 206, 231, 1)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'height' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]]; /*GRIDVIEW ARRAY ROWS*/ foreach ($gvHeadColomn as $key => $value[]) { $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => $value[$key]['filterType'], 'filter' => $value[$key]['filter'], 'filterOptions' => ['style' => 'background-color:rgba(' . $value[$key]['filterwarna'] . '); align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'noWrap' => true, 'group' => $value[$key]['GRP'], 'format' => $value[$key]['FORMAT'], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['FIELD'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['text-align' => $value[$key]['align'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]]; } /*STATUS RADIUS*/ $attDinamik[] = ['attribute' => 'sttKoordinat', 'label' => 'STATUS', 'filter' => $SttFilter, 'filterOptions' => ['style' => 'background-color:rgba(249, 215, 100, 1); align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($model) { return statusRadius($model); }, 'noWrap' => true, 'format' => 'html', 'headerOptions' => ['style' => ['text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(249, 215, 100, 1)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]]; /*SHOW GRID VIEW LIST EVENT*/ echo GridView::widget(['id' => 'cust-visit-list', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $attDinamik, 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'cust-visit-list']], 'panel' => ['heading' => '<h3 class="panel-title">DAILY CUSTOMERS VISIT</h3>', 'type' => 'info'], 'toolbar' => [''], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => true]); ?> </div>