| Current Path : /home2/wtmwscom/public_html/admin/ |
| Current File : /home2/wtmwscom/public_html/admin/report_withdraw.php |
<?php
$title = "Withdrawal Report";
include 'header.php';
//include_once('./lib/ps_pagination.php');
//if(isset($_GET['login_id'])){ $uid = mysqli_fetch_object(mysqli_query($connection, "SELECT uid FROM user WHERE login_id = '".$_GET['login_id']."'"))->uid; }
//$param .= isset($_GET['login_id']) && $_GET['login_id'] != '' ? "&login_id=" . $_GET['login_id'] : '';
//$param .= isset($_GET['from_date']) && $_GET['from_date'] != '' ? "&from_date=" . $_GET['from_date'] : '';
//$param .= isset($_GET['to_date']) && $_GET['to_date'] != '' ? "&to_date=" . $_GET['to_date'] : '';
//$param .= isset($_GET['hold_payment']) && $_GET['hold_payment'] != '' ? "&hold_payment=" . $_GET['hold_payment'] : '';
//$param .= isset($_GET['status']) && $_GET['status'] != '' ? "&status=" . $_GET['status'] : '';
$query = "SELECT t1.recid AS recid, t1.uid AS uid, t1.amount AS amount, t1.tds AS tds, t1.service_tax AS service_tax, t1.service AS service, t1.net_amount AS net_amount, t1.datetime AS datetime, t1.status AS status, t1.description AS description, "
. "t2.login_id as login_id, t2.name as name, t2.email as email, t2.mobile as mobile, t2.account_holder_name as account_holder_name, t2.bank_name as bank_name, t2.branch_name as branch_name, t2.account_number as account_number, t2.ifsc as ifsc"
. " FROM `withdraw` t1 INNER JOIN user t2 ON t1.uid = t2.uid WHERE t1.uid != 0";
$query .= isset($_GET['login_id']) && $_GET['login_id'] != '' ? " AND t2.login_id='" . $_GET['login_id'] . "'" : '';
$query .= isset($_GET['from_date']) && $_GET['from_date'] != '' && isset($_GET['to_date']) && $_GET['to_date'] != '' ? " AND (date(t1.datetime) BETWEEN '" . $_GET['from_date'] . "' AND '" . $_GET['to_date'] . "')" : '';
$query .= isset($_GET['hold_payment']) && $_GET['hold_payment'] != '' ? " AND t2.hold_payment='" . $_GET['hold_payment'] . "'" : '';
$query .= isset($_GET['status']) && $_GET['status'] != '' ? " AND t2.status='" . $_GET['status'] . "'" : '';
$query .= " ORDER BY t1.`datetime` DESC";
?>
<!----new table started-->
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<h4 class="page-title">Report Withdraw</h4>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item"><a href="#">Income</a></li>
<li class="breadcrumb-item active">Report Withdraw</li>
</ol>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card m-b-20">
<div class="card-body">
<form class="form-inline" id="search-form" action="">
<div class="form-group " >
<label class="form-control" for="login_id"> UserId: </label>
<input type="text" class="form-control" id="login_id" placeholder="Enter login id" name="login_id">
</div>
<div class="form-group " >
<label class="form-control " > From Date: </label>
<input type="text" class="form-control datepicker" placeholder="From date" name="from_date" autocomplete="off">
</div>
<div class="form-group">
<label class="form-control "> To date: </label>
<input type="text" class="form-control datepicker" placeholder="To date" name="to_date" autocomplete="off" >
</div><br>
<!-- <label class="form-control" for="hold_payment"> : </label>-->
<select name="hold_payment" id="income_type" class="form-control">
<option value="">All Payment User</option>
<option value="0">Active Payment</option>
<option value="1">Hold Payment</option>
</select>
<!-- <label class="form-control" for="status"> </label>-->
<select name="status" id="income_type" class="form-control">
<option value="">All Status User</option>
<option value="0">Active User</option>
<option value="1">Blocked User</option>
</select>
<button type="submit" class="btn btn-primary" id="submit">Search</button><br><br><br>
</form>
<table class="table table-striped table-bordered mb-0" id="datatable-ajax-page">
<thead>
<tr>
<th>S. No.</th>
<th>User</th>
<th>Date</th>
<th>Amount</th>
<th>TDS (<?php echo $master_tds_rate; ?>%)</th>
<th>Service Charge (<?php echo $master_service_rate; ?>%)</th>
<th>Net Amount</th>
<th>Details</th>
</tr>
</thead>
<tbody>
</tbody>
<!-- <tr>
<th colspan="3" style="text-align: right;">Total Amount:</th>
<th colspan="3" style="text-align: left;">Rs. <?php echo $total ?></th>
<th colspan="2" style="text-align: left;">Rs. <?php echo $net_total ?></th>
</tr>-->
</table>
</div>
</div>
</div> <!-- end col -->
</div>
<!--table content ends here-->
</div>
<div id="commonModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mt-0" id="myModalLabel">Payment Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<form class="form-horizontal" action="./process_withdraw.php" method="POST" onsubmit="return confirm('Are you sure? You want to update payment details!')">
<table class="table table-striped">
<tbody>
<tr >
<td>Name</td>
<td id="name"></td>
</tr>
<tr >
<td>Email</td>
<td id="email"></td>
</tr>
<tr>
<td>Mobile</td>
<td id="mobile"></td>
</tr>
</tbody>
</table>
<table class="table table-striped">
<thead>
<tr>
<th colspan="2" style="text-align: left;">Bank Details</th>
</tr>
</thead>
<tbody>
<tr>
<td>Account Holder Name</td>
<td id="account_holder_name"></td>
</tr>
<tr>
<td>Bank Name</td>
<td id="bank_name"></td>
</tr>
<tr >
<td>Branch Name</td>
<td id="branch_name"></td>
</tr>
<tr >
<td>Account Number</td>
<td id="account_number"></td>
</tr>
<tr >
<td>IFSC Code</td>
<td id="ifsc"></td>
</tr>
</tbody>
</table>
<div>
<input type="hidden" name="recid" id="withdraw_recid" value=""/>
<textarea id="withdraw_description" name="description" rows="7" cols="60" placeholder="Enter Bank Transaction Details" ></textarea>
<br/>
<div class="modal-footer">
<div class="col-md-offset-3">
<button class="btn btn-primary" name="submit">Update Transaction Details</button>
<button class="btn btn-default " data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</form>
<form class="form-horizontal" id="search-modal-form">
<div id="searchModalFormField">
</div>
</form>
</div>
<!-- <div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary waves-effect waves-light">Save changes</button>
</div>-->
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<script type="text/javascript">
var start;
$(document).ready(function () {
var table = $('#datatable-ajax-page').DataTable({
"ajax": {
"url": "./report/report_withdraw_json.php",
"type": "POST",
dataType: 'json',
data: function (d) {
var formData = $("#search-form").serializeArray();
$.each(formData, function (i, field) {
d[field.name] = field.value;
});
},
},
"processing": true,
"serverSide": true,
"pageLength": 500,
//"lengthMenu": [[100, 500, 1000, 2000, -1], [100, 500, 1000, 2000, "All"]],
"lengthMenu": [[100, 500, 1000, 2000, 5000], [100, 500, 1000, 2000, 5000]],
"dom": 'B<"top">rt<"bottom"lp><"clear">',
buttons: [
'excel', 'csv', 'pdf', 'print'
],
"columns": [
{"data": "sno"},
{"title": "User", "data": "name",
"render": function (data, type, full, meta) {
return full.name + ' (' + full.login_id + ')';
}},
/* { "data": "parentRoleId" }, */
{"data": "datetime"},
{"data": "amount"},
{"data": "tds"},
{"data": "service"},
{"data": "net_amount"},
{"data": "uid",
"render": function (data, type, full, meta) {
return '<button onclick="processStatus(' + full.recid + ', \'' + full.description + '\', \'' + full.name + '\', \'' + full.email + '\', \'' + full.mobile + '\', \'' + full.account_holder_name + '\', \'' + full.bank_name + '\', \'' + full.branch_name + '\', \'' + full.account_number + '\', \'' + full.ifsc + '\');" class="btn btn-primary">' + 'View Pay Details' + '</buton>';
}
},
],
}
);
$("#search-form").submit(function (e) {
table.ajax.reload();
e.preventDefault(); // avoid to execute the actual submit of the form.
});
table.on('xhr', function () {
start = table.ajax.json().start;
});
});
function processStatus(recid, description, name, email, mobile, account_holder_name, bank_name, branch_name, account_number, ifsc) {
$("#withdraw_recid").val(recid);
$("#withdraw_description").val(description);
$("#name").text(name);
$("#email").text(email);
$("#mobile").text(mobile);
$("#account_holder_name").text(account_holder_name);
$("#bank_name").text(bank_name);
$("#branch_name").text(branch_name);
$("#account_number").text(account_number);
$("#ifsc").text(ifsc);
$('#commonModal').modal();
}
</script>
<?php include 'footer.php'; ?>