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

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


		
      $sql = "select * from CountryCode ";
  		 $stmt = $conn->prepare($sql);
			$stmt->execute();
			$result = $stmt->fetchAll(PDO::FETCH_ASSOC);

     if($result!=null &&  $result>0){
        $response["CountryCode"] = array();

        foreach($result as $row) {
 

			$CountryCode["ID"] = $row["ID"];          
$CountryCode["CountryCode"] = $row["CountryCode"]; 
$CountryCode["CountryName"] = $row["CountryName"];                                        
$CountryCode["CurrencyName"] = $row["CurrencyName"];                                       
$CountryCode["CurrencySigne"] = $row["CurrencySigne"]; 
$CountryCode["ClientID"] = $row["ClientID"];
		  
		  $current_date = date("Y-m-d H:i:s");	
		  $CountryCode["SessionDate"] = $current_date;	
			
          // push single product into final response array
    			array_push($response["CountryCode"], $CountryCode);
        }

        // success
    		$response["success"] = 1;
        // echoing JSON response
    		echo json_encode($response);
      }else {
        // no products found
    		$response["success"] = 0;
    		$response["message"] = "No Data Found";
        // echoing JSON response
    		echo json_encode($response);
      }
   
?>
