game/seasons.php

304 lines
13 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?php
2022-12-19 18:26:14 +00:00
function GetRealIp()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
return $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return $_SERVER['REMOTE_ADDR'];
2022-06-06 21:30:34 +00:00
}
2022-12-19 18:26:14 +00:00
function var_info($vars, $d = false)
{
2022-06-06 21:30:34 +00:00
echo "<pre style='border: 1px solid gray;border-radius: 5px;padding: 3px 6px;background: #cecece;color: black;font-family: Arial;font-size: 12px;'>\n";
var_dump($vars);
echo "</pre>\n";
2022-12-19 18:26:14 +00:00
if ($d) {
exit();
}
2022-06-06 21:30:34 +00:00
}
2022-12-19 18:26:14 +00:00
define('IP', GetRealIp());
die('off');
2022-06-06 21:30:34 +00:00
include('_incl_data/__config.php');
2022-12-19 18:26:14 +00:00
const GAME = true;
2022-06-06 21:30:34 +00:00
include('_incl_data/class/__db_connect.php');
2022-12-19 18:26:14 +00:00
$u = User::start();
$filter = new Filter();
2022-06-06 21:30:34 +00:00
2022-12-19 18:26:14 +00:00
if (isset($_GET['upi'])) {
$k = explode(',', $_GET['upi']);
$i = 0;
while ($i < count($k)) {
//
$i1 = mysql_fetch_array(
mysql_query(
'SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($k[$i - 1]) . '" LIMIT 1'
)
);
$i2 = mysql_fetch_array(
mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($k[$i]) . '" LIMIT 1')
);
$i3 = mysql_fetch_array(
mysql_query(
'SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($k[$i + 1]) . '" LIMIT 1'
)
);
if (isset($i2['id'])) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (isset($i3['id'])) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> i2 -> i3
$test = mysql_fetch_array(
mysql_query(
'SELECT * FROM `items_upgrade` WHERE `iid` = "' . $i2['id'] . '" AND `iup` = "' . $i3['id'] . '" LIMIT 1'
)
);
if (!isset($test['id'])) {
mysql_query(
'INSERT INTO `items_upgrade` (`iid`,`iup`,`price1`,`price2`) VALUES (
"' . $i2['id'] . '","' . $i3['id'] . '","0","' . ($i3['price2'] - $i2['price2']) . '"
)'
);
echo '[' . $i2['id'] . ']->[' . $i3['id'] . '] <20><> ' . ($i3['price2'] - $i2['price2']) . '<27><><EFBFBD>.<br>';
}
}
if (isset($i1['id']) || !isset($i3['id'])) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> i2 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo '[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ' . $i2['id'] . ' <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]<br>';
mysql_query('UPDATE `items_shop` SET `kolvo` = 0 WHERE `item_id` = "' . $i2['id'] . '"');
}
}
//
$i++;
}
} else {
die();
2022-06-06 21:30:34 +00:00
}
$tjs = '';
2022-12-19 18:26:14 +00:00
if ($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) {
header('location: main.php');
die();
2022-06-06 21:30:34 +00:00
}
2022-12-19 18:26:14 +00:00
if ($u->info['id'] == 1000001) {
$u->info['admin'] = 0;
2022-06-06 21:30:34 +00:00
}
#--------<2D><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
2022-12-19 18:26:14 +00:00
if ($u->info['online'] < time() - 60) {
$filter->setOnline($u->info['online'], $u->info['id']);
$u->onlineBonus();
mysql_query(
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time(
) . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
);
} elseif ($u->info['timeMain'] < time() - 60) {
mysql_query(
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time(
) . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
);
2022-06-06 21:30:34 +00:00
}
2022-12-19 18:26:14 +00:00
if (!isset($u->info['id']) || ($u->info['joinIP'] == 1 && $u->info['ip'] != $_SERVER['HTTP_X_REAL_IP']) || $u->info['banned'] > 0) {
die($c['exit']);
2022-06-06 21:30:34 +00:00
}
/* */
$rz = 1;
2022-12-19 18:26:14 +00:00
if (isset($_GET['rz'])) {
if ($_GET['rz'] == 2) {
$rz = 2;
}
2022-06-06 21:30:34 +00:00
}
/* */
2022-12-19 18:26:14 +00:00
Season::$date['Y'] = date('Y');
Season::$date['m'] = date('m');
Season::$date['d'] = date('d');
Season::$yy = Season::$yy[Season::$date['m']];
2022-06-06 21:30:34 +00:00
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
2022-12-19 18:26:14 +00:00
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<meta http-equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<meta http-equiv=Expires Content=0>
<link href="https://img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
<link href="/sss_css.css" rel="stylesheet" type="text/css">
2022-06-06 21:30:34 +00:00
</head>
2022-12-19 18:26:14 +00:00
<body style="padding-top:0px; margin-top:7px; background-color:#E2E0E0;">
<script type="text/javascript" src="js/jquery.js"></script>
<h3 style="font-size:25px;"><?= Season::$yy[3] ?> <20><><EFBFBD><EFBFBD><EFBFBD>, <?= Season::$date['Y'] ?></h3>
<table width="912" border="0" align="center" cellpadding="0" cellspacing="0" class="sss_bg<?= Season::$date['m'] ?>">
<tr>
<td style="min-height:450px;">
<!-- -->
<?
if ($rz == 1) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$html = '';
$sp = mysql_query(
'SELECT * FROM `sss_m` WHERE `s` = "' . mysql_real_escape_string(Season::$date['m']) . '"'
);
while ($pl = mysql_fetch_array($sp)) {
if ($pl['dd'] > Season::$date['d']) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$html .= '<div onClick="location.href=\'seasons.php?rz=2&mis=' . $pl['id'] . '\';" style="background-image:url(https://img.new-combats.com/ss_boss0.png);" class="sss_block_m">' .
'<div class="sss_block_m_in2" align="center"><small><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></small><br>' . $pl['dd'] . '.' . Season::$date['m'] . '.' . Season::$date['Y'] . '</div>' .
'</div>';
} else {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$html .= '<div onClick="location.href=\'seasons.php?rz=2&mis=' . $pl['id'] . '\';" style="background-image:url(https://img.new-combats.com/' . $pl['img'] . ');" class="sss_block_m">' .
'<div class="sss_block_m_in"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!</div>' .
'</div>';
}
}
if ($html == '') {
$html = '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
}
echo '<div align="center">' . $html . '</div>';
} elseif ($rz == 2) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$html = '';
Season::data($_GET['mis']);
if (!isset(Season::$m['id'])) {
$html = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
} else {
if (Season::$m['dd'] > Season::$date['d']) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$html .= '<div onClick="location.href=\'seasons.php?rz=2&mis=' . Season::$m['id'] . '\';" style="background-image:url(https://img.new-combats.com/ss_boss0.png);" class="sss_block_m">' .
'<div class="sss_block_m_in2" align="center"><small><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></small><br>' . Season::$m['dd'] . '.' . Season::$date['m'] . '.' . Season::$date['Y'] . '</div>' .
'</div>';
} else {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$html .= '<div onClick="location.href=\'seasons.php?rz=2&mis=' . Season::$m['id'] . '\';" style="float:left;background-image:url(https://img.new-combats.com/' . Season::$m['img'] . ');" class="sss_block_m">' .
'<div class="sss_block_m_in3">&nbsp;<small><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<br>0 / ??</small></div>' .
'</div>';
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$sp = mysql_query('SELECT * FROM `sss_q` WHERE `m` = "' . Season::$m['id'] . '"');
$ends = [];
$i = 0;
$lstms = mysql_fetch_array(
mysql_query(
'SELECT * FROM `sss_f` WHERE `uid` = "' . $u->info['id'] . '" ORDER BY `id` DESC LIMIT 1'
)
);
while ($pl = mysql_fetch_array($sp)) {
$qe = 0;
$tss = strtotime('01-' . Season::$m['s'] . '-' . Season::$date['Y'] . '');
if (isset($lstms['id'])) {
$tss = strtotime(
'' . date('d', $lstms['time']) . '-' . date('m', $lstms['time']) . '-' . date(
'Y', $lstms['time']
) . ''
);
}
//
if ($pl['type'] == 1) {
//<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$c1 = mysql_fetch_array(
mysql_query(
'SELECT COUNT(*) FROM `items_users` WHERE `time_create` > "' . $tss . '" AND `uid` = "' . $u->info['id'] . '" AND `delete` < 1001 AND `item_id` = "' . $pl['value'] . '" LIMIT 1'
)
);
$qe = $c1[0];
} elseif ($pl['type'] == 2 || $pl['type'] == 3) {
$c1 = mysql_fetch_array(
mysql_query(
'SELECT COUNT(*) FROM `actions` WHERE `time` > "' . $tss . '" AND `uid` = "' . $u->info['id'] . '" AND `vars` LIKE "%win_bot_' . $pl['value'] . '" LIMIT 1'
)
);
$qe = $c1[0];
}
//
if ($qe > $pl['var']) {
$qe = $pl['var'];
}
$f = 0;
//
$nogo = false;
if (!isset($ends[$i - 1]) && $i != 0) {
$nogo = true;
}
//
$plf = mysql_fetch_array(
mysql_query(
'SELECT * FROM `sss_f` WHERE `uid` = "' . $u->info['id'] . '" AND `m` = "' . $pl['id'] . '" AND `y` = "' . Season::$date['Y'] . '" LIMIT 1'
)
);
if (isset($plf['id'])) {
$f = 1;
}
//
$html .= '<div style="float:right;padding-top:25px;"';
if ($nogo == true) {
$html .= ' class="graysc"';
}
$html .= '>';
//
$html .= '<div align="left" class="sss_mis_div">';
$html .= '<img src="https://img.new-combats.com/ss_ico' . $pl['type'] . '.png">';
$html .= '<div style="float:right;width:530px;color:#efefef;" align="left">';
$html .= '<div style="width:500px;margin-top:10px;height:50px;"><small>' . $pl['info'] . '</small></div>';
if ($nogo == true) {
//<2F><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
} elseif ($f == 1) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
} elseif ($nogo == false && $f == 0 && isset($_GET['endq']) && $_GET['endq'] == $pl['id'] && $qe == $pl['var']) {
$f = 1;
mysql_query(
'INSERT INTO `sss_f` (`m`,`y`,`uid`,`time`) VALUES (
"' . $pl['id'] . '",
"' . Season::$date['Y'] . '",
"' . $u->info['id'] . '",
"' . time() . '"
)'
);
} else {
$html .= '<div class="sss_line1"><div style="width:' . round(
$qe / $pl['var'] * 300
) . 'px;" class="sss_line2"></div></div>';
if ($qe == $pl['var']) {
$html .= ' <button onclick="location.href=\'seasons.php?rz=2&mis=' . round(
(int)$_GET['mis']
) . '&endq=' . $pl['id'] . '\';" class="sss_btn1"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></button>';
}
$html .= ' &nbsp; ' . $qe . ' / ' . $pl['var'] . '';
}
if ($f == 1) {
$ends[$i] = true;
$html .= '<b style="color:#efefef"><img src="https://img.new-combats.com/i/ico/wins.gif"> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</b>';
} elseif ($nogo == true) {
$html .= '<i style="color:#ffa5a5"><img src="https://img.new-combats.com/i/ico/draw.gif"> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</i>';
}
$html .= '</div>';
$html .= '</div>';
//
$html .= '</div>';
$i++;
}
}
}
echo '<div align="center">' . $html . '</div>';
}
?>
<!-- -->
</td>
</tr>
2022-06-06 21:30:34 +00:00
</table>
</body>
</html>