Вход Регистрация
Файл: stalkerus.tk/index.php
Строк: 219
<?php

require_once('conf/dbc.php');
require_once(
'conf/session_start.php');

if ((!isset(
$_SESSION['id'])) or (!isset($_SESSION['nick'])))  {
  
?>
  <script type="text/javascript">
  document.location.href = "login.php";
  </script>
  <?php
  
exit();
}

$page_title 'S.T.A.L.K.E.R.-онлайн-игра на мобильный';
require_once(
'conf/head.php');
if ((isset(
$_SESSION['id'])) and (isset($_SESSION['nick'])))  {
  require_once(
'conf/banned.php');
  
$user_id $_SESSION['id'];
  
/////////////////////////////////
  ////////////////////////////////////Записали локацию
  
$query "Select hp, max_hp, location, m_fight, sost_cl, sost_p, sost_w from users where id = '$user_id'  limit 1";
  
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД6');
  
$row mysqli_fetch_array($result);
  
$location $row['location'];
  
$m_fight=$row['m_fight'];
  if (
$location == 'monster1' or $location == 'monster2' or $location == 'monster3' or $location == 'monster4' or $location == 'monster5' or $location == 'monster6' or $location == 'monster7' or $location == 'monster8' or $location == 'monster9') {
    
$query_t "Select id from users where m_fight='$m_fight' and location = '$location' and hp>0 and last_active > NOW() - (300*5)";
    
$result_t mysqli_query($dbc$query_t) or die ('Ошибка передачи запроса к БД2');
    
$count mysqli_num_rows($result_t);
        if (
$count <= 1) {
          
$query_t "Select id from users where m_fight='$m_fight'";
      
$result_t mysqli_query($dbc$query_t) or die ('Ошибка передачи запроса к БД2');
          while (
$row_t=mysqli_fetch_array($result_t)) {
$id_t=$row_t['id'];
$query "update users set m_fight=0 where id = '$id_t' limit 1";
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД5');
}
$query_tt "Select id_monster from m_fight where id_fight='$m_fight' limit 1";
$result_tt mysqli_query($dbc$query_tt) or die ('Ошибка передачи запроса к БД2');
$row_tt mysqli_fetch_array($result_tt);
$m=$row_tt['id_monster'];

$query_tt "Select clan, max_hp from monsters where id_monster='$m' limit 1";
$result_tt mysqli_query($dbc$query_tt) or die ('Ошибка передачи запроса к БД2');
$row_tt mysqli_fetch_array($result_tt);
if (
$row_tt['clan'] <> 0) {
$hp_monst=$row_tt['max_hp'];
$query_tt "update m_fight set start=0, hp='$hp_monst' where id_fight='$m_fight' limit 1";
$result_tt mysqli_query($dbc$query_tt) or die ('Ошибка передачи запроса к БД2');
}

}
$query_tt "Select start from m_fight where id_fight='$m_fight' limit 1";
$result_tt mysqli_query($dbc$query_tt) or die ('Ошибка передачи запроса к БД2');
$row_tt mysqli_fetch_array($result_tt);
if (
$row_tt['start'] == 0) {
$query_tt "update users set m_fight=0 where id='$user_id' limit 1";
$result_tt mysqli_query($dbc$query_tt) or die ('Ошибка передачи запроса к БД2');
$query_tt "DELETE FROM m_inf WHERE `user_id` ='$user_id' and id_fight='$m_fight' limit 1";
$result_tt mysqli_query($dbc$query_tt) or die ('Ошибка передачи запроса к БД2');
}
}
$hp $row['hp'];
$max_hp $row['max_hp'];
if (
$hp <= 0) {
$sost_p $row['sost_p'];
if (
$sost_p>0) {
$sost_p = ($sost_p 1);
}
$sost_w $row['sost_w'];
if (
$sost_w>0) {
$sost_w = ($sost_w 1);
}
$sost_cl $row['sost_cl'];
if (
$sost_cl>0) {
$sost_cl = ($sost_cl 1);
}
$query "update users set hp = '$max_hp', location = 'index', sost_cl = '$sost_cl', sost_p = '$sost_p', sost_w = '$sost_w' where id = '$user_id' limit 1";
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД');
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
$query "update things set sost = '$sost_cl' where user_id = '$user_id' and type = 1 and place=2 limit 1";
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД');
$query "update things set sost = '$sost_p' where user_id = '$user_id' and type = 2 and place=2  limit 1";
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД');
$query "update things set sost = '$sost_w' where user_id = '$user_id' and type = 3 and place=2  limit 1";
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД');
}
else {
$query_loc "update users set location = 'index' where id = '$user_id' limit 1";
$result_loc mysqli_query($dbc$query_loc) or die ('Ошибка передачи запроса к БД');
$query_loc "DELETE FROM `m_inf` WHERE user_id = '$user_id' and id_fight='$m_fight' limit 1";
$result_loc mysqli_query($dbc$query_loc) or die ('Ошибка передачи запроса к БД');
}
require_once(
'conf/top.php');
}
else {
$ip getenv("REMOTE_ADDR");
$query_del "DELETE FROM `login` WHERE `ip` = '$ip' LIMIT 1";
$result_del mysqli_query($dbc$query_del) or die ('Ошибка передачи запроса к БД');
$invite_id $_GET['inv'];
$adress getenv("HTTP_REFERER");
$time_beg=microtime();
$ip mysqli_real_escape_string($dbctrim($ip));
$invite_id =  mysqli_real_escape_string($dbctrim($invite_id));
$adress =  mysqli_real_escape_string($dbctrim($adress));
$query "select id_invite from invite where ip='$ip'";
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД');
if (
mysqli_fetch_array($result)) {
$query "update invite set id_invite = '$invite_id', iz = '$adress' where ip='$ip'  limit 1";
@
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД');
}
else {
$query "insert into invite (`ip`, `id_invite`, `iz`) values ( '$ip', '$invite_id', '$adress')";
@
$result mysqli_query($dbc$query) or die ('Ошибка передачи запроса к БД');
}
}
?>
<div id="main">

<body>
<div style="border-left:1px solid #444e4f;border-right:1px solid #444e4f;">
<div class="pole2">
<p style="border-top: solid 1px #2e2e2d"></p>
<div style="background: url(img/logo2.jpg) 100% no-repeat; background-size: cover;">
<p style="float: right;"><img src="img/ico/elka.png" alt="¨ëêà"/></p>
<p style="clear: right;"></p>
</div>
<p style="border-top: solid 1px #444e4f"></p>

<center><p style="border-style: double;"><span class="white">Добро пожаловать в мобильную онлайн игру "S.T.A.L.K.E.R. - Начало!"<br />Советую начать путь с Рейдов - способ
заработать немного хабара и
опыта. Так давай же сходим
туда.</span></p></center>

<p class="white"></p>
<div class="stats">
<?php
if ((!isset($_SESSION['id'])) and (!isset($_SESSION['nick'])))  {
?>
<p><img src="img/ico/link.png" width="12" height="12"/> <a href="reg.php">Регистрация</a></p>
<p><img src="img/ico/link.png" width="12" height="12"/> <a href="login.php">В Зону</a></p>
<?php
}
?>
<?php
$query_num 
"Select id from users where last_active > NOW()-(300*5) and gruppa <> 'mytants' and gruppa <>'bandits' and gruppa <> 'zombie' and gruppa <> 'monolits'" ;
    
$result_num mysqli_query($dbc$query_num) or die ('Ошибка передачи запроса к БД');
    
$total mysqli_num_rows($result_num); 
    
?>

<center> <p class="podmenu" style="border-top:1px solid #444e4f; background-color:#1c252f ;">Новости</p></center> 
<center><p>Открытие<a href=" /topic.php?topic=9">(Читать полностью)</a></p></center>
<div class="name"><center>Торговля</center></div>
<div class="link">
<a class="link" href="skadovsk.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Скадовск</a></div>
<div class="link">
<a class="link" href="quests.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Бар</a></div>
<div class="link">
<a class="link" href="auction.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Барахолка</a></div>
<div class="link">
<a class="link" href="lock.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Взлом сейф</a></div>
<div class="name"><center>Бои</center></div>
<div class="link">
<a class="link" href="zona.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Зона</a></div>
<div class="link">
<a class="link" href="secret.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Перестрелки</a></div>
<div class="link">
<a class="link" href="monsters.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Рейды</a></div>
<div class="name"><center>Общение</center></div>
<div class="link">
<a class="link" href="forum.php?type=main"><img width="12" height="12" src="img/ico/link.png"></img>Форум</a></div>
<div class="link">
<a class="link" href="chat.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Чат</a></div>
<div class="name"><center>Рейтинги</center></div>
<div class="link">
<a class="link" href="activerat.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Активность</a></div>
<div class="link">
<a class="link" href="rating.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Снаряжение</a></div>
<div class="link">
<a class="link" href="listcompany.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Отряды</a></div>
<div class="name"><center>Информация</center></div>
<div class="link">
<a class="link" href="smiles.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Смайлы</a></div>
<div class="link">
<a class="link" href="online.php">
<img src="img/ico/link.png" width="12" height="12"/></img>Онлайн <span class="bonus"><?php echo "[ $total ]"?></span></a></div></p>
<p class="podmenu" style="border-top:1px solid #444e4f; background-color:#1c252f ;"></p>
</div>
</div>
<?php
if ((isset($_SESSION['id'])) and (isset($_SESSION['nick'])))  {
  require_once(
'conf/navig.php');
}
require_once(
'conf/foot.php');
?>
</body>
</html>
Онлайн: 1
Реклама