Files
WrenchBoradWeb/www/application/views/users/view_coupon.php
T
2022-06-02 21:15:27 -04:00

192 lines
8.6 KiB
PHP

<!--begin::Row-->
<div class="row g-5 g-xl-8">
<!--begin::Col-->
<div class="col-xl-6">
<!--begin::Tables Widget 5-->
<div class="card card-xl-stretch mb-5 mb-xl-8">
<!--begin::Header-->
<div class="card-header border-0 pt-5">
<h3 class="card-title align-items-start flex-column">
<span class="card-label fw-bolder fs-3 mb-1">my Coupons</span>
</h3>
<div class="card-toolbar">
</div>
</div>
<!--end::Header-->
<!--begin::Body-->
<div class="card-body py-3">
<div class="tab-content">
<!--begin::Tap pane-->
<div class="tab-pane fade show active" id="kt_table_widget_5_tab_1">
<!--begin::Table container-->
<div class="table-responsive">
<!--begin::Table-->
<table class="table table-row-dashed table-row-gray-200 align-middle gs-0 gy-4">
<!--begin::Table head-->
<thead>
<tr class="border-0">
<th class="p-0 w-100px">Added</th>
<th class="p-0 min-w-125px">Coupon</th>
<th class="p-0 min-w-105px">Amount</th>
<th class="p-0 w-90px">Status</th>
<th class="p-0 min-w-50px"></th>
</tr>
</thead>
<!--end::Table head-->
<!--begin::Table body-->
<tbody>
<?php
foreach ($coupon_table_row as $row)
{
?>
<tr>
<td>
<div class="symbol symbol-45px me-2">
<?= $row->added ?>
</div>
</td>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> <?= $row->code ?></a>
<span class="text-muted fw-bold d-block">Free credit</span>
</td>
<td class="text-end text-muted fw-bold"><?= $row->amount*0.01 ?> Naira</td>
<td class="text-end">
<span class="badge badge-light-success"><?= $row->status ?></span>
</td>
<td class="text-end">
<div id="reddem_<?=$row->id?>" >
<button type="submit" onclick="return startRedeem('<?=$row->id?>','<?=$row->code?>')" class="btn btn-sm btn-info w-150 mb-5">
<span class="indicator-label">Redeem</span>
<span class="indicator-progress">Please wait...
<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
</button>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
<!--end::Table body-->
</table>
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
</div>
<!--end::Col-->
<!--begin::Col-->
<div class="col-xl-6">
<!--begin::Tables Widget 5-->
<div class="card card-xl-stretch mb-5 mb-xl-8">
<!--begin::Header-->
<div class="card-header border-0 pt-5">
<h3 class="card-title align-items-start flex-column">
<span class="card-label fw-bolder fs-3 mb-1">Redeem Report</span>
</h3>
<div class="card-toolbar">
</div>
</div>
<!--end::Header-->
<!--begin::Body-->
<div class="card-body py-3">
<div class="tab-content">
<!--begin::Tap pane-->
<div class="tab-pane fade show active" id="kt_table_widget_5_tab_1">
<!--begin::Table container-->
<div class="table-responsive">
<!--begin::Table-->
<table class="table table-row-dashed table-row-gray-200 align-middle gs-0 gy-4">
<!--begin::Table head-->
<thead>
<tr class="border-0">
<th class="p-0 w-100px">Added</th>
<th class="p-0 min-w-125px">Coupon</th>
<th class="p-0 min-w-105px">Amount</th>
<th class="p-0 w-90px">Status</th>
<th class="p-0 min-w-50px"></th>
</tr>
</thead>
<!--end::Table head-->
<!--begin::Table body-->
<tbody>
<?php
foreach ($coupon_redeem_row as $row)
{
?>
<tr>
<td>
<div class="symbol symbol-45px me-2">
<?= $row->added ?>
</div>
</td>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> <?= $row->code ?></a>
<span class="text-muted fw-bold d-block">Free credit</span>
</td>
<td class="text-end text-muted fw-bold"><?= $row->amount*0.01 ?> Naira</td>
<td class="text-end">
<span class="badge badge-light-success"><?= $row->status ?></span>
</td>
<td class="text-end">
<span class="badge badge-light-success"><?= $row->active ?></span>
</td>
</tr>
<?php
}
?>
</tbody>
<!--end::Table body-->
</table>
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
</div>
<!--end::Col-->
</div>
<!--end::Row-->
<script type="text/javascript">
<!--
function startRedeem(what, value) {
if (confirm("Are you sure you want to redeem this coupon?")) {
// do something
} else {
return false;
}
$.ajax({
url: "/coupons/redeem?value="+value+"&what="+what
}).done(function (data) {
//alert(data);
$('#reddem_'+what).html(data);
});
}
// -->
</script>