| Current Path : /var/www/html/ssr26/frontend/runtime/frontendpage/ |
| Current File : /var/www/html/ssr26/frontend/runtime/frontendpage/74_1775022689027970800-content-175.php |
<?php
/*** CONTENT_ID-175***/
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\data\ActiveDataProvider;
use yii\widgets\ActiveForm;
use backend\modules\payment\models\Payment;
echo '
<link rel="stylesheet" href="https://code.jquery.com/ui/1.14.0/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.14.0/jquery-ui.js"></script>
<style>
.wrapper{background:white !important;}
.user-wrapper{
margin-top: -110px;
border-radius: 5px;
padding:30px;
padding-top:0;
padding-bottom: 50px;
box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;background: linear-gradient(9deg, rgba(243,243,243,1) 0%, rgba(240,240,240,1) 35%, rgba(243,243,243,1) 100%);
}
.table-bordered tbody tr td, .table-bordered thead tr th{
border-color : #ccc;
}
.table-bordered thead tr th{
background: #4c2462;
}
</style>
<div class="container mb-100 user-wrapper">
<h3 class="pt-50 pb-10">Rekod Pembayaran</h3>';
$start_date = Yii::$app->getRequest()->getQueryParam('start_date');
$end_date = Yii::$app->getRequest()->getQueryParam('end_date');
$form = ActiveForm::begin(['method' => 'get',]);
echo '<div class="row">
<div class="col-sm-3">' . Html::input('text', 'start_date', $start_date, $options = ['class' => 'form-control datepicker', 'readonly' => true, 'placeholder' => 'Tarikh Mula']) . '</div>
<div class="col-sm-3">' . Html::input('text', 'end_date', $end_date, $options = ['class' => 'form-control datepicker', 'readonly' => true, 'placeholder' => 'Tarikh Akhir']) . '</div>
<div class="col-sm-3">
<button type="submit" class="button">Cari</button>
<a href="/portal-main/mydonation" class="button">Set Semula</a>
</div>
</div>';
ActiveForm::end();
$query = Payment::find()->where(['=','payment_payer_email',Yii::$app->user->identity->email])->andwhere(['=','payment_status','verified']);
if (!empty($start_date) && !empty($end_date))
$query->andFilterWhere(['BETWEEN', 'DATE(payment_date)', $start_date, $end_date]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => ['defaultOrder' => ['payment_id' => SORT_DESC]],
'pagination' => ['pageSize' => 10,'route' => 'portal-main/mydonation'],
]);
echo GridView::widget([
'dataProvider' => $dataProvider,
'summary' => '',
'tableOptions' => ['class' => 'table table-striped table-bordered table-custom mt-3'],
'columns' => [
['class' => 'yii\grid\SerialColumn', 'contentOptions' => ['class' => 'text-center', 'width' => '1%'],],
[
'header'=>'Nombor Rujukan',
'value' => function($model) {
return $model->payment_gateway_refno;
}
],
[
'header' => 'Jumlah',
//'contentOptions' => ['style' => 'text-align:right;'],
'value' => function($model) {
return 'RM '. number_format((float)($model->payment_total / 100), 2, '.', ', ');
}
],
[
'header' => 'Tarikh & Masa Pembayaran',
'value' => function($model) {
//return date("d.m.Y", strtotime($model->payment_date));
return $model->payment_date;
}
],
[
'header' => 'Maklumat Kempen',
'format' => 'raw',
'value' => function ($model) {
$output = '';
$model2 = (new \yii\db\Query())->select(['campaign.campaign_title', 'campaign_donor.donor_amount'])
->from('campaign_donor')
->innerjoin('campaign', 'campaign_id=donor_campaign_id')
->where(['=', 'donor_payment_id', $model->payment_id])
->all();
if (!empty($model2)) {
$output .= '<ul class="ml-10">';
foreach ($model2 as $row) {
$output .= '<li>' . $row['campaign_title'] . '</li>';
}
$output .= '</ul>';
}
return $output;
}
],
[
'class' => 'yii\grid\ActionColumn',
'header' => '',
'template' => '{view}',
'headerOptions' => ['style' => 'text-align:center;width:1%;'],
'contentOptions' => ['style' => 'text-align:center;'],
'buttons' => [
'view' => function ($url, $model, $key) {
return Html::a('<span class="fa fa-info-circle fa-lg"></span> ', ['/portal-main/mydonation-details', 'id' => $model->payment_id],['title'=>'Butiran']);
},
],
],
/*[
'header' => 'Status Pembayaran',
'contentOptions' => ['style' => 'text-align:center;'],
'value' => function($model) {
return \backend\modules\refdynawebv2\models\Ref::getDesc('PAYMENT_STATUS', $model->payment_status,'descr');
}
],*/
],
]);
echo '</div>
<script>
$( function() {
$(".datepicker").datepicker({dateFormat: "yy-mm-dd"});
});
</script>';
?>