<?php

require_once('connect.php');


if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    if ($_POST['lat']!="" && $_POST['lang']!="" ) {

        $kontr_id = $_POST['kontr_id'];
        $telefon = $_POST['telefon'];
        $lat = $_POST['lat'];
        $lang = $_POST['lang'];

        mysqli_set_charset($conn,"utf8");
        $query = mysqli_query($conn,"SET NAMES utf8");
 

        $query = "UPDATE kontragentlar SET telefon=$telefon,lat=$lat, lang=$lang WHERE kontr_id = $kontr_id";

        if(mysqli_query($conn, $query)){
         echo "ok";
        }else{
         echo "no";

        }


    }else{
          echo "no_c";
    }
}
else
{
     echo "error";
}

$conn->close();
?>

