| Current Path : /home2/wtmwscom/public_html/admin/ |
| Current File : /home2/wtmwscom/public_html/admin/pin.php |
<?php
$title = "Pins";
include 'header.php';
?>
<div class="container-fluid">
<?php echo getMessage(); ?>
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<h4 class="page-title"><B>PIN REPORT</b></h4>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item"><a href="#">Pin</a></li>
<li class="breadcrumb-item active">Pin</li>
</ol>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-12">
<div class="card m-b-20">
<div class="card-body">
<form name="form" id="form" action="pin_model.php" method="post">
<div class="form-group row">
<!-- <label for="example-text-input" class="col-sm-2 col-form-label">Text</label>-->
<label for="pin" class="col-sm-2 col-form-label">Select Pin Amount</label>
<!-- <label class="col-sm-2 col-form-label" for="dob"> Name<span>*</span></label>-->
<div class="col-sm-10">
<select class="custom-select" name="type" id="type" onChange="show_type(this.value);" required="required">
<?php
$result_pin_package = mysqli_query($connection, "SELECT id, package_name, package_amount, pin_length FROM pin_package where package_amount != 0 ");
while ($pin_type = mysqli_fetch_object($result_pin_package)) {
?>
<option value="<?php echo $pin_type->id; ?>" <?php
if ($pin_type->id == $_GET['type']) {
echo "selected='selected'";
}
?>><?php echo $pin_type->package_name . " ($pin_type->package_amount) "; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="pin">Enter Number of Pin <span>*</span></label>
<div class="col-sm-10">
<input class="form-control" type="text" name="pin" id="pin" pattern="[0-9]{1,3}" required="required" maxlength="3">
<br>
<input type="hidden" value="<?php echo $_GET['type']; ?>" name="type"/>
</div>
</div>
<div class="form-group">
<div>
<!-- <input style="position: relative; left: 160px;" name="submit" type="submit" id="submit" value="Save">
-->
<button name="submit" type="submit" id="submit" value="Generate" class="btn btn-primary waves-effect waves-light">
Generate
</button>
<!-- <button type="reset" class="btn btn-secondary waves-effect m-l-5">
Cancel
</button>-->
</div>
</div>
</form>
</div>
</div>
</div> <!-- end col -->
</div> <!-- end row -->
</div> <!-- container-fluid -->
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<h4 class="page-title"><B>PIN REPORT</b></h4>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item"><a href="#">Pin</a></li>
<li class="breadcrumb-item active">Pin</li>
</ol>
<section id="comments">
<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>
<div class="form-group">
<select name="status" id="income_type" class="form-control">
<option value="">All</option>
<option value="used">Used</option>
<option value="unused">Unused</option>
<option value="transfer">Transfer</option>
<!--<option value=5>Income on Income</option>-->
</select>
</div>
<!-- <div class="form-group " >
<label class="form-control" for="pinumber"> Pin Number: </label>
<input type="text" class="form-control" id="pinnumber" placeholder="Enter pinnumber" name="pinumber">
</div>-->
<!-- <div class="form-group " >
<label class="form-control" for="account_no"> Account No: </label>
<input type="text" class="form-control" id="login_id" placeholder="Enter account number" name="account_no">
</div>
<label class="form-control" for="hold_payment"> Income Type: </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>
<option value="2">Binary Pair Income</option>
<option value=5>Income on Income</option>
</select>
<label class="form-control" for="status"> Income Type: </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>
<option value="2">Binary Pair Income</option>
<option value=5>Income on Income</option>
</select> -->
<input type="hidden" value="<?php echo $_GET['type']; ?>" name="type"/>
<button type="submit" class="btn btn-primary" id="submit">Search</button><br><br><br>
</form>
</section>
</div>
</div>
</div>
<form name="myform">
<div class="row">
<div class="col-lg-12">
<div class="card m-b-20">
<div class="card-body">
<table class="table mb-0 " id="datatable-ajax-page">
<thead>
<tr>
<th>check</th>
<th>S.No</th>
<th>Date of Generate</th>
<th>Pin Number</th>
<th>Pin Type</th>
<th>Amount</th>
<th>Status</th>
<th>Used By</th>
<th>Transfer</th>
<th>Generation</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<?php //echo $pager->renderFullNav(); ?>
</div>
</div>
</div> <!-- end col -->
</div>
<!--table content ends here-->
<div class="row">
<div class="col-12">
<div class="card m-b-20">
<div class="card-body">
<form name="myform" action="pin.php">
<div class="form-group row">
<!-- <label for="example-text-input" class="col-sm-2 col-form-label">Text</label>-->
<label class="col-sm-2 col-form-label" for="uid">Enter User Id </label>
<!-- <label class="col-sm-2 col-form-label" for="dob"> Name<span>*</span></label>-->
<div class="col-sm-10">
<input class="form-control" type="text" name="uid" id="uid" required="required" maxlength="20"/>
</div>
</div>
<div class="form-group">
<div>
<!-- <input style="position: relative; left: 160px;" name="submit" type="submit" id="submit" value="Save">
-->
<button type="button" name="submit" id="submit" onClick="transfer();" value="Transfer" class="btn btn-primary waves-effect waves-light">
Transfer
</button>
<!-- <button type="reset" class="btn btn-secondary waves-effect m-l-5">
Cancel
</button>-->
</div>
</div>
</form>
</div>
</div>
</div> <!-- end col -->
</div> <!-- end row -->
</form>
</div>
</div> <!-- container-fluid -->
<script type="text/javascript">
var start;
$(document).ready(function () {
var table = $('#datatable-ajax-page').DataTable({
"ajax": {
"url": "./report/pin_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": "uid",
"render": function (data, type, full, meta) {
return '<input type="checkbox" name="list" value="' + full.recid + '" '+ ( full.status=="transfer" || full.status=="used" ? 'disabled="disabled"' : '') +' />';
}
},
{"data": "sno"},
/* { "data": "parentRoleId" }, */
// {"title": "User", "data": "name",
// "render": function (data, type, full, meta) {
// return '<a href="user_login_process.php?uid=' + full.uid + '" title="Login this user" target="_blank">' + full.name + '</a>';
// }},
{"data": "datetime"},
{"data": "pinumber"},
{"data": "pin_type"},
{"data": "amount"},
{"data": "status"},
{"data": "used"},
{"data": "transfer"},
{"data": "generated_by"},
// {"data": "total_binary"},
],
}
);
$("#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 show_type(type) {
window.location = 'pin.php?type=' + type;
}
function transfer(){
var len = document.myform.list.length;
var uid = document.getElementById("uid").value;
var type = '<?php echo $_GET['type'];?>';
var pin_id = "";
for(var i=0; i<len; i++){
if(document.myform.list[i].checked==true){
pin_id+=document.myform.list[i].value+",";
}
}
var location = "pin_transfer_model.php?pin_id="+pin_id+"&uid="+uid+"&type="+type;
//alert(location);
window.location = location;
}
</script>
<?php include('footer.php'); ?>