Файл: new_fanland/second/res_s.php
Строк: 55
<?php
###########################
# Данная версия скрипта принадлежит #
# LiraS aka Артур Лукин Иванович #
# Вносить свои изменения крайне #
# запрещенно! #
###########################
function ab()
{
echo "<div class="main"><div class="in">"; pochta();
$u = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE usr = '".mysql_real_escape_string($_GET['usr'])."'"));
$id = strip_tags($u['id']);
$f = mysql_fetch_array(mysql_query("SELECT * FROM resurs WHERE u_id = '$id'"));
$food = strip_tags($f['food']);
$food_d = strip_tags($f['food_d']);
$food_time = strip_tags($f['food_time']);
$der = strip_tags($f['der']);
$der_d = strip_tags($f['der_d']);
$der_time = strip_tags($f['der_time']);
############
$n = mysql_fetch_array(mysql_query("SELECT * FROM people WHERE u_id = '$id'"));
$workers = strip_tags($n['workers']);
$lesorubi = strip_tags($n['lesorubi']);
$max_d = $workers*3;
$min_d = $workers*1.5;
$max_d = round($max_d);
$min_d = round($min_d);
####################
$max_dr = $lesorubi*3;
$min_dr = $lesorubi*1.5;
$min_dr = round($min_dr);
$max_dr = round($max_dr);
########################
if ($food_d == 'start')
{
echo 'Добыча еды: '.$min_d.'-'.$max_d.'<br>';
} else
{
echo 'Вы не добываете еду!<br>';
}
if ($der_d == 'start')
{
echo 'Добыча дерева: '.$min_dr.'-'.$max_dr.'<br>';
} else
{
echo 'Вы не добываете дерево!<br>';
}
echo '------<br>';
echo "<br/><a href="main.php?usr=$_GET[usr]&pwd=$_GET[pwd]">На главную</a>";
}
$db_connection = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db($db_table, $db_connection);
mysql_query('SET NAMES cp1251');
$exist = mysql_num_rows(mysql_query("SELECT usr, pwd FROM users WHERE usr = '".mysql_real_escape_string($_GET['usr'])."' AND pwd = '".mysql_real_escape_string($_GET['pwd'])."'"));
$online = mysql_num_rows(mysql_query("SELECT * FROM online WHERE laikas > '$timeout'"));
$year = date("Y.m.d");
$times = date("H:i");
$vremechko = "$year $times";
$subt = file_get_contents("max_on.dat");
$max = explode("|", $subt);
$max_onl = $max[0];
$max_on_time = $max[1];
if ($online >= $max_onl)
{
$fp55 = fopen("max_on.dat", 'w');
fwrite($fp55, "$online|$vremechko|");
fclose($fp55);
}
$set['title']='Статистика добычи ресов';
head();
title ();
if($exist == 1)
{
if($_GET['id'] == "")
{ab();}
}
else
{
echo "<div class="main"><div class="in">"; pochta();
echo "Вы не зарегистрированны!<br/>";
}
foot();
mysql_close($db_connection);
?>