Вход Регистрация
Файл: modules/edit_ank.php
Строк: 89
<?

////////////////////////////////////////
///// Kyber ApiCMS 2013 apicms.ru //////
///// Запрещается продажа данной CMS ///
///// Автор Евгений Медянкин Kyber /////
///// ICQ 626-000-895 или 37-22-47 /////
////////////////////////////////////////

////////////////////////////////////////
$title 'Редактирование аккаунта';
require_once 
'../api_core/apicms_system.php';
require_once 
'../design/styles/'.htmlspecialchars($api_design).'/head.php';
////////////////////////////////////////
if (!$user['id']) header('location: /');

$my_sets mysql_real_escape_string($_POST['set_theme']);
///////////////////////////////////
if (isset($_POST['save'])){
///////////////////////////////////
if (isset($_POST['name']) && preg_match('/[A-zА-я0-9 _-=+()*?.,]/i'$_POST['name'])){
$nameus mysql_real_escape_string($_POST['name']);
mysql_query("UPDATE `users` SET `name` = '$nameus' WHERE `id` = '$user[id]' LIMIT 1");
}
///////////////////////////////////
if (isset($_POST['set_theme']) && preg_match('#^([A-z0-9-_()]+)$#ui'$_POST['set_theme']) && is_dir(H.'design/styles/'.$_POST['set_theme'])){
mysql_query("UPDATE `users` SET `style` = '$my_sets' WHERE `id` = '$user[id]' LIMIT 1");
}
///////////////////////////////////
if (isset($_POST['email']) && preg_match('/[0-9a-z_-]+@[0-9a-z_-^.]+.[a-z]{2,6}/i'$_POST['email'])){
$mailus mysql_real_escape_string($_POST['email']);
mysql_query("UPDATE `users` SET `email` = '$mailus' WHERE `id` = '$user[id]' LIMIT 1");
}
///////////////////////////////////
if (isset($_POST['surname']) && preg_match('/[A-zА-я0-9 _-=+()*?.,]/i'$_POST['surname'])){
$surnameus mysql_real_escape_string($_POST['surname']);
mysql_query("UPDATE `users` SET `surname` = '$surnameus' WHERE `id` = '$user[id]' LIMIT 1");
}
///////////////////////////////////
if (isset($_POST['country']) && preg_match('/[A-zА-я0-9 _-=+()*?.,]/i'$_POST['country'])){
$countryus mysql_real_escape_string($_POST['country']);
mysql_query("UPDATE `users` SET `country` = '$countryus' WHERE `id` = '$user[id]' LIMIT 1");
}
///////////////////////////////////
if (isset($_POST['city']) && preg_match('/[A-zА-я0-9 _-=+()*?.,]/i'$_POST['city'])){
$cityus mysql_real_escape_string($_POST['city']);
mysql_query("UPDATE `users` SET `city` = '$cityus' WHERE `id` = '$user[id]' LIMIT 1");
}
///////////////////////////////////
echo '<div class="apicms_content"><center>Изменения в анкету внесены</center></div>';
}
////////////////////////////////////////
echo "<form method='post' action='?ok'>n";
///////////////////////////////////
echo '<div class="apicms_subhead">';
echo 
"Ваше имя: </br> <input type='text' name='name' value='".htmlentities($user['name'], ENT_QUOTES'UTF-8')."'  /><br />n";
echo 
'</div>';
///////////////////////////////////
echo '<div class="apicms_subhead">';
echo 
"Ваша фамилия: </br> <input type='text' name='surname' value='".htmlentities($user['surname'], ENT_QUOTES'UTF-8')."'  /><br />n";
echo 
'</div>';
///////////////////////////////////
echo '<div class="apicms_subhead">';
echo 
"Ваша страна: </br> <input type='text' name='country' value='".htmlentities($user['country'], ENT_QUOTES'UTF-8')."'  /><br />n";
echo 
'</div>';
///////////////////////////////////
echo '<div class="apicms_subhead">';
echo 
"Ваш город: </br> <input type='text' name='city' value='".htmlentities($user['city'], ENT_QUOTES'UTF-8')."'  /><br />n";
echo 
'</div>';
///////////////////////////////////
echo '<div class="apicms_subhead">';
echo 
"Оформление  <br/><select name='set_theme'>n";
$opendirthem=opendir(H.'design/styles');
while (
$themes_set=readdir($opendirthem)){
if (
$themes_set=='.' || $themes_set=='..' || !is_dir(H."design/styles/$themes_set"))continue;
echo 
"<option value='$themes_set'>".trim(file_get_contents(H.'design/styles/'.$themes_set.'/them.name'))."</option>n";
}
closedir($opendirthem);
echo 
"</select><br />n";
echo 
'</div>';
///////////////////////////////////
echo '<div class="apicms_subhead">';
echo 
"E-mail: <br/><input type='text' name='email' value='".htmlentities($user['email'], ENT_QUOTES'UTF-8')."'  /><br />n";
echo 
'</div>';
///////////////////////////////////
echo "<div class='apicms_subhead'><center><input type='submit' name='save' value='Сохранить' /></center></div>n";
////////////////////////////////////////
require_once '../design/styles/'.htmlspecialchars($api_design).'/footer.php';
?>
Онлайн: 1
Реклама