- Баллы
- 173
Прошу скинуть)
Или вот код, которая имеется.
Или вот код, которая имеется.
Код:
<?php require_once( 'db_con.php' ); error_reporting(0);
public static function proceedTextual( $numeric, $one, $two, $many)
{
$numeric = (int) abs($numeric);
if ( (numeric % 100 == 1 || ($numeric % 100 > 20) && ( $numeric % 10 == 1 ) ) return $one;
if ( $numeric % 100 == 2 || ($numeric % 100 > 20) && ( $numeric % 10 == 2 ) ) return $two;
if ( $numeric % 100 == 3 || ($numeric % 100 > 20) && ( $numeric % 10 == 3 ) ) return $two;
if ( $numeric % 100 == 4 || ($numeric % 100 > 20) && ( $numeric % 10 == 4 ) ) return $two;
return $many;
}
?>
<html>
<head>
<title>Голодные Игры :: Статистика</title>
<style>
@import url(style.css);
</style>
<script type="text/javascript">
function search(str)
{
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","pages/search.php?player="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<div id="page">
<div id="wrap">
<div id="header">
<div id="topbar">
<ul>
<li>
<a href="http://mc-sg.org/forum">Главная</a>
</li>
<li>
<a href="index.php?page=player">Поиск игроков</a>
</li>
<li>
<a href="index.php?page=leaderboard">Доска почета</a>
</li>
<li>
<a href="index.php?page=gamehistory">Архив</a>
</li>
</div>
</div>
<div id="main">
<div id="page-title">
</div>
<div id="main-content">
<?php include (!isset($_GET['page'])?'pages/home.php' : 'pages/'.$_GET['page'].'.php'); ?>
</div>
</div>
<div id="footer">
<?php
$sql = 'SELECT count(*) as tplayed, sum(time) as ttime, sum(points) as tpoints, count(DISTINCT player) as tplayers FROM '.$dbprefix.'playerstats';
$sql2 = 'SELECT count(*) as games FROM '.$dbprefix.'gamestats';
$result = mysql_fetch_array(mysql_query($sql));
$result2 = mysql_fetch_array(mysql_query($sql2));
echo mysql_error();
echo '<center>'.number_format($result2['games']).' '.proceedTextual(number_format($result2['games']),"игра","игры","игр").' сыграно '.number_format($result['tplayers']).' '.proceedTextual(number_format($result['tplayers'])),"игроком","игроками","игроками").', которые сыграли '.number_format($result['tplayed']).' раз за ';
$day = round($result['ttime']/ 86400000,2);
echo $day . ' '.proceedTextual($day,"день","дня","дней").' и набрали '.number_format($result['tpoints']). ' '.proceedTextual(number_format($result['tpoints']),"очко","очка","очков");
?>
</div>
</div>
</div>
</body>
</html>