<?php 
 
$___notjson = 1;
error_reporting(-1);
ini_set('display_errors', true);
//header('Content-Type: text/html; charser=utf-8');
date_default_timezone_set ('Europe/Moscow');

if (isset($_REQUEST['term'])) {

	require_once 'classes/Cdek_class.php';
	$cdek = new Cdek();
	$q = $cdek->engToRus(mb_strtoupper($_REQUEST['term'], "UTF-8"));
	$city = $cdek->getCity($q);
	if (empty($city)) $cdek->response('error', 'Город не найден. Он существует?');
	exit(json_encode($city));
}

?>