<?php
require 'middleware.php';

$data = json_decode(file_get_contents("php://input"), true);

$lat = $data['lat'];
$lng = $data['lng'];

$pdo->prepare("
UPDATE drivers
SET current_lat=?, current_lng=?
WHERE id=?
")->execute([$lat, $lng, $driver_id]);

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