<?php

define('_IN_JOHNCMS', 1);

if (!$act) {
echo '<div class="phdr">Clash Royale</div>';
} else {
echo '<div class="phdr"><a href="index.php">Clash Royale</a></div>';
}


$usr = mysql_fetch_assoc(mysql_query("SELECT * FROM `cr_users` WHERE `uid` = ".$user_id." "));
if($usr['skill'] >= $usr['lvlup']){
    mysql_query("UPDATE `cr_users` SET `lvl` = `lvl` + 1 WHERE `uid` = '".$user_id."'");
    mysql_query("UPDATE `cr_users` SET `skill` = `skill` - `lvlup` WHERE `uid` = '".$user_id."'");
    mysql_query("UPDATE `cr_users` SET `lvlup` = `lvlup` * 2 WHERE `uid` = '".$user_id."'");
}

echo '<div class="list2"><big><b>Уровень:</b> '.$usr['lvl'].' | Опыт : '.$usr['skill'].'/'.$usr['lvlup'].'</big>'.
'<br/><big><b>Монеты :</b> '.$usr['money'].'</big>'.
'<br/><big><b>Кристаллы :</b> '.$usr['gems'].'</big>'.
'<br/><big><b>Короны :</b> '.$usr['coron'].'</big>'.
'<br/><big><b>Арена :</b> '.$usr['arena'].'</big></div>';

if(!$usr && $headmod != 'cr|reg'){
header('Location: /cr/reg.php');
}

?>