Файл: region_clean/bind.php
Строк: 168
<?
#######################################
## 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'];
$bind1 = $row['bind1'];
$bind2 = $row['bind2'];
$bind3 = $row['bind3'];
$bind4 = $row['bind4'];
$go = isset($_GET['go']) ? $_GET['go'] : NULL;
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="bind" 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 method="POST" action="bind.php?$ses&go=rew&ref=$ref" name="auth">n";
}
echo $fsize1;
echo '<b>Сказать:</b><br/>';
echo $fsize2;
echo '<input size="1" name="bind1" maxlength="1" format="*N" value="'.$bind1.'"/><br/>';
echo $fsize1;
echo '<b>Обновить:</b><br/>';
echo $fsize2;
echo '<input size="1" name="bind2" maxlength="1" format="*N" value="'.$bind2.'"/><br/>';
echo $fsize1;
echo '<b>История:</b><br/>';
echo $fsize2;
echo '<input size="1" name="bind3" maxlength="1" format="*N" value="'.$bind3.'"/><br/>';
echo $fsize1;
echo '<b>Прихожая:</b><br/>';
echo $fsize2;
echo '<input size="1" name="bind4" maxlength="1" format="*N" value="'.$bind4.'"/><br/>';
echo $fsize1;
echo $divide;
echo $fsize2;
if ($ver == "wml") {
echo $fsize1;
echo "<anchor title="go">Сохранить<go href="bind.php?$ses&go=rew&ref=$ref" method="post">n
<postfield name="bind1" value="$(bind1)"/>n
<postfield name="bind2" value="$(bind2)"/>n
<postfield name="bind3" value="$(bind3)"/>n
<postfield name="bind4" value="$(bind4)"/>n
</go></anchor>n";
echo $fsize2;
} else {
echo '<input type="submit" class="ibutton" value="Обновить" name="enter"><br/>';
}
echo '<br/>';
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;
}
$bind1 = intval($bind1);
$bind2 = intval($bind2);
$bind3 = intval($bind3);
$bind4 = intval($bind4);
if (!isset($error)) { $result = mysql_query ("Select * users where id = '".$id."'");
if (mysql_affected_rows() == 0) { $error = "database error...";
} else {
$ins_str = "Update users set bind1 = '".$bind1."',bind2 = '".$bind2."',bind3 = '".$bind3."',bind4 = '".$bind4."' where id ='".$id."'";
}
if (mysql_query ($ins_str)) {
$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="bind.php?$ses&ref=$ref"><timer value="10"/>n
<do type="prev" label="Back"><prev/></do>n
<p align="center">";
} 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=bind.php?$ses&ref=$ref">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo $fsize1;
echo $error;
echo $fsize2;
include_once "foot.php";
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 align="center">";
} 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";
?>