<?php
//                  (c) 2017 IZYUM WEB SYSTEM www.izyum.name 
    require_once('../../../../config.php');
    require_once(DIR_SYSTEM . 'library/db.php');
    require_once(DIR_SYSTEM . 'library/db/' . DB_DRIVER . '.php');

// Database 
    $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);

if  (isset($_GET['town'])) {
    if ($_GET['town']) {
       $town = preg_replace("/[^а-яА-Я0-9- ]|insert|delete|update/iu","",$_GET['town']);
       $query = $db->query("SELECT * FROM " . DB_PREFIX . "iws_yamap WHERE iwstown = '" . $town . "'");
       $modulesgeo1 = $query->rows;
       $json = json_encode($modulesgeo1);
       echo $json;
    }
}

?>
