View file sdark.mobi/set/color.php

File size: 3.48Kb
<?
require_once '../core/system.php';
echo only_reg();
echo ban();
$header = 'Выбор цвета ника';
require_once H.'core/head.php';

if(empty($_POST['sb'])){
echo "<form action='/set/color' method='POST'>";
echo"<div class='head'>";
$s=time();
echo'<table width="100%" border="0" cellpadding="0" cellspacing="0" style="color:#E5CBB7;font-size:11px;">
<tbody>
<tr><td align="left">
';
echo'<input type="radio" name="sb" value="98A2AB" CHECKED /> <font color="98A2AB">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="FE2E2E" /> <font color="FE2E2E">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="186CD4" /> <font color="186CD4">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="yellow" /> <font color="yellow">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="grey" /> <font color="grey">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="lime" /> <font color="lime">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="Magenta" /> <font color="Magenta">'.$user['nick'].'</font><br />
</td><td align="center">
<input type="radio" name="sb" value="green" /> <font color="green">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="orange" /> <font color="orange">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="white" /> <font color="white">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="E2EA53" /> <font color="E2EA53">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="EA9953" /> <font color="EA9953">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="EA6953" /> <font color="EA6953">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="B0EA53" /> <font color="B0EA53">'.$user['nick'].'</font><br />
</td><td align="right">
<input type="radio" name="sb" value="53EA5A" /> <font color="53EA5A">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="53EAE0" /> <font color="53EAE0">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="53B7EA" /> <font color="53B7EA">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="A353EA" /> <font color="A353EA">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="E553EA" /> <font color="E553EA">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="A1A1A1" /> <font color="A1A1A1">'.$user['nick'].'</font><br />
<input type="radio" name="sb" value="E6EE52" /> <font color="E6EE52">'.$user['nick'].'</font><br /></td></tr></tr></tbody></table>';
echo'<div class="empty"></div>
<input class="inpc-ar form-submit" type="submit" value="Сменить" /></form></div>';
}

else{
if($user['gold']<500){header("location: /user/settings"); 
$_SESSION['err'] = 'Недостаточно золота';exit;}
$sb = check($_POST['sb']);
$rest = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Цвет ника'"),0);
if($rest==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Цвет ника', `time` = '".time()."', `kol`='500', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".time()."', `kol`=`kol`+'500', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Цвет ника'");}
mysql_query("UPDATE `user` SET `font` =  '$sb', `gold`=`gold`-500 WHERE `id` = '$user[id]' ");
header('Location: ?');
$_SESSION['message'] = 'Цвет ника успешно изменен!';
exit();
}


require_once H.'core/foot.php';
?>