Файл: extraction.php
Строк: 29
<?php
require 'sys/sid.php';
require 'sys/config.php';
include 'sys/user.php';
include 'sys/head.php';
visit(0, 'extraction');
$ext = mysql_fetch_assoc(mysql_query("SELECT id, level FROM construct WHERE user = '$user[id]' AND cid = '1' LIMIT 1"));
$ext2 = mysql_fetch_assoc(mysql_query("SELECT id, level FROM construct WHERE user = '$user[id]' AND cid = '2' LIMIT 1"));
$ext3 = mysql_fetch_assoc(mysql_query("SELECT id, level FROM construct WHERE user = '$user[id]' AND cid = '3' LIMIT 1"));
$ext4 = mysql_fetch_assoc(mysql_query("SELECT id, level FROM construct WHERE user = '$user[id]' AND cid = '4' LIMIT 1"));
$ext5 = mysql_fetch_assoc(mysql_query("SELECT id, level FROM construct WHERE user = '$user[id]' AND cid = '5' LIMIT 1"));
$numArmy = mysql_fetch_assoc(mysql_query("SELECT SUM(lot) AS num FROM duty WHERE user = '$user[id]' AND timeleft < '$rtime' AND done = '0'"));
$consuming = ceil($numArmy['num'] / 100 * 5);
if ($ext['level'] == 1) $a1 = 300;
else $a1 = 300 * $ext['level'];
if ($ext2['level'] == 1) $a2 = 300;
else $a2 = 300 * $ext2['level'];
if ($ext3['level'] == 1) $a3 = 300;
else $a3 = 300 * $ext3['level'];
if ($ext4['level'] == 1) $a4 = 300;
else $a4 = 300 * $ext4['level'];
if ($ext5['level'] == 1) $a5 = 300;
else $a5 = 300 * $ext5['level'];
echo 'Добыча/час<br/>
<img src="images/res.1.png" alt="Еда"/> ' . (isset($ext['id']) ? $a1 : 3) . '
<br/>
<img src="images/res.2.png" alt="Дерево"/> ' . (isset($ext3['id']) ? $a3 : 3) . '
<br/>
<img src="images/res.3.png" alt="Камень"/> ' . (isset($ext4['id']) ? $a4 : 3) . '
<br/>
<img src="images/res.4.png" alt="Руда"/> ' . (isset($ext2['id']) ? $a2 : 3) . '
<br/>
<img src="images/res.5.png" alt="Золото"/> ' . (isset($ext5['id']) ? $a5 : 3) . '
<br/>
<br/>
Расходы/час<br/>
<img src="images/res.1.png" alt="Еда"/> <span style="color:#ff3030;">' . (isset($ext['level']) ? $consuming : 0) . '</span><br/>';
echo '<a href="index.php">На главную</a>';
include 'sys/foot.php';
?>