<?php
require_once __DIR__ . "/../../portal/config.php";

$license = $_POST['license'];
$symbol  = $_POST['symbol'];
$side    = $_POST['side'];
$lot     = floatval($_POST['lot']);
$sl      = floatval($_POST['sl']);
$tp      = floatval($_POST['tp']);
$admin   = $_SESSION['admin_id'] ?? 0;

$conn->prepare("
INSERT INTO fxh_manual_trades
(admin_id, license_key, symbol, side, lot, sl, tp, status)
VALUES (?, ?, ?, ?, ?, ?, ?, 'QUEUED')
")->execute([$admin,$license,$symbol,$side,$lot,$sl,$tp]);

echo json_encode(["OK"=>1]);
