<?php
require 'config_db.php';
$data = json_decode(file_get_contents('php://input'), true);
$user_type = $data['user_type'];
$mode = $data['mode'];

if ($user_type == '') {
	$returnArr = array("ResponseCode" => "401", "Result" => "false", "ResponseMsg" => "Something Went wrong try again !");
} else {
    // get all visitors
	if ($mode == 1) {
	    $activity_query = $con->query("select * from app_gallery Order by id ASC");
		$activity_details = array();
		$all_activitys = array();
		while ($row1 = $activity_query->fetch_assoc()) {
			$activity_details['id'] = $row1['id'];
			$activity_details['img_url'] = $row1['img_url'];
			$activity_details['name'] = $row1['name'];
			$all_activitys [] = $activity_details;
		}
		$returnArr = array(
			"ResponseCode" => "200",
			"Result" => "true",
			"ResponseMsg" => "Success",
			"data" => $all_activitys
		);
	}
}

echo json_encode($returnArr);
mysqli_close($con);
?>