desimal issue:GWM
This commit is contained in:
parent
de1acfe5ed
commit
2b5554335f
@ -694,7 +694,7 @@ class Admin_controller extends BaseController
|
|||||||
->join('member', 'transactions.member_id = member.id', 'left')
|
->join('member', 'transactions.member_id = member.id', 'left')
|
||||||
->orderBy('transactions.created_at' , 'desc')
|
->orderBy('transactions.created_at' , 'desc')
|
||||||
->findAll();
|
->findAll();
|
||||||
// echo '<pre>'; echo print_r($data['creditsData']); '</pre>';
|
// echo '<pre>'; echo print_r($data['creditsData']); '</pre>'; die;
|
||||||
echo view('layout/header',$userdata);
|
echo view('layout/header',$userdata);
|
||||||
echo view('transactions_list',$data);
|
echo view('transactions_list',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
@ -714,7 +714,8 @@ class Admin_controller extends BaseController
|
|||||||
$date = new DateTime($row['created_at']);
|
$date = new DateTime($row['created_at']);
|
||||||
if($row['status'] == 'Success'){
|
if($row['status'] == 'Success'){
|
||||||
$style = 'style="color:green;"';
|
$style = 'style="color:green;"';
|
||||||
$cost = json_decode($row['transaction'] , true)['payment']['amount_money']['amount'];
|
$cost = json_decode($row['transaction'] , true)['payment']['amount_money']['amount'] / 100;
|
||||||
|
$cost = number_format($cost, 2, '.', '');
|
||||||
}else{$cost=''; $style = 'style="color:red;"';}
|
}else{$cost=''; $style = 'style="color:red;"';}
|
||||||
$output .='<tr><td>'.$row['order_id'].'</td><td>'.$date->format('M d , Y').'</td><td>'.$row['transaction_id'].'</td><td>'.$cost.'</td></td><td>'.$row['member_name'].'</td></td><td '.$style.'>'.$row['status'].'</td></tr>';
|
$output .='<tr><td>'.$row['order_id'].'</td><td>'.$date->format('M d , Y').'</td><td>'.$row['transaction_id'].'</td><td>'.$cost.'</td></td><td>'.$row['member_name'].'</td></td><td '.$style.'>'.$row['status'].'</td></tr>';
|
||||||
}
|
}
|
||||||
@ -739,8 +740,9 @@ class Admin_controller extends BaseController
|
|||||||
$output = '<div class="table-responsive"><table class="table mb-0"><thead class="thead-light"><tr> <th>Order Id</th><th>Package Name</th><th>Cost</th><th>Total Amount</th><th>Credits</th><th>Payment Status</th></tr></thead><tbody>';
|
$output = '<div class="table-responsive"><table class="table mb-0"><thead class="thead-light"><tr> <th>Order Id</th><th>Package Name</th><th>Cost</th><th>Total Amount</th><th>Credits</th><th>Payment Status</th></tr></thead><tbody>';
|
||||||
foreach ($creditsData as $row) {
|
foreach ($creditsData as $row) {
|
||||||
if($row['is_active'] == 1 ){ $status = 'Success';}else{ $status = 'Failed';}
|
if($row['is_active'] == 1 ){ $status = 'Success';}else{ $status = 'Failed';}
|
||||||
|
$cost = number_format($row['cost'], 2, '.', '');
|
||||||
$cost_with_tax = number_format($row['cost_with_tax'], 2, '.', '');
|
$cost_with_tax = number_format($row['cost_with_tax'], 2, '.', '');
|
||||||
$output .='<tr><td>'.$row['order_id'].'</td><td>'.$row['package_name'].'</td><td>'.$row['cost'].'</td></td><td>'.$cost_with_tax.'</td></td><td>'.$row['credit_points'].'</td><td>'.$status.'</td></tr>';
|
$output .='<tr><td>'.$row['order_id'].'</td><td>'.$row['package_name'].'</td><td>'.$cost.'</td></td><td>'.$cost_with_tax.'</td></td><td>'.$row['credit_points'].'</td><td>'.$status.'</td></tr>';
|
||||||
}
|
}
|
||||||
echo $output .= '</tbody></table></div> ';
|
echo $output .= '</tbody></table></div> ';
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@
|
|||||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100">
|
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th>Order Id</th>
|
<th>Order Id</th>
|
||||||
<th>Order Date</th>
|
<th>Order Date</th>
|
||||||
<th>Transaction Id</th>
|
<th>Transaction Id</th>
|
||||||
@ -62,6 +63,7 @@
|
|||||||
<?php foreach ($creditsData as $row)
|
<?php foreach ($creditsData as $row)
|
||||||
{ ?>
|
{ ?>
|
||||||
<tr class="order_details" id="<?php echo $row['member_id'];?>">
|
<tr class="order_details" id="<?php echo $row['member_id'];?>">
|
||||||
|
|
||||||
<td><?php echo $row['order_id'];?></td>
|
<td><?php echo $row['order_id'];?></td>
|
||||||
<td><?php $date = new DateTime($row['created_at']); echo $date->format('M d , Y'); ?></td>
|
<td><?php $date = new DateTime($row['created_at']); echo $date->format('M d , Y'); ?></td>
|
||||||
<td><?php echo $row['transaction_id'];?></td>
|
<td><?php echo $row['transaction_id'];?></td>
|
||||||
@ -149,12 +151,13 @@ $(document).on('click','.order_details',function(){
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#datatable-buttons').DataTable({
|
$('#datatable-buttons').DataTable({
|
||||||
"order": [[1, 'desc']], // Set initial sorting to descending on the first column
|
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
|
||||||
"dom": 'Bfrtip', // Show export buttons
|
"dom": 'Bfrtip', // Show export buttons
|
||||||
// "buttons": ['copy', 'csv', 'excel', 'pdf'], // Enable export options
|
// "buttons": ['copy', 'csv', 'excel', 'pdf'], // Enable export options
|
||||||
"language": {
|
"language": {
|
||||||
"search": "Search: " // Customize search label
|
"search": "Search: " // Customize search label
|
||||||
}
|
},
|
||||||
|
"ordering": false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user