<?php
require 'db.php';

$data = [
    $_POST['title'] ?? '',
    $_POST['subheading'] ?? '',
    $_POST['mobile'] ?? '',
    $_POST['callmobile'] ?? '',
    date("Y-m-d H:i:s")
];

$stmt = $pdo->prepare("UPDATE settings SET title=?, subheading=?, mobile=?, callmobile=?, updatedate=? WHERE id=1");
$success = $stmt->execute($data);

echo json_encode(['status' => $success]);
?>
