
<?php


    
    require_once __DIR__ . '/../DBConnect.php';
	try 
	{
	
		
		
			$stmt = $conn->prepare("SELECT * from ProjectMenuSub");
			$stmt->execute();
			$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
		
		
	   if($result!=null &&  $result>0){
			$response["ProjectMenuSub"] = array();
			foreach($result as $row) { 
			
			 $ProjectMenuSub["SubMenuID"] = $row["SubMenuID"];
			  $ProjectMenuSub["MenuName"] = $row["MenuName"];
			  $ProjectMenuSub["SabMenuName"] = $row["SabMenuName"];
			  $ProjectMenuSub["JavaQuery"] = $row["JavaQuery"];
			  $ProjectMenuSub["NativeQuery"] = $row["NativeQuery"];
			  $ProjectMenuSub["FlutterQuery"] = $row["FlutterQuery"];
			  $ProjectMenuSub["PhpQuery"] = $row["PhpQuery"];
			  $ProjectMenuSub["Detail"] = $row["Detail"];
			  $ProjectMenuSub["AddEditPage"] = $row["AddEditPage"];
			  $ProjectMenuSub["LinkPage"] = $row["LinkPage"];
			 

			  // push single product into final response array
			  array_push($response["ProjectMenuSub"], $ProjectMenuSub);
			}
			 // 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);
				
			}
	}
	catch(PDOException $e){
		
		echo "Error: " . $e->getMessage();
		
	}
  $conn = null;
?>
