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

require("config.php");
require("db.php");

$seller= $_SESSION['SESS_USERID']; 
$select=mysqli_query($db,"SELECT * FROM logins WHERE id='$seller'");
$serow=mysqli_fetch_assoc($select);
$forename = $serow['firstname'];
$surname = $serow['lastname'];
$country = $serow['country'];
$state = $serow['state'];
$city = $serow['city'];
$postcode = $serow['currency'];
$phone = $serow['phone'];
$email = $serow['email'];
$username = $serow['username'];
$password = $serow['password'];

$userImage = $serow['user_image'];
$ver_b=$serow['ver_badge'];
//$ver=$numrow['verified'];
//$acc_verified=$numrow['acc_verified'];
?>



<!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>
@media (max-width: 800px) {
  .with1{
   float: left !important;
  }
  
  .with2{
   float: left !important;
  }
   .with3{
   float: left !important;
  }
   .with4{
   float: left !important;
  }
   .with5{
   float: left !important;
  }
   .with6{
   float: left !important;
  }
   .with7{
   float: left !important;
  }
   .with8{
   float: left !important;
  }
}
.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>
  
  
  
  
  <title>Alpha Chequers™ - Account Settings</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 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 active 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; 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: 0px !important; border: 1px solid # !important">
        <!-- Tables -->
        <div class="row my-2 g-3 g-lg-4 pb-3">
          <div class="col-12">
            <div class="mainchart px-3 px-md-4 py-3 py-lg-4">
	<div class="row">
	
	<div class="col-md-12 col-lg-12" style="">
	
	
	
	           <div class="card" style="background-color: var(--bg-card)">
                <div class="card-body">
				 <br/>
                  <h5 class="card-title" style="color: #fff; text-align: center !important">Profile Settings</h5>
				  <br/>
				  
				  <?php //echo $success ?>
				  
				  <?php 
				     if($_GET['success']){
						 
						 if($_GET['success'] == 'userUpdated'){
							 ?>
						<div class='alertme' style='color: green; height: 40px; width: auto; padding: 10px; border: 1px color: #777; background: #999;' align='center'>
						Profile updated successfully!!
						</div>
						<br/>
						<?php
							 
						 }
						 
					 }
				  
				  
			 
				    if(isset($_GET['error'])){
				  
				    if($_GET['error'] == 'dataEmpty'){
						?>
						<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>
						<br/>
						<?php						
					}else if($_GET['error'] == 'invalidFileType'){
						?>
						<div class='alertme' style='color: red; height: 40px; width: auto; padding: 10px; border: 1px color: #777; background: pink;' align='center'>
						Invalid file type. Only images are allowed!!
						</div>
						<br/>
						<?php
					} else if($_GET['error'] == 'invalidFileSize'){
					  ?>
						<div class='alertme' style='color: red; height: 40px; width: auto; padding: 10px; border: 1px color: #777; background: pink;' align='center'>
						Maximum 1mb image size allowed!!
						</div>
						<br/>
						<?php
					
					}
					
					}
				  ?>
				  
                  <div class="settings-profile">
                    <form action='update.php' method='POST' id='myform' enctype= 'multipart/form-data'>
                    <?php if(!empty($userImage)) {
                             ?>                            
              <img height="100" width="100" class="img-fluid" src="userImages/<?php echo $userImage; ?>" alt="">
              <?php
              }else{
                ?>
                <img src="assets/img/avatarnow.png" alt="" height="100" width="100">
                <?php
              }
        
            ?>                
                      <div class="form-row mt-4">
                        <div class="col-md-6">
                          <label for="formFirst">First name</label>
                          <input id="username" type="text" name="forenameBox" min="3"  value="<?php echo $forename?>" required class="form-control" placeholder="First name" style="background-color: var(--bg-body); !important; border: 1px solid #1e222d; color: #ccc">
                        </div>
                        <div class="col-md-6">
                          <label for="formLast">Last name</label>
                          <input id="username" type="text" name="surnameBox" min="3"  value="<?php echo $surname?>" class="form-control" placeholder="Last name" style="background-color: var(--bg-body) !important; border: 1px solid #1e222d; color: #ccc">
                        </div>
						
                        <div class="col-md-6">
                          <label for="emailAddress">Email</label>
                          <input id="username" type="email" name="emailBox" min="3"  value="<?php echo $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">Phone</label>
                          <input id="username" type="number" name="phoneBox" min="999999999" value="<?php echo $phone?>" required class="form-control" placeholder="Enter phone number" style="background-color: var(--bg-body)!important; border: 1px solid #1e222d; color: #ccc">
                        </div>
						
						<div class="col-md-6">
                          <label for="formLast">Country</label>
                          <input id="username" type="text" name="txtcountry"  value="<?php echo $country?>" class="form-control" placeholder="Country" style="background-color: var(--bg-body); !important; border: 1px solid #1e222d; color: #ccc">
                        </div>
						<div class="col-md-6">
                          <label for="formLast">State</label>
                          <input id="username" type="text" name="txtstate" value="<?php echo $state ?>" required class="form-control" placeholder="State" style="background-color: var(--bg-body) !important; border: 1px solid #1e222d; color: #ccc">
                        </div>
						
                        <div class="col-md-6">
                          <label for="formLast">City</label>
                          <input id="username" type="text" name="txtcity" value="<?php echo $city?>" required class="form-control" placeholder="City" style="background-color: var(--bg-body)!important; border: 1px solid #1e222d; color: #ccc">
                        </div>
						
						
                        <div class="col-md-6">
                          <label for="selectCurrency">Currency</label>
                          <select id="selectCurrency" name="postcodeBox" class="form-control" required="required" style="background-color: var(--bg-body); !important; border: 1px solid #1e222d; color: #ccc">
                             <option value="<?php echo $postcode?>"><?php echo $postcode?></option>
                             <option value="USD">USD</option>
                             <option value="GBP">GBP</option>
                             <option value="EUR">EUR</option>
                             <option value="AUD">AUD</option>
                             <option value="CAD">CAD</option>
                          </select>
                        </div>
						
						
						<div class="col-md-6">
                          
                          <input id="username" type="file" name="userImage" class="form-control" >
                        </div>
						
						
                        <div class="col-md-12">
						
                          <input type="submit" value="Update" id="btn-mlogin" name="update" style="border: 1px solid #1e222d">
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
	
	
	
	
	
	</div>
	
	</div>
	
	
	
	
	
	
	
	</div>
	<br>
	<br>
			  
			  

            </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>
</body>



</html>