Прикручиваем шаблон. Хороним идиотские ошибки.

This commit is contained in:
Igor Barkov (iwork) 2020-09-30 17:48:23 +03:00
parent 354499f885
commit 47147182fb

View File

@ -21,122 +21,114 @@ if (isset($user['id'])) {
include('./classes/battle_new.class.php'); include('./classes/battle_new.class.php');
$fbattle = new fbattle($user['battle']); $fbattle = new fbattle($user['battle']);
Template::header('fbattle');
?> ?>
<html> <script type="text/javascript" src="js/ZeroClipboard.js"></script>
<head> <script type="text/javascript" src="js/sl2.js"></script>
<link rel="stylesheet" href="css/main.css"> <script type="text/javascript" src="js/ch.js"></script>
<meta charset="utf-8"> <script src="js/tooltip.js"></script>
<script type="text/javascript" src="js/ZeroClipboard.js"></script> <link rel="stylesheet" type="text/css" href="css/tooltip.css"/>
<script type="text/javascript" src="js/sl2.js"></script> <script>
<script type="text/javascript" src="js/ch.js"></script> function refreshPeriodic() {
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>';//reload();
<script src="js/tooltip.js"></script> <?}?>
<link rel="stylesheet" type="text/css" href="css/tooltip.css"/> const timerID = setTimeout("refreshPeriodic()", 20000);
<SCRIPT> }
function refreshPeriodic() {
<?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>';//reload(); timerID = setTimeout("refreshPeriodic()", 20000);
<?}?> let Hint3Name = '';
const timerID = setTimeout("refreshPeriodic()", 20000);
function findlogin(title, script, name) {
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2>' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 100;
document.all(name).focus();
Hint3Name = name;
}
let attack = false;
let defend = false;
function check() {
if ((!attack) || (!defend)) {
alert('Блок или удар не выбран.');
return false;
} }
return true;
}
timerID = setTimeout("refreshPeriodic()", 20000); function Prv(logins) {
</SCRIPT> top.frames['bottom'].window.document.F1.text.focus();
<script> top.frames['bottom'].document.forms[0].text.value = logins + top.frames['bottom'].document.forms[0].text.value;
let Hint3Name = ''; }
function findlogin(title, script, name) { function setattack() {
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' + attack = true;
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2>' + }
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 100;
document.all(name).focus();
Hint3Name = name;
}
let attack = false; function setdefend() {
let defend = false; defend = true;
}
function check() { function refreshPeriodic() {
if ((!attack) || (!defend)) { <?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>'; <? } ?>
alert('Блок или удар не выбран.'); const timerID = setTimeout("refreshPeriodic()", 30000);
return false; }
}
return true;
}
function Prv(logins) { timerID = setTimeout("refreshPeriodic()", 30000);
top.frames['bottom'].window.document.F1.text.focus();
top.frames['bottom'].document.forms[0].text.value = logins + top.frames['bottom'].document.forms[0].text.value;
}
function setattack() { function checksubmit() {
attack = true; const ajaxload = 1;
} if (ajaxload > 0) {
let enemy =;
let batl =;
const tac_at = $('input[name=attack]:checked').val();
const att = "&attack=" + $('input[name=attack]:checked').val();
const def = $('input[name=defend]:checked').val();
function setdefend() { if (tac_at >= 1 && def >= 1) {
defend = true;
}
function refreshPeriodic() {
<?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>'; <? } ?>
const timerID = setTimeout("refreshPeriodic()", 30000);
}
timerID = setTimeout("refreshPeriodic()", 30000);
function checksubmit() {
const ajaxload = 1;
if (ajaxload > 0) {
let enemy =;
let batl =;
const tac_at = $('input[name=attack]:checked').val();
const att = "&attack=" + $('input[name=attack]:checked').val();
const def = $('input[name=defend]:checked').val();
if (tac_at >= 1 && def >= 1) {
$.ajax({
url: "fbattle.php",
type: "POST",
cache: false,
data: "batl=" + batl + "&myid=1053012363" + att + "&defend=" + def + "&enemy=" + enemy + "",
success: function (html) {
$("body").html(html);
}
});
} else {
alert('Выберите зону атаки и блока!');
$("#at").prop("disabled", false);
}
} else {
document.f1.submit();
}
}
$("document").ready(function () {
$('#refresh').click(function () {
$.ajax({ $.ajax({
url: "fbattle.php", url: "fbattle.php",
type: "POST",
cache: false, cache: false,
data: "batl=" + batl + "&myid=1053012363" + att + "&defend=" + def + "&enemy=" + enemy + "",
success: function (html) { success: function (html) {
$("body").html(html); $("body").html(html);
} }
}); });
}); } else {
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500}); alert('Выберите зону атаки и блока!');
}); $("#at").prop("disabled", false);
</script> }
<style type="text/css"> } else {
span { document.f1.submit();
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
text-decoration: none;
font-weight: bold;
cursor: pointer;
} }
</style> }
</head>
<body onLoad="top.setHP(<?= $user['hp'] ?>,<?= $user['maxhp'] ?>)"> $("document").ready(function () {
$('#refresh').click(function () {
$.ajax({
url: "fbattle.php",
cache: false,
success: function (html) {
$("body").html(html);
}
});
});
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});
});
</script>
<style type="text/css">
span {
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
text-decoration: none;
font-weight: bold;
cursor: pointer;
}
</style>
<div id="hint3" class="ahint"></div> <div id="hint3" class="ahint"></div>
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST" name="f1" id="f1"> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST" name="f1" id="f1">
<table width=100% cellspacing=0 cellpadding=0 border=0> <table width=100% cellspacing=0 cellpadding=0 border=0>
@ -542,12 +534,8 @@ $fbattle = new fbattle($user['battle']);
</td></tr> </td></tr>
</table> </table>
</form> </form>
<div id="oMenu" onmouseout="closeMenu()" <div id="oMenu" onmouseout="closeMenu()"
style="position: absolute; border: 1px solid #666; background-color: #CCC; display: none; "></div> style="position: absolute; border: 1px solid #666; background-color: #CCC; display: none; "></div>
</body>
</html>
<?php <?php
db::c()->query('UNLOCK TABLES'); db::c()->query('UNLOCK TABLES');
?> ?>