<?php
include('dbconnection.php');
header('Content-Type: application/json');
$sender = isset($_POST['sender']) ? $con->real_escape_string($_POST['sender']) : '';
if ($sender) {
    $sql = "UPDATE SMS SET Seen = 1 WHERE Sender = '$sender'";
    $con->query($sql);
    if ($con->affected_rows > 0) {
        echo json_encode(['status' => 'success']);
    } else {
        echo json_encode(['status' => 'no_change']);
    }
} else {
    echo json_encode(['status' => 'error', 'message' => 'No sender passed']);
}
$con->close();