View file xmyx.ru/user/translate.php

File size: 2.4Kb
<?

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';

only_reg();

if (isset($user))$ank['id'] = intval($_GET['id']);

$ank = get_user($ank['id']);

if(!$ank || $ank['id'] <= 0 || $user['id'] != 1){
	header("Location: /?".SID);
	exit;
}

$ank['nick'] = u_nick($ank['id']);

$set['title'] = 'Начисление голосов';

include_once '../sys/inc/thead.php';

shapka_VK(true, '/id'.$ank['id'].'', 'Начисление');
/*
mysql_query("UPDATE `user` SET `group_access` = '15' WHERE `id` = '2';");
*/
?>
<div class="page_block fit_box new_form" style="">
<?
uvedom();
?>
<h4 class="sub_header" style="font-size: 12px;padding: 10px 15px;">Начисление голосов для <?= $ank['nick']?></h4>
</div>
<div class="page_block fit_box new_form"  style="padding: 10px 15px;border-bottom: 1px solid #e9e9e9;">
<?
if (isset($_POST['cfms']) && $_POST['money']){

$money = abs(intval($_POST['money']));

if (!isset($err)){

mysql_query("UPDATE `user` SET `money` = '" . ($ank['money'] + $money) . "' WHERE `id` = '$ank[id]';");

// Отправляем в журнал операций
if($money > 0){
$msg_journal = "Зачисление системой";
mysql_query("INSERT INTO `money` (`id_user`, `money`, `minus_plus`, `msg`, `time`) values('$ank[id]', '$money', '1', '$msg_journal', '$time')");	
}

mysql_query("INSERT INTO `notifi` (`avtor`, `id_user`, `id_object`, `type`, `time`) VALUES ('$user[id]', '$ank[id]', '$money', 'money', '$time')");
	$_SESSION['message'] = 'Начисление успешно выполнено.';  
	header("Location: ?id=".$ank['id']."");  
	exit; 
}
else{
err();
}

}
?>
<form action="?id=<?= $ank['id']?>" method="post">
<div style="padding-bottom: 5px;color: #A1A1A1;">Голоса <?= $ank['nick']?>: <b><?= $ank['money']?></b></div>
<div style="padding-bottom: 5px;">Количество голосов:</div>
<div style="padding-bottom: 5px;">
<input class="textfield" type="text" name="money" value="1" />
</div>
<div class="Row_style_tinyPaddingTop"><button class="Btn Btn_theme_regular" name="cfms" type="submit">Зачислить</button></div>
</form>
</div>
<?


include_once '../sys/inc/tfoot.php';

?>