<?php
error_reporting(0); 
session_start();
$success=$ccard="";
if(isset($_SESSION['SESS_LOGGEDIN']) == FALSE) {
    header("Location: " . $config_basedir."access-login.php");
}

require("config.php");
require("db.php");
?>
<?php

$seller= $_SESSION['SESS_USERID']; 

$sql = mysqli_query($db,"SELECT * FROM logins WHERE id='$seller'");
 
// Place image in the folder 
$numrow=mysqli_fetch_assoc($sql);
$forename = $numrow['firstname'];
$walletid = $numrow['walletid'];
$surname = $numrow['lastname'];
$walletid = $numrow['walletid'];
$active_no = $numrow['active_no'];
$cashout_no = $numrow['cashout_no'];
$investors_no = $numrow['investors_no'];
$ver_b=$numrow['ver_badge'];
//$profile = $numrow['profile'];
//$verifyuser = $numrow['verifyuser'];

$userImage = $numrow['user_image'];
?>


<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="shortcut icon" href="assets/img/myfavicon.png" type="image/x-icon">
  <link rel="stylesheet" href="assets/css/bootstrap_custom.css">
  <link rel="stylesheet"
    href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200">
  <link rel="stylesheet" href="assets/css/nice-select.css">
  <link rel="stylesheet" href="assets/css/styles.css">
  
  <script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
  <link rel="stylesheet" href="assets1/css/style.css">
  
   
  <style>
     .blink_me{
   font-size: 25px;
   font-family: serif;
   color:#ffffff;
   text-align: center;
   font-weight: bold;
   animation: animate 1.5s linear infinite;
 } 
  
 @keyframes animate{
   0%{
     opacity: 0;
   }
   50%{
     opacity: 0.7;
   }
   100%{
     opacity: 0;
   }
 }
 
@media (max-width: 800px) {
  .depo1{
   float: left !important;
  }
  
  .depo2{
   float: left !important;
  }
  .depo3{
   float: left !important;
  }
  .balnce{
	  margin-right: 30px !important;
  }
}

 form.example input[type=text] {
  padding: 8px;
  font-size: 15px;
  border: 1px solid grey;
  float: left;
  width: 80%;
  background: #f1f1f1;
}

form.example button {
  float: left;
  width: 20%;
  padding: 8px;
  background: #2196F3;
  color: white;
  font-size: 15px;
  border: 1px solid grey;
  border-left: none;
  cursor: pointer;
}

form.example button:hover {
  background: #0b7dda;
}

form.example::after {
  content: "";
  clear: both;
  display: table;
}
.fw-semibold{
  color: #007bff !important;
}
@media (max-width: 800px) {
  .img-fluid{
   border: 1px solid #333 !important;
   margin-right: 6px !important;
  }
}
@media screen and (max-width:800px ){
     .text-center{
      font-size: 12px !important;
  }
  .primary{
    font-size: 12px !important;  
  }
}
</style>
  <script>
  function myFunction() {
  // Get the text field
  var copyText = document.getElementById("myInput");

  // Select the text field
  copyText.select();
  copyText.setSelectionRange(0, 99999); // For mobile devices

   // Copy the text inside the text field
  navigator.clipboard.writeText(copyText.value);

  // Alert the copied text
  alert("Copied the text: " + copyText.value);
}
  </script>
  <title>Alpha Chequers™ - Deposit</title>
</head>

<body style="background: var(--bg-body) !important">
  <div class="d-flex wrapper" id="wrapper">
    <!-- Sidebar -->
    <div id="sidebar-wrapper" class="sidebar-wrapper" style="padding-top: 0px !important">
      <div class="sidebar-heading" style="padding-top: 0px !important">
        <a href="../index.html" style="margin-top: 8px !important">
          <img id="logo" src="assets/img/crypto/logo.png" style="height: 25px; width: 25px" alt="">
          <span style="font-weight: bold; color: #007bff; font-size: 14px !important"> ALPHA <span style="color: orange !important; font-size: 14px !important">CHEQUERS</span>
</span></a>
      </div>
     



	 <nav class="sidebar mb-4">
        <ul class="nav flex-column" id="nav_accordion">
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="trade.php">
              <img src="assets/img/dashboard_icon_inactive.png" alt="" />
              <span class="fw-semibold">Dashboard</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link active d-flex gap-2 align-items-center" href="deposit.php">
              <span class="material-symbols-outlined fw-lighter"> sync </span>
              <span class="fw-semibold">Deposit</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="withdraw.php">
              <span class="material-symbols-outlined fw-lighter">
                payments
              </span>
              <span class="fw-semibold">Withdraw</span>
            </a>
          </li>
         
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="pending.php">
              <span class="material-symbols-outlined fw-lighter">
                percent
              </span>
              <span class="fw-semibold">Pending</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="verify.php">
              <span class="material-symbols-outlined fw-lighter">
                insights
              </span>
              <span class="fw-semibold">Verify</span>
            </a>
          </li>
          
       

         <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="account-details.php">
              <span class="material-symbols-outlined fw-lighter">
                settings
              </span>
              <span class="fw-semibold">Settings</span>
            </a>
          </li>

         <li class="nav-item">
            <a class="nav-link d-flex gap-2 align-items-center" href="logout.php">
              <span class="material-symbols-outlined fw-lighter">
                logout
              </span>
              <span class="fw-semibold">Logout</span>
            </a>
          </li>
        
        </ul>
        
      </nav>
	  
	  
    </div>

    <!-- Page Content -->
    <div id="page-content-wrapper" class="page-content-wrapper">
            <nav class="navbar navbar-expand-lg py-lg-3 px-2 px-lg-4 d-flex fixed-top justify-content-between" style="padding-top: 0px !important; padding-bottom: 0px !important; border: 1px solid # !important; height: 60px !important">
        <div class="d-flex align-items-center" style="margin-top: 0px !important">
          <div class="d-flex align-items-center d-lg-none">
            <span class="material-symbols-outlined menu-toggle" id="menu-toggle">
              menu
            </span>
          </div>
          <div class="d-none d-xl-block"> 
 		  
            
                <a class="dropdown-item d-flex align-items-center gap-2" href="#" style="color: #fff !important">
                  <span class="material-symbols-outlined fw-light" style="color: orange !important">
                    email
                  </span>
                  info@alphachequers.com.</a>
               
          </div>
        </div>

        <div class="d-flex gap-3 p-lg-2 p-lg-0 align-items-center justify-content-end" style="">           
          <div class="nav-item dropdown">
            <a class="d-flex gap-2 align-items-center" href="#" id="navbarDropdown4" role="button"
              data-bs-toggle="dropdown" aria-expanded="false">
              <?php if(!empty($userImage)) {
                             ?>                            
              <img height="35" width="35" class="img-fluid" src="userImages/<?php echo $userImage; ?>" alt="" style="border-radius: 50%">
              <?php
              }else{
                ?>
                <img src="assets/img/avatarnow.png" alt="" height="35" width="35" style="border-radius: 50%">
                <?php
              }
        
            ?>
              <div class="d-flex flex-column d-none d-xl-block">
                 <script src="https://code.iconify.design/iconify-icon/1.0.7/iconify-icon.min.js"></script>
           
		   <p class="mb-0 text-white fw-semibold" style="font-size: 15px">
		   <?php echo $forename; ?> <?php echo $surname; if($ver_b == 2){
                  echo "<iconify-icon icon='material-symbols:verified' style='color: #ccc; font-size: 12px'></iconify-icon>";
                 } ?>		  		      
		   </p>
		   
		  
                <span class="small text-white">Investor</span>
				
				<?php
                        function display_currency($currency){

                            foreach($currency as $currence){
                                echo $currence;
                            }
                        }
                        $username = $_SESSION['SESS_USERNAME'];
                        $currency = array();
                        $query = mysqli_query($db,"SELECT * FROM logins WHERE username='$username'");
                        $user_data = mysqli_fetch_array($query);
                        if($user_data['currency']==mysqli_real_escape_string($db,'USD')){
                            $currency[]='$';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'GBP')){
                            $currency[]='£';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'EUR')){
                            $currency[]='€';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'AUD')){
                            $currency[]='$';
                        }
                        else if($user_data['currency']==mysqli_real_escape_string($db,'CAD')){
                            $currency[]='$';
                        }
                        $seller= $_SESSION['SESS_USERID']; 
                        $sql = mysqli_query($db,"SELECT * FROM logins WHERE id='$seller'");

                        $numrow=mysqli_fetch_assoc($sql);
                        $balc=$numrow['balance'];
                        ?>
              </div>
            </a>
            <ul class="dropdown-menu dropdown-menu-end user shadow border-0" aria-labelledby="navbarDropdown4"
              onclick="event.stopPropagation()">
              <li><span class="px-3 d-inline-block">Welcome <?php echo $surname; ?></span></li>
               <li>
                <a class="dropdown-item d-flex align-items-center gap-2" href="account-details.php">
                  <span class="material-symbols-outlined fw-light">
                    account_circle
                  </span>
                  Profile Settings</a>
              </li>
             
            
            
              <li>
                <a class="dropdown-item d-flex align-items-center gap-2" href="deposit.php">
                  <span class="material-symbols-outlined fw-light"> sync </span>
                  Deposit</a>
              </li>
              <li>
                <a class="dropdown-item d-flex align-items-center gap-1" href="logout.php">
                  <span class="material-symbols-outlined fw-light"> logout </span>
                  Log Out</a>
              </li>
            </ul>
          </div>
        </div>
        <!-- For pc -->
      </nav>
	  
      <div class="container-fluid main-content px-2 px-lg-4" style="margin-top: 32px !important">
   
    <!--
	<div class="row my-2 g-3 g-lg-4 pb-3" style="">
          <div class="col-12">
		   <p class="balnce" style="float: right !important">Balance:<span style='color: green !important; font-weight: bold !Important'> <?php //display_currency($currency); echo' '. $balc ?>.00</span></p>
		  </div>
     </div>
   -->
          
		  
		   <?php 
				     if($_GET['success']){
						 
						 if($_GET['success'] == 'depositSuccessful'){
							 ?>
							 <br/><br/><br/><br/>
						<div class='alertme' style='color: green; height: 50px; width: auto; padding: 5px; border: 1px color: #777; background: #333;' align='center'>
						<img src='download.png' height='30' width='40'>Form submitted successfully!!<br/>You will be contacted via your contact email within 24 hours.
						</div>
						
						<?php
							 
						 }
						 
					 }
				  
				    if(isset($_GET['error'])){
				  
				    if($_GET['error'] == 'fieldEmpty'){
						?>
						<div class='alertme' style='color: red; height: 40px; width: auto; padding: 10px; border: 1px color: #777; background: pink;' align='center'>
						Please fill information correctly!!
						</div>
						
						<?php	
					
					}
					}
		?>
		<div class="row my-2 g-3 g-lg-4 pb-3  ">
          <div class="col-12" style="margin-top: 2px !important">
          <div class="mainchart px-3 px-md-4 py-3 py-lg-4">
          <div class="container" align="center" style="margin-top:10px;margin-bottom:20px">
          
	
	
                    <div class="col-md-10">
                    <div class="row">
					 <div class="col-md-12 col-lg-12">
					 
					 	 <div class="card" style="background-color: var(--bg-card) !important; width: 100% !important">
                          <div class="card-body" style="">
                            <h5 class="card-title" style="color: #fff; text-align: center !important">Wallet Deposit Address</h5>
                            
							<?php if(!empty($walletid)) {
                             ?>
							<div class="row wallet-address">
                              <div class="col-md-8">
                                <p style="font-size: 13px !important">Make a Deposit to your account using your secured Alpha Chequers Wallet Address 
                                  below. After a successful deposit, fill correctly and submit the form below, you 
                                  will be contacted within the hour.<br/>
								<span style="color: #fff !important">Current Balance:</span><span style="color: green !important; font-weight: bold !important"> <?php display_currency($currency); echo' '. $balc ?>.00</span>
								</p>
                                <div class="input-group">
                                  <input type="text" id='myInput' class="form-control" value="<?php echo $walletid; ?>">
                                  <div class="input-group-prepend">
                                    <button class="btn btn-primary" onclick='myFunction()'>COPY</button>
                                  </div>
                                </div>
                              </div>
                              <!--
                              <div class="col-md-4">
                                <img src="assets1/img/qr-code-light.svg" alt="qr-code">
                              </div>
                              -->
                            </div>
							<?php
							} else{
                      
							?> 
              <div class="row">    
              <div class="container">
                    <div class="col-md-12">
                    <div class="dropdown-item d-flex gap-2 blink_me" href="#" style="color: white; font-size: 13px; width: 200px">
                         <?php $walletid = 'Generating Wallet Address...';
                         echo $walletid; 
                          ?>
                        </div>
                       </div>
                        
						 <div class="container">
                         <div class="col-md-12">
                        <div class="loader">
                        <div class="loaderBar"></div>
                        </div>
                        </div>
						</div>
                        
                        </div>
						</div>
                         <?php           
                        }
                       ?>
							
							
                          </div>
                        </div>
					 
					 
					 
					 
					 
			
					 
					 
					 <div class="card" style="background-color: var(--bg-card) !important; width: 100% !important">
                    <div class="card-body" style="">
					
					 <div class="settings-profile">
                          <form action="update_deposit.php" enctype="multipart/form-data" name="myForm" id="myform" method="post">
                              <div class="form-row mt-4">
							  
				<div class="col-md-6">
               <label for="emailAddress" style="float:left !important">Email</label>
               <input id="details" type="text" name="email" class="form-control" placeholder="Enter your email" style="background-color: var(--bg-body); !important; border: 1px solid #1e222d; color: #ccc">
                                 </div>
								 
								  <div class="col-md-6">
                                <label for="phoneNumber" style="float:left !important">Amount</label>
                                 <input id="details" type="text" name="amount" class="form-control" placeholder="Enter amount" style="background-color: var(--bg-body); !important; border: 1px solid #1e222d; color: #ccc">
                                </div>
							  
                                <div class="col-md-6">
                                  <label for="formFirst" style="float:left !important">Date</label>
                                  <input id="details" type="date" class="form-control" name="edate" placeholder="Set the date of request" style="background-color: var(--bg-body); !important; border: 1px solid #1e222d; color: #ccc">
								  
								  <input type="hidden" name="type" value="<?php echo $type ?>">
                                </div>
	
						<div class="col-md-12">
                          <input type="submit" value="Update" name="deposit_button" style="border: 1px solid #1e222d">
                        </div>
						
                              </div>

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

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

        <!-- Footer -->
        <div class="row py-2 g-3 g-lg-4 top-border footer">
          <div class="col-lg-6">
            <span class="text-center text-lg-start d-block w-100">©2024. All Rights Reserved By <a href="#" class="primary" style="color: orange !important">Alpha Chequers.</a></span>
          </div>
         
        </div>
      </div>
    </div>
  </div>
  <!-- JS script links -->
  <script src="../cdn.jsdelivr.net/npm/bootstrap%405.0.0-beta3/dist/js/bootstrap.bundle.min.js"></script>
  <script src="../code.jquery.com/jquery-3.5.1.min.js"></script>
  <script src="assets/js/jquery.nice-select.js"></script>
  <script src="assets/js/dd.min.js"></script>
  <script src="assets/js/main.js"></script>
  
  <script src="assets1/js/jquery-3.4.1.min.js"></script>
  <script src="assets1/js/popper.min.js"></script>
  <script src="assets1/js/bootstrap.min.js"></script>
  <script src="assets1/js/amcharts-core.min.js"></script>
  <script src="assets1/js/amcharts.min.js"></script>
  <script src="assets1/js/custom.js"></script>

  <style>
    .loader { 
  width:200px; 
  margin:0 auto;
  border-radius:10px;
  border:4px solid transparent;
  position:relative;
  padding:1px;
}
.loader:before {
  content:'';
  border:1px solid #fff; 
  border-radius:10px;
  position:absolute;
  top:-4px; 
  right:-4px; 
  bottom:-4px; 
  left:-4px;
}
.loader .loaderBar { 
  position:absolute;
  border-radius:10px;
  top:0;
  right:100%;
  bottom:0;
  left:0;
  background:#fff; 
  width:0;
  animation:borealisBar 2s linear infinite;
}

@keyframes borealisBar {
  0% {
    left:0%;
    right:100%;
    width:0%;
  }
  10% {
    left:0%;
    right:75%;
    width:25%;
  }
  90% {
    right:0%;
    left:75%;
    width:25%;
  }
  100% {
    left:100%;
    right:0%;
    width:0%;
  }
}
    </style>
</body>


</html>