<?
@session_start();
require_once('../connect/connect.php');
include_once('../lib/lib.php');
require('pdk.php');
?>
<HTML><HEAD>
<META http-equiv=content-type content="text/html; charset=utf-8">
<link rel="stylesheet" href="../style/template_adm.css" type="text/css"/>
</HEAD>
<BODY>
<?
echo '<font color=green size=+1><em>Изменяем кэш регионов</em></font><br><br>';

if(!isset($_GET['o']))
$o = -1;
else
$o=intval($_GET['o']);

$r = mysql_query("SELECT * FROM region WHERE parent_glob > '".$o."' ORDER BY parent_glob LIMIT 1");
$nr=mysql_num_rows($r);
if($nr)
	{
	echo 'Регион  '.$o;
	$rr=mysql_fetch_array($r);
	$parent_glob=intval($rr['parent_glob']);
	include_once('_svod_region.php');
	echo "<HTML><HEAD><meta http-equiv='Refresh' charset='utf-8' content='0; URL=upd_2.php?o=".$parent_glob."'></HEAD></HTML>";
	exit();
	}
else 
	{
	echo '<a href="upd_3.php">Шаг 4</a>';
	}
?> 
</BODY></HTML>