<?php
$response = array();


require_once dirname(__FILE__) . '/db_connect.php';


$db = new DB_CONNECT();

$result = mysql_query("SELECT *FROM hopitaux WHERE A=1") or die(mysql_error());


if (mysql_num_rows($result) > 0) {
            
$response["hopitaux"] = array();
    
    
while ($row = mysql_fetch_array($result)) {
        
$hopitau = array();
        
$hopitau["ID"] = $row["ID"];        
$hopitau["NAME"] = $row["NAME"];       
$hopitau["CATEGORIE"] = $row["CATEGORIE"];
$hopitau["ACTIVITY"] = $row["ACTIVITY"];
$hopitau["ADRESS"] = $row["ADRESS"];
$hopitau["COMMUN"] = $row["COMMUN"];
$hopitau["WILAYA"] = $row["WILAYA"];
$hopitau["TEL"] = $row["TEL"];
$hopitau["FAX"] = $row["FAX"];
$hopitau["LA"] = $row["LA"];
$hopitau["LO"] = $row["LO"];                  
        
array_push($response["hopitaux"], $hopitau);
    }
        
$response["success"] = 1;
    
echo json_encode($response);
} 
else {
    
$response["success"] = 0;
    
$response["message"] = "No products found";
    
echo json_encode($response);
}
?>
