Просмотр поста #534502: У Вас есть один вопрос? - Тогда задайте его тут! new!

.
Str@nnik

Alexis22,

click (+/-)
ini_set("max_execution_time", "600");
define('_IN_JOHNCMS', 1);

$headmod = 'panel';
$textl = 'Бонус фентези';
require_once ('../incfiles/core.php');
require_once ('../incfiles/head.php');
 
if ($rights < 9) {
    header('Location: http://meneger.org/');
    exit;
}

$users = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '$id'"));
 
if (isset($_POST['submit'])) {
    $bonus = isset($_POST['bonus2']) ? abs(intval($_POST['bonus2'])) : 0;

    mysql_query("UPDATE `users` SET `balans1` = `balans1` + $bonus WHERE `id` = '$id'");
    header('location: /manag/index.php');
    exit;
}
else {
    echo '<div class="gmenu"><b>Бонус</b></div>'
        . '<div class="c"><p>Фентези: <b>' . $users['balans1'] . '</b></p></div>'
        . '<div class="c"><p>'
        . '<form action="bonus2.php?id=' . $id . '" method="post">'
        . '<input type="text" value="0" name="bonus2" size="5" maxlength="3"/>'
        . '<input type="submit" value="Начислить" name="submit" />'
        . '</form></p></div>';
}
 
require_once ('../incfiles/end.php');