Рефакторинг html.

This commit is contained in:
Ivor Barhansky 2023-07-19 16:33:33 +03:00
parent 89a8c47471
commit 059b8e9579

View File

@ -1,5 +1,9 @@
<?php <?php
use Core\Config;
use Core\ConversionHelper;
use Core\Db;
if (!defined('GAME')) { if (!defined('GAME')) {
die(); die();
} }
@ -15,71 +19,32 @@ if (date("H") >= 8 && date("H") <= 23) {
$tattack = ''; $tattack = '';
} }
?> function getBtc(int $id)
<script>
<?php
if (date("H") < 23 || date("H") >= 6) {
?>
function AtackNoWindow() {
var dt = document.getElementById('atackDiv');
if (dt.style.display == 'none') {
dt.style.display = '';
} else {
dt.style.display = 'none';
}
}
<?php
}
?>
</script>
<?php
function timeOut($ttm): string
{ {
$out = ''; $res = Db::getValue('select res_x from stats where id = ?', [$id]);
$time_still = $ttm; if (!$res) {
$tmp = floor($time_still / 2592000); $res = 0;
$id = 0;
if ($tmp > 0) {
$id++;
if ($id < 3) {
$out .= $tmp . " мес. ";
}
$time_still = $time_still - $tmp * 2592000;
} }
$tmp = floor($time_still / 86400); return $res;
if ($tmp > 0) { }
$id++;
if ($id < 3) { ?>
$out .= $tmp . " дн. "; <?php if (date("H") < 23 || date("H") >= 6): ?>
<script>
function AtackNoWindow() {
var dt = document.getElementById('atackDiv');
if (dt.style.display == 'none') {
dt.style.display = '';
} else {
dt.style.display = 'none';
}
} }
$time_still = $time_still - $tmp * 86400; </script>
} <?php endif; ?>
$tmp = floor($time_still / 3600);
if ($tmp > 0) {
$id++;
if ($id < 3) {
$out .= $tmp . " ч. ";
}
$time_still = $time_still - $tmp * 3600;
}
$tmp = floor($time_still / 60);
if ($tmp > 0) {
$id++;
if ($id < 3) {
$out .= $tmp . " мин. ";
}
}
if ($out == '') {
if ($time_still < 0) {
$time_still = 0;
}
$out = $time_still . ' сек.';
}
return $out;
} ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td width="250" valign="top"> <td style="width: 250px; vertical-align: top;">
<?php $usee = $u->getInfoPers($u->info['id'], 0); <?php $usee = $u->getInfoPers($u->info['id'], 0);
if ($usee) { if ($usee) {
echo $usee[0]; echo $usee[0];
@ -87,208 +52,140 @@ function timeOut($ttm): string
echo 'information is lost.'; echo 'information is lost.';
} ?> } ?>
</td> </td>
<td width="230" valign="top" style="padding-top:19px;"><?php require_once('modules_data/stats_loc.php'); ?></td> <td style="vertical-align: top; padding-top:19px;"><?php require_once('modules_data/stats_loc.php'); ?></td>
<td width="230" valign="top" style="padding-top:19px;"> <td style="width: 500px; vertical-align: top; text-align: right;">
<span style="font-size:12px;"> <div style="text-align: right">
</span> <?php if (!empty($re)) {
</td> echo '<b style="color: red;">' . $re . '</b>';
<td valign="top"> } ?>
<div align="right"> <div style="position:relative; cursor: pointer;" id="ione">
<table border="0" cellpadding="0" cellspacing="0"> <img src="<?= Config::img() ?>/city/capitalcity/<?= $now; ?>/city_capres1.jpg" alt="" name="img_ione" width="580" height="312" border="1" id="img_ione"/>
<tr align="right" valign="top"> <div id="buttons_on_image" style="cursor:pointer; font-weight:bold; color:#D8D8D8; font-size:10px;">
<td> <?= $tattack; ?>
<?php if (!empty($re)) { &nbsp;
echo '<b style="color: red;">' . $re . '</b>'; <span onclick="window.open('/forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')">Форум проекта</span>
} ?> </div>
<table width="500" border="0" cellspacing="0" cellpadding="0"> <script>
<tr> if (document.getElementById('ione')) {
<td> document.getElementById('ione').appendChild(document.getElementById('buttons_on_image'));
<div style="position:relative; cursor: pointer;" id="ione"> document.getElementById('buttons_on_image').style.position = 'absolute';
<img document.getElementById('buttons_on_image').style.bottom = '8px';
src="//img.new-combats.tech/city/capitalcity/<?= $now; ?>/city_capres1.jpg" document.getElementById('buttons_on_image').style.right = '23px';
alt="" name="img_ione" width="580" height="312" border="1" } else {
id="img_ione"/> document.getElementById('buttons_on_image').style.display = 'none';
<div id="buttons_on_image" }
style="cursor:pointer; font-weight:bold; color:#D8D8D8; font-size:10px;"> </script>
<?= $tattack; ?> <div style="position:absolute; left:150px; top:40px; width:236px; height:157px; z-index:90;">
&nbsp; <img <?php thisInfRm('1.180.0.3'); ?> src="<?= Config::img() ?>/i/images/300x225/capital/2klub.gif" width="236" height="157" class="aFilter" alt="">
<span </div>
onclick="window.open('/forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')">Форум проекта</span> <div style="position: absolute; left: 459px; top: 155px; width: 79px; height: 88px; z-index: 91;">
&nbsp; <img <?php thisInfRm('1.180.0.371'); ?> src="<?= Config::img() ?>/city/capitalcity/day/loto.gif" width="86" height="63" class="aFilter" alt="">
</div> </div>
<script language="javascript" type="text/javascript"> <div style="position: absolute; left: 125px; top: 165px; width: 73px; height: 47px; z-index: 91;">
<!-- <img <?php thisInfRm('1.180.0.10'); ?> src="<?= Config::img() ?>/i/images/300x225/capital/2shop.gif" width="73" height="47" class="aFilter" alt="">
if (document.getElementById('ione')) { </div>
document.getElementById('ione').appendChild(document.getElementById('buttons_on_image')); <div style="position: absolute; left: 270px; top: 158px; width: 71px; height: 45px; z-index: 91;">
document.getElementById('buttons_on_image').style.position = 'absolute'; <img <?php thisInfRm('1.180.0.210'); ?> src="<?= Config::img() ?>/i/images/300x225/capital/2remont.gif" width="71" height="45" class="aFilter" alt="">
document.getElementById('buttons_on_image').style.bottom = '8px'; </div>
document.getElementById('buttons_on_image').style.right = '23px';
} else {
document.getElementById('buttons_on_image').style.display = 'none';
}
-->
</script>
<div
style="position:absolute; left:150px; top:40px; width:236px; height:157px; z-index:90;">
<img <?php thisInfRm('1.180.0.3'); ?>
src="//img.new-combats.tech/i/images/300x225/capital/2klub.gif"
width="236" height="157" class="aFilter"/></div>
<div
style="position: absolute; left: 459px; top: 155px; width: 79px; height: 88px; z-index: 91;">
<img <?php thisInfRm('1.180.0.371'); ?>
src="//img.new-combats.tech/city/capitalcity/day/loto.gif"
class="aFilter" width="86" height="63"/></div>
<div
style="position: absolute; left: 125px; top: 165px; width: 73px; height: 47px; z-index: 91;">
<img <?php thisInfRm('1.180.0.10'); ?>
src="//img.new-combats.tech/i/images/300x225/capital/2shop.gif"
width="73" height="47" class="aFilter"/></div>
<div
style="position: absolute; left: 270px; top: 158px; width: 71px; height: 45px; z-index: 91;">
<img <?php thisInfRm('1.180.0.210'); ?>
src="//img.new-combats.tech/i/images/300x225/capital/2remont.gif"
width="71" height="45" class="aFilter"/></div>
<?php <?php
$btc = mysql_fetch_array( if (ConversionHelper::secondsToTimeout(getBtc(89489) - time()) == '0 сек.'): ?>
mysql_query('SELECT * FROM `stats` WHERE `id` = 89489 LIMIT 1') <div style="position:absolute; left:300px; top:168px; width:27px; height:55px; z-index:99;">
); <img onclick="location.href='main.php?atak_user=89489'" src="<?= Config::img() ?>/i/images/300x225/capital/jora1.png"
if (isset($btc['id'])) { width="120" height="135" title="Напасть на Слабого Трупожора" alt="">
if (timeOut($btc['res_x'] - time()) == '0 сек.') { </div>
?> <?php endif; ?>
<div
style="position:absolute; left:300px; top:168px; width:27px; height:55px; z-index:99;">
<img onclick="location.href='main.php?atak_user=89489'"
src="//img.new-combats.tech/i/images/300x225/capital/jora1.png"
width="120" height="135"
title="Напасть на Слабого Трупожора"/></div>
<?php }
} ?>
<?php <?php
$btc = mysql_fetch_array( if (ConversionHelper::secondsToTimeout(getBtc(903093) - time()) == '0 сек.'): ?>
mysql_query('SELECT * FROM `stats` WHERE `id` = 903093 LIMIT 1') <div style="position:absolute; left:100px; top:175px; width:27px; height:55px; z-index:99;">
); <img onclick="location.href='main.php?atak_user=903093'" src="<?= Config::img() ?>/i/images/300x225/capital/jora2.png"
if (isset($btc['id'])) { width="120" height="150" title="Напасть на Сильного Трупожора" alt="">
if (timeOut($btc['res_x'] - time()) == '0 сек.') { </div>
?> <?php endif; ?>
<div
style="position:absolute; left:100px; top:175px; width:27px; height:55px; z-index:99;">
<img onclick="location.href='main.php?atak_user=903093'"
src="//img.new-combats.tech/i/images/300x225/capital/jora2.png"
width="120" height="150"
title="Напасть на Сильного Трупожора"/></div>
<?php }
} ?>
<?php if (date('d.m') == '31.10' || (date('m') == 11 && date('d') < 7)): /* Хэллоуин */ ?>
<?php if (date('d.m') == '31.10' || (date('m') == 11 && date( <div style="position: absolute; left: 219px; top: 171px; width: 32px; height: 43px; z-index: 91;">
'd' <img onclick="location.href='main.php?talk=5'" title="Диалог с Тыквоголовым"
) < 7)) { /* Хэллоуин */ ?> src="<?= Config::img() ?>/loca/cp11/sun_pmd.gif" width="32" height="43" class="aFilter" alt="">
<div </div>
style="position: absolute; left: 219px; top: 171px; width: 32px; height: 43px; z-index: 91;"> <?php endif;
<img onclick="location.href='main.php?talk=5'" if (date('m') == 12 || date('m') == 1): /*Ёлка*/ ?>
title="Диалог с Тыквоголовым" <div style="position: absolute; left: 212px; top: 133px; width: 32px; height: 43px; z-index: 91;">
src="//img.new-combats.tech/loca/cp11/sun_pmd.gif" width="32" <img <?php thisInfRm('1.180.0.208'); ?>src="<?= Config::img() ?>/newyear2014.png" width="60"
height="43" class="aFilter"/></div> height="90" title="" class="aFilter" alt="">
<?php } </div>
if (date('m') == 12 || date('m') == 1) {/*Ёлка*/ ?> <?php endif; ?>
<div <div style="position:absolute; left:33px; top:180px; width:92px; height:62px; z-index:92;">
style="position: absolute; left: 212px; top: 133px; width: 32px; height: 43px; z-index: 91;"> <img <?php thisInfRm('1.180.0.14'); ?>onclick="alert('Не работает. Находится на реконструкции.')"
<img <?php thisInfRm('1.180.0.208'); ?> onMouseOver="this.className='aFilterhover';"
src="//img.new-combats.tech/newyear2014.png" width="60" onMouseOut="this.className='aFilter';"
height="90" title="" class="aFilter"/></div> src="<?= Config::img() ?>/city/capitalcity/day/2vokzal.gif" width="92" height="62" class="aFilter" alt="">
<?php } ?> </div>
<div <div style="position:absolute; left:535px; top:225px; width:30px; height:54px; z-index:94;">
style="position:absolute; left:33px; top:180px; width:92px; height:62px; z-index:92;"> <img <?php thisInfRm('1.180.0.11'); ?>src="<?= Config::img() ?>/i/images/300x225/capital/2strelka.gif"
<img <?php thisInfRm('1.180.0.14'); ?> width="30" height="54" class="aFilter" alt="">
onclick="alert('Не работает. Находится на реконструкции.')" </div>
onMouseOver="this.className='aFilterhover';" <div style="position:absolute; left:14px; top:225px; width:30px; height:54px; z-index:910;">
onMouseOut="this.className='aFilter';" <img src="<?= Config::img() ?>/i/images/300x225/capital/3strelka.gif" width="30" height="53" <?php thisInfRm('1.180.0.323'); ?> class="aFilter" alt="">
src="//img.new-combats.tech/city/capitalcity/day/2vokzal.gif" </div>
width="92" height="62" class="aFilter"/></div> <div id="snow"></div>
<div <?= $goline; ?>
style="position:absolute; left:535px; top:225px; width:30px; height:54px; z-index:94;"> </div>
<img <?php thisInfRm('1.180.0.11'); ?> <?php
src="//img.new-combats.tech/i/images/300x225/capital/2strelka.gif" if (date("H") < 6 || date("H") >= 22): ?>
width="30" height="54" class="aFilter"/></div> <div id="atackDiv" style="display:none; text-align: center;">
<div <div style="width:300px; padding:3px; margin:7px; background-color:#CCCCCC; border:1px solid #575757;">
style="position:absolute; left:14px; top:225px; width:30px; height:54px; z-index:910;"> <form method="post" action="/main.php"> Введите логин жертвы:<br/>
<img src="//img.new-combats.tech/i/images/300x225/capital/3strelka.gif" <input name="atack" type="text" id="atack" size="35" maxlength="30"/>
width="30" height="53" <input type="submit" name="button" id="button" class="btn" value="OK"/>
<?php thisInfRm('1.180.0.323'); ?>class="aFilter"/></div> </form>
<div id="snow"></div> </div>
<?= $goline; ?> </div>
</div> <?php endif; ?>
</td> <!-- -->
</tr> <div style="width:580px; text-align:left; background-color:#D3D3D3;">
</table> <span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<?php <img src="<?= Config::img() ?>/i/move/links.gif" width="9" height="7" alt="">&nbsp;
if (date("H") < 6 || date("H") >= 22) { <a href="#" class="menutop" id="greyText" onclick="location='main.php?loc=1.180.0.3&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.3', 1); ?>">
?> Бойцовский Клуб
<div align="center" id="atackDiv" style="display:none;"> </a>
<form method="post" action="main.php"> </span>
<table width="300" border="0" cellspacing="0" cellpadding="0"> <span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<tr> <img src="<?= Config::img() ?>/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<td> <a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.323&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.323', 1); ?>">
<div Парковая Улица
style="width:300px; padding:3px; margin:7px; background-color:#CCCCCC; border:1px solid #575757;"> </a>
Введите логин жертвы:<br/> </span>
<input name="atack" type="text" id="atack" size="35" <span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
maxlength="30"/> <img src="<?= Config::img() ?>/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<input type="submit" name="button" id="button" class="btn" <a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.10&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.10', 1); ?>">
value="OK"/> Магазин
</div> </a>
</td> </span>
</tr> <span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
</table> <img src="<?= Config::img() ?>/i/move/links.gif" width="9" height="7" alt="">&nbsp;
</form> <a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.210&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.210', 1); ?>">
</div> Ремонтная Мастерская
<?php </a>
} </span>
?> <span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<!-- --> <img src="<?= Config::img() ?>/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<div style="width:580px; text-align:left; background-color:#D3D3D3;"> <a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.11&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.11', 1); ?>">
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img Страшилкина Улица
src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/>&nbsp;<a </a>
href="#" class="menutop" id="greyText" </span>
onclick="location='main.php?loc=1.180.0.3&rnd=<?= $code; ?>';" <span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
title="<?php thisInfRm('1.180.0.3', 1); ?>">Бойцовский Клуб</a></span> <img src="<?= Config::img() ?>/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img <a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.14&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.14', 1); ?>">
src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/>&nbsp;<a Вокзал
href="#" id="greyText" class="menutop" </a>
onclick="location='main.php?loc=1.180.0.323&rnd=<?= $code; ?>';" </span>
title="<?php thisInfRm('1.180.0.323', 1); ?>">Парковая Улица</a></span> </div>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img <!-- -->
src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/>&nbsp;<a <div style="display:none; height:0;" id="moveto"></div>
href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=1.180.0.10&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.10', 1); ?>">Магазин</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img
src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/>&nbsp;<a
href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=1.180.0.210&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.210', 1); ?>">Ремонтная Мастерская</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img
src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/>&nbsp;<a
href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=1.180.0.11&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.11', 1); ?>">Страшилкина Улица</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img
src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/>&nbsp;<a
href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=1.180.0.14&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.14', 1); ?>">Вокзал</a></span>
</div>
<!-- -->
<div style="display:none; height:0px " id="moveto"></div>
</td>
<td></td>
</tr>
</table>
<HR> <HR>
<BR><?= $rowonmax; ?><BR> <BR><?= $rowonmax; ?><BR>
</div> </div>
</td> </td>
</tr> </tr>