<?php
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED);
session_start();
ob_start();
if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') {
    die();
}
require_once("../../backend/functions.php");
require_once("../../db/connection.php");
session_write_close();
$id_map = (int)$_POST['id_map'];
$array_geoimages = array();
$query = "SELECT * FROM sml_geoimages WHERE id_map=?";
if($smt = $mysqli->prepare($query)) {
    $smt->bind_param('i',$id_map);
    $result = $smt->execute();
    if($result) {
        $result = get_result($smt);
        $count = count($result);
        if($count>0) {
            while($row = array_shift($result)) {
                $array_geoimages[] = $row;
            }
        }
    }
}
ob_end_clean();
echo json_encode(array("geoimages"=>$array_geoimages));