chess/application/views/pages/withdrawl_request.php

268 lines
13 KiB
PHP

<!doctype html>
<html lang="en" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg"
data-sidebar-image="none" data-preloader="disable">
<!-- Mirrored from themesbrand.com/velzon/html/default/ by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 23 Mar 2023 12:52:34 GMT -->
<head>
<?php include 'link/links.php'?>
</head>
<body>
<!-- Begin page -->
<div id="layout-wrapper">
<?php include 'common_file/header.php'?>
<!-- removeNotificationModal -->
<!-- ========== App Menu ========== -->
<?php include 'common_file/sidebar.php'?>
<!-- Left Sidebar End -->
<!-- Vertical Overlay-->
<div class="vertical-overlay"></div>
<!-- ============================================================== -->
<!-- Start right Content here -->
<!-- ============================================================== -->
<div class="main-content">
<div class="page-content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">Withdrawl Request</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?php echo base_url('dashboard')?>">Home</a>
</li>
<li class="breadcrumb-item active">Withdrawl Request</li>
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-header align-items-center d-flex">
<h4 class="card-title mb-0 flex-grow-1">Withdrawl Request</h4>
<div class="flex-shrink-0">
<!-- <div class="form-check form-switch form-switch-right form-switch-md">
<label for="responsive-table-showcode" class="form-label text-muted">Show
Code</label>
<input class="form-check-input code-switcher" type="checkbox"
id="responsive-table-showcode">
</div> -->
<div class="search-box">
<input type="search" class="form-control search-input form-control-sm "
id=" searchMemberList" placeholder="Search here..."
data-table="table_list">
<i class="ri-search-line search-icon"></i>
</div>
<!-- <div id="example3_filter" class="dataTables_filter" style="float:right;">
<label>
<input id="abc" type="search" placeholder="Search"
class=" form-control search-input form-control-sm mt-2"
aria-controls="example3" data-table="table_list"></label>
</div> -->
</div>
</div><!-- end card header -->
<div class="card-body">
<!-- <p class="text-muted">Use <code>table-responsive</code> class to make any table
responsive across all viewports. Responsive tables allow tables to be scrolled
horizontally with ease.</p> -->
<div class="live-preview">
<div class="table-responsive">
<table
class="table align-middle table-bordered table-sortable table-nowrap mb-0 table_list">
<thead class="table-light">
<tr>
<th scope="col">Sr.No.</th>
<th scope="col">User Name</th>
<!-- <th scope="col">Mobile Number</th> -->
<th scope="col">Wallet Amount</th>
<th scope="col">Withdrawl Request Amount</th>
<th scope="col">Req.Date|Time</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
<?php $count_data = count($data);?>
<?php if(count($data) > 0) {
$i = 1;
foreach($data as $data) {
$user_id = $data['user_id'];
$name =""; $mobile ="";
$user_data = $this->db->get_where('tbl_user', array('user_id' => $user_id))->row_array();
if($user_data){
$name = $user_data['name'];
}
?>
<tr id="<?php echo $data['id']; ?>">
<td><a href="#" class="fw-medium"><?php echo $i;?></a></td>
<td><?php echo $name; ?></td>
<td>₹ <?php echo $data['user_total_balance'];?></td>
<td>₹ <?php echo $data['withdraw_amt'];?></td>
<td>
<?php
$date = date('d-m-Y', strtotime($data['created_at']));
$time = date('h:i A', strtotime($data['created_at']));
echo $date." | ".$time;
?>
</td>
<td><select class="form-select"
id="status_<?php echo $i;?>" name="status">
<?php if($data['request_status'] == '0') {?>
<option value="0" <?php if($data['request_status'] == '0') { echo "selected";}?>>Pending</option>
<option value="2" <?php if($data['request_status'] == '2') { echo "selected";}?>>Accept </option>
<option value="1" <?php if($data['request_status'] == '1') { echo "selected";}?>>Reject</option>
<?php } ?>
<?php if($data['request_status'] == '1') {?>
<option value="1" <?php if($data['request_status'] == '1') { echo "selected";}?>>Reject</option>
<?php } ?>
<?php if($data['request_status'] == '2') {?>
<option value="2" <?php if($data['request_status'] == '2') { echo "selected";}?>>Accept </option>
<?php } ?>
</select>
</td>
<td>
<div class="">
<a href="<?php echo base_url('withdrawl_history/')?><?php echo $data['user_id'];?>">
<button type="button"
class="btn btn-success btn-icon "><i
class="ri-file-info-fill"></i></button>
</a>
</div>
</td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
<p id="table_list" class="text-warning">No matching records found
</p>
<div class="d-flex justify-content-end mt-4">
<?php echo $this->pagination->create_links(); ?>
</div>
<!-- end table -->
</div>
<!-- end table responsive -->
</div>
</div><!-- end card-body -->
</div><!-- end card -->
</div><!-- end col -->
</div>
</div>
<!-- container-fluid -->
</div>
<!-- End Page-content -->
<footer class="footer">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<script>
document.write(new Date().getFullYear())
</script> © Chess.
</div>
<div class="col-sm-6">
<div class="text-sm-end d-none d-sm-block">
Design & Develop by Appzia
</div>
</div>
</div>
</div>
</footer>
</div>
<!-- end main content-->
</div>
<!-- END layout-wrapper -->
<!--start back-to-top-->
<button onclick="topFunction()" class="btn btn-danger btn-icon" id="back-to-top">
<i class="ri-arrow-up-line"></i>
</button>
<!--end back-to-top-->
<!--preloader-->
<div id="preloader">
<div id="status">
<div class="spinner-border text-primary avatar-sm" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
</div>
<?php include 'link/script.php'?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
var c = "<?php echo $count_data;?>";
for(j=1; j<=c; j++){
$('#status_'+j).change(function(){
var status = $(this).val();
var id = $(this).closest('tr').attr('id'); // table row ID
// console.log(status);
$.ajax({
url:'<?php echo site_url('Dashboard_controller/change_status_with'); ?>',
method: 'post',
data: {status:status, id: id},
dataType: 'json',
success: function(response){
alert('status is updated');
console.log(response);
}
});
});
}
});
</script>
</body>
</html>