<?php
$param_perc_bonus = mysql_fetch_assoc(mysql_query("SELECT * FROM `clan_buildings` WHERE `clan_id` = '".$clan['id']."' AND `type` = 'param_perc_bonus'"));
$param_bonus = $param_perc_bonus['bonus'];
$param_bonus = round($param_bonus/2);
$max_mana = $user['max_mana'];
$max_health = $user['max_health'];
$sila = $user['sila'];
$lovkost = $user['lovk'];
$zashita = $player['zashit'];
mysql_query("UPDATE `user` SET `bonus_mana` = `max_mana`/100*$param_bonus, `bonus_health` = `max_health`/100*$param_bonus, `bonus_sila` = `sila`/100*$param_bonus, `bonus_lovk` = `lovk`/100*$param_bonus, `bonus_zashit` = `zashit`/100*$param_bonus WHERE `id` = '".$user['id']."'");
mysql_query("UPDATE `user` SET `max_mana` = `max_mana`/100*$param_bonus+$max_mana, `max_health` = `max_health`/100*$param_bonus+$max_health, `sila` = `sila`/100*$param_bonus+$sila, `lovk` = `lovk`/100*$param_bonus+$lovkost, `zashit` = `zashit`/100*$param_bonus+$zashita WHERE `id` = '".$user['id']."'");
?>