 <?php
    include_once('opendb.php');
    $mess="OK";
    $CustCode=$_POST["CustCode"];
    $Latitude=$_POST["Latitude"];
    $Longitude=$_POST["Longitude"];
    $CompID=$_POST["comp_id"]; 
    $edittime= date('ymdHi');
    $sql = "UPDATE subsidiary SET latitude=$Latitude,longitude=$Longitude,loc_edit_time='$edittime' WHERE sub_code='$CustCode' and comp_id=" .$CompID;
    if ($conn->query($sql) === TRUE) {
        $mess="OK";
    } else {
        die( "Error updating settings: " . $conn->error);
    }
    echo "OK";
    $conn->close();
?>