2022-06-06 21:30:34 +00:00
|
|
|
<?php
|
2023-06-08 18:33:56 +00:00
|
|
|
|
|
|
|
use Core\Config;
|
|
|
|
use Location\Loto;
|
|
|
|
use Model\ActionModel;
|
|
|
|
|
|
|
|
if (!defined('GAME')) {
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($u->room['file'] != 'loto') {
|
|
|
|
return;
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
2023-06-08 18:33:56 +00:00
|
|
|
$loto = new Loto();
|
|
|
|
$am = new ActionModel($u->info['id']);
|
|
|
|
|
|
|
|
$titm = $am->getLastByVals($u->room['file']);
|
|
|
|
|
|
|
|
if ($_GET['get'] == '20' && isset($titm['id']) && $u->info['money2'] > 5) {
|
|
|
|
$u->info['money2'] = $u->info['money2'] - 5;
|
|
|
|
$u->addEkr(-5);
|
|
|
|
$am->deleteByVals($u->room['file']);
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
$titm = $am->getLastByValsAndTime($u->room['file'], 24 * 60 * 60);
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
?>
|
2023-06-08 18:33:56 +00:00
|
|
|
<TABLE width="100%" cellspacing="0" cellpadding="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top" id="centerBlockLoto">
|
|
|
|
<div align="center" class="pH3"><h1>Ежедневная Бесплатная Рулетка</h1></div>
|
|
|
|
<br/>
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
<div id="winDiv">
|
2023-01-10 16:29:32 +00:00
|
|
|
<p class="testDiv">Ваш приз: <span id="win"></span></p>
|
2022-06-06 21:30:34 +00:00
|
|
|
<div id="imgWin"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="wraper">
|
|
|
|
<div class="arrowup"></div>
|
|
|
|
<div class="arrowdown"></div>
|
|
|
|
<div class="window">
|
|
|
|
<ul class="list"></ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p style="text-align: center">
|
2023-06-08 18:33:56 +00:00
|
|
|
<?php if (!$titm): ?>
|
|
|
|
<button class="buttonRuletka" formmethod="get">Запустить игру!</button>
|
|
|
|
<?php else: ?>
|
|
|
|
<button class="buttonRuletka" disabled formmethod="get">
|
|
|
|
Приходите Завтра!
|
|
|
|
</button>
|
|
|
|
<?php endif; ?>
|
|
|
|
<button class="buttonsElements">Предметы и шансы</button>
|
2022-06-06 21:30:34 +00:00
|
|
|
<div id="tableItemChange" hidden>
|
|
|
|
<table>
|
|
|
|
<tr>
|
2023-01-10 16:29:32 +00:00
|
|
|
<th colspan="2">Предмет</th>
|
|
|
|
<th>Шанс выпадения</th>
|
2022-06-06 21:30:34 +00:00
|
|
|
</tr>
|
2023-06-08 18:33:56 +00:00
|
|
|
<?= $loto->getPrizeListByRarity() ?>
|
2022-06-06 21:30:34 +00:00
|
|
|
</table>
|
|
|
|
</div>
|
2023-06-08 18:33:56 +00:00
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
2022-06-06 21:30:34 +00:00
|
|
|
<script>
|
2023-06-08 18:33:56 +00:00
|
|
|
let img = "<?= Config::get('img2') ?>/i/items";
|
|
|
|
let prizesArray = <?= json_encode($loto->getPrizes()) ?>;
|
|
|
|
let arrLiImg = [];
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-06-08 18:33:56 +00:00
|
|
|
prizesArray.forEach(function (elem, key) {
|
|
|
|
arrLiImg.push(`<li><img src="${img}/${elem[0]}" title="${elem[1]}" alt="${elem[1]}" type="id${key}"></li>`);
|
|
|
|
});
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-06-08 18:33:56 +00:00
|
|
|
let ulImg = document.getElementsByClassName("list")[0]
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-06-08 18:33:56 +00:00
|
|
|
let finallyLiImg = arrLiImg.sort(() => 0.5 - Math.random())
|
2022-06-06 21:30:34 +00:00
|
|
|
|
2023-06-08 18:33:56 +00:00
|
|
|
for (let key of finallyLiImg) {
|
|
|
|
let htmlElementsMessage = new DOMParser().parseFromString(key, "text/html").getElementsByTagName("li")[0]
|
|
|
|
ulImg.append(htmlElementsMessage)
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var $button = document.getElementsByClassName("buttonRuletka")[0]
|
|
|
|
var $winWindow = document.getElementById("winDiv")
|
|
|
|
var $win = document.getElementById("win")
|
|
|
|
var $wrapper = document.getElementsByClassName("wraper")[0]
|
|
|
|
var $imgWin = document.getElementById("imgWin")
|
|
|
|
|
|
|
|
$wrapper.style.marginTop = "110px"
|
|
|
|
$winWindow.hidden = true
|
|
|
|
|
2023-06-08 18:33:56 +00:00
|
|
|
var timeOutWin
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
$(".list li").clone().appendTo(".list");
|
|
|
|
}
|
|
|
|
$button.onclick = async function () {
|
|
|
|
|
|
|
|
$wrapper.style.marginTop = "110px"
|
|
|
|
|
|
|
|
if (timeOutWin) {
|
|
|
|
clearTimeout(timeOutWin)
|
|
|
|
$imgWin.innerHTML = ""
|
|
|
|
$winWindow.hidden = true
|
|
|
|
}
|
|
|
|
|
|
|
|
$imgWin.innerHTML = ""
|
2023-01-10 16:29:32 +00:00
|
|
|
$button.textContent = "Ожидание..."
|
2022-06-06 21:30:34 +00:00
|
|
|
$button.disabled = true
|
|
|
|
|
2023-03-31 18:30:14 +00:00
|
|
|
var response = await fetch("/lotowork.php", {
|
2022-06-06 21:30:34 +00:00
|
|
|
method: "POST",
|
2023-06-08 18:33:56 +00:00
|
|
|
body: <?= $u->info['id'] ?>
|
2022-06-06 21:30:34 +00:00
|
|
|
})
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
$('.window').css({
|
|
|
|
right: "0"
|
|
|
|
})
|
|
|
|
$('.list li').css({
|
|
|
|
border: '4px solid transparent'
|
|
|
|
})
|
|
|
|
|
2022-12-19 18:26:14 +00:00
|
|
|
var textFromResponse = await response.text()
|
|
|
|
var resultRegexp = textFromResponse.match(/\b[0-9]{0,2}\b/);
|
|
|
|
var idItem = '';
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-12-19 18:26:14 +00:00
|
|
|
if (resultRegexp && resultRegexp[0] && resultRegexp[0] >= 0 && resultRegexp[0] <= 29) {
|
|
|
|
idItem = resultRegexp[0];
|
|
|
|
} else {
|
2023-01-10 16:29:32 +00:00
|
|
|
return ($button.textContent = 'Ошибка, нажмите F5!');
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var elemRul = 0
|
|
|
|
var $winImg
|
|
|
|
|
|
|
|
for (var i = 60; i < 90; i++) {
|
2023-04-08 15:14:19 +00:00
|
|
|
if ($('.list li:eq(' + i + ')')[0].children[0].getAttribute("type") == `id${idItem}`) {
|
2022-06-06 21:30:34 +00:00
|
|
|
elemRul = $('.list li:eq(' + i + ')')[0].children[0].offsetLeft
|
|
|
|
$winImg = $('.list li:eq(' + i + ')')[0]
|
|
|
|
}
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
$('.window').animate({
|
|
|
|
right: elemRul - 452.5
|
|
|
|
}, 10000, () => {
|
2023-06-08 18:33:56 +00:00
|
|
|
setTimeout(() => {
|
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
var idThing = $winImg.children[0].getAttribute("type")
|
|
|
|
var titleThing = $winImg.children[0].getAttribute("title")
|
|
|
|
$wrapper.style.marginTop = "0px"
|
|
|
|
$winWindow.hidden = false
|
|
|
|
|
|
|
|
|
2023-01-10 16:29:32 +00:00
|
|
|
$button.textContent = "Приходите завтра!"
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
$win.textContent = titleThing
|
|
|
|
|
|
|
|
var $img = document.createElement("img")
|
|
|
|
$img.src = $winImg.children[0].getAttribute("src")
|
|
|
|
$imgWin.append($img)
|
2023-06-08 18:33:56 +00:00
|
|
|
|
|
|
|
timeOutWin = setTimeout(() => {
|
2022-06-06 21:30:34 +00:00
|
|
|
$imgWin.innerHTML = ""
|
|
|
|
$winWindow.hidden = true
|
|
|
|
$wrapper.style.marginTop = "110px"
|
|
|
|
}, 10000)
|
|
|
|
}, 300)
|
|
|
|
})
|
2023-06-08 18:33:56 +00:00
|
|
|
// });
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var $buttonsElements = document.getElementsByClassName("buttonsElements")[0]
|
|
|
|
var $tableItemChange = document.getElementById("tableItemChange")
|
|
|
|
|
|
|
|
$buttonsElements.onclick = function (event) {
|
2022-12-19 18:26:14 +00:00
|
|
|
var contentIsHidden = $tableItemChange.hidden;
|
|
|
|
|
|
|
|
$tableItemChange.hidden = !contentIsHidden;
|
2023-01-10 16:29:32 +00:00
|
|
|
event.target.textContent = !contentIsHidden ? 'Предметы и шансы' : 'Скрыть шансы';
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
#centerBlockLoto {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
* {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
li {
|
|
|
|
list-style: none;
|
|
|
|
display: inline-block;
|
|
|
|
float: left;
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
#tableItemChange table {
|
2023-06-08 18:33:56 +00:00
|
|
|
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
|
2022-06-06 21:30:34 +00:00
|
|
|
font-size: 14px;
|
|
|
|
text-align: center;
|
|
|
|
margin: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
#tableItemChange table td, th {
|
|
|
|
border-style: solid;
|
|
|
|
border-width: 1px;
|
|
|
|
border-collapse: collapse;
|
|
|
|
border-color: rgb(47, 1, 1);
|
|
|
|
padding: 3px 5px;
|
2023-06-08 18:33:56 +00:00
|
|
|
}
|
2022-06-06 21:30:34 +00:00
|
|
|
|
|
|
|
#tableItemChange table tr th {
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#tableItemChange {
|
|
|
|
text-align: center;
|
|
|
|
border: 1px solid #1a96bf;
|
|
|
|
width: 70%;
|
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.buttonsElements {
|
|
|
|
font-size: 17px;
|
|
|
|
padding: 5px;
|
|
|
|
width: 200px;
|
|
|
|
border: 1px solid #1a96bf;
|
|
|
|
background: rgba(182, 114, 4, 0.3);
|
|
|
|
}
|
|
|
|
|
|
|
|
.window {
|
|
|
|
padding: 5px 0;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
width: 25000px;
|
|
|
|
height: 82px;
|
2023-06-08 18:33:56 +00:00
|
|
|
right: 0;
|
2022-06-06 21:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.wraper {
|
|
|
|
position: relative;
|
|
|
|
margin: auto;
|
|
|
|
width: 982px;
|
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: hidden;
|
|
|
|
border: 4px solid #1a96b7;
|
|
|
|
border-radius: 2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.list {
|
|
|
|
position: relative;
|
|
|
|
margin-left: 0;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.list li {
|
|
|
|
border: 4px solid transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.list li img {
|
|
|
|
width: 75px;
|
|
|
|
height: 75px;
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
.arrowup {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 487.5px;;
|
|
|
|
z-index: 1;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
border-bottom: 20px solid #1a96bf;
|
|
|
|
border-left: 5px solid transparent;
|
|
|
|
border-right: 5px solid transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.arrowdown {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 487.5px;;
|
|
|
|
z-index: 1;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
border-top: 20px solid #1a96bf;
|
|
|
|
border-left: 5px solid transparent;
|
|
|
|
border-right: 5px solid transparent;
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
.buttonRuletka {
|
|
|
|
font-size: 17px;
|
|
|
|
padding: 5px;
|
|
|
|
width: 200px;
|
|
|
|
border: 1px solid #1a96bf;
|
|
|
|
background: rgba(0, 149, 25, 0.33);
|
|
|
|
margin: 10px 0;
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
.buttonRuletka:hover, .buttonsElements:hover {
|
|
|
|
background: rgba(0, 102, 149, 0.33);
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
#winDiv {
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 3px;
|
|
|
|
border: 1px solid #000;
|
|
|
|
width: auto;
|
|
|
|
margin: 10px auto 5px;
|
|
|
|
padding: 7px;
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
.testDiv {
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
2023-06-08 18:33:56 +00:00
|
|
|
|
2022-06-06 21:30:34 +00:00
|
|
|
#win {
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
</style>
|
2023-06-08 18:33:56 +00:00
|
|
|
<td width="50" valign="top">
|
|
|
|
<TABLE cellspacing="0" cellpadding="0">
|
|
|
|
<tr>
|
|
|
|
<TD width="100%"> </TD>
|
|
|
|
<TD>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
|
|
<tr align="right" valign="top">
|
|
|
|
<td>
|
|
|
|
<?= $goLis; ?>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
|
|
|
<tr>
|
|
|
|
<td nowrap="nowrap">
|
|
|
|
<tr>
|
|
|
|
<td bgcolor="#D3D3D3">
|
|
|
|
<img src="<?= Config::get('img2') ?>/i/move/links.gif" width="9"
|
|
|
|
height="7">
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#D3D3D3" nowrap>
|
|
|
|
<a
|
|
|
|
href="#"
|
|
|
|
id="greyText"
|
|
|
|
class="menutop"
|
|
|
|
onclick="location='main.php?loc=1.180.0.9&rnd=<?= PassGen::intCode(
|
|
|
|
) ?>';"
|
|
|
|
title="<?php thisInfRm('1.180.0.9', 1); ?>">
|
|
|
|
Центральная площадь
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td bgcolor="#D3D3D3">
|
|
|
|
<img src="<?= Config::get('img2') ?>/i/move/links.gif" width="9"
|
|
|
|
height="7">
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#D3D3D3" nowrap>
|
|
|
|
<a
|
|
|
|
href="#"
|
|
|
|
id="greyText"
|
|
|
|
class="menutop"
|
|
|
|
onclick="location='main.php?loc=1.180.0.449&rnd=<?= PassGen::intCode(
|
|
|
|
) ?>';"
|
|
|
|
title="<?php thisInfRm('1.180.0.449', 1); ?>">
|
|
|
|
Платная Комната
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</TABLE>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br><br>
|
|
|
|
<div id="textgo" style="visibility:hidden;"></div>
|