View file sdark.mobi/set/empire.php

File size: 1.58Kb
<?
require_once'../core/system.php';
echo only_reg();
echo ban();
$header='Смена империи';
require_once'../core/head.php';
if(isset($_GET['yes'])){
if($user['plem']=='ogn'){$plem='mol';}
if($user['plem']=='mol'){$plem='ogn';}
if($user['gold']<10000){$_SESSION['err'] = 'Недостаточно золота'; header("location: /user/settings"); exit;}
if($user['clan']>0){$_SESSION['err'] = 'Вы находитесь в клане'; header("location: /user/settings"); exit;}

$_SESSION['message'] = 'Империя успешно изменена';
$time=time();
mysql_query("UPDATE `user` set `gold` = `gold` - '10000', `plem`='$plem' where `id` = '".$user['id']."' limit 1");
mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Империя', `time` = '".$time."', `kol`='10000', `kto`='-'");
header("location: /user/settings"); 
}
echo "</div><div class='foot center'><table  class='d-grey' width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>";
echo '<div class="inpc-ar"><div class="empty2"></div>Вы уверены, что хотите сменить империю за <img src="/images/icon/gold.png">100?</div><div class="empty2"></div>
<td width="40%"><a class="big-but" href="/set/empire?yes"><div class="imgwrap"><img src="/images/icon/ok.png"></div>Сменить империю</a></td>';
echo '<td width="40%"><a class="big-but" href="/user/settings/"><div class="imgwrap"><img src="/images/icon/error.png"></div>Отмена</a></td></tbody></table></div></div>';
echo "</div>";
require_once'../core/foot.php';
?>