require( $hd."/bitrix/modules/main/include/prolog_before.php"); ini_set('display_errors', 1 ); CModule::IncludeModule('iblock'); require( $hd."/service/contract/c_geodata.php"); if ( isset($_REQUEST["get"]) ){ $result = array(); switch( $_REQUEST["get"] ){ case 'country': $result["data"] = Geo::getCounty(intval( $_REQUEST["cid"] )); break; case 'district': break; case 'region': $result["data"] = Geo::getRegion(intval( $_REQUEST["cid"] ),intval( $_REQUEST["did"] ),intval( $_REQUEST["rid"] )); break; case 'town': $result["data"] = Geo::getCity( intval($_REQUEST["cid"]), intval($_REQUEST["did"]), intval($_REQUEST["rid"]), intval($_REQUEST["tid"]) ); break; } echo json_encode ( $result ); } require( $hd."/bitrix/modules/main/include/epilog_after.php");?>