<?php
include"initialize_page.php";

?>
<!DOCTYPE html>
<html lang="en">

<head>
  
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

	<title>CDS</title>

	<!-- Bootstrap core CSS -->
	<link rel="stylesheet" href="assets/css/bootstrap/bootstrap.css" /> 

	<!-- datatables Styling  -->
    <link rel="stylesheet" href="assets/css/plugins/datatables/jquery.dataTables.css" />
    
    <!-- Fonts  -->
    <link href='http://fonts.googleapis.com/css?family=Raleway:400,500,600,700,300' rel='stylesheet' type='text/css'>
    
    <!-- Base Styling  -->
    <link rel="stylesheet" href="assets/css/app/app.v1.css" />

</head>
<body>
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript">
		
	function approveMaturecds(id,userid,maturedamount)
	 {
		 
		    // alert(investamount);
			var r = confirm("Are you sure to Approve??");
			if(r==true)
			{
			$.post("controller.php", {id:id,userid:userid,maturedamount:maturedamount,q:"approve_mature_cds"} , function(data)
			{
				alert(data);
			
				
			window.location.href='<?php   echo website_settingdata('x_weburl'); ?>admin/view_mature_cds.php';  
			});
			}
		
	}

 </script>
	<?php include"xleftmenu.php"; ?>
    
    <section class="content">
    	
         <?php  include"xheader.php";  ?>
        <!-- Header Ends -->
        
        
        <div class="warrper container-fluid">
        	
           
            
        </div>
<!-- Warper Ends Here (working area) -->

     <div class="panel panel-default">
                  
           
                   
                    <div class="row">
                    <div class="col-md-12">
                    <div class="panel-body">
                   
<table class="table table-striped table-bordered" id="basic-datatable" width="100%">
        <thead>
            <tr>
                <th>Sr.</th>
                <th>Name</th>
                <th>Matured Amount</th>
				<th>Approve</th>
               
                
            </tr>
        </thead>
        <tbody>
                            
             <?php
				$sr=1;		  
			    $data_q=mysqli_query($con,"SELECT * FROM x_cds WHERE x_maturestatus = 'Y' ORDER by x_id DESC");
				while($data_array=mysqli_fetch_array($data_q))
			    {
				$cds_id = $data_array['x_id'];
				$user_id = $data_array['x_userid'];
				$cds_amount = $data_array['x_investamount'];
				$mature_amount = $data_array['x_maturedamount']; 
				$matured_amount = number_format($mature_amount,2);
				$main_currency = main_account_currency($user_id);
				
				//$total_amount = $data_array['x_totalpay'];
			?>
                <tr class="odd gradeX">
				
                <td><?php echo $sr; ?></td>
                <td><?php echo  user_bankuser($user_id,"x_fname");?> <?php echo  user_bankuser($user_id,"x_lname");?>    </td>              
                <td><?php echo $main_currency ?><?php echo $mature_amount;?></td> 
				
                <td><button class="btn btn-danger" onClick="approveMaturecds(<?php echo $cds_id;?>,<?php echo $user_id;?>,<?php echo $data_array['x_maturedamount'];?>)">Approve</button></td>
			
                                 
                </tr>
			<?php
            
            $sr++;
            }
            ?>  
</tbody>
</table>

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


<footer class="container-fluid footer">
Copyright &copy; <?php    echo date('Y');  ?>
</footer>


</section>
<!-- Content Block Ends Here (right box)-->



<!-- JQuery v1.9.1 -->
			<script src="assets/js/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
            
            <!-- Bootstrap -->
            <script src="assets/js/bootstrap/bootstrap.min.js"></script>
            
            <!-- NanoScroll -->
            <script src="assets/js/plugins/nicescroll/jquery.nicescroll.min.js"></script>
            
            
            <!-- Data Table -->
            <script src="assets/js/plugins/datatables/jquery.dataTables.js"></script>
            <script src="assets/js/plugins/datatables/DT_bootstrap.js"></script>
            <script src="assets/js/plugins/datatables/jquery.dataTables-conf.js"></script>
            
            
            <!-- Custom JQuery -->
            <script src="assets/js/app/custom.js" type="text/javascript"></script>
            
            
            
            <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
            
            ga('create', 'UA-56821827-1', 'auto');
            ga('send', 'pageview');
            
            </script>
</body>
</html>
