<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php

use App\Libraries\MyEncrypt;
use App\Helpers\site_helper;
$this->db = db_connect();
$session = session();
$this->common_model = model('CommonModel');

echo view('user/common_style1');
echo view('user/pool_common_header');
?> 


<link rel="stylesheet" href="<?php echo base_url('styles/css/table.css');?>">


<style type="text/css">
.table-responsive {
overflow-x: visible !important;
}
table tr th {
background: #203c9d none repeat scroll 0 0;
color: #fff;
font-size: 13px;
font-weight: 300;
padding: 16px 20px;
text-align: left;
text-transform: capitalize;
white-space: nowrap;
}
@media only screen and (max-width:768px){
#DataTables_Table_0_wrapper{
overflow: auto !important;
overflow-y: hidden !important;
}
}
input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
background-color: #fff;
border: 1px solid #e1e1e1;
color: #000;
font-size: 14px;
height: 42px;
margin: 5px 0;
padding: 10px 7px 10px 10px;
width: 100%;
}
.btn
{
	padding: 10px !important;
}
  #hp3{
  width: 49px;
  height: 43px;
  margin: 2px;
  /* margin-left: -12px; */
  padding: 4px;
  margin-bottom: 10px;
  }

  #mobile_left{
  	margin-left: 82px;
  }

   @media only screen and (max-width:767px) {
  #mobile_left{
  	margin-left: 0px !important;
  }
}
</style>


</head>
<body class="admin-inner">

<section class="white pt-10 pb-10">




<div class="container">


<h3 class="color-2 mt-4" align="center">
<div class="row mb-3" style="display: flex;justify-content: center;">
<div class="col-lg-12">
<a href="<?php echo base_url('pool');?>" class="mobile_response btn btn-default" style="float: left;">
<i class="fa fa-arrow-left text-primary" style="font-size: 22px;"></i>
</a>

<img src="<?php echo base_url();?>/assets/images/bar-chart_1.gif" id="hp3">Pool Trading Investment List</h3>
</div>
</div>


<div class="container">

<div class="row  trading_pairbg bg-white inner-box mt-3 px-3 py-4">

<div class="col-lg-12">
<div class="right-block">
<!-- <div class="inner-title pb-3">
<h6 class="color-2"><i class="fab fa-bitcoin"></i>&nbsp;&nbsp;Pool Trading Investment List</h6>
</div> -->




<div class="table-responsive  main-table mont">
<div class="trading-table">
<div class="table-responsive">
<table class="table-striped">
<thead>
<tr>
<th class="text-center">S/No</th>
<th class="text-center">Pacakge Name</th>
<th class="text-center">Invest Amount</th>
<th class="text-center">Invest Date</th>
<th class="text-center">Transaction ID</th>
<th class="text-center">Status</th>
<th style="display: none;"></th>
<th style="display: none;"></th>
</tr>
</thead>
<tbody>
<?php
if($withdrawal) {
$i=0;
foreach ($withdrawal as $sponser) 
{
$i++;

$invest_pool_pack = $this->db->table('package_settings')->where('id',$sponser->planid)->get()->getRow();
$plan_name = $invest_pool_pack->package_name;

if($sponser->status=='active')
{
$status =  "<span class='btn btn-success' >Active</span>";
}

if($sponser->status=="matured")
{
$status =  "<span class='btn btn-primary claim_package' id='claim_package' data-id=".$sponser->depositid."> Claim </span>";	
}

if($sponser->status=="matured" && $sponser->request_status==1)
{
$status =  "<span class='btn btn-success'>Claimed</span>";
}

if($sponser->status=="released")
{
$status =  "<span class='btn btn-success'>Completed</span>";
}

?>
<tr>
<td class="text-center"><?php echo $i;?></td>
<td class="text-center"><?php echo $plan_name;?></td>
<td class="text-center"><?php echo number_format($sponser->amount,2);?> USDT</td>
<td class="text-center"><?php echo $sponser->invest_date;?></td>
<td class="text-center"><?php echo $sponser->transhash;?></td>
<td class="text-center"><!-- <?php echo $status; ?> -->
<a  class="btn btn-success check_days" data-bs-toggle="modal" data-bs-target="#check_days" data-id="<?php echo $sponser->depositid;?>" data-bs-whatever="@fat"><i class="fa fa-search position-center"></i>View Days Meter</a></td>
<td style="display: none;"></td>
<td style="display: none;"></td>
</tr>
<?php }
} else { ?>
<tr>
<td colspan="6" style="text-align: center;"><?php echo 'No Records';?></td>
</tr>
<?php } ?>

</tbody>
</table>
</div> 
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>

<br>
<br>

<?php
echo view('user/footer1');
echo view('user/common_script');
?>
</body>
</html>



<div class="modal fade" id="check_days" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content" style="padding: 15px; width: 100%;">
<div class="modal-header">
 <h4 class="other-title theme-color"><img src="<?php echo base_url('assets/images/bot.png');?>" height="50" width="50" style="margin-top: -11px;" id="bot-act"></i>Pool Trading ROI </h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>

<div class="modal-body">
<div class="row">
<br>
<div class="row">

<span id="include_chart"></span>


</div>

</div>
</div>

</div>
</div>
</div>




<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo base_url('/styles/js/datatables.min.js');?>"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.6.0/sweetalert2.min.css" integrity="sha512-y6TjkITSFkRB9mZmDaJyDOsyHsYvOo3Np3iAKe02HgMDP4L4vbmbhlzNpbbIVC1x+GUUHvepTd1BKDe4kC6kNg==" crossorigin="anonymous" referrerpolicy="no-referrer" />

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.6.0/sweetalert2.min.js" integrity="sha512-STirfWdXti4sBdx8qNLvlPU6G008ynF4TcZkLd0hOsM6PkZM3PbWbAoe4tO0nAu92S/HfE/XK1N4SwDzai9xDg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript">


function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).html()).select(); //Note the use of html() rather than text()
document.execCommand("copy");
$temp.remove();
}


$(document).ready(function(){

$('.claim_package').on('click',function(){


Swal.fire({
title: 'Are you sure?',
text: "You won't be able to Claim  Request!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Claim it!'
}).then((result) => {
if (result.isConfirmed) {

var deposit_id = $(this).data("id");
$.ajax({
type: 'post',
url : '<?php echo base_url();?>/UserSettings/claim_pack',
data : {'deposit_id':deposit_id},
success : function(msg)
{

setTimeout(function () {
window.location.reload();
}, 2500);

}
});

Swal.fire(
'success!',
'Invest Pacakge Claim Request Successfully. Please Wait for Admin Conformation',
'success'
)


}
})

});

$('.main-table table').dataTable({
"language": { search: "" },
"Info": false
});
});


</script>
<script src="<?php echo base_url();?>styles/js/jquery.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$(".check_days").on('click',function(){
var famID=$(this).attr('data-id');

if(famID > 0)
{

$.ajax({
type: 'get',
url : '<?php echo base_url();?>/Poolearn/earn_trad_count/'+famID,
success : function(msg)
{
	if(msg)
	{
		$('#include_chart').html(msg);
	}
}
})
}

});

});


</script>

