Файл: countr.php
Строк: 99
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
$set['title'] = 'Выбор страны';
include_once 'sys/inc/thead.php';
title();
aut();
if (isset($_GET['go'])){
echo "Быстрый поиск города:<br/>";
$city2=mysql_fetch_array(mysql_query("SELECT * FROM `city` WHERE `name`='$_POST[city]' LIMIT 1"));
$mycity=NULL;
if (isset($_SESSION['mycity']))$mycity=esc(stripcslashes(htmlspecialchars($_SESSION['mycity'])));
if (isset($city2['city_id']))$mycity=esc(stripcslashes(htmlspecialchars($city2['city_id'])));
$_SESSION['mycity']=$mycity;
$mycity=ereg_replace("( ){1,}","",$mycity);
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `city` WHERE `city_id` like '%".mysql_escape_string($mycity)."%'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)
{
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Нет результатовn";
echo " </td>n";
echo " </tr>n";
}
$q=mysql_query("SELECT * FROM `city` WHERE `city_id` like '%".mysql_escape_string($mycity)."%' ORDER BY `name` LIMIT $start, $set[p_str]");
while ($count = mysql_fetch_array($q))
{
if($num==1){
echo "<div class='rowdown'>";
$num=0;
}else{
echo "<div class='rowup'>";
$num=1;}
$country=mysql_fetch_array(mysql_query("SELECT * FROM `country` WHERE `country_id` = '$count[country_id]'"));
$region=mysql_fetch_array(mysql_query("SELECT * FROM `region` WHERE `region_id` = '$count[region_id]'"));
echo "<a href='/mysiti.php?id=$count[region_id]&p=city&st=$count[city_id]&set'>$count[name]</a>($country[name],$region[name])n";
echo "</div>n";
}
if ($k_page>1)str("?id=$id_siti&",$k_page,$page); // Вывод страниц
}else{
$city2=mysql_fetch_array(mysql_query("SELECT * FROM `city` WHERE `name`='$_POST[city]' LIMIT 1"));
echo "<form method="post" action="?go">";
echo "Быстрый поиск города:<br/>";
echo "<input type="text" name="city" maxlength="40"/> </br>r";
echo "<input type="submit" value="Найти" />";
echo "</form>";
echo "шаг№1)Выбрать свою странуn";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `country`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)
{
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Нет результатовn";
echo " </td>n";
echo " </tr>n";
}
$q=mysql_query("SELECT * FROM `country` LIMIT $start, $set[p_str]");
while ($count = mysql_fetch_array($q))
{
if($num==1){
echo "<div class='rowdown'>";
$num=0;
}else{
echo "<div class='rowup'>";
$num=1;}
echo "<a href='/region.php?id=$count[country_id]'>$count[name]</a>n";
echo " </div>n";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
}
include_once 'sys/inc/tfoot.php';
?>