Файл: region_clean/emo.php
Строк: 173
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once "start.php";
require_once "sid.php";
header("Cache-Control: no-cache");
if ($ver == "wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");
require_once "inc.php";
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require_once "version.php";
$us = $row['user'];
if (!isset($go)) {
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="emo" title="Мои эмоции">n
<p>n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Мои эмоции</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">
<form action="emo.php?$ses&go=rew&ref=$ref" method="post">n";
}
echo $fsize1;
echo '<b>Дополнительные настройки:</b><br/>';
echo $divide;
echo '<b>Эмоции:</b><br/>';
echo $fsize2;
echo '<select name="selemoc">';
if ($row['selemoc'] == "1") {
echo '<option value="1">Включены</option>
<option value="0">Выключены</option>';
} else {
echo '<option value="0">Выключены</option>
<option value="1">Включены</option>';
}
echo '</select><br/>';
echo $fsize1;
echo '<b>Личные эмоции:</b><br/>';
echo $divide;
echo $fsize2;
echo '<select name="emocmenu">';
if ($row['emocmenu'] == "1") {
echo '<option value="1">Да</option>
<option value="0">Нет</option>';
} else {
echo '<option value="0">Нет</option>
<option value="1">Да</option>';
}
echo '</select><br/>';
echo $fsize1;
echo 'Личные эмоции:<br/>';
echo $fsize2;
for($i = 1; $i <= 10; $i++) {
$emoc = "emoc" . $i;
$emocname = $row["emoc".$i];
echo $fsize1;
echo $i.")n";
echo $fsize2;
echo "<input name="$emoc" maxlength="12" value="$emocname"/><br/>";
}
echo $fsize1;
echo $divide;
echo $fsize2;
if ($ver == "wml") {
echo $fsize1;
echo "<anchor title="go">Сохранить<go href="emo.php?$ses&go=rew&ref=$ref" method="post">n
<postfield name="selemoc" value="$(selemoc)"/>n
<postfield name="emocmenu" value="$(emocmenu)"/>n
<postfield name="emoc1" value="$(emoc1)"/>n
<postfield name="emoc2" value="$(emoc2)"/>n
<postfield name="emoc3" value="$(emoc3)"/>n
<postfield name="emoc4" value="$(emoc4)"/>n
<postfield name="emoc5" value="$(emoc5)"/>n
<postfield name="emoc6" value="$(emoc6)"/>n
<postfield name="emoc7" value="$(emoc7)"/>n
<postfield name="emoc8" value="$(emoc8)"/>n
<postfield name="emoc9" value="$(emoc9)"/>n
<postfield name="emoc10" value="$(emoc10)"/>n
</go></anchor>n";
echo $fsize2;
echo '<br/>';
} else {
echo '<input type="submit" class="ibutton" value="Сохранить"/></form>';
}
echo $fsize1;
echo $divide;
echo "<div class = 'd1'><a href="cabinet.php?$ses&ref=$ref">Личный кабинет</a><br/>n
<a href="enter.php?$ses&ref=$ref">Прихожая</a></div>n";
echo $fsize2;
include_once "foot.php";
exit;
}
if ($row['translit'] == 1) {
$emoc1 = trun_to_rus($emoc1);
$emoc2 = trun_to_rus($emoc2);
$emoc3 = trun_to_rus($emoc3);
$emoc4 = trun_to_rus($emoc4);
$emoc5 = trun_to_rus($emoc5);
$emoc6 = trun_to_rus($emoc6);
$emoc7 = trun_to_rus($emoc7);
$emoc8 = trun_to_rus($emoc8);
$emoc9 = trun_to_rus($emoc9);
$emoc10 = trun_to_rus($emoc10);
}
$emoc1 = mysql_real_escape_string(check($emoc1));
$emoc2 = mysql_real_escape_string(check($emoc2));
$emoc3 = mysql_real_escape_string(check($emoc3));
$emoc4 = mysql_real_escape_string(check($emoc4));
$emoc5 = mysql_real_escape_string(check($emoc5));
$emoc6 = mysql_real_escape_string(check($emoc6));
$emoc7 = mysql_real_escape_string(check($emoc7));
$emoc8 = mysql_real_escape_string(check($emoc8));
$emoc9 = mysql_real_escape_string(check($emoc9));
$emoc10 = mysql_real_escape_string(check($emoc10));
$selemoc = mysql_real_escape_string(check($selemoc));
$emocmenu = abs(intval($emocmenu));
$emp = "Неправильный формат данных!";
if (!preg_match("!^[0-9]+$!i",$emocmenu)) { $error = $emp; }
elseif (!preg_match("!^[0-9]+$!i",$selemoc)) { $error = $emp; }
if (!isset($error)) {
if (mysql_query ("Update users set selemoc = '".$selemoc."', emocmenu = '".$emocmenu."', emoc1 = '".$emoc1."', emoc2 = '".$emoc2."', emoc3 = '".$emoc3."', emoc4 = '".$emoc4."', emoc5 = '".$emoc5."', emoc6 = '".$emoc6."', emoc7 = '".$emoc7."', emoc8 = '".$emoc8."', emoc9 = '".$emoc9."', emoc10 = '".$emoc10."' where id ='$id'")) {
$msg = "Твои настройки изменены!";
} else {
$error = " ".mysql_error()." ";
}
}
mysql_close($link);
if (isset($error)) {
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<card id="error" title="error" ontimer="emo.php?$ses&ref=$ref"><timer value="10"/>n
<do type="prev" label="Back"><prev/></do>n
<p>n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ошибка</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=emo.php?$ses&ref=$ref">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo $fsize1;
echo "<b>$error</b>n";
echo $fsize2;
if ($ver == "wml") echo "</p></card></wml>n";
else echo "</div></body></html>n";
exit;
}
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<card id="ok" title="Ok!" ontimer="cabinet.php?$ses&ref=$ref"><timer value="10"/>n
<p>n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок!</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=cabinet.php?$ses&ref=$ref">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo $fsize1;
echo $msg;
echo $fsize2;
include_once "foot.php";
?>