Ejemplo n.º 1
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Report Emiten';
$this->params['breadcrumbs'][] = $this->title;
Pjax::begin(['id' => 'pjax-report']);
?>
<div class="report-emiten-index">

    <!-- <div class="ui divider"></div> -->
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
    <?php 
$form = ActiveForm::begin(['action' => ['update'], 'options' => []]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'responsive' => true, 'responsiveWrap' => true, 'hover' => true, 'resizableColumns' => false, 'showPageSummary' => true, 'showFooter' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> <span class="hidden-xs"></span> ' . Html::encode($this->title) . '</h3>', 'before' => '<div class="row">' . '<div class="col-xs-5 col-md-4 col-md-3 col-lg-2">' . DatePicker::widget(['name' => 'reportDate', 'value' => $reportDates[1], 'options' => ['id' => 'reportDate', 'placeholder' => 'Tgl Emiten ...'], 'readonly' => true, 'removeButton' => false, 'pluginOptions' => ['todayHighlight' => true, 'todayBtn' => true, 'format' => 'dd-M-yyyy', 'autoclose' => true], 'pluginEvents' => ["changeDate" => "function(e) {\n                        changeDate(e.format(0,'yyyy-m-d'))\n                    }"]]) . '</div>' . '<div class="col-xs-5 col-sm-4 col-md-3 col-lg-2">' . '</div>' . '</div>', 'after' => Html::submitButton('<i class="glyphicon glyphicon-floppy-disk"></i> Simpan', ['class' => 'btn btn-success']) . ' ' . Html::a('<i class="glyphicon glyphicon-trash"></i> Hapus', ['delete', 'date' => $reportDates[1]], ['class' => 'btn btn-danger', 'data-method' => 'post', 'data-pjax' => '0', 'data-confirm' => 'Apakah data akan dihapus?']) . ' ', 'footer' => false], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ButtonExport::widget()], 'export' => ['fontAwesome' => true], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'EMITEN_KODE', 'label' => 'Kode', 'filter' => false, 'format' => 'raw', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle', 'value' => function ($data) {
    return Html::a($data->EMITEN_KODE, '', ['onclick' => 'setFromGridview($(this)); return false;', 'data-pjax' => '0']);
}], ['attribute' => 'JMLLOT', 'label' => 'Jml Lot', 'filter' => false, 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'JMLSAHAM', 'label' => 'Jml Saham', 'filter' => false, 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['label' => 'Range Beli', 'format' => ['decimal', 2], 'filter' => false, 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    // Range Beli = saldob / (jmllotb * jmllbrsaham) -> Ket:  saldob, jmllotb dr detemiten; jmllbrsaham dr lotshare.
    //koreksi: Range Beli = saldob / jmlsahamb -> Ket:  saldob, jmlsahamb dr detemiten.
    $range_beli = (double) @($data->SALDOB / $data->JMLSAHAMB);
    return $range_beli;
}], ['label' => 'Range', 'format' => ['decimal', 2], 'filter' => false, 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    //Range = saldo / jmlsaham.
    $range = (double) @($data->SALDO / $data->JMLSAHAM);
    return $range;
}], ['attribute' => 'SALDO', 'label' => 'Saldo', 'filter' => false, 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'HARGA', 'label' => 'Harga', 'filter' => false, 'format' => 'raw', 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    return MaskedInput::widget(['name' => 'harga[' . $data->EMITEN_KODE . ']', 'value' => number_format($data->HARGA, 2), 'clientOptions' => ['alias' => 'numeric', 'groupSeparator' => ',', 'radixPoint' => '.', 'autoGroup' => true, 'removeMaskOnSubmit' => true]]);
}], ['attribute' => 'TGLAKHIR', 'label' => 'Tgl Akhir', 'filter' => false, 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['label' => 'Saldo **)', 'format' => ['decimal', 2], 'filter' => false, 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    //Saldo**) = jmlsaham * harga
    $saldo = $data->HARGA * $data->JMLSAHAM;
Ejemplo n.º 2
0
/* @var $this yii\web\View */
/* @var $searchModel app\models\ParamfundSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Parameter Fundamental';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="paramfund-index">
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
    <?php 
Pjax::begin(['id' => 'paramfund-index-pjax']);
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'responsive' => true, 'hover' => true, 'resizableColumns' => false, 'showPageSummary' => true, 'showFooter' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> <span class="hidden-xs"></span> ' . Html::encode($this->title) . '</h3>', 'before' => (Mimin::filterRoute($this->context->id . '/create') ? Html::a('Create', ['create'], ['class' => 'btn btn-success', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Create Data Parameter", 'data-size' => "modal-lg"]) : '') . ' '], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index', 'date' => $dates[1]], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ButtonExport::widget()], 'export' => ['fontAwesome' => true], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'EMITEN_KODE', 'label' => 'Emiten', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'TAHUN', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'TRIWULAN', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'CE', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'CA', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'TA', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'TE', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'CL', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'TL', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ActionColumn', 'hAlign' => 'center', 'vAlign' => 'middle', 'options' => ['width' => '100px'], 'template' => Mimin::filterTemplateActionColumn(['view', 'update', 'delete'], $this->context->route), 'buttons' => ['view' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-eye-open"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "View Data Parameter"]);
}, 'update' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-pencil"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Update Data Parameter", 'data-size' => "modal-lg"]);
}, 'delete' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-trash"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-confirm' => "Apakah anda mau menghapus data ini?", 'data-method' => 'post']);
}]]]]);
?>
    <?php 
Pjax::end();
?>
</div>
Ejemplo n.º 3
0
$parent = substr($permission, 0, $pos);
echo $parent;
*/
?>
<div class="securitas-index">
    <!-- <div class="ui divider"></div> -->
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
Pjax::begin(['id' => 'securitas-index-pjax']);
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'responsive' => true, 'responsiveWrap' => true, 'hover' => true, 'resizableColumns' => false, 'showFooter' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> <span class="hidden-xs"></span> ' . Html::encode($this->title) . '</h3>', 'before' => '<div class="row">' . '<div class="col-xs-2 col-lg-1">' . (Mimin::filterRoute($this->context->id . '/create') ? Html::a('Create', ['create'], ['class' => 'btn btn-success', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Create Data Securitas"]) : '') . ' ' . '</div>' . '<div class="col-xs-5 col-sm-4 col-md-3 col-lg-2">' . '</div>' . '</div>'], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ButtonExport::widget()], 'export' => ['fontAwesome' => true], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'KODE', 'label' => 'Kode', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'NAMA', 'label' => 'Nama', 'options' => [], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'left', 'vAlign' => 'middle'], ['attribute' => 'ALAMAT', 'options' => [], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'left', 'vAlign' => 'middle'], ['attribute' => 'TELP', 'options' => [], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'left', 'vAlign' => 'middle'], ['attribute' => 'HP', 'options' => [], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'left', 'vAlign' => 'middle'], ['attribute' => 'CP', 'label' => 'Kontak', 'options' => ['width' => '140px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'left', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ActionColumn', 'hAlign' => 'center', 'vAlign' => 'middle', 'options' => ['width' => '100px'], 'template' => Mimin::filterTemplateActionColumn(['view', 'update', 'delete'], $this->context->route), 'buttons' => ['view' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-eye-open"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "View Data Securitas"]);
}, 'update' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-pencil"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Update Data Securitas"]);
}, 'delete' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-trash"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-confirm' => "Apakah anda mau menghapus data ini?", 'data-method' => 'post']);
}]]]]);
?>
    <?php 
Pjax::end();
?>

</div>
Ejemplo n.º 4
0
    <?php 
$dataEmitens = \yii\helpers\ArrayHelper::map(app\models\Emiten::find()->select(['KODE', 'NAMA', 'DERIVED' => 'CONCAT(KODE," - ",NAMA)'])->asArray()->all(), 'KODE', 'KODE');
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'responsive' => true, 'responsiveWrap' => true, 'hover' => true, 'resizableColumns' => false, 'showFooter' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> <span class="hidden-xs"></span> ' . Html::encode($this->title) . '</h3>', 'before' => '
              <div class="row">' . '<div class="col-xs-2 col-md-1">' . Html::dropDownList('per-page', $perpage, ['2' => '2', '10' => '10', '20' => '20', '50' => '50', '100' => '100', 'all' => 'all'], ['id' => 'per-page', 'class' => 'form-control']) . '</div>' . '<div class="col-xs-6 col-md-4">' . \kartik\widgets\Select2::widget(['name' => 'emitens', 'data' => $dataEmitens, 'value' => $emitens, 'options' => ['placeholder' => 'Pilih Emiten ...', 'onchange' => '
                        $.pjax.reload("#pjax-gridview", {
                          url: "' . Url::to(['index']) . '?emitens="+$(this).val(),
                          container: "#pjax-gridview",
                          timeout: 3000,
                          push: false,
                          replace: false
                        });
                    '], 'pluginOptions' => ['allowClear' => true, 'multiple' => true]]) . '</div>' . '</div>'], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ButtonExport::widget()], 'export' => ['fontAwesome' => true], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'KODE', 'label' => 'Kode', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'JMLLOT', 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['attribute' => 'JMLSAHAM', 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'format' => ['decimal', 2], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['header' => 'Range Beli', 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) use($lotshare) {
    //-	Range Beli = saldob / (jmllotb * jmllbrsaham) -> Ket:  saldob, jmllotb dr detemiten; jmllbrsaham dr lotshare.
    $detemiten = Detemiten::find()->where(['EMITEN_KODE' => $data->KODE])->orderBy('TGL DESC')->one();
    $range_beli = (double) @($detemiten->SALDOB / ($detemiten->JMLLOTB * $lotshare));
    return number_format($range_beli, 2);
    //-	Laba/Rugi = (jmlsaham * harga) - saldo
}], ['header' => 'Range', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    //- Range = Saldo / Jml Saham
    return @($data->SALDO / $data->JMLSAHAM);
}], ['attribute' => 'SALDO', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['attribute' => 'HARGA', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['header' => 'Tgl Akhir', 'format' => ['date', 'php:d/M/Y'], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    //-	Range Beli = saldob / (jmllotb * jmllbrsaham) -> Ket:  saldob, jmllotb dr detemiten; jmllbrsaham dr lotshare.
    $detemiten = Detemiten::find()->where(['EMITEN_KODE' => $data->KODE])->orderBy('TGL DESC')->one();
    if (substr($detemiten->TGLAKHIR, 0, 4) == '0000') {
        return '-';
    } else {
        return date('d-m-Y', strtotime($detemiten->TGLAKHIR));
Ejemplo n.º 5
0
?>
<div class="asset-index">
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
    <?php 
Pjax::begin(['id' => 'pjax-gridview']);
?>
    <?php 
$this->registerJs('
      var startDate = "' . $dates[0] . '";
      var endDate = "' . $dates[2] . '";
    ');
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'responsive' => true, 'responsiveWrap' => true, 'hover' => true, 'resizableColumns' => false, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> <span class="hidden-xs"></span> ' . Html::encode($this->title) . '</h3>', 'before' => '<div class="row">' . '<div class="col-xs-2 col-lg-1">' . (Mimin::filterRoute($this->context->id . '/create') ? Html::a('Create', ['create'], ['class' => 'btn btn-success', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-title' => "Create Data Asset"]) : '') . ' ' . '</div>' . '</div><br>' . '<table class="table table-condensed" style="width:50%">' . '<tr>' . '<td> start' . DatePicker::widget(['name' => 'start', 'value' => $dates[1], 'removeButton' => false, 'options' => ['placeholder' => 'Start ...'], 'readonly' => true, 'pluginOptions' => ['todayHighlight' => true, 'todayBtn' => true, 'format' => 'dd-M-yyyy', 'autoclose' => true, 'buttonClose' => false], 'pluginEvents' => ["changeDate" => "function(e) {\n                          startDate = e.format(0,'yyyy-m-d');\n                          \$.pjax.reload({\n            \t\t\t\t\t\t\t\turl: '" . Url::to(['index']) . "?start='+startDate+'&end='+endDate,\n            \t\t\t\t\t\t\t\tcontainer: '#pjax-gridview',\n            \t\t\t\t\t\t\t\ttimeout: 1,\n            \t\t\t\t\t\t\t});\n                      }"]]) . '</td>' . '<td> <br>s.d </td>' . '<td> end' . DatePicker::widget(['name' => 'end', 'value' => $dates[3], 'removeButton' => false, 'options' => ['placeholder' => 'End ...'], 'readonly' => true, 'pluginOptions' => ['todayHighlight' => true, 'todayBtn' => true, 'format' => 'dd-M-yyyy', 'autoclose' => true, 'buttonClose' => false], 'pluginEvents' => ["changeDate" => "function(e) {\n                          endDate = e.format(0,'yyyy-m-d');\n                          \$.pjax.reload({\n            \t\t\t\t\t\t\t\turl: '" . Url::to(['index']) . "?start='+startDate+'&end='+endDate,\n            \t\t\t\t\t\t\t\tcontainer: '#pjax-gridview',\n            \t\t\t\t\t\t\t\ttimeout: 1,\n            \t\t\t\t\t\t\t});\n                      }"]]) . '</td>' . '</tr>' . '</table>'], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ButtonExport::widget()], 'export' => ['fontAwesome' => true], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'TGL', 'format' => ['date', 'php:d-M-Y'], 'filter' => false, 'hAlign' => 'center', 'vAlign' => 'middle', 'options' => ['width' => '200px']], ['attribute' => 'KAS_BANK', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'TRAN_JALAN', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'INV_LAIN', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['attribute' => 'STOK_SAHAM', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ActionColumn', 'hAlign' => 'center', 'vAlign' => 'middle', 'options' => ['width' => '100px'], 'template' => Mimin::filterTemplateActionColumn(['view', 'update', 'delete'], $this->context->route), 'buttons' => ['view' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-eye-open"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "View Data Asset"]);
}, 'update' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-pencil"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0']);
}, 'delete' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-trash"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-confirm' => "Apakah anda mau menghapus data ini?", 'data-method' => 'post']);
}]]]]);
?>
    <?php 
Pjax::end();
?>
</div>
Ejemplo n.º 6
0
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pembelian-index">
    <!-- <div class="ui divider"></div> -->
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
Pjax::begin(['id' => 'pembelian-index-pjax']);
?>
    <?php 
$total_lot = 1;
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'responsive' => true, 'hover' => true, 'resizableColumns' => false, 'showPageSummary' => true, 'showFooter' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-shopping-cart"></i> ' . Html::encode($this->title) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . '(<span class="hidden-xs">tanggal</span> transaksi terakhir ' . ($latestDate[1] == 1 ? 'belum ada' : $latestDate[1]) . ')</h3>', 'before' => '<div class="row">' . '<div class="col-xs-2 col-lg-1">' . (Mimin::filterRoute($this->context->id . '/create') ? Html::a('Create', ['create', 'date' => $dates[1]], ['class' => 'btn btn-success', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Create Data Pembelian", 'data-size' => "modal-lg"]) : '') . ' ' . '</div>' . '<div class="col-xs-2 col-md-1">' . Html::dropDownList('per-page', $perpage, ['5' => '5', '10' => '10', '20' => '20', '50' => '50', '100' => '100', 'all' => 'all'], ['id' => 'per-page', 'class' => 'form-control']) . '</div>' . '<div class="col-xs-5 col-sm-4 col-md-3 col-lg-2">' . DatePicker::widget(['name' => 'grid_date', 'value' => $dates[1], 'removeButton' => false, 'options' => ['placeholder' => 'Tgl Grid ...'], 'readonly' => true, 'pluginOptions' => ['todayHighlight' => true, 'todayBtn' => true, 'format' => 'dd-M-yyyy', 'autoclose' => true, 'buttonClose' => false], 'pluginEvents' => ["changeDate" => "function(e) {\n                          \$.pjax.reload({\n            \t\t\t\t\t\t\t\turl: '" . Url::to(['index']) . "?per-page='+" . $perpage . "+'&date='+e.format(0,'yyyy-m-d'),\n            \t\t\t\t\t\t\t\tcontainer: '#pembelian-index-pjax',\n            \t\t\t\t\t\t\t\ttimeout: 1,\n            \t\t\t\t\t\t\t});\n                      }"]]) . '</div>' . '</div>'], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ButtonExport::widget()], 'export' => ['fontAwesome' => true], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'TGL', 'header' => 'Tanggal', 'filter' => false, 'format' => ['date', 'php:d M Y'], 'options' => ['width' => '125px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'NOMOR', 'label' => 'Nomor', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'EMITEN_KODE', 'label' => 'Emiten', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'SECURITAS_KODE', 'label' => 'Securitas', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'JMLLOT', 'label' => 'Jml Lot', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'JMLSAHAM', 'label' => 'Jml Saham', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'HARGA', 'label' => 'Harga', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'KOM_BELI', 'label' => 'Komisi', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'value' => function ($data) {
    // 2.	Perhitungan Total Komisi = kom_beli * harga * share / 100
    $bruto = $data->JMLSAHAM * $data->HARGA;
    $komisi_total = $data->KOM_BELI * $bruto / 100;
    return $komisi_total;
}, 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'TOTAL_BELI', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['class' => 'kartik\\grid\\ActionColumn', 'hAlign' => 'center', 'vAlign' => 'middle', 'options' => ['width' => '100px'], 'template' => Mimin::filterTemplateActionColumn(['update', 'delete'], $this->context->route), 'buttons' => ['update' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-pencil"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Update Data Pembelian", 'data-size' => "modal-lg"]);
}, 'delete' => function ($url, $model) {
    $icon = '<span class="glyphicon glyphicon-trash"></span>';
    return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-confirm' => "Apakah anda mau menghapus data ini?", 'data-method' => 'post']);
}]]]]);
?>
    <?php 
$this->registerJs('
      $("#per-page").on("change", function () {