Просмотр файла sdark.mobi/core/fit.php

Размер файла: 5.16Kb
<?php
print'<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://www.w3.org/1999/XSL/Transform">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>'.$header.'</title>
<link rel="stylesheet" href="http://'.$set['site'].'/style/style.css" type="text/css"/>
<link rel="apple-touch-icon" href="/images/icon/apple-touch-icon.png">
<link rel="icon" href="/favicon.ico" type="image/x-icon"/></head><body>';

$setgame = mysql_fetch_array(mysql_query("SELECT * from `setgame`"));
$tm = $_SERVER['REQUEST_TIME'];

if($_SESSION['pumpit_id'] > 0){

$widgets = $pumpit->getWidgets($_SESSION['p_sid']);
print $widgets['header'];
}

if(isset($user['id'])){
$level = file(H."data/ex.txt");
$exp = trim($level[$user['level']+1]);
$exp_gold = (5 + $user['level'])*100;
$k_new = mysql_result(mysql_query("SELECT COUNT(id) FROM `users_konts` WHERE `id_user` = '".$user['id']."' AND `new_msg`"),0);


if($setgame['obnova']<1 || $user['prava']>3){
if($user['level']<120){
	print"<div class='exp_bar'><div class='progress' style='width:".round(100/($exp/($user['exp'])))."%'></div></div>";
	} else {
?>
	<div class='exp_bar'><div class='progress' style='width:0%'></div></div>
<?
	}
?>
<div class='head left' ><span class='normal'><font color='BAC1C8'>
<?

$gold = floor($user['gold'] / 100);

if($user['gold'] < 100){
print'<img src="/images/icon/silver.png">'.$user['gold'].'';
}
if($user['gold'] >= 100){
print'<img src="/images/icon/gold.png">'.$gold.'';
}
$hp = $user['max_health'] / 2;
if($user['health'] > $hp){
print' <img src="/images/icon/hp.png">';
}
if($user['health'] <= $hp and $user['health'] > 0){
print' <img src="/images/icon/hp2.png">';
}
if($user['health'] <=0 ){
print' <img src="/images/icon/hp3.png">';
}

print''.$user['health'].' ';




$req = mysql_query("SELECT `usr` from `def_bat` where `usr` = '".$user['id']."'");
$avttto = mysql_num_rows($req);
if($avttto > 0){
	
if($setgame['fight']==0  or $setgame['def_bat'] < $tm){
	
$recharge = $setgame['def_time']-$_SERVER['REQUEST_TIME'];
} else {
$recharge = $setgame['def_bat']-$_SERVER['REQUEST_TIME'];
}

if($recharge < 600){
$de = date(''.i.':'.s.'', ''.$recharge.'');
echo' <div class="float-right">
 <img src="/images/icon/dead.png" width="15" height="15"><font color="CDCDCD">'.$de.' </font> </div> ';
}
}

}
}
if(isset($user['id'])){
if($k_new > 0){
echo'</div>
<div class="line"></div>
<div class="news">
<a class="news-close" href="?msg_read"></a>
<a class="news-sms" href="/user/new_mess"><img src="/images/icon/mail.png"> <font color="D2D2D2">Новое сообщение ('.$k_new.')</font></a>
</div>';
}	
if(isset($_SESSION['light'])){
print '</div><div class="mini-line"></div><div class="block_light center">'.$_SESSION['light'].'</div>';
$_SESSION['light']=NULL;
}

if($user['exp'] >= $exp and $user['level']<120){

mysql_query("update `user` set `level` = '".($user['level']+1)."',`exp`='0',`gold`='".($user['gold']+$exp_gold)."',`health`='".($user['max_health'])."' where (`id` = '".$user['id']."') LIMIT 1");
$l=$user['level']+1;
$_SESSION['light'] = "<font color='#FE642E'>Вы получили ".$l." уровень!</font><div class='empty'></div><span class='blue'>Ваша награда:</span> <img src='/images/icon/gold.png' alt=''/> ".($exp_gold/100)." </div>";
header('location: ?'); exit; 
}
}

if(isset($_SESSION['message'])){
	
print "</div><div class='mini-line'></div><div class='ok center'><div class='empty'></div><img src='/images/icon/ok.png'> ".$_SESSION['message']."<div class='empty'></div></div>";
$_SESSION['message']=NULL;
}
if (isset($_SESSION['err'])){
	
print "</div><div class='mini-line'></div><div class='error center'><img src='/images/icon/error.png'> ".$_SESSION['err']."</div>";
$_SESSION['err']=NULL;
}



if($setgame['obnova']<1 || $user['prava']>3){
	
if($_SERVER['PHP_SELF']!='/index.php'){
	
print '</div><div class="mini-line"></div><div class="player title"><font size="3">'.$header.'</font></div><div class="mini-line"></div>';

}
}

if($setgame['obnova']==1 && $user['prava']<3){
?>
</div><div class='line'></div><div class='temn'><center><div class='player title'><font size='3'>Игра недоступна</font> </div><div class='mini-line'></div>
<center><img src='/images/main.jpg' width='100%'></center></div><div class='line'></div><div class='foot grey'><center>В данный момент идёт обновление и улучшение игры. <br/>Зайдите позже или обновите страницу через несколько минут.</center>
</div><div class='line'></div><div class='but-list'><center><a href='?'><img src='/images/icon/reload.png' alt='*'/>Обновить</a></div></font></center>
<div class='px'></div><div class='menu'><div class='center'>
<div style='text-shadow: 0 1px 0 #000;font-size: 12px;
color:#757575; text-align: center;padding: 5px;'><div class='empty'></div>
<?
 print"  ".date("H:i:s")." <div class='empty'></div> Сила Тьмы © 2015, 16+ 
</div>";
if($_SESSION['pumpit_id']>0){
	
require_once(H.'pumpitapi/pumpit-class.php');

$widgets = $pumpit->getWidgets($_SESSION['p_sid']);
print $widgets['footer'];
}
exit;
}


?>