Файл: profi_wm/top/setup.php
Строк: 131
<?php
// by -=ШАХТЕР=- (waphp.ru - качай только тут)
include 'config.php';
//---------------------------------------------------------------
//---------------------------------------------------------------
if (empty($_POST['uid']) or empty($_POST['p']))
{
if (empty($_GET['uid']) or empty($_GET['p']))
{
header ("Location: admin.php");
exit;
}
else
{
$id=check($_GET['uid']);
$pass=check($_GET['p']);
}
}
else
{
$id=check($_POST['uid']);
$pass=check($_POST['p']);
}
$rows=mysql_fetch_assoc(mysql_query("SELECT * FROM top_users WHERE uid = '".$id."'"));
$result = mysql_query("SELECT pass FROM top_users WHERE uid=$id");
$row=mysql_fetch_row($result);
if(empty($row[0]))
{
$title='Вход : Паспорт';
include_once 'head.php';
echo "<div class="header">Вход</div>";
echo "".$div4."";
echo "Вы ввели неверный ID!<br/>";
echo "<a href='admin.php'>« назад</a><br/>n";
echo "</div>";
print ''.$div4.'<a href="'.$rating_url.'index.php">'.$site_name.'</a><img src="img/gt.gif" alt=">" />Вход</div>';
include "foot_code.php";
exit;
}
$tpass=$row[0];
if($tpass != md5($pass))
{
$title='Вход : Паспорт';
include_once 'head.php';
echo "<div class="header">Вход</div>";
echo "".$div4."";
echo "Вы ввели неверный пароль!<br/>";
echo "<a href='admin.php'>« назад</a><br/>n";
echo "</div>";
print ''.$div4.'<a href="'.$rating_url.'index.php">'.$site_name.'</a><img src="img/gt.gif" alt=">" />Вход</div>';
include "foot_code.php";
exit;
}
// дополнительные настройки
if (!empty($_GET['action']))
{
$title='Личный кабинет';
include_once 'head.php';
echo "<div class="header">Настройка вида счетчика</div>";
echo "".$div4."";
$action=$_GET['action'];
// получаем тип счетчика
$result = mysql_query("SELECT type FROM top_users WHERE uid=$id");
$row=mysql_fetch_row($result);
// выбор типа счетчика
if($action == "change")
{
echo "<form action='setup.php' method='get'>";
echo "<input type='hidden' name='uid' value='$id'/>";
echo "<input type='hidden' name='p' value='$pass'/>";
echo "<input type="hidden" name="".session_name()."" value="".session_id().""/>n";
echo "<input type='radio' ".(($row[0] == 5) ? "checked='checked'" : '')." name='type' value='5'/>Полный <a href='help.php?mod=full'>?</a><br/>";
echo "<input type='radio' ".(($row[0] == 3) ? "checked='checked'" : '')." name='type' value='3'/>Маленький <a href='help.php?mod=small'>?</a><br/>";
echo "<input type='radio' ".(($row[0] == 4) ? "checked='checked'" : '')." name='type' value='4'/>Оптимал <a href="help.php?mod=micro">?</a> <br/>";
echo "<input class='ibutnkn' type="submit" value="Сохранить" />";
echo "</form>";
}
// доп настройки
if($action == "setup")
{
$name = array("Полный","","Маленький","Оптимал","Полный");
echo "Ваш текуший вид счетчика:";
echo " ".$name[$row[0]-1]." <br/>";
if ($row[0]==1)
echo "Для данного вида не предусмотренны дополнительные настройки!<br/>";
else
{
echo "Выберите цвет счетчика:<br/>";
echo "<form action='setup.php' method='get'>";
echo "<input type='hidden' name='uid' value='$id'/>";
echo "<input type='hidden' name='p' value='$pass'/>";
echo "<input type="hidden" name="".session_name()."" value="".session_id().""/>n";
$result = mysql_query("SELECT typeStat FROM top_users WHERE uid=$id");
$typeData=mysql_fetch_row($result);
if($row[0]==3)
{
echo "<input type='radio' ".(($typeData[0] == 1) ? "checked='checked'" : '')." name='typeStat' value='1'/>1<img src="img/31.gif" alt="1"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 2) ? "checked='checked'" : '')." name='typeStat' value='2'/>2<img src="img/32.gif" alt="2"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 3) ? "checked='checked'" : '')." name='typeStat' value='3'/>3<img src="img/33.gif" alt="3"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 4) ? "checked='checked'" : '')." name='typeStat' value='4'/>4<img src="img/34.gif" alt="4"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 5) ? "checked='checked'" : '')." name='typeStat' value='5'/>5<img src="img/35.gif" alt="5"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 6) ? "checked='checked'" : '')." name='typeStat' value='6'/>6<img src="img/36.gif" alt="6"/><br/>";
}
if($row[0]==4)
{
echo "<input type='radio' ".(($typeData[0] == 1) ? "checked='checked'" : '')." name='typeStat' value='1'/>1<img src="img/41.gif" alt="1"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 2) ? "checked='checked'" : '')." name='typeStat' value='2'/>2<img src="img/42.gif" alt="2"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 3) ? "checked='checked'" : '')." name='typeStat' value='3'/>3<img src="img/43.gif" alt="3"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 4) ? "checked='checked'" : '')." name='typeStat' value='4'/>4<img src="img/44.gif" alt="4"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 5) ? "checked='checked'" : '')." name='typeStat' value='5'/>5<img src="img/45.gif" alt="5"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 6) ? "checked='checked'" : '')." name='typeStat' value='6'/>6<img src="img/46.gif" alt="6"/><br/>";
}
if($row[0]==5)
{
echo "<input type='radio' ".(($typeData[0] == 1) ? "checked='checked'" : '')." name='typeStat' value='1'/>1<img src="img/51.gif" alt="1"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 2) ? "checked='checked'" : '')." name='typeStat' value='2'/>2<img src="img/52.gif" alt="1"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 3) ? "checked='checked'" : '')." name='typeStat' value='3'/>3<img src="img/53.gif" alt="1"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 4) ? "checked='checked'" : '')." name='typeStat' value='4'/>4<img src="img/54.gif" alt="1"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 5) ? "checked='checked'" : '')." name='typeStat' value='5'/>5<img src="img/55.gif" alt="1"/><br/>";
echo "<input type='radio' ".(($typeData[0] == 6) ? "checked='checked'" : '')." name='typeStat' value='6'/>6<img src="img/56.gif" alt="1"/><br/>";
}
echo "<input class="btn" type="submit" value="Сохранить" />";
echo "</form>";
}
}
echo "</div>";
print ''.$div4.'<a href="'.$rating_url.'index.php">'.$site_name.'</a><img src="img/gt.gif" alt=">" />Личный кабинет</div>';
include "foot_code.php";
exit;
}
### Применение настроек
if(!empty($_GET['type']))
{
$type=check($_GET['type']);
if($type > 0 && $type < 6)
@mysql_query("UPDATE top_users SET type=$type WHERE uid=$id");
}
if(!empty($_GET['typeStat']))
{
$typeStat=check($_GET['typeStat']);
if($typeStat > 0 && $typeStat < 7)
@mysql_query("UPDATE top_users SET typeStat=$typeStat WHERE uid=$id");
}
$title='Личный кабинет';
include_once 'head.php';
echo "<div class="header">Настройки</div>";
echo "".$div4."";
echo "<img src="img/next.gif" alt=">" align="middle"/> <a href="setup.php?action=change&uid=$id&p=$pass">Выбрать вид счетчика</a><br/>";
echo "<img src="img/next.gif" alt=">" align="middle"/> <a href="setup.php?action=setup&uid=$id&p=$pass">Выбрать цвет счетчика</a><br/>";
echo "<a href='admin.php?email=".$rows['email']."&p=$pass&mod=list'>« назад</a><br/>n";
echo "</div>";
print ''.$div4.'<a href="'.$rating_url.'index.php">'.$site_name.'</a><img src="img/gt.gif" alt=">" />Личный кабинет</div>';
include "foot_code.php";
?>