checkout:GWM
This commit is contained in:
parent
7dc3cfd1d5
commit
00e3c5a442
@ -99,7 +99,7 @@ $routes->match(['get','post'],'/booked_slot','Admin_controller::booked_slot');
|
||||
$routes->match(['get','post'],'/manage_availability','Admin_controller::manage_availability');
|
||||
$routes->match(['get','post'],'/add_to_cart_package','Admin_controller::add_to_cart_package');
|
||||
$routes->match(['post'],'/order_details','Admin_controller::order_details');
|
||||
$routes->match(['get'],'/view_member_details/(:any)','Admin_controller::view_member_details/$1');
|
||||
$routes->match(['get'],'/view_credit_details/(:any)','Admin_controller::view_credit_details/$1');
|
||||
|
||||
|
||||
$routes->match(['get'],'/admin_home','Dashboard::admin_home');
|
||||
|
||||
@ -1084,28 +1084,14 @@ class Admin_controller extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function view_member_details($member_id)
|
||||
public function view_credit_details($member_id)
|
||||
|
||||
{
|
||||
|
||||
|
||||
$creditsData = $this->creditsModel->where('member_id',$member_id)->where('is_active',1)->orderBy('id' , 'ASC')->findAll();
|
||||
$recent_expiry = $this->creditsModel->select('expiring_date')->selectSum('running_balance', 'no_of_credits')->groupBy('expiring_date')->orderBy('expiring_date', 'asc')->where('member_id',$member_id)->where('is_active',1)->first();
|
||||
if($recent_expiry){
|
||||
$data['no_of_credits'] = $recent_expiry['no_of_credits'];
|
||||
$data['expiring_date'] = $recent_expiry['expiring_date'];
|
||||
}else{
|
||||
$data['no_of_credits'] = '';
|
||||
$data['expiring_date'] = '';
|
||||
}
|
||||
|
||||
|
||||
$creditsData = $this->creditsModel->where('md5(member_id)',$member_id)->where('is_active',1)->orderBy('id' , 'ASC')->findAll();
|
||||
$data['credit_data'] = [];
|
||||
$data['avaiable_credit'] = 0;
|
||||
$data['profile'] = $this->MemberModel->select('member.* , zipcode.code as zipcode')
|
||||
->join('zipcode', 'member.pincode = zipcode.id', 'left')
|
||||
->where('member.id', $member_id)
|
||||
->find();
|
||||
$data['country'] = $this->CountryModel->findAll();
|
||||
foreach ($creditsData as $creditsDataindex => $creditsDataValue)
|
||||
{
|
||||
@ -1115,37 +1101,14 @@ class Admin_controller extends BaseController
|
||||
array_push($data['credit_data'] , $creditsDataValue);
|
||||
}
|
||||
|
||||
|
||||
$TransactionData = $this->TransactionModel->where('member_id', $member_id)->where('status', 'success')->findAll();
|
||||
$data['TransactionData'] = [];
|
||||
foreach ($TransactionData as $TransactionDatakey => $TransactionDatavalue) {
|
||||
$credit_data = $this->creditsModel->where('member_id', $member_id)
|
||||
->select('package_name')
|
||||
->select('cost')
|
||||
->select('credit_points')
|
||||
->select('expiring_date')
|
||||
->selectSum('credit_points', 'creditPointsSum')
|
||||
->selectSum('cost', 'costSum')
|
||||
->selectCount('package_name', 'pack_count')
|
||||
->groupBy('package_name')
|
||||
->where('order_id',$TransactionDatavalue['order_id'])
|
||||
->where('is_active',1)
|
||||
->findAll();
|
||||
$TransactionDatavalue['credit_data'] = $credit_data;
|
||||
array_push($data['TransactionData'] ,$TransactionDatavalue);
|
||||
}
|
||||
$data['gst'] = $this->RuleModel->select('value')->where('rule_key', 3 )->get()->getRow()->value;
|
||||
$data['pst'] = $this->RuleModel->select('value')->where('rule_key', 4 )->get()->getRow()->value;
|
||||
$zip = $this->ZipcodeModel->findAll();
|
||||
$output = '<option value="">Select Zipcode</option>';
|
||||
foreach($zip as $row)
|
||||
{
|
||||
$output .= '<option value="'.$row['id'].'">'.$row['code'].'</option>';
|
||||
}
|
||||
$data['zipcode'] = $output;
|
||||
|
||||
echo view('view_member_details',$data); //dashboard
|
||||
|
||||
$output = '<div class="table-responsive"><table class="table mb-0"><thead class="thead-light"><tr> <th>Order Id</th><th>Order Date</th><th>Expiry Date</th><th>Credit Transactions</th><th>Credit Balance</th></tr></thead><tbody>';
|
||||
for( $i = count($data['credit_data']) - 1; $i >= 0 ; $i--) {
|
||||
$date = new DateTime($data['credit_data'][$i]['created_at']);
|
||||
$expirydate = new DateTime($data['credit_data'][$i]['expiring_date']);
|
||||
$output .='<tr><td>'.$data['credit_data'][$i]['order_id'].'</td><td>'.$date->format('M-d-Y').'</td><td>'.$expirydate->format('M-d-Y').'</td><td>'.$data['credit_data'][$i]['running_balance'].'</td><td>'.$data['credit_data'][$i]['avaiable_credit'].'</td></tr>';
|
||||
}
|
||||
echo $output .= '</tbody></table></div> ';
|
||||
|
||||
}
|
||||
|
||||
// public function add_to_cart_package()
|
||||
|
||||
@ -372,8 +372,8 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<input type="checkbox" " id="rememberMe"> <label for="rememberMe">Accept and Continue</label>
|
||||
</br>
|
||||
<input type="checkbox" " id="rememberMe"> <label for="rememberMe">By placing your order, you agree to our company privacy policy and condition of use.</label>
|
||||
|
||||
|
||||
|
||||
@ -516,7 +516,7 @@ $web_payment_sdk_url = $_ENV["ENVIRONMENT"] === Environment::PRODUCTION ? "https
|
||||
|
||||
<div class="col-lg-12">
|
||||
|
||||
<p>By placing your order, you agree to our company privacy policy and condition of use.</p>
|
||||
<!-- <p>By placing your order, you agree to our company privacy policy and condition of use.</p> -->
|
||||
|
||||
<!-- <button id="card-button" type="button">Proceed to Pay</button> -->
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
<td><?php echo $row['name'];?></td>
|
||||
<td><?php echo $row['mobile'];?></td>
|
||||
<td><?php echo $row['email'];?></td>
|
||||
<td><?php echo $row['credits'];?></td>
|
||||
<td class="credit_usage" id="<?php echo md5($row['id']);?>"><?php echo $row['credits'];?></td>
|
||||
<td><?php if($row['is_active'] == 1){ echo "Active"; }else{ echo "Deactive"; }?></td>
|
||||
<td><a href="<?= base_url() ?>member_edit/<?php echo md5($row['id']);?>"><i class="mdi mdi-lead-pencil" style="font-size:18px;"></i></a>
|
||||
<?php if ($row['is_active'] == 1) { ?>
|
||||
@ -72,7 +72,7 @@
|
||||
<a href="<?= base_url() ?>member_activate/<?php echo md5($row['id']);?>"><i class="mdi mdi-account-cancel-outline" title="Activate" style="font-size:18px;"></i></a>
|
||||
<?php } ?>
|
||||
|
||||
<i class="mdi mdi-eye-outline credit_usage" id="<?php echo md5($row['id']);?>" style="font-size:18px;" title="Transactions"></i>
|
||||
<i class="mdi mdi-eye-outline transaction" id="<?php echo md5($row['id']);?>" style="font-size:18px;" title="Transactions"></i>
|
||||
</td>
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myLargeModalLabel">Transaction Details</h4>
|
||||
<h4 class="modal-title" id="myLargeModalLabel"></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body" id="model-table" >
|
||||
@ -110,18 +110,18 @@
|
||||
|
||||
|
||||
|
||||
<!-- <script>
|
||||
$(document).on('click','.',function(){
|
||||
<script>
|
||||
$(document).on('click','.credit_usage',function(){
|
||||
|
||||
var member_id = $(this).closest('i').attr('id');
|
||||
var member_id = $(this).closest('td').attr('id');
|
||||
alert(member_id);
|
||||
$.ajax({
|
||||
url:"<?= base_url(); ?>view_credit_details/"+member_id,
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
$('.modal-body').html(response);
|
||||
$('#full-width-modal').modal('show');
|
||||
// $('#bs-example-modal-lg').modal('show');
|
||||
$('#myLargeModalLabel').html('Credits Details')
|
||||
$('#model-table').html(response);
|
||||
$('#bs-example-modal-lg').modal('show');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle the error here
|
||||
@ -129,17 +129,17 @@ $(document).on('click','.',function(){
|
||||
}
|
||||
});
|
||||
});
|
||||
</script> -->
|
||||
</script>
|
||||
<script>
|
||||
$(document).on('click','.credit_usage',function(){
|
||||
$(document).on('click','.transaction',function(){
|
||||
|
||||
var member_id = $(this).closest('i').attr('id');
|
||||
alert(member_id);
|
||||
|
||||
$.ajax({
|
||||
url:"<?= base_url(); ?>/transactions_list/"+member_id,
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
$('#myLargeModalLabel').html('Transaction Details')
|
||||
$('#model-table').html(response);
|
||||
$('#bs-example-modal-lg').modal('show');
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user