Файл: region_clean/pers/index.php
Строк: 220
<?php
#######################################
## 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";
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>
<card id="pers" title="Персонаж">
<p>";
} 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">n";
}
$mode = (isset($_GET['mode'])) ? htmlspecialchars($_GET['mode']) : 0;
switch ($mode)
{
case 'head':
echo '<div class = "d1"><b>Выбор головы</b></div><br/>';
echo '<center>';
echo '<form action="index.php?'.$ses.'&mode=body" method="post">
<input name="head" type="radio" value="1"/><img src="./head/1.gif" alt="1"/> |
<input name="head" type="radio" value="2"/><img src="./head/2.gif" alt="2"/> |
<input name="head" type="radio" value="3"/><img src="./head/3.gif" alt="3"/> |
<input name="head" type="radio" value="4"/><img src="./head/4.gif" alt="4"/> |<br/>
<input name="head" type="radio" value="5"/><img src="./head/5.gif" alt="5"/> |
<input name="head" type="radio" value="6"/><img src="./head/6.gif" alt="6"/> |
<input name="head" type="radio" value="7"/><img src="./head/7.gif" alt="7"/> |
<input name="head" type="radio" value="8"/><img src="./head/8.gif" alt="8"/> |<br/>
<input name="head" type="radio" value="9"/><img src="./head/9.gif" alt="9"/> |
<input name="head" type="radio" value="10"/><img src="./head/10.gif" alt="10"/> |
<input name="head" type="radio" value="11"/><img src="./head/11.gif" alt="11"/> |
<input name="head" type="radio" value="12"/><img src="./head/12.gif" alt="12"/> |<br/>
<input name="head" type="radio" value="13"/><img src="./head/13.gif" alt="13"/> |
<input name="head" type="radio" value="14"/><img src="./head/14.gif" alt="14"/> |
<input name="head" type="radio" value="15"/><img src="./head/15.gif" alt="15"/> |
<input name="head" type="radio" value="16"/><img src="./head/16.gif" alt="16"/> |<br/>
<input name="head" type="radio" value="17"/><img src="./head/17.gif" alt="17"/> |
<input name="head" type="radio" value="18"/><img src="./head/18.gif" alt="18"/> |
<input name="head" type="radio" value="19"/><img src="./head/19.gif" alt="19"/> |
<input name="head" type="radio" value="20"/><img src="./head/20.gif" alt="20"/> |<br/>
<input name="head" type="radio" value="21"/><img src="./head/21.gif" alt="21"/> |
<input name="head" type="radio" value="22"/><img src="./head/22.gif" alt="22"/> |
<input name="head" type="radio" value="23"/><img src="./head/23.gif" alt="23"/> |
<input name="head" type="radio" value="24"/><img src="./head/24.gif" alt="24"/> |<br/>
<input name="head" type="radio" value="25"/><img src="./head/25.gif" alt="25"/> |
<input name="head" type="radio" value="26"/><img src="./head/26.gif" alt="26"/> |
<input name="head" type="radio" value="27"/><img src="./head/27.gif" alt="27"/> |
<input name="head" type="radio" value="28"/><img src="./head/28.gif" alt="28"/> |<br/>
<input name="head" type="radio" value="29"/><img src="./head/29.gif" alt="29"/> |
<input name="head" type="radio" value="30"/><img src="./head/30.gif" alt="30"/> |
<input name="head" type="radio" value="31"/><img src="./head/31.gif" alt="31"/> |
<input name="head" type="radio" value="32"/><img src="./head/32.gif" alt="32"/> |<br/>
<br/><input class="ibutton" type="submit" value="Выбрать"/><br/>
<br/><div class = "d1"><a href="../enter.php?'.$ses.'&ref='.$ref.'">Прихожая</a></div>
</form>';
echo '</center>';
break;
case 'body':
if (empty($head)) {
echo 'Ошибка! Не выбрана голова.<br/>';
break;
}
if (!is_numeric($head)) { header('Location: ../index.php?isset=403'); }
$head = abs(intval($_POST['head']));
if ($head < 0 or $head > 32) {
echo 'Ошибка!<br/>';
break;
}
echo '<div class = "d1"><b>Выбор тела</b></div><br/>
<center>
<img src="head/'.$head.'.gif" alt="'.$head.'"/><br/>
<form action="index.php?'.$ses.'&mode=result" method="post">
<input name="body" type="radio" value="1"/><img src="./body/1.gif" alt="1"/> |
<input name="body" type="radio" value="2"/><img src="./body/2.gif" alt="2"/> |
<input name="body" type="radio" value="3"/><img src="./body/3.gif" alt="3"/> |
<input name="body" type="radio" value="4"/><img src="./body/4.gif" alt="4"/> |<br/>
<input name="body" type="radio" value="5"/><img src="./body/5.gif" alt="5"/> |
<input name="body" type="radio" value="6"/><img src="./body/6.gif" alt="6"/> |
<input name="body" type="radio" value="7"/><img src="./body/7.gif" alt="7"/> |
<input name="body" type="radio" value="8"/><img src="./body/8.gif" alt="8"/> |<br/>
<input name="body" type="radio" value="9"/><img src="./body/9.gif" alt="9"/> |
<input name="body" type="radio" value="10"/><img src="./body/10.gif" alt="10"/> |
<input name="body" type="radio" value="11"/><img src="./body/11.gif" alt="11"/> |
<input name="body" type="radio" value="12"/><img src="./body/12.gif" alt="12"/> |<br/>
<input name="body" type="radio" value="13"/><img src="./body/13.gif" alt="13"/> |
<input name="body" type="radio" value="14"/><img src="./body/14.gif" alt="14"/> |
<input name="body" type="radio" value="15"/><img src="./body/15.gif" alt="15"/> |
<input name="body" type="radio" value="16"/><img src="./body/16.gif" alt="16"/> |<br/>
<input name="body" type="radio" value="17"/><img src="./body/17.gif" alt="17"/> |
<input name="body" type="radio" value="18"/><img src="./body/18.gif" alt="18"/> |
<input name="body" type="radio" value="19"/><img src="./body/19.gif" alt="19"/> |
<input name="body" type="radio" value="20"/><img src="./body/20.gif" alt="20"/> |<br/>
<input name="body" type="radio" value="21"/><img src="./body/21.gif" alt="21"/> |
<input name="body" type="radio" value="22"/><img src="./body/22.gif" alt="22"/> |
<input name="body" type="radio" value="23"/><img src="./body/23.gif" alt="23"/> |
<input name="body" type="radio" value="24"/><img src="./body/24.gif" alt="24"/> |<br/>
<input name="body" type="radio" value="25"/><img src="./body/25.gif" alt="25"/> |
<input name="body" type="radio" value="26"/><img src="./body/26.gif" alt="26"/> |
<input name="body" type="radio" value="27"/><img src="./body/27.gif" alt="27"/> |
<input name="body" type="radio" value="28"/><img src="./body/28.gif" alt="28"/> |<br/>
<input name="body" type="radio" value="29"/><img src="./body/29.gif" alt="29"/> |
<input name="body" type="radio" value="30"/><img src="./body/30.gif" alt="30"/> |
<input name="body" type="radio" value="31"/><img src="./body/31.gif" alt="31"/> |
<input name="body" type="radio" value="32"/><img src="./body/32.gif" alt="32"/> |<br/>
<input name="body" type="radio" value="33"/><img src="./body/33.gif" alt="33"/> |
<input name="body" type="radio" value="34"/><img src="./body/34.gif" alt="34"/> |<br/>
<input type="hidden" name="head" value="'.$head.'"/>
<br/><input class="ibutton" type="submit" value="Выбрать"/><br/>
<br/><div class = "d1"><a href="index.php?'.$ses.'&mode=head">Выбор головы</a><br/>
<a href="../enter.php?'.$ses.'&ref='.$ref.'">Прихожая</a></div>
</form>';
echo '</center>';
break;
case 'result':
if (empty($body)) {
echo 'Ошибка! Не выбрано туловище.<br/>';
break;
}
if (!is_numeric($head) or !is_numeric($body)) { header('Location: ../index.php?isset=403'); }
$head = abs(intval($_POST['head']));
if ($head < 0 or $head > 32) {
echo 'Ошибка!<br/>';
break;
}
$body = abs(intval($_POST['body']));
if ($body < 0 or $body > 34) {
echo 'Ошибка!<br/>';
break;
}
echo '<div class = "d1"><b>Твой персонаж</b></div><br/>
<center>
<img src="rezult/'.$body.'-'.$head.'.gif" alt="."/><br/>
</center>
<br/><form action="index.php?'.$ses.'&mode=save" method="post">
<input type="hidden" name="head" value="'.$head.'"/>
<input type="hidden" name="body" value="'.$body.'"/>
<input class="ibutton" type="submit" value="Сохранить"/></form>
<form action="index.php?'.$ses.'&mode=head" method="post">
<input class="ibutton" type="submit" value="Сначала"/></form>
<form action="index.php?'.$ses.'&mode=del" method="post">
<input class="ibutton" type="submit" value="Удалить"/></form>
<div class="d1"><a href="../enter.php?'.$ses.'&ref='.$ref.'">Прихожая</a></div>';
break;
default:
echo 'Для выбора персонажа,
выбери последовательно голову и тело, затем,
если тебя устроит результат, сохрани его или же начни сборку сначала.<br/>';
echo '<br/><a href="index.php?'.$ses.'&mode=head">Go</a><br/>
<br/><div class = "d1"><a href="../enter.php?'.$ses.'&ref='.$ref.'">Прихожая</a></div>';
break;
case 'save':
$body = intval($body);
$head = intval($head);
if (
mysql_query("UPDATE `users` SET `pbody`='$body',`phead`='$head' WHERE `id`='$id'"))
{
echo 'Персонаж успешно сохранен!<br/>';
} else {
echo 'Произошла ошибка!<br/>';
}
echo '<br/><div class="d1"><a href="../enter.php?'.$ses.'&ref='.$ref.'">Прихожая</a></div>';
break;
case 'del':
if (empty($row['phead']) and empty($row['pbody'])) {
echo 'Ошибка! Персонаж не установлен.<br/>';
}
elseif (mysql_query("UPDATE `users` SET `phead`='', `pbody`='' WHERE `id`='$id'"))
{
echo 'Персонаж успешно удален!<br/>';
} else {
echo 'Произошла ошибка!<br/>';
}
break;
}
include_once '../foot.php';
?>