<?php
require_once "auth.php";
$user = API_AUTH();

$type = $_POST['type'] ?? "INFO";
$msg  = $_POST['msg'] ?? "";
$sym  = $_POST['symbol'] ?? "";
$ts   = date("Y-m-d H:i:s");

$q = $conn->prepare("
    INSERT INTO logs (user_id,type,msg,symbol,ts)
    VALUES (?,?,?,?,?)
");
$q->bind_param("issss",$user['id'],$type,$msg,$sym,$ts);
$q->execute();

echo "OK";
?>
