Файл: html/huntb/1x1/check.php
Строк: 18
<?php
require_once '../../system/func.php';
$time_wait = 5;
if (isset($user)) {
$resultBattleInfo = $mc->query("SELECT * FROM `battle` WHERE `Mid`='" . $user['id'] . "' AND `player_activ`='1' AND `end_battle`='0'");
$huntMyRes = $mc->query("SELECT * FROM `huntb_list` WHERE `user_id` = '" . $user['id'] . "' && (`type`='1'||`type`='2')");
if ($huntMyRes->num_rows > 0) {
$huntMy = $huntMyRes->fetch_array(MYSQLI_ASSOC);
//wait
echo json_encode(array(
"result" => 0,
"error" => 0,
"time" => $time_wait - (time() - $huntMy['time_start'])
));
} elseif ($resultBattleInfo->num_rows > 0) {
echo json_encode(array(
"result" => 1,
"error" => 0,
"time" => 0
));
}
}