<?php
// array for JSON response
  $response= array();

    // include db connect class
   require_once __DIR__ . '/../DBConnect.php';

if(isset($_POST['ClientID'])){
	
	$ClientID = $_POST['ClientID'];

      $sql = "SELECT * FROM Account5customGroup1 WHERE ClientID = $ClientID";
     $stmt = $conn->prepare($sql);
			$stmt->execute();
			$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
	if($result!=null &&  $result>0){
        $response["Account5customGroup1"] = array();
       foreach($result as $row) { 
             
		$Account5customGroup1["ID"] = $row["ID"];          
  		$Account5customGroup1["CustomGroup1ID"] = $row["CustomGroup1ID"];
		$Account5customGroup1["CustomGroupName"]= $row["CustomGroupName"];
  		$Account5customGroup1["ClientID"] = $row["ClientID"];
  		$Account5customGroup1["ClientUserID"] = $row["ClientUserID"];
  		$Account5customGroup1["SysCode"] = $row["SysCode"];
		$Account5customGroup1["NetCode"] = $row["NetCode"];
        $Account5customGroup1["UpdatedDate"] = $row["UpdatedDate"];

          // push single product into final response array
          array_push($response["Account5customGroup1"], $Account5customGroup1);
        }
        // success
        $response["success"] = 1;
        // echoing JSON response
        echo json_encode($response);
      }
}else {
        // success
        $response["success"] = 0;
        $response["message"] = "No Data Availaible";
        // echoing JSON response
    		echo json_encode($response);
      }
?>
