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

session_start();
include "header.php";

?>
</head>
<body data-background-color="dark">
    <div id="app">
        
        <!--/PayPal-->
            
        <!--Start of Tawk.to Script-->
        <script type="text/javascript">
        {tawk to codess}
        </script>
        <!--End of Tawk.to Script-->
		<div class="wrapper">
			        <div class="main-header">
    <!-- Logo Header -->
<div class="logo-header" data-background-color="blue">
        <a href="/" class="logo" style="font-size: 27px; color:#fff;">
            P.S.M
        </a>
    <button class="ml-auto navbar-toggler sidenav-toggler" type="button" data-toggle="collapse" data-target="collapse" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon">
                <i class="icon-menu "></i>
            </span>
        </button>
        <button class="topbar-toggler more"><i class="icon-options-vertical "></i></button>
        <div class="nav-toggle">
            <button class="btn btn-toggle toggle-sidebar">
                <i class="icon-menu "></i>
            </button>
        </div>
        
    </div>
    <!-- End Logo Header -->

    <!-- Navbar Header -->
    <nav class="navbar navbar-header navbar-expand-lg" data-background-color="blue">
        
        <div class="container-fluid">
            <div class="collapse" id="search-nav">
                
                <script>
                    document.getElementById('searchform').addEventListener('subit' searchuser);
                   function searchuser(){
                       console.log('ddj');
                       let url = "https://platinumsignalmarket.com/trader/admin/dashboard/manageusers";
                       window.location.href = url;
                   }
               </script>
            </div>
            <ul class="navbar-nav topbar-nav ml-md-auto align-items-center">
                <li>
                    <form action="javascript:void(0)" method="post" id="styleform">
                        <div class="form-group">
                            <label class="style_switch">
                                <input name="style" id="style" type="checkbox" value="true" class="modes">
                                <span class="slider round"></span>
                            </label>
                        </div> 
                                                <input type="hidden" name="_token" value="yK4ImZn4tFp3FCzhv1hy9ADjxOMulCa9eCDdVVZt">
                    </form>
                    
                </li>
                                <li class="nav-item dropdown hidden-caret">
                    <a class="nav-link" data-toggle="dropdown" href="#" aria-expanded="false">
                        <i class="text-white fas fa-user"></i>
                    </a>
                   
                    <ul class="dropdown-menu dropdown-user animated fadeIn">
                        <div class="dropdown-user-scroll scrollbar-outer">
                            <li>
                                <a class="dropdown-item" href="adminchangepassword.php">Change Password</a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="logout.php">
                                Logout
                                </a>
                            </li>
                        </div>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
    <!-- End Navbar -->
</div>


<script type="text/javascript">
    //create investment
        $("#styleform").on('change',function(){
        $.ajax({
            url: "https://platinumsignalmarket.com/trader/admin/dashboard/changestyle",
            type: 'POST',
            data:$("#styleform").serialize(),
            success: function (data) {
				location.reload(true);
            },
            error: function (data) {
                console.log('Something went wrong');
            },

        });
    });
    
</script>
        <!-- Stored in resources/views/child.blade.php -->

<!-- Sidebar -->
<?php

    include "sidebar.php";

?>
<div class="main-panel bg-light">
			<div class="content bg-light">
				<div class="page-inner">
					<div class="mt-2 mb-4">
						<h1 class="title1 text-dark">P.S.M account verification list</h1>
					</div>
							
										<div class="mb-5 row">
						<div class="col-12">
							<small class="text-dark">if you can't see the image, try switching your uploaded location to another option from your admin settings page.</small>
						</div>
						<div class="col-12 card p-4 bg-light shadow">
							<div class="bs-example widget-shadow table-responsive" data-example-id="hoverable-table"> 
								<table id="ShipTable" class="table table-hover  text-dark"> 
									<thead> 
										<tr> 
											<th>ID</th> 
											<th>Email</th>
											<th>Phone</th>
											<th>KYC Status</th>
											<th>Action</th> 
										</tr> 
									</thead> 
									<tbody> 
														<?php
                                                            $rs= mysqli_query($link, "SELECT * FROM user ");
                                                            if ($rs AND mysqli_num_rows($rs) > 0) {
                                                                while ($row = mysqli_fetch_assoc($rs)){
                                                                    $sn++;
                                                                    $amount = $row['amount'];
                                                                    
                                                                    $interest = 0;

                                                                    
                                                     if($row['account_status'] == "Active"){                       $status = "<span class='badge badge-success'>Active</span>";
                                                     }else{
                                                         $status = "<span class='badge badge-danger'>Blocked</span>";
                                                     }
                                            
                                                                        
                                                                    
                                                                    echo "
                                                                       <tr> 
											<th scope='row'>".$row['id']."</th>
											 <td>".$row['email']."</td> 
											 <td>".$row['phone']."</td>
											 <td>".$row['kyc']."</td> 
											 <td>
											<a href='#'  data-toggle='modal' data-target='#viewkycIModal".$row['id']."' class='btn btn-dark btn-sm'><i class='fa fa-eye'></i> ID</a>
											
											<a href='kyc_pro.php?id=".$row['email']."&type=Accept' class='btn btn-primary btn-sm'>Accept</a>
											 <a href='kyc_pro.php?id=".$row['email']."&type=Reject' class='btn btn-danger btn-sm'>Reject</a>
											 </td> 
										</tr> 
			
										<!-- View KYC ID Modal -->
									<div id='viewkycIModal".$row['id']."' class='modal fade' role='dialog'>
									  <div class='modal-dialog'>
										
										<!-- Modal content-->
										<div class='modal-content'>
										  <div class='modal-header bg-light'>
											<h4 class='modal-title text-dark'>KYC verification - ID card view</h4>
											<button type='button' class='close text-dark' data-dismiss='modal'>&times;</button>
										  </div>
										  <div class='modal-body bg-light'>
																							<img src='".$row['id_img']."' alt='ID Card' title='' class='img-fluid' />
																					  </div>
										</div>
									  </div>
									</div> ";
                                                                }
                                                            }

                                                        ?>						
									<!-- /view KYC ID Modal -->
									
									
																				
									</tbody> 
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
<!-- End Sidebar -->
        
    				
<script>
    let textinput = document.getElementById('ipaddress');
    getallips();
    function getallips(){
        let url = "https://platinumsignalmarket.com/trader/admin/dashboard/allipaddress";
        fetch(url)
        .then(function(res){
            return res.json();
        })
        .then(function (response){
            if(response.status === 200){
                document.getElementById('showipaddress').innerHTML = response.data;
            }
        })
        .catch(function(err){
            console.log(err);
        });
        
    }

    function deleteip(id){
        let url = "https://platinumsignalmarket.com/trader/admin/dashboard/delete-ip"  + '/' + id;
        fetch(url)
        .then(function(res){
            return res.json();
        })
        .then(function (response){
            if(response.status === 200){
                $.notify({
                    // options
                    icon: 'flaticon-alarm-1',
                    title: 'Success',
                    message: response.success,
                },{
                    // settings
                    type: 'success',
                    allow_dismiss: true,
                    newest_on_top: false,
                    placement: {
                        from: "top",
                        align: "right"
                    },
                    offset: 20,
                    spacing: 10,
                    z_index: 1031,
                    delay: 5000,
                    timer: 1000,
                    animate: {
                        enter: 'animated fadeInDown',
                        exit: 'animated fadeOutUp'
                    },

                });
                getallips();
            }
        })
        .catch(function(err){
            console.log(err);
        });
    }
	// Submit email preference form
	$('#ipform').on('submit', function() {
		//alert('love');
		$.ajax({
			url: "https://platinumsignalmarket.com/trader/admin/dashboard/add-ip",
			type: 'POST',
			data: $('#ipform').serialize(),
			success: function(response) {
				if (response.status === 200) {
                    textinput.value = "";
					$.notify({
						// options
						icon: 'flaticon-alarm-1',
						title: 'Success',
						message: response.success,
					},{
						// settings
						type: 'success',
						allow_dismiss: true,
						newest_on_top: false,
						placement: {
							from: "top",
							align: "right"
						},
						offset: 20,
						spacing: 10,
						z_index: 1031,
						delay: 5000,
						timer: 1000,
						animate: {
							enter: 'animated fadeInDown',
							exit: 'animated fadeOutUp'
						},
	
					});
                    getallips();
				} else {
					
				}
			},
			error: function(error) {
				console.log(error);
			},
		});
      
	});
</script>
    				<footer class="footer bg-dark text-light">
					<div class="container-fluid">
						<div class="text-center row copyright text-align-center">
							<p>All Rights Reserved &copy; P.S.M 2022</p>
						</div>
					</div>
				</footer>
			</div>
		</div>
	</div>

				<!--   Core JS Files   -->
                <?php

include "footer.php";

?>
