/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = SopSalesHeader::find();
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['ID' => $this->ID, 'TGL' => $this->TGL, 'STT_DEFAULT' => $this->STT_DEFAULT, 'SOP_TYPE' => $this->sopNm, 'BOBOT_PERCENT' => $this->BOBOT_PERCENT, 'TARGET_MONTH' => $this->TARGET_MONTH, 'TARGET_DAY' => $this->TARGET_DAY, 'TTL_DAYS' => $this->TTL_DAYS, 'CREATE_AT' => $this->CREATE_AT]);
     $query->andFilterWhere(['like', 'KATEGORI', $this->KATEGORI])->andFilterWhere(['like', 'TARGET_UNIT', $this->TARGET_UNIT])->andFilterWhere(['like', 'CREATE_BY', $this->CREATE_BY]);
     return $dataProvider;
 }
 /**
  * Finds the SopSalesHeader model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return SopSalesHeader the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = SopSalesHeader::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #3
0
    } elseif ($value[$key]['FIELD'] == 'SCORE_RSLT') {
        $attDinamik[] = ['class' => 'kartik\\grid\\EditableColumn', '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']]];
    } else {
        $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']]];
    }
}
/*GRID VIEW BASE*/
$detail_sop = GridView::widget(['id' => 'sop-detail-idxy', 'dataProvider' => $dataProvider_detail, 'columns' => $attDinamik, 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'sop-detail-idxy']], 'panel' => ['heading' => '<h3 class="panel-title" style="font-family: verdana, arial, sans-serif ;font-size: 9pt;">Detail</h3>', 'type' => 'info'], 'toolbar' => [['content' => detailtombol($detail_id)]], 'summary' => false, 'hover' => true, 'responsive' => true, 'responsiveWrap' => true]);
?>




    <!-- HEADER !-->
    <div  class="row" style="font-family: verdana, arial, sans-serif ;font-size: 8pt;padding-bottom:20px;">

    <div class="col-sm-6">
        <?php 
echo Yii::$app->controller->renderPartial('sop_detailexpand', ['model_header' => $model_detail = SopSalesHeader::find()->where(['ID' => $detail_id])->one()]);
?>
            </div>
            </div>
            <div  class="row" style="font-family: verdana, arial, sans-serif ;font-size: 8pt;padding-bottom:20px;">
        <!-- HEADER !-->
        <div class="col-md-12">
            <?php 
echo $detail_sop;
?>
        </div>
    </div>