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

include "header.php";

$id = $_GET['id'];

?>
</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="https://platinumsignalmarket.com/trader/admin/dashboard/adminprofile">Account Settings</a>
                                <a class="dropdown-item" href="https://platinumsignalmarket.com/trader/admin/dashboard/adminchangepassword">Change Password</a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="https://platinumsignalmarket.com/trader/adminlogin/logout"
                                onclick="event.preventDefault();
                                document.getElementById('logoutform').submit();">
                                Logout
                                </a>
                                <form id="logoutform" action="https://platinumsignalmarket.com/trader/adminlogin/logout" method="POST" style="display: none;">
                                    <input type="hidden" name="_token" value="yK4ImZn4tFp3FCzhv1hy9ADjxOMulCa9eCDdVVZt">
                                </form>
                            </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";

?>
<!-- End Sidebar -->
        <div class="main-panel bg-light">
            <div class="content bg-light">
                <div class="page-inner">
                    <div class="mt-2 mb-5">
                        <h1 class="title1 d-inline text-dark">Process Withdrawal Request</h1>
                        <div class="d-inline">
                            <div class="float-right btn-group">
                                
                                <a class="btn btn-primary btn-sm" href="mwithdrawals.php"> <i class="fa fa-arrow-left"></i> back</a>
                            </div>
                        </div>
                    </div>
                    <div>
    </div>                    <div>
    </div>                    <div class="mb-5 row">
                        <div class="col-lg-8 offset-lg-2 card p-md-4 p-2 bg-light shadow">
                            <div class="mb-3">
                                                                <h4 class="text-dark">Send Funds to Chadwick holcomb through his payment details below</h4>
                                                            </div>
                            <div class="">
                                                                                                        <div class="mb-3 form-group">
                                        <h5 class="text-dark">ETH Address</h5>
                                        <input type="text" class="form-control readonly text-dark bg-light" value="0x3bb8D80B16eaD17f7630d17A741Ca26248222247" readonly>
                                    </div>
                                                                                                </div>

                                                            <div class="mt-1">
                                    <form action="pwithdrawal.php?id=<?php echo $id ?>" method="POST">
                                        <input type="hidden" name="_token" value="yK4ImZn4tFp3FCzhv1hy9ADjxOMulCa9eCDdVVZt">                                        <div class="form-row">
                                            <div class="form-group col-md-12">
                                                <h6 class="text-dark">Action</h6>
                                                <select name="action" id="action" class="bg-light text-dark mb-2 form-control">
                                                    
                                                    <option value="Paid">Paid</option>
                                                    <option value="Rejected">Reject</option>
                                                </select> 
                                            </div>
                                        </div>
                                        <div class="form-row d-none" id="emailcheck">
                                            <div class="col-md-12 form-group">
                                                <div class="selectgroup">
                                                    <label class="selectgroup-item">
                                                        <input type="radio" name="emailsend" id="dontsend" value="false" class="selectgroup-input" checked="">
                                                        <span class="selectgroup-button">Don't Send Email</span>
                                                    </label>
                                                    <label class="selectgroup-item">
                                                        <input type="radio" name="emailsend" id="sendemail" value="true" class="selectgroup-input">
                                                        <span class="selectgroup-button">Send Email</span>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-row d-none" id="emailtext">
                                            <div class="form-group col-md-12">
                                                <h6 class="text-dark">Subject</h6>
                                                <input type="text" name="subject" id="subject" class="bg-light text-dark form-control">
                                            </div>
                                            <div class="form-group col-md-12">
                                                <h6 class="text-dark">Enter Reasons for rejecting this withdrawal request</h6>
                                                <textarea class="bg-light text-dark form-control" row="3" placeholder="Type in here" name="reason" id="message"></textarea>
                                            </div>
                                        </div>
                                        
                                        <div class="form-group">
                                            <input type="hidden" name="id" value="35">
                                            <input type="submit" class="px-3 btn btn-primary" value="Proccess">
                                        </div>
                                    </form>
                                </div> 
                                                    </div>
                    </div>
                </div>
            </div>

            <script>
                let action = document.getElementById('action');
                 
                $('#action').change(function(){
                    if (action.value === "Reject") {
                        document.getElementById('emailcheck').classList.remove('d-none');
                    }else{
                        document.getElementById('emailcheck').classList.add('d-none');
                        document.getElementById('emailtext').classList.add('d-none');
                        document.getElementById('dontsend').checked = true;
                        document.getElementById('subject').removeAttribute('required');
                        document.getElementById('message').removeAttribute('required');
                    }
                });

                $('#sendemail').click(function(){
                    document.getElementById('emailtext').classList.remove('d-none');
                    document.getElementById('subject').setAttribute('required', '');
                    document.getElementById('message').setAttribute('required', '');
                });

                $('#dontsend').click(function(){
                    document.getElementById('emailtext').classList.add('d-none');
                    document.getElementById('subject').removeAttribute('required');
                    document.getElementById('message').removeAttribute('required');
                });
            

            </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";

?>
</body>
</html>


