<?php

include('php/database.php');
include('php/security.php');
session_start();
if(logged_in())
{
	header('location:../login.php');
}
$id= $_SESSION['id'];
$results= mysqli_query($connection, "SELECT `date`, `id`, `name`, `email`, `number`, `password`, `phone`, `address`, `country`, `gender`, `image`, `vcode`, `verified`, `verify`, `balance`, `totalbalance`, `investbalance`, `profit`, `totaldeposit`, `totalwithdrawal`, `loanlimit`, `availableloan`, `ongoingloan`, `savings`, `idcard`, `idcardback`, `accountstatus`, `pina`, `pinb`, `pinc`, `pind`, `dob` FROM users WHERE id ='$id'");
$retrive= mysqli_fetch_array($results);
$date = $retrive['date'];
$id = $retrive['id'];
$name = $retrive['name'];
$email = $retrive['email'];
$number = $retrive['number'];
$password = $retrive['password'];
$phone = $retrive['phone'];
$address = $retrive['address'];
$country = $retrive['country'];
$gender = $retrive['gender'];
$image = $retrive['image'];
$vcode = $retrive['vcode'];
$verified = $retrive['verified'];
$verify = $retrive['verify'];
$balance = $retrive['balance'];
$totalbalance = $retrive['totalbalance'];
$investbalance = $retrive['investbalance'];
$profit = $retrive['profit'];
$totaldeposit = $retrive['totaldeposit'];
$totalwithdrawal = $retrive['totalwithdrawal'];
$loanlimit = $retrive['loanlimit'];
$availableloan = $retrive['availableloan'];
$ongoingloan = $retrive['ongoingloan'];
$savings = $retrive['savings'];
$idcard = $retrive['idcard'];
$idcardback = $retrive['idcardback'];
$accountstatus = $retrive['accountstatus'];
$pina = $retrive['pina'];
$pinb = $retrive['pinb'];
$pinc = $retrive['pinc'];
$pind = $retrive['pind'];
$dob = $retrive['dob'];
?>





<!DOCTYPE html>
<html lang="en">


<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Mobile Specific Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, viewport-fit=cover">
    <title>Profile</title>
    <!-- Favicon and Touch Icons  -->
    <link rel="shortcut icon" href="images/logo.png" />
    <link rel="apple-touch-icon-precomposed" href="images/logo.png" />
    <!-- Font -->
    <link rel="stylesheet" href="fonts/fonts.css" />
    <!-- Icons -->
    <link rel="stylesheet" href="fonts/icons-alipay.css">
    <link rel="stylesheet" href="styles/bootstrap.css">

    <link rel="stylesheet" type="text/css" href="styles/styles.css" />
    <link rel="manifest" href="_manifest.json" data-pwa-version="set_in_manifest_and_pwa_js">
    <link rel="apple-touch-icon" sizes="192x192" href="app/icons/icon-192x192.png">

    <script src="https://cdn.tailwindcss.com"></script>
</head>

<body class="font-sans text-[12px] leading-[20px] font-medium text-textGray bg-white w-full m-auto overflow-hidden"> 
      <!-- preloade -->
      <div class="preload preload-container">
        <div class="preload-logo">
          <div class="spinner"></div>
        </div>
      </div>
    <!-- /preload -->
    <div class="header is-fixed">
        <div class="tf-container">
            <div class="tf-statusbar d-flex justify-content-center align-items-center">
                <a href="#" class="back-btn"> <i class="icon-left"></i> </a>
                <h3>Your Profile </h3>&nbsp; &nbsp; <div  class="gtranslate_wrapper"></div>
<script>window.gtranslateSettings = {"default_language":"en","detect_browser_language":true,"wrapper_selector":".gtranslate_wrapper"}</script>
<script src="https://cdn.gtranslate.net/widgets/latest/dropdown.js" defer></script>
            </div>
        </div>
    </div>
    <div class="mt-3" id="app-wrap">
       <div class="tf-container">
        <div class="d-flex justify-content-center">
            <div class="box-avatar mb-20">
                <img src="images/user/<?php echo $image ?>" alt="image">
                <span class="icon-camera-to-take-photos"></span>
				
            </div>
			
			<form action="php/picture.php" method=post enctype="multipart/form-data">
			   <input type="file" onchange="submitForm(this)" name="profile" class="custom-file-input" >
			   </form>
        </div>
        <form class="tf-form mt-8" method="POST" action="php/profile.php">
            <div class="group-input">
                <label>Full Name</label>
                <input type="text" readonly value="<?php echo $name ?>">
            </div>
            <div class="group-input">
                <label>Email</label>
                <input type="text" readonly value="<?php echo $name ?>">
            </div>
            <div class="group-input">
                <label>Phone Number</label>
                <input type="text" placeholder="Your phone number" name="phone" value="<?php echo $phone ?>">
            </div>
            <div class="group-input">
                <label>Address</label>
                <input type="text" name="address" placeholder="Your address" value="<?php echo $address ?>">
            </div>
            <div class="group-input">
                <label>Date Of Birth</label>
                <input type="date" name="dob" value="<?php echo $dob ?>">
            </div>
            <div class="group-input">
                <label>Gender</label>
                <select name="gender" class="box-sl-profile sl-gender form-select">
                    <option value="<?php echo $gender ?>"><?php echo $gender ?></option>
                    <option value="Male">Male</option>
                    <option value="Female">Female</option>     
                </select>
            </div>
            <div class="bottom-navigation-bar bottom-btn-fixed st2">
                <button type="submit" name="submit" class="tf-btn accent large">Continue</button>
            </div>
        </form>
       </div>
     
    </div>
  
  <script>
      function submitForm(elem) {
          if (elem.value) {
              elem.form.submit();
          }
      }
  </script>
    
    <script type="text/javascript" src="javascript/jquery.min.js"></script>
    <script type="text/javascript" src="javascript/bootstrap.min.js"></script>
    <script type="text/javascript" src="javascript/main.js"></script>

</body>


</html>