<?php

include("../config.php");
session_start();

if(isset($_SESSION["user_login"])){
	$userid = $_SESSION["user_login"];
}else{
		header("location: ../register-login.php");
	}
	

		//get Admin Wallet Address
		$stmt=$pdo->prepare("SELECT * FROM users WHERE type='admin' ");
		$stmt->execute();
		$adminW=$stmt->fetch();
	
		
		//get user info
		$stmt=$pdo->prepare("SELECT * FROM users WHERE userid = :userid");
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$row=$stmt->fetch();
		$userimage = (!empty($row["profilepix"]) ? "../img/users/".$row["profilepix"]: "../img/avatar.png");
		
		
		//redirect incase it was admin
		if($row["type"]=="admin"){
			header("location: ../admin/dashboard.php");
		}
		
		//Generate unique transcation ID
		$gen = "1234ABCDEFGHI567890JKLMNOPQRSTUVWXYZ";
		$shuff = str_shuffle($gen);
		$ref = substr($shuff,0,25);
	
?>

<style>
form label{
	font-weight:500!important;
	color:#444;
	cursor:pointer;
	font-size:16px!important;
}

.prime-hover{
	color:#4583c3;
	font-weight:500;
	cursor:pointer;
}
.prime-hover:hover{
	color:#3d77b3;
}
select{
	-moz-appearance:none;
	-webkit-appearance:none;
	appearance:none;
	text-indent:1px;
	text-overflow:'';
}
</style>


<!DOCTYPE html>

<html lang="en">

<head>

        <meta charset="utf-8" />

        <title> Investment</title>

        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <meta content="A fully featured cryptocurrency investment platform" name="description" />

        <meta content="Coderthemes" name="author" />

        <meta http-equiv="X-UA-Compatible" content="IE=edge" />

      

            <link rel="stylesheet" type="text/css" href="w3.css">

        <!-- Bootstrap Css -->

        <link href="assets/css/bootstrap.min.css" id="bootstrap-stylesheet" rel="stylesheet" type="text/css" />

        <!-- Icons Css -->

        <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />

        <!-- App Css-->

        <link href="assets/css/app.min.css" id="app-stylesheet" rel="stylesheet" type="text/css" />

			<link href="../css/style7eda3860.css" rel="stylesheet">

    </head>



    <body>


	<div class='coversoverlay'>
	<center><img src="../img/loader.gif" style="width:60px; margin-top:20%;"></center>
	</div>

  <!-- Begin page -->
  <div id="wrapper" style="overflow:auto!important">

    
	
	<!-- Topbar Start -->
	<?php
	include("header.php");
	?>
    <!-- end Topbar -->
	
	

    <!-- ========== Left Sidebar Start ========== -->
    <div class="left-side-menu">

      <div class="slimscroll-menu">

        <!-- User box -->
        <div class="user-box text-center ">

          <div class="dropdown">
            <a href="#" class="user-name dropdown-toggle h5 mt-2 mb-1 d-block" data-toggle="dropdown" aria-expanded="false"></a>
            <div class="dropdown-menu user-pro-dropdown">




            </div>
          </div>


        </div>

        <!--- Sidemenu -->
        <?php include("sidebar.php");?>
		
        <!-- End Sidebar -->
        <div class="clearfix"></div>



                </div>

                <!-- Sidebar -left -->



            </div>

            <!-- Left Sidebar End -->






            <div class="content-page" >

                <div class="content" style="width: 100%;color: white;">



                    <!-- Start Content-->

                    <div class="container-fluid" >

                        <div id="google_translate_element"></div>

                         <div class="row">

                            <div class="col-md-12" style="padding-left:0px; padding-right:0px">
                            
						
						
				<form class="col-md-7" style="margin-top:20px!important;margin: auto;">
				
                <div class="card-box" style="padding:0px;"><br>
				<h2 align="center" style='color:#767e80' id="wlcm">Payment Processor</h2>
				<div id="note" style="color:#888; margin:10px 0px;font-size:15px;line-height:17px; text-align:center">
				All transcation will be proceesed with <br>Bitcoin | Ethereum | USDT | USDC(SOL)</div>
				<div class="dropdown-divider"></div>
				<br>
				<center>
				<img class="btcimg" src="../img/btc.jpg" style="width:50px;box-shadow: 0 0 1px rgb(0 0 0 / 13%), 0 1px 2px rgb(0 0 0 / 50%);
				border-radius: 50%;">
				
			&nbsp; <img class="btcimg" src="../img/Ethereum.png" style="width:50px;box-shadow: 0 0 1px rgb(0 0 0 / 13%), 0 1px 2px rgb(0 0 0 / 50%);
				border-radius: 50%;">
				
				&nbsp; <img class="btcimg" src="../img/usdt.svg" style="width:50px;box-shadow: 0 0 1px rgb(0 0 0 / 13%), 0 1px 2px rgb(0 0 0 / 50%);
				border-radius: 50%; height:50px;">
				
				&nbsp; <img class="btcimg" src="../img/usdc.png" style="width:50px;box-shadow: 0 0 1px rgb(0 0 0 / 13%), 0 1px 2px rgb(0 0 0 / 50%);
				border-radius: 50%; height:50px;">
				
				</center>
		
		<section id="suc" class="display-none" style="padding:15px;">
	<div style="color:#2ecc71;font-size:17px;display:flex;justify-content:center;place-items:center; text-align:center;margin:0px auto 20px auto;">
		<span id="pay">Payment request recorded</span> &nbsp; <span><img src="../img/tick.png" width="25"></span></div>
		
		
		 <div class="inner-plan-head" style="text-align:center;margin:2px auto 20px auto;">
		 <h4><span>Plan &nbsp;</span><span id="plan" style="color:#fff;text-shadow:0.1em 0.1em 0.1em #856565;text-transform:uppercase"></span></h4> 
		 </div>
		
		
		<center><div class="btn btnss display-none" id="viewAdress"> View addresses <i class="fas fa-link"></i></div></center>
		
		
		<div style="color:#667a83;font-size:15px; text-align:center;margin:20px auto 0px auto;line-height:19px;" id="makePay">All payments will be verified and your account credited within few minutes once payment is received and a you will receive a confirmation mail<br>Make payment with the Wallet address below, ensure you copy the address correctly, make your payments and wait for confirmation email</div>
                                                    
													
				<br><div id="copy-con">
				 
				 <div class="dropdown-divider"></div>
				 <div id="amt" style="margin-left:10px;color:#2e657e;"></div>
				  
				  <div class="dropdown-divider"></div>
				  <div id="refss" style="margin-left:10px;color:#2e657e;"></div>
				  
				  <div class="dropdown-divider"></div>
				  <div id="user" style="margin-left:10px;color:#2e657e;"><b>Email:</b> <?php echo htmlspecialchars($row["email"]);?></div>
				  
				  
				  <div class="dropdown-divider"></div><br>
				   <div class="form-group">
                    <label for="myInput" style="margin-left:10px; font-weight:500"><i class="fas fa-link"></i> Bitcoin Address</label>
                    <div class="col-sm-12">
                    <input type="text" readonly class="form-control" id="myInput" value="bc1qz3r9c2qwtan45k4vxrzk0mmss4x4fq3fe3wzcv">
                    
					<br>
                  <div onclick="copyAddress()" id="copyAddress" class="btn btnss btn-block copyAddress" style="border-radius:0">Click to Copy</div>
					</div>
                  </div>
				  
				<br><br>
				
				   <div class="form-group">
                    <label for="myInputE" style="margin-left:10px;font-weight:500"><i class="fas fa-link"></i> Ethereum Bep20 Address</label>
                    <div class="col-sm-12">
                      <input type="text" readonly class="form-control" id="myInputE" value="0xd5F6d0B9ac9cA935A197539c042B6A2d0dFb5939">
                    <br>
                  <div onclick="copyAddressE()" id="copyAddressE" class="btn btnss btn-block copyAddress" style="border-radius:0">Click to Copy</div>
				  </div>
                  </div>
				
				<br><br>
				
				   <div class="form-group">
                    <label for="myInputT" style="margin-left:10px; font-weight:500"><i class="fas fa-link"></i> Tether USDT(TRC20)</label>
                    <div class="col-sm-12">
                      <input type="text" readonly class="form-control" id="myInputT" value="TApBVnXYnUEzmLnBDg5Nj8opw7h2HA1bTD">
                    
					<br>
                  <div onclick="copyAddressT()" id="copyAddressT" class="btn btnss btn-block copyAddress" style="border-radius:0">Click to Copy </div>
				 </div>
                  </div>
                  
                  <br><br>
<div class="form-group">
    <label for="myInputT" style="margin-left:10px; font-weight:500"><i class="fas fa-link"></i> USDC(SOL)</label>
    <div class="col-sm-12">
        <input type="text" readonly class="form-control" id="myInputT" value="Fstxi3TmRGLEfyqvZGby76js441vnSrp1EruJubYTzhL">
        <br>
       
    </div>
</div>

	   
		
		<p><br>
		<div class="dropdown-divider"></div>
		<div style="text-align:center">
		<a href="account.php" style="color:#2e657e; font-size:16px;"><i class="fas fa-tachometer-alt"></i> Dashboard</a> 
		&nbsp; &nbsp; <a href="transactions.php" style="color:#2e657e; font-size:16px;"> <i class="fas fa-history"></i> Status</a>
		</div>
		</section>
		
		
		
		<div align="center" style="color:#ff3737; margin-left:-20px!important; margin-bottom:30px;font-size:17px;font-weight:500" id="result"></div>
				
				
				
				<?php 
				
				//don't allow further investment if user exceeds the max deposit per day which is 5
				$stmt=$pdo->prepare("SELECT * FROM duedate WHERE userid=:userid");
				$stmt->bindParam(":userid",$userid, PDO::PARAM_STR);
				$stmt->execute();
				$check=$stmt->fetch();
			
			if(!empty($check["count"]) && $check["count"] > 4){
				
		echo 
		'<center style="padding:0px 10px 20px 10px">
		<h4 style="margin-left:10px;margin-top:30px; color:#3d658d;font-weight:500">
		You have exceeded the Maximum daily deposit slots</h4>
		<div style="color:#999; margin:5px 15px;font-size:14px;letter-spacing: .7;line-height:20px;"> Maximum daily deposit slot is 5 times</div>
		
		<div class="dropdown-divider"></div><br><br>
		
		<a href="transactions.php" style="font-size:14px;margin-top:-5px; margin-bottom:-10px" class="btn btn-sm btn-primary btnss">
					 Check pending withdrawals &nbsp; <i class="fa fa-caret-right"></i></a>
		</center>';
	
				
			}else{
				
				
				?>
				
				
				
				
				
				
				<div id="contactForm">
				
				
				<div class="dropdown-divider"></div>
				
				<div style="margin:12px 22px;font-size:18px;color:#326ca9;">Investment Plans</div>
				<div class="dropdown-divider"></div>


				  <div class="plans">
				  
				  <div class="inner-plan">
				  <div class="inner-plan-head">
				  <h4>BRONZE</h4>
					<text>$100 - $999</text>
				  </div>
				  <div style="padding:10px;color:#436289;font-size:15px;line-height:1.5;">
				  4% ROI After 3 days<br><div class="dropdown-divider" style="border-color: #d2d2d3;"></div>
				  </div>
				  </div>
				  
				  <div class="inner-plan">
				  <div class="inner-plan-head">
				  <h4>SILVER</h4>
					<text>$1,000 - $4,999</text>
				  </div>
				  <div style="padding:10px;color:#436289;font-size:15px;line-height:1.5;">
				  6% ROI After 3 days <div class="dropdown-divider" style="border-color: #d2d2d3;"></div>
				  </div>
				  </div>
				  
				  </div>
				  
				  
				  
				  <div class="plans">
				  
				  <div class="inner-plan">
				  <div class="inner-plan-head">
				  <h4>GOLD</h4>
					<text>$5,000 - $49,999</text>
				  </div>
				  <div style="padding:10px;color:#436289;font-size:15px;line-height:1.5;">
				  8% ROI After 3days <div class="dropdown-divider" style="border-color: #d2d2d3;"></div>
				  </div>
				  </div>
				  
				  <div class="inner-plan">
				  <div class="inner-plan-head">
				  <h4>PLATINUM</h4>
					<text>$50,000 - $149,999</text>
				  </div>
				  <div style="padding:10px;color:#436289;font-size:15px;line-height:1.5;">
				  10% ROI After 3days <div class="dropdown-divider" style="border-color: #d2d2d3;"></div>
				  </div>
				  </div>
				  
				  <div class="inner-plan">
				  <div class="inner-plan-head">
				  <h4>VIP</h4>
					<text>$150,000 - $Unlimited</text>
				  </div>
				  <div style="padding:10px;color:#436289;font-size:15px;line-height:1.5;">
				  15% ROI After 3days<br><div class="dropdown-divider" style="border-color: #d2d2d3;"></div>
				  </div>
				  </div>
				  
				  </div>
				  
				  

				  
				  
				  
				  <div class="form-group" style="padding:10px;">
                  <label for="amount" style="margin:10px 0px 10px 13px"> Select Amount</label>
					
					<div class="col-sm-12">
					 <select class="form-control form-control-lg" id="amount" name="amount">
					 <option selected id="selected" value="100">$ 100.00</option>
					 <option value="100">$ 100.00</option>
					 <option value="300">$ 300.00</option>
					 <option value="1000">$ 1,000.00</option>
					 <option value="3000">$ 3,000.00</option>
					 <option value="5000">$ 5,000.00</option>
					 <option value="8000">$ 8,000.00</option>
					 <option value="10000">$ 10,000.00</option>
					 <option value="20000">$ 20,000.00</option>
					 <option value="30000">$ 30,000.00</option>
					 </select>
					 
                    </div>
                  </div>
				  
				  
				  
				  
			<div class="text-priary prime-hover" id="addAmount" style="margin:8px 20px 20px;font-size:15px;">+ Other Amount</div>
			
			<!--End Date Time - optional-->
			<div class="display-none" id="addAmountDrop" style="padding:10px;">
			<div class="display-none row" style="margin-left:10px;display:flex;place-items:center;">
			<div class="form-group">
            <label for="customAmount">Custome Amount</label>
			<br><input type="number" style="width:200px" name="customAmount" placeholder="$ 0.00" step="0.01" id="customAmount" class="form-control">
            </div>
			<div id="closeaddAmountDrop" style="padding:20px 15px" class="fas fa-times prime-hover"></div>	
            </div>
			<div style="color:#888;line-height:17px; margin-left:10px;font-size:14px;">Minimum amount $100. Maximum amount $100,000</div>
			
            </div>
				  
				  
				  
				  
				  
				  <div class="dropdown-divider"></div>
				  <br>
				   <div class="form-group" style="padding:10px;">
                    <label for="ref" required style="margin-left:10px"><i class="fas fa-qrcode"></i> Transaction Ref ID</label>
                    <div class="col-sm-12">
                      <input type="text" name="ref" readonly class="form-control" id="ref" value="<?php echo htmlspecialchars($ref);?>">
                    </div>
					</div>
                  <button type="submit" id="invest" class="btn btnss btn-block">Process &nbsp;<i class="fas fa-location-arrow"></i></button>
                 
				 
               </div>
			   
			   
			<?php }  ?>
			   
               </div>
              </form>

                   
				   
				   
				   
				   
				   
				   
				   
				   
			 <!-- PAYMENT METHODS -->
 <div class="col-md-12 card-box" style="margin-bottom:20px;">
<h4 style="font-size: 16px;color: #F46B45;letter-spacing: 5px;margin:50px auto 10px auto;font-weight: 500;">PAYMENT METHODS</h4>
<h3 style="font-size:25px;color:#111;margin-bottom:6px;position:relative;font-weight:600;">Accepted Payment Method</h3>
<div class="line_shape line_shape2"></div>


<div style="display:flex;flex-wrap:wrap;justify-content: space-between; margin: 40px auto 10px auto;">

<div class="payM">
<center><img src="../img/bitcoin-logo.png" width="140px"></center>
</div>

<div class="payM">
<center><img src="../img/ethereum-logo.png" width="140px"></center>
</div>

<div class="payM">
<center><img src="../img/usdt.png" width="200px" style="margin-top:-8px;"></center>
</div>

<div class="payM">
<center><img src="../img/usdc.png" width="200px" style="margin-top:-8px;"></center>
</div>

</div>
</div>

 <!--/ PAYMENT METHODS -->	   
				   
				   
				   
				   
				   
				   
				   
				   
				   
				   
						   </div>
							</div> <!-- container-fluid -->



                </div> <!-- content -->
                </div> 
              
					</div> 
	
					</div>
               


       

        <!-- Vendor js -->

        <script src="assets/js/vendor.min.js"></script>

        <!-- App js -->

        <script src="assets/js/app.min.js"></script>

   
   
   
   
   
   
   
 	                           
   
   <script>
   
    
 //Copy BTC address
   function copyAddress() {
  var copyText = document.getElementById("myInput");
  copyText.select();
  copyText.setSelectionRange(0, 99999)
  document.execCommand("copy");
}  
  
 //Copy Ethereum address
   function copyAddressE() {
  var copyText = document.getElementById("myInputE");
  copyText.select();
  copyText.setSelectionRange(0, 99999)
  document.execCommand("copy");
}
 
 //Copy Tether USDT address
   function copyAddressT() {
  var copyText = document.getElementById("myInputT");
  copyText.select();
  copyText.setSelectionRange(0, 99999)
  document.execCommand("copy");
}

 //Copy USDC(SOL) address
   function copyAddressT() {
  var copyText = document.getElementById("myInputT");
  copyText.select();
  copyText.setSelectionRange(0, 99999)
  document.execCommand("copy");
}




   
   $(document).ready(function(){ 
	
	$('.coversoverlay').hide();
		 





	//investment
 
	$("#invest").click(function(e){
	 e.preventDefault();
	 
		
		let amount = $("#amount").val();
		let customAmount = $("#customAmount").val();
		let ref = $("#ref").val();
		

		$.ajax({
			url:'function.php',
			method:'POST',
			data:{amount:amount, customAmount:customAmount, ref:ref},
			beforeSend:function(){$(".coversoverlay").show()},
			success:function(data){
				$("#result").html(data);
				
				//console.log(data);
				$(".coversoverlay").hide();
				
			}
		});
		
		});
	
 
 
 
 
 
 
 
 
 	//Add Custom Amount

	$("#addAmount").click(function(){
		$("#addAmount").fadeOut(100,function(){
		$("#addAmountDrop").removeClass("display-none");
		$("#customAmount").focus();		
		});
		
		//disable select input
		$("#amount").prop("disabled",true);
		$("#amount").val("");
		
	});

	$("#closeaddAmountDrop").click(function(){
		$("#addAmountDrop").addClass("display-none");	
		$("#addAmount").fadeIn(100);
		
		//clear input
		$("#customAmount").val("");
		
		//enable select input
		$("#amount").prop("disabled",false);
		$("#selected").prop("selected",true);
		
	});

 
 
 
 
 //AFTER COPY 
 
 $("#viewAdress").click(function(){
	$("#copy-con").slideDown(); 
	$("#viewAdress").addClass("display-none");
 });
 
 
 $(".copyAddress").click(function(){
	
	
	$("#copy-con").slideUp(function(){
	$(".btcimg").fadeOut("fast");
	$("#viewAdress").removeClass("display-none");
	
	$("#suc").removeClass("display-none").fadeOut(function(){
	$("#suc").fadeIn();
	$("#wlcm").html("Transaction Pending");
	$("#pay").html("Wallet Link Copied");
	$("#note").html("Your transaction is awaiting confirmation");
	$("#makePay").html("All payments will be verified and your account credited within few minutes once payment is received");
	});
	
	});
	
 });
 
 
 
 
	 
   });
   
   
   
   
   </script>
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
    </body>
</html>