This commit is contained in:
2022-02-28 22:56:08 -05:00
parent d323cc274b
commit 3ca0ce7600
4 changed files with 148 additions and 17 deletions
+21 -9
View File
@@ -642,7 +642,7 @@ class Member extends Users_Controller {
$data['comment'] = '';
// $data['fee'] = 0;
//$data['escrow_balance'] = 0;
$this->load->model('report_model');
$this->load->library('table');
$this->table->set_template($this->template);
$mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, "
@@ -659,6 +659,8 @@ class Member extends Users_Controller {
$data['sendmoney_table'] = $this->table->generate($query);
$data['sendmoney_table_result'] = $query->result();
$data['card_payment_data_result'] = $this->report_model->getCardPurchase(6)['card_payment_data_result'];
if ($_POST) {
$data['comment'] = $this->input->post('comment');
$data['amount'] = $this->input->post('amount') + 0; // must be number [still in full will be cents to go to backend latter]
@@ -1004,7 +1006,11 @@ class Member extends Users_Controller {
$this->load->library('pagination');
$config = array();
/*
*
* 7 | MEMBER_NEWCARD_PAYM | MNCCD | 0
8 | MEMBER_RETCARD_PAYM | MRCCD | 0
*/
$this->load->library('table');
$this->table->set_template($this->template);
@@ -1012,7 +1018,10 @@ class Member extends Users_Controller {
. "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' "
. "WHEN code ='SMPAY' THEN 'Account Withdraw' "
. "WHEN code ='COCNL' THEN 'Cancellation Refund' "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' "
. "WHEN code ='MNCCD' THEN 'New Card Payment' "
. "WHEN code ='MRCCD' THEN 'Repeat Card Payment' "
. "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC";
$query = $this->db->query($mysql);
@@ -1045,12 +1054,15 @@ class Member extends Users_Controller {
$page = is_numeric($page) ? $page : 0;
$mysql = "SELECT added::date,(CASE WHEN code = 'OFDPS' THEN 'Job Offer Deposit' "
. "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' "
. "WHEN code ='SMPAY' THEN 'Account Withdraw' "
. "WHEN code ='COCNL' THEN 'Cancellation Refund' "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page;
. "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' "
. "WHEN code ='SMPAY' THEN 'Account Withdraw' "
. "WHEN code ='COCNL' THEN 'Cancellation Refund' "
. "WHEN code ='COPAY' THEN 'Completed Task Payment' "
. "WHEN code ='MNCCD' THEN 'New Card Payment' "
. "WHEN code ='MRCCD' THEN 'Repeat Card Payment' "
. "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page;
$query = $this->db->query($mysql);
+24
View File
@@ -0,0 +1,24 @@
<?php
class Report_model extends CI_Model {
function __construct() {
}
public function getCardPurchase($limit){
$data = array();
$mysql = "SELECT added::date,"
." (CASE WHEN code ='MNCCD' THEN 'New Card Payment' "
. "WHEN code ='MRCCD' THEN 'Repeat Card Payment' "
. "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC LIMIT ". $limit; // OFFSET " . $page;
$query = $this->db->query($mysql);
$data['card_payment_data_result'] = $query->result();
return $data;
}
}
+102 -7
View File
@@ -1,9 +1,5 @@
<?php include('common/userstrip.php'); ?>
<?php
//var_dump($_SESSION);
?>
<!--begin::Row-->
<div class="row g-5 g-xl-8">
<!--begin::Col-->
@@ -148,9 +144,9 @@
<tr>
<th class="p-0 w-90px">Date</th>
<th class="p-0 min-w-150px">Recipient</th>
<th class="p-0 w-60px">Amount/Fee</th>
<th class="p-0 min-w-100px">Conf/Status</th>
<th class="p-0 min-w-160px">Recipient</th>
<th class="p-0 w-100px">Amount/Fee</th>
<th class="p-0 w-100px">Conf/Status</th>
</tr>
</thead>
<!--end::Table head-->
@@ -462,6 +458,105 @@
</div>
<!--end::Row-->
<!--begin::Row-->
<div class="row g-5 g-xl-8">
<!--begin::Col-->
<div class="col-xl-6">
<!--begin::Table Widget 7-->
<div class="card card-xl-stretch 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">Purchases</span>
<span class="text-muted mt-1 fw-bold fs-7"></span>
</h3>
<div class="card-toolbar">
<ul class="nav">
</ul>
</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_7_tab_1">
<!--begin::Table container-->
<div class="table-responsive">
<!--begin::Table-->
<table class="table align-middle gs-0 gy-3">
<!--begin::Table head-->
<thead>
<tr>
<th class="p-0 w-100px">Date</th>
<th class="p-0 min-w-150px">Description</th>
<th class="p-0 w-140px">Amount</th>
<th class="p-0 w-140px">Fee</th>
<th class="p-0 w-80px"></th>
</tr>
</thead>
<!--end::Table head-->
<!--begin::Table body-->
<tbody>
<?php
//var_dump($payment_data_result);
foreach ($card_payment_data_result as $row)
{
?>
<tr>
<td>
<?=$row->added?>
</td>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"><?=$row->description?> </a>
<span class="text-muted fw-bold d-block fs-7"><?=$row->confirmation?></span>
</td>
<td class="text-start">
<span class="text-dark fw-bolder d-block fs-7"><?=$row->amount?></span>
</td>
<td class="text-start">
<span class="text-dark fw-bolder d-block fs-7"><?=$row->fee?></span>
</td>
<td class="text-end">
<a href="#" class="btn btn-sm btn-icon btn-bg-light btn-active-color-primary">
<i class="bi bi-three-dots fs-5"></i>
</a>
</td>
</tr>
<?php
}
?>
<!--end::Table body-->
</table>
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 7-->
</div>
<!--end::Col-->
<!--begin::Col-->
<div class="col-xl-6">
<!--begin::Table Widget 8-->
<div class="card card-xl-stretch mb-5 mb-xl-8">
</div>
<!--end::Tables Widget 8-->
</div>
<!--end::Col-->
</div>
<!--end::Row-->
+1 -1
View File
@@ -51,7 +51,7 @@
<?=$row->added?>
</td>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> <?=$row->description?></a>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"><?=$row->description?> </a>
<span class="text-muted fw-bold d-block fs-7"><?=$row->confirmation?></span>
</td>
<td class="text-start">