Exemplo n.º 1
0
 /**
  * Lists all SalesRoadHeader models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new SalesRoadHeaderSearch();
     //$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider = $searchModel->searchGroup(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Exemplo n.º 2
0
use yii\data\ArrayDataProvider;
use lukisongroup\roadsales\models\SalesRoadHeaderSearch;
$this->sideCorp = 'PT.Effembi Sukses Makmur';
/* Title Select Company pada header pasa sidemenu/menu samping kiri */
$this->sideMenu = 'sales_road';
/* kd_menu untuk list menu pada sidemenu, get from table of database */
$this->title = Yii::t('app', 'ESM - SALES ROAD');
/* title pada header page */
$this->params['breadcrumbs'][] = $this->title;
/**
 * COLUMN DATA.
 */
$columnRoadHeader = [['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' => '7pt', 'background-color' => 'rgba(113, 235, 29, 0.8)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['class' => 'kartik\\grid\\ExpandRowColumn', 'width' => '50px', 'header' => 'Detail', 'value' => function ($model, $key, $index, $column) {
    return GridView::ROW_COLLAPSED;
}, 'detail' => function ($model, $key, $index, $column) {
    $searchModelExpand = new SalesRoadHeaderSearch(['USER_ID' => $model->USER_ID, 'CREATED_AT' => $model->TGL]);
    $dataProviderExpand = $searchModelExpand->searchDetail(Yii::$app->request->queryParams);
    return Yii::$app->controller->renderPartial('indexExpand', ['dataProviderExpand' => $dataProviderExpand]);
}, 'collapseTitle' => 'Close Exploler', 'expandTitle' => 'Click to views detail', 'expandOneOnly' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(74, 206, 231, 1)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'height' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'TGL', 'label' => 'HARI', 'hAlign' => 'center', 'vAlign' => 'middle', 'mergeHeader' => true, 'filter' => false, 'value' => function ($model) {
    $nilaiHari = Yii::$app->formatter->asDate($model->CREATED_AT, 'php:N');
    if ($nilaiHari == 1) {
        return "Senin";
    } elseif ($nilaiHari == 2) {
        return "Selasa";
    } elseif ($nilaiHari == 3) {
        return "Rabu";
    } elseif ($nilaiHari == 4) {
        return "Kamis";
    } elseif ($nilaiHari == 5) {
        return "Jumat";
    } elseif ($nilaiHari == 6) {