Файл: public_html/klan/adm_panel/balls.php
Строк: 93
<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
$set['title'] = 'Админка';
include_once '../../sys/inc/thead.php';
title();
aut();
$id = intval($_GET['id']);
$us = mysql_fetch_array(mysql_query("SELECT * FROM `clan_user` WHERE `id_user` = '$user[id]' AND `id_clan` = '$id' LIMIT 1"));
if($us['level']==2){
echo "<div class='p_t'><center><img src='/klan/img/01.png'/></center></div>";
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id` = '$id' LIMIT 1"));
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".intval($_GET['user'])."' LIMIT 1"));
if (isset($_POST['balls']))
{
$balls=intval($_POST['balls']);
if ($balls > $clan['bank']) {$err='Недостаточно баллов в банке клана';}
else{
mysql_query("UPDATE `user` SET `balls` = '".($ank['balls']+$balls)."' WHERE `id` = '$ank[id]' LIMIT 1");
mysql_query("UPDATE `clan` SET `bank` = '".($clan['bank']-$balls)."' WHERE `id` = '$id' LIMIT 1");
mysql_query("INSERT INTO `clan_jurnal` (`id_clan`, `msg`, `time`) values('$id', 'Пользователю [url=/info.php?id=$ank[id]]$ank[nick][/url] выдано [b]".$balls."[/b] баллов из банка клана!', '$time')");
mysql_query("INSERT INTO `jurnal` (`id_kont`, `msg`, `time`) values('$ank[id]', 'Вам начислено [b]".$balls."[/b] баллов от администрации клан [b]$clan[name][/b]!', '$time')");
}
}
err();
echo "<div class='p_m'>n";
echo "<form method="post" action="?id=$id&user=$ank[id]">n";
echo "Колличесво баллов:<br />n";
echo "Доступно: $clan[bank]<br />n";
echo "<input type='text' name='balls' value=''/><br />n";
echo "<input value="Выдать" type="submit" />n";
echo "</form>n";
echo "</div>n";
echo "<img src='/klan/img/nazad.png'/> | <a href='index.php?id=$id'>Админка </a><br/>n";
echo "</div>n";
}
include '../inc/foot.php';
include_once '../../sys/inc/tfoot.php';
?>