Файл: test.masteram.us/adm_panel/city.php
Строк: 102
<?
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';
$temp_set=$set;
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/adm_check.php';
user_access('adm_set_user',null,'index.php?'.SID);
adm_check();
$set['title']='Добавление городов';
include_once '../sys/inc/thead.php';
title();
$count=intval($_POST['country']);
$reg=intval($_POST['regi']);
$siti=intval($_POST['siti']);
if (isset($_POST['save'])){
if (isset($_POST['siti']))
{
if ($_POST['siti']==NULL)msg ('Пустое поле');else{
if (preg_match('#[^A-zА-я0-9 _-=+()*?.,]#ui',$_POST['siti']))msg ('Используются запрещенные символы');
else{
$siti=$_POST['siti'];
mysql_query("INSERT INTO `city` (country_id,region_id, name) values('$re[country_id]', '$reg', '$siti')");
msg ('Изменения успешно приняты');
}}}
}else{
if (isset($_GET['act']) && $_GET['act']=='region')
{
echo "<form method='post' action='?$passgen'>n";
echo "Регион:<br />n";
echo "<select name="regi">n";
$q = mysql_query("SELECT * FROM `region` WHERE `country_id` = $count");
while ($region1 = mysql_fetch_assoc($q))
{
echo "<option value="$region1[region_id]">$region1[name]</option>n";
}
echo "</select><br />n";
echo "Добавить Город:<br />n<input type='text' name='siti' maxlength='80' /><br />n";
echo "<input type='submit' name='save' value='Добавить' />n";
echo "</form>n";
}else{
err();
aut();
echo "<form method="post" action="?act=region">n";
echo "Страна:<br />n";
echo "<select name="country">n";
$q2 = mysql_query("SELECT * FROM `country`");
while ($count = mysql_fetch_assoc($q2))
{
echo "<option value="$count[country_id]">$count[name]</option>n";
}
echo "</select><br />n";
echo "<input value="Дальше" type="submit" /><br />n";
echo "</form>n";
}}
if (user_access('adm_panel_show')){
echo "<div class='foot'>n";
echo "«<a href='/adm_panel/'>В админку</a><br />n";
echo "</div>n";
}
include_once '../sys/inc/tfoot.php';
?>