<?
@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>';
$r = mysql_query("SELECT id_catalog, catalog FROM catalog");
while($rr=mysql_fetch_array($r)) 
{
mysql_query("UPDATE catalog SET url='".cpu($rr['catalog'], $rru['url_type'])."' WHERE id_catalog='".$rr['id_catalog']."'");
}

$r = mysql_query("SELECT id_region, region FROM region");
while($rr=mysql_fetch_array($r)) 
{
mysql_query("UPDATE region SET url='".cpu($rr['region'], $rru['url_type'])."' WHERE id_region='".$rr['id_region']."'");
}

echo '<a href="upd_1.php">Шаг 2</a>';
?> 
</BODY></HTML>