<?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 Restaurant1Potion WHERE ClientID = $ClientID";
     $stmt = $conn->prepare($sql);
			$stmt->execute();
			$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
	if($result!=null &&  $result>0){
        $response["Restaurant1Potion"] = array();
       foreach($result as $row) { 
             
		$Restaurant1Potion["ID"] = $row["ID"];          
		$Restaurant1Potion["PotionID"] = $row["PotionID"];
  		$Restaurant1Potion["PotionName"] = $row["PotionName"];
		$Restaurant1Potion["PotionDescriptions"] = $row["PotionDescriptions"];
  		$Restaurant1Potion["ClientID"] = $row["ClientID"];
  		$Restaurant1Potion["ClientUserID"] = $row["ClientUserID"];
  		$Restaurant1Potion["NetCode"] = $row["NetCode"];
  		$Restaurant1Potion["SysCode"] = $row["SysCode"];
        $Restaurant1Potion["UpdatedDate"] = $row["UpdatedDate"];
		
          // push single product into final response array
          array_push($response["Restaurant1Potion"], $Restaurant1Potion);
        }
        // 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);
      }
}else {
        // success
        $response["success"] = 0;
        $response["message"] = "No Data Availaible";
        // echoing JSON response
    		echo json_encode($response);
      }
?>
