<?php
// include db connect class
//require_once __DIR__ . '/../DBConnect.php';
  require_once __DIR__ . '/../DBConnect.php';    
if (isset($_POST['CountryClientID']) && isset($_POST['PhoneNumber']) && isset($_POST['AcNameID'])) {
    $AcNameID = $_POST['AcNameID'];
    $PhoneNumber = $_POST['PhoneNumber'];
     $CountryClientID = $_POST['CountryClientID'];
    $current_date = date("Y-m-d H:i:s");

    //$sql = "UPDATE Account3Name SET AcMobileNo='$PhoneNumber' , AcContactNo='$PhoneNumber' WHERE AcNameID='$AcNameID'";
    $sql="UPDATE Account3Name SET AcMobileNo='$PhoneNumber' , AcContactNo='$PhoneNumber' WHERE AcNameID='$AcNameID' && ClientID = '$CountryClientID'";
    try {
        $stmt = $conn->prepare($sql);
        $stmt->execute();
        $result = $stmt->rowCount();
    } catch (PDOException $e) {
        echo $sql . "<br>" . $e->getMessage();
    }
    // $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
    if ($result != 0) {
        // success
        $response["success"] = 1;
        $response["message"] = "Data Updated";
        // echoing JSON response
        echo json_encode($response);
    } else {
        // success
        $response["success"] = 0;
        $response["message"] = "No Client Availaible";
        // echoing JSON response
        echo json_encode($response);
    }
} else {
    // success
    $response["success"] = 0;
    $response["message"] = "Set All Parameter";
    // echoing JSON response
    echo json_encode($response);
}