<?php
require_once '../config.php';

$result = $conn->query("
SELECT * FROM fxh_trade_logs 
ORDER BY id DESC 
LIMIT 500
");
?>
<html>
<body>

<h2>Closed Trades (Latest 500)</h2>

<table border=1 cellpadding=5>
<tr>
<th>ID</th><th>License</th><th>Account</th><th>Ticket</th>
<th>Symbol</th><th>Type</th><th>Volume</th>
<th>Entry</th><th>Exit</th><th>Profit</th>
<th>Open Time</th><th>Close Time</th>
<th>SL</th><th>TP</th><th>Comment</th>
</tr>

<?php while($r = $result->fetch_assoc()): ?>
<tr>
<td><?= $r['id'] ?></td>
<td><?= $r['license_key'] ?></td>
<td><?= $r['mt5_account'] ?></td>
<td><?= $r['ticket'] ?></td>
<td><?= $r['symbol'] ?></td>
<td><?= $r['type'] ?></td>
<td><?= $r['volume'] ?></td>
<td><?= $r['open_price'] ?></td>
<td><?= $r['close_price'] ?></td>
<td><?= $r['profit'] ?></td>
<td><?= $r['open_time'] ?></td>
<td><?= $r['close_time'] ?></td>
<td><?= $r['sl'] ?></td>
<td><?= $r['tp'] ?></td>
<td><?= $r['comment'] ?></td>
</tr>
<?php endwhile; ?>

</table>

</body>
</html>
