Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Sot2::find();
     $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(['ID' => $this->ID, 'TGL' => $this->TGL, 'UNIT_QTY' => $this->UNIT_QTY, 'UNIT_BERAT' => $this->UNIT_BERAT, 'SO_TYPE' => $this->SO_TYPE, 'SO_QTY' => $this->SO_QTY, 'HARGA_PABRIK' => $this->HARGA_PABRIK, 'HARGA_DIS' => $this->HARGA_DIS, 'HARGA_SALES' => $this->HARGA_SALES, 'HARGA_LG' => $this->HARGA_LG]);
     $query->andFilterWhere(['like', 'CUST_KD_ALIAS', $this->CUST_KD_ALIAS])->andFilterWhere(['like', 'KD_DIS', $this->KD_DIS])->andFilterWhere(['like', 'USER_ID', $this->USER_ID])->andFilterWhere(['like', 'KD_BARANG_ALIAS', $this->KD_BARANG_ALIAS])->andFilterWhere(['like', 'NM_BARANG', $this->NM_BARANG])->andFilterWhere(['like', 'UNIT_BARANG', $this->UNIT_BARANG])->andFilterWhere(['like', 'NOTED', $this->NOTED]);
     return $dataProvider;
 }
Exemplo n.º 2
0
    return '<li>' . Html::a('<span class="fa fa-search-plus fa-dm"></span>' . Yii::t('app', 'Image Start'), ['/master/schedule-detail/img1', 'id' => $model->ID], ['id' => 'img1-id', 'data-toggle' => "modal", 'data-target' => "#img1-visit"]) . '</li>' . PHP_EOL;
}, 'view2' => function ($url, $model, $key) {
    return '<li>' . Html::a('<span class="fa fa-search-plus fa-dm"></span>' . Yii::t('app', 'Image End'), ['/master/schedule-detail/img2', 'id' => $model->ID], ['id' => 'img2-id', 'data-toggle' => "modal", 'data-target' => "#img2-visit"]) . '</li>' . PHP_EOL;
}], '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 EXPAND*/
$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('_view_visitExpand', ['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);