<?php
error_reporting(1);
session_start();
require("db.php");
require("config.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'];
$surname = $numrow['lastname'];
$active_no = $numrow['active_no'];
$cashout_no = $numrow['cashout_no'];
$investors_no = $numrow['investors_no'];
$profile = $numrow['profile'];
$verifyuser = $numrow['verifyuser'];
?>

<?php
 function change_profile_image($seller, $file_temp, $file_extn){
       $file_path = 'images/profile/' . substr(md5(time()), 0, 10) . '.' . $file_extn;
       move_uploaded_file($file_temp, $file_path);
       mysql_query("UPDATE logins SET profile = '".  mysql_real_escape_string($file_path) ."' WHERE id = " . (int)$seller);
 }

?>


<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Alpha Lite Trade - Forex Trading | Crypto Trading</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <!-- 

http://www.templatemo.com/preview/templatemo_395_urbanic 
-->
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!--<link rel="shortcut icon" href="PUT YOUR FAVICON HERE">-->

        <!-- Google Web Font Embed -->
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>

        <!-- Bootstrap core CSS -->
        <link href="css2/bootstrap.css" rel='stylesheet' type='text/css'>
        <link href="css2/styles.css" rel='stylesheet' type='text/css'>
        <link href="css2/grid.css" rel='stylesheet' type='text/css'>
        <!-- Custom styles for this template -->
        <link href="js2/colorbox/colorbox.css"  rel='stylesheet' type='text/css'>
        <link href="css2/templatemo_style.css"  rel='stylesheet' type='text/css'>
		<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

<!--=========================================================-->
		<!-- Stylesheets -->
        <link href="css/bootstrap.css" rel="stylesheet">
<link href="plugins/revolution/css/settings.css" rel="stylesheet" type="text/css"><!-- REVOLUTION SETTINGS STYLES -->
<link href="plugins/revolution/css/layers.css" rel="stylesheet" type="text/css"><!-- REVOLUTION LAYERS STYLES -->
<link href="plugins/revolution/css/navigation.css" rel="stylesheet" type="text/css"><!-- REVOLUTION NAVIGATION STYLES -->
<link href="css/style.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">

<!--Color Switcher Mockup-->
<link href="css/color-switcher-design.css" rel="stylesheet">

<!--Color Themes-->
<link id="theme-color-file" href="css/color-themes/orange-theme.css" rel="stylesheet">



<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
	<link href='https://fonts.googleapis.com/css?family=Oswald:700' rel='stylesheet' type='text/css'>
	
	
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>



  
  
  

<!--Favicon-->
<link rel="shortcut icon" href="images/favicon2.png" type="image/x-icon">
<link rel="icon" href="images/favicon2.png" type="image/x-icon">
<!-- Responsive -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script><![endif]-->
<!--[if lt IE 9]><script src="js/respond.js"></script><![endif]-->
<style type="text/css">
.text-anim {
  color: #000;
  font-size: 13px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-weight: bold;
}

/* ==========================================================================
	 Main Animation	 ========================================================================== */
.text-anim span {
  opacity: 0;
  transition: all, 0ms;
  -webkit-filter: blur(25px);
  -moz-filter: blur(25px);
  -ms-filter: blur(25px);
  filter: blur(25px);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.text-anim span:nth-child(22) {
  transition-delay: 300ms;
}
.text-anim span:nth-child(21) {
  transition-delay: 300ms;
}
.text-anim span:nth-child(20) {
  transition-delay: 700ms;
}
.text-anim span:nth-child(19) {
  transition-delay: 665ms;
}
.text-anim span:nth-child(18) {
  transition-delay: 630ms;
}
.text-anim span:nth-child(17) {
  transition-delay: 595ms;
}
.text-anim span:nth-child(16) {
  transition-delay: 560ms;
}
.text-anim span:nth-child(15) {
  transition-delay: 525ms;
}
.text-anim span:nth-child(14) {
  transition-delay: 490ms;
}
.text-anim span:nth-child(13) {
  transition-delay: 455ms;
}
.text-anim span:nth-child(12) {
  transition-delay: 420ms;
}
.text-anim span:nth-child(11) {
  transition-delay: 385ms;
}
.text-anim span:nth-child(10) {
  transition-delay: 350ms;
}
.text-anim span:nth-child(9) {
  transition-delay: 315ms;
}
.text-anim span:nth-child(8) {
  transition-delay: 280ms;
}
.text-anim span:nth-child(7) {
  transition-delay: 245ms;
}
.text-anim span:nth-child(6) {
  transition-delay: 210ms;
}
.text-anim span:nth-child(5) {
  transition-delay: 175ms;
}
.text-anim span:nth-child(4) {
  transition-delay: 140ms;
}
.text-anim span:nth-child(3) {
  transition-delay: 105ms;
}
.text-anim span:nth-child(2) {
  transition-delay: 70ms;
}
.text-anim span:nth-child(1) {
  transition-delay: 35ms;
}

.text-anim.animate span {
  opacity: 1;
  -webkit-filter: blur(0px);
  -moz-filter: blur(0px);
  -ms-filter: blur(0px);
  filter: blur(0px);
}

</style>






<script type="">
setInterval(function(){$('.text-anim').toggleClass('animate');
  },1400);
</script>

    </head>

    <body style="">

            <div class="templatemo-top-bar" id="templatemo-top">
            <div class="container">
                <div class="subheader">
                    <div id="email" class="pull-right">
					  <p style="font-size: 14px; color: orange;margin-top: 12px"><?php echo $forename; ?> <?php echo $surname; ?>&nbsp;<?php echo $verifyuser; ?></p>
                       
                        <?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>
                   
                   
                   <div class="ProfileImg" style="border: 1px solid #; float: right; margin-bottom:10px;">
                   <?php
                            if(isset($_FILES['profile']) === true){
                              if(empty($_FILES['profile']['name']) === true){
                                  echo 'Please choose a file!';
                              }else{
                                  $allowed = array('jpg','jpeg','gif','png');
                                  $file_name=$_FILES['profile']['name'];
                                  $file_extn=strtolower(end(explode('.', $file_name)));
                                  $file_temp=$_FILES['profile']['tmp_name'];
                                  
                                 if(in_array($file_extn, $allowed) === true){
                                     change_profile_image($seller, $file_temp, $file_extn);
                                      header("Location: http://localhost/uchz/trade.php/trade.php");
                                     
                              }else{
                                  echo 'Incorrect file type. Allowed:';
                                 echo implode(', ', $allowed);
                              }
                            }
                            }
                           if(empty($profile) === false){
                                echo '<img src="', $profile, '" alt="', $profile, '\'s Profile Image" style="height: 55px; width: 55px; border-radius: 50% !important">';
                           }
                          
                           ?>
                       </div>
                      
                       
                </div>
            </div>
        </div>
        <div class="">
            <div class="container">
                <!-- Static navbar -->
                <div class="navbar navbar-default" role="navigation" style="background: white; border: 1px solid white !important">
                    <div class="container">
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a href="trade.php" class="navbar-brand"><img class="toplogo" src="images/logo10.png" alt="Logo" title="Elite Crypto Services" /></a>
                        </div>
                        <div class="navbar-collapse collapse" id="templatemo-nav-bar">
                            <ul class="nav navbar-nav navbar-right" style="margin-top: 40px;">
                                <li><a href="account-details.php">MY ACCOUNT</a></li>
                                
                                <li><a href="withdraw.php">WITHDRAWAL</a></li>
                                <li><a href="message.php" style="margin-right: 3px">MESSAGE</a></li>
								 <li><a href="deposit.php" style="margin-right: 3px; color: orange; font-weight: bold; text-decoration: underline">INVEST</a></li>
								 <li><a href="logout.php" style="margin-right: 3px">LOGOUT</a></li>
								 <li>
								 <form action="" method="POST" enctype="multipart/form-data" style="float: left;">
                                 <input type="file" name="profile">
                                 <button type="submit" style="border: 1px solid #555 !important; margin-top: 2px !important; border-radius: 3px !important; padding: 2px !important; color:#000 !important">Upload Profile Image</button>
                                 </form></li>
                            </ul>
                        </div><!--/.nav-collapse -->
                    </div><!--/.container-fluid -->
                </div><!--/.navbar -->
            </div> <!-- /container -->
        </div>
        