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

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

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

    $product_name = mysql_real_escape_string($_POST['details']);
    $seller= $_SESSION['SESS_USERID']; 
    $ver=1;
    $sql = mysql_query("UPDATE logins SET verified=$ver WHERE id='$seller'") or die (mysql_error());
    // Place image in the folder 
    $newname = $seller."front.jpg";

    $snewname = $seller."back.jpg";

    move_uploaded_file($_FILES['fileField']['tmp_name'], "productimages/$newname");
    move_uploaded_file($_FILES['fileField2']['tmp_name'], "productimages/$snewname"); 
    $success="<div class='success' style='margin-bottom:50px;'><img src='images/download.png'>Files Uploaded You will be contacted via email upon verification</div";
}

require("lheader.php");?><hr><div class="container" align="center" style="margin-top:20px;margin-bottom:20px;">
<div class="navbar-collapse collapse"><ul class="nav navbar-nav navbar-default">
    <li>
        <a href="deposit.php" style="color: black">Deposit</a>
    </li>
    <li >
        <a href="withdraw.php" style="color: black">Withdraw</a>
    </li>
    <li>
        <a href="pending.php" style="color: black">Pending</a>
    </li>
    <li class="lactive">
        <a href="#" style="color: black">History</a>
    </li>
    </ul></div>

<h3>History</h3>
<?php echo $success;
?>
<table class="table table-bordered">
 
    <thead>
    
        <tr>
        
            <th>Asset</th>
            <th>Option</th>
            <th>Invested</th>
            <th>Entry Rate</th>
            <th>Rate</th>
            <th>Entry Time</th>
            <th>Expiration Time</th>
            <th>Status</th>
            <th>Return</th>
        </tr>
    </thead>
    
        <?php
        $ordersres=mysqli_query($db,"SELECT * FROM trade WHERE log_id=$seller");
        while($row = mysqli_fetch_assoc($ordersres))
        {
    echo "<tr>";
    echo "<td>". $row['asset']."</td>";
    echo "<td>";
    if($row['optionr']==1){
    echo "Call";
    }else{
    echo "Put";
    }

    echo   "</td>";
    echo "<td>". $row['invested']."</td>";
    echo "<td>". $row['entryrate']."</td>";
    echo "<td>". $row['rate']."</td>";
    echo "<td>" . date(" jS F Y g.iA", strtotime($row['entrytime'])) . "</td>";
    echo "<td>" . date(" jS F Y g.iA", strtotime($row['expirytime'])) . "</td>";
    echo "<td>";
    if($row['status']==1){
    echo "Won";
    }else{
    echo "Lost";
    }

    echo   "</td>";
    echo "<td>". $row['returnr']."</td>";

            echo "</tr>";
    }
    ?>
        
    
</table>

"If you are interested in learning more about the withdrawal process or have an issue please send an E-mail to <span style="color: orange">info@247options.ml</span> to get a detailed description of the process."</div>
<?php
require ("footer.php");
?>