<?php
session_start();
header('Content-Type: application/json');
include '../../config/db.php';

$log_id  = intval($_POST['log_id']   ?? 0);
$seconds = intval($_POST['duration'] ?? 0);

if($log_id){
    $conn->query("UPDATE call_logs SET duration_sec='$seconds' WHERE id='$log_id'");
}

echo json_encode(['success'=>true]);