\n";
var_dump($vars);
echo "\n";
if ($d) {
exit();
}
}
define('IP', GetRealIp());
die('off');
include('_incl_data/__config.php');
const GAME = true;
include('_incl_data/class/__db_connect.php');
$u = User::start();
$filter = new Filter();
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'])) {
//Проводим работу
if (isset($i3['id'])) {
//Добавляем апгрейд 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'] . '] за ' . ($i3['price2'] - $i2['price2']) . 'екр.
';
}
}
if (isset($i1['id']) || !isset($i3['id'])) {
//Удаляем i2 из магазина
echo '[Удаляем ' . $i2['id'] . ' с прилавка]
';
mysql_query('UPDATE `items_shop` SET `kolvo` = 0 WHERE `item_id` = "' . $i2['id'] . '"');
}
}
//
$i++;
}
} else {
die();
}
$tjs = '';
if ($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) {
header('location: main.php');
die();
}
if ($u->info['id'] == 1000001) {
$u->info['admin'] = 0;
}
#--------для общаги, и позже для почты
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"
);
}
if (!isset($u->info['id']) || ($u->info['joinIP'] == 1 && $u->info['ip'] != $_SERVER['HTTP_X_REAL_IP']) || $u->info['banned'] > 0) {
die($c['exit']);
}
/* */
$rz = 1;
if (isset($_GET['rz'])) {
if ($_GET['rz'] == 2) {
$rz = 2;
}
}
/* */
Season::$date['Y'] = date('Y');
Season::$date['m'] = date('m');
Season::$date['d'] = date('d');
Season::$yy = Season::$yy[Season::$date['m']];
?>
if ($rz == 1) {
//Сезонная линейка
$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']) {
//Миссия еще закрыта
$html .= ' ' .
' ';
} else {
//Открытая миссия
$html .= 'Дата открытия ' .
'' . $pl['dd'] . '.' . Season::$date['m'] . '.' . Season::$date['Y'] . ' ' .
' ';
}
}
if ($html == '') {
$html = 'Нет миссий для текущего сезона';
}
echo 'Приступить! ' .
'' . $html . ' ';
} elseif ($rz == 2) {
//Открытая миссия
$html = '';
Season::data($_GET['mis']);
if (!isset(Season::$m['id'])) {
$html = 'Миссия для текущего сезона не найдена';
} else {
if (Season::$m['dd'] > Season::$date['d']) {
//Миссия еще закрыта
$html .= '' .
' ';
} else {
//Открытая миссия
$html .= 'Дата открытия ' .
'' . Season::$m['dd'] . '.' . Season::$date['m'] . '.' . Season::$date['Y'] . ' ' .
' ';
//Задания в миссии
$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) {
//Сбор ресурсов
$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 .= ' Выполнено заданий: ' .
'0 / ?? ';
$html .= ' ';
//
$html .= '';
$i++;
}
}
}
echo '';
$html .= ' ';
$html .= '' . $pl['info'] . ' ';
if ($nogo == true) {
//Еще не готов выполнять
} elseif ($f == 1) {
//Выполнено
} 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 .= '';
if ($qe == $pl['var']) {
$html .= ' ';
}
$html .= ' ' . $qe . ' / ' . $pl['var'] . '';
}
if ($f == 1) {
$ends[$i] = true;
$html .= ' Задание выполнено.';
} elseif ($nogo == true) {
$html .= ' Требует выполнение предыдущего задания.';
}
$html .= ' ' . $html . ' ';
}
?>
|