/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Pembukuan_child::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(['CHILD_ID' => $this->CHILD_ID, 'TYPE_ID' => $this->TYPE_ID]);
     $query->andFilterWhere(['like', 'CHILD_NM', $this->CHILD_NM])->andFilterWhere(['like', 'SRC', $this->SRC]);
     return $dataProvider;
 }
Example #2
0
        return Html::a('<i class="fa fa-remove fa-md"></i> Closing', '#', ['class' => 'btn btn-danger btn-xs', 'style' => ['width' => '25px'], 'title' => 'Closing']);
    }
}
//$this->title = 'Pembukuans';
//$this->params['breadcrumbs'][] = $this->title;
$clmPembukuan = [['class' => 'kartik\\grid\\SerialColumn', 'width' => '10px', 'header' => 'No.', 'hAlign' => 'center', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-right' => '0px']]], ['attribute' => 'TGL', 'label' => 'Tanggal', 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['pluginOptions' => ['format' => 'yyyy-mm-dd', 'autoclose' => true, 'todayHighlight' => true, 'autoWidget' => false]], 'value' => function ($model) {
    /*
     * max String Disply
     * @author ptrnov <*****@*****.**>
     */
    return substr($model->TGL, 0, 10);
}, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'TYPE', 'label' => 'Type', 'filter' => $filterTypeNm, 'value' => function ($model) {
    $nmType = Pembukuan_type::find()->where(['TYPE_ID' => $model->TYPE])->one();
    return $nmType != '' ? $nmType->TYPE_NM : 'none';
}, 'noWrap' => false, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'CHILD', 'label' => 'Kategori', 'filter' => $filterChildNm, 'noWrap' => true, 'value' => function ($model) {
    $nmChild = Pembukuan_child::find()->where(['CHILD_ID' => $model->CHILD])->one();
    return $nmChild != '' ? $nmChild->CHILD_NM : 'none';
}, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'SRC', 'noWrap' => false, 'label' => 'State', 'filter' => $valSource, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'SRC_DSC_REF', 'label' => 'Ref.Kode', 'filter' => true, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'SRC_DSC', 'label' => 'Dari', 'filter' => $dataRt, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'SRC_DSC_QTY', 'label' => 'Jumlah', 'hAlign' => 'left', 'vAlign' => 'middle', 'pageSummaryFunc' => GridView::F_SUM, 'pageSummary' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryOptions' => ['style' => ['text-align' => 'right', 'width' => '100px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']]], ['attribute' => 'SRC_DSC_PRICE', 'label' => 'Harga', 'hAlign' => 'left', 'vAlign' => 'middle', 'format' => ['decimal', 2], 'pageSummaryFunc' => GridView::F_SUM, 'pageSummary' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '80px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryOptions' => ['style' => ['text-align' => 'right', 'width' => '100px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']]], ['class' => 'kartik\\grid\\FormulaColumn', 'header' => 'Sub.total', 'mergeHeader' => true, 'vAlign' => 'middle', 'hAlign' => 'right', 'value' => function ($model, $key, $index, $widget) {
    $p = compact('model', 'key', 'index');
    /*Formula Round Unit/harga pcs -ptr.nov-*/
    //return $widget->col(6, $p) != 0 ? $widget->col(6, $p) * round($model->UNIT_QTY  * $widget->col(8, $p),0,PHP_ROUND_HALF_UP): 0;
    return $widget->col(7, $p) != 0 ? round($widget->col(7, $p) * $widget->col(8, $p), 0, PHP_ROUND_HALF_UP) : 0;
    //return $widget->col(3, $p) != 0 ? $widget->col(5 ,$p) * 100 / $widget->col(3, $p) : 0;
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '150px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryFunc' => GridView::F_SUM, 'pageSummary' => true, 'format' => ['decimal', 2], 'pageSummaryOptions' => ['style' => ['text-align' => 'right', 'width' => '100px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']], 'footer' => true], ['attribute' => 'SRC_DSC_DETAIL', 'label' => 'Ket.Detail', 'filter' => false, 'noWrap' => true, 'mergeHeader' => true, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'STATUS', 'label' => 'Status', 'filter' => $valStatus, 'format' => 'html', 'value' => function ($model, $key, $index, $widget) {
    return sttPembukuan($model);
}, 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{view}{edit}{delete}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'buttons' => ['view' => function ($url, $model, $key) {
    return '<li>' . Html::a('<span class="fa fa-eye fa-dm"></span>' . Yii::t('app', 'View'), ['/dashboard/pembukuan-harian/view', 'id' => $model->ID], ['data-toggle' => "modal", 'data-target' => "#modal-view", 'data-title' => 'RT0' . $model->SRC_DSC_REF]) . '</li>' . PHP_EOL;
}, 'edit' => function ($url, $model, $key) {
    return '<li>' . Html::a('<span class="fa fa-edit fa-dm"></span>' . Yii::t('app', 'Edit'), ['/dashboard/pembukuan-harian/edit', 'id' => $model->ID], ['data-toggle' => "modal", 'data-target' => "#modal-edit", 'data-title' => 'RT0' . $model->SRC_DSC_REF]) . '</li>' . PHP_EOL;
}, 'delete' => function ($url, $model, $key) {
    return '<li>' . Html::a('<span class="fa fa-remove fa-dm"></span>' . Yii::t('app', 'delete'), ['/dashboard/pembukuan-harian/delete', 'id' => $model->ID], ['data-method' => 'post', 'data-confirm' => 'Anda yakin ingin menghapus data warga ' . $model->SRC_DSC_REF . ' ?']) . '</li>' . PHP_EOL;
Example #3
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\Select2;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use kartik\widgets\DepDrop;
use kartik\widgets\TouchSpin;
use ubud\dashboard\models\Pembukuan_type;
use ubud\dashboard\models\Pembukuan_child;
use ubud\dashboard\models\Pembukuan_golongan;
use ubud\dashboard\models\Rt;
$filterTypeNm = ArrayHelper::map(Pembukuan_type::find()->all(), 'TYPE_ID', 'TYPE_NM');
$filterChildNm = ArrayHelper::map(Pembukuan_child::find()->where(['SRC' => 'rw11'])->all(), 'CHILD_ID', 'CHILD_NM');
$dataRt = ArrayHelper::map(Rt::find()->all(), 'id_rt', 'ket_rt');
$arySource = [['user_warga' => 'rw11', 'DESCRIP' => 'RW11'], ['user_warga' => 1, 'DESCRIP' => 'RT01'], ['user_warga' => 2, 'DESCRIP' => 'RT02'], ['user_warga' => 3, 'DESCRIP' => 'RT03'], ['user_warga' => 4, 'DESCRIP' => 'RT04']];
$valSource = ArrayHelper::map($arySource, 'user_warga', 'DESCRIP');
$tglSkarang = date('Y-m-d h:i:s');
if (!Yii::$app->user->isGuest) {
    $idWarga = Yii::$app->user->identity->warga != '' ? Yii::$app->user->identity->warga : 'rw11';
}
?>

<div class="pembukuan-form">

   <?php 
$form = ActiveForm::begin(['id' => 'create-lap', 'enableClientValidation' => true]);
?>

    <?php 
 /**
  * DepDrop |  TYPE - KAT - 
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionKtgType()
 {
     if (!Yii::$app->user->isGuest) {
         $idWarga = Yii::$app->user->identity->warga != '' ? Yii::$app->user->identity->warga : 'rw11';
     }
     $out = [];
     if (isset($_POST['depdrop_parents'])) {
         $parents = $_POST['depdrop_parents'];
         if ($parents != '') {
             $prn_id = $parents[0];
             //$corp_id = $parents[1];
             //$model = Pembukuan_child::find()->asArray()->where("SRC=".$idWarga." AND TYPE_ID='".$prn_id."'")->all();
             $model = Pembukuan_child::find()->asArray()->where(['SRC' => $idWarga, 'TYPE_ID' => $prn_id])->all();
             foreach ($model as $key => $value) {
                 $out[] = ['id' => $value['CHILD_ID'], 'name' => $value['CHILD_NM']];
             }
             echo json_encode(['output' => $out, 'selected' => '']);
             return;
         }
     }
     echo Json::encode(['output' => '', 'selected' => '']);
 }
 /**
  * Finds the Pembukuan_child model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Pembukuan_child the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Pembukuan_child::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #6
0
 public function getBookchild()
 {
     return $this->hasOne(Pembukuan_child::className(), ['CHILD_ID' => 'CHILD']);
 }