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

if (isset($_POST['details']) and isset($_POST['cdetails'])) {

    $old_password = mysql_real_escape_string($_POST['details']);
    $new_password = mysql_real_escape_string($_POST['cdetails']);
    $seller= $_SESSION['SESS_USERID'];
    $user_data = mysql_fetch_array(mysql_query("SELECT username FROM logins WHERE id='$seller'"));

    if($user_data['password']==$old_password){
        mysql_query("UPDATE logins SET password='$new_password' WHERE id='$seller'");
    }else{
        echo '<h1>Request Failed</h1>';
    }
    
}

require("lheader.php");?><hr><div class="container" align="center" style="margin-top:20px;">
<div class="navbar-collapse collapse"><ul class="nav navbar-nav navbar-default">
    <li >
        <a href="verify.php">Verfication</a>
    </li>
    <li >
        <a href="account-details.php">Account Details</a>
    </li>
    <li>
        <a href="account-summary.php">Account Summary</a>
    </li>
    <li class="lactive">
        <a href="#">Change Password</a>
    </li>
    </ul></div>

<h3>Change Password</h3>
For regulation purposes, we require that you verify your account by sending us Proof of ID with the most recent date. 
This process is a requirement before your account becomes active and you are able to begin the trading process on Elite Crypto platform.

Proof of ID - Passport / Driver's License - front and back / Government Issued photo ID - front and back

After submission, we will vet the document for authenticity. To begin please upload a scanned copy below and provide the Full Name on the Document.
<?php echo $success;
?>
<form action="" enctype="multipart/form-data" name="myForm" id="myform" method="post" style="margin-top:20px;"><div class="container" align="center">
    <div class="col-md-5" align="right"><label for="details" style="margin-top:12px;">Old Password :</label></div><div class="col-md-7" align="left">
    <input type="password" name="details" id="details" min="10"/>
    </div></div><div class="container" align="center">
    <div class="col-md-5" align="right"><label for="details" style="margin-top:12px;">New Password :</label></div><div class="col-md-7" align="left">
    <input type="password" name="cdetails" id="details" min="10"/>
    </div></div><div clas="container" align="center"><div class="col span-3-of-3"><label>
    <input type="submit" name="button" id="btn-mlogin" value="Change" />
    </label></div></div>
</form>
</div>
<?php
require ("footer.php");
?>