Файл: accmarket.net/game/sector.php
Строк: 54
<?php
define('_ON_CMS', 1);
require_once '../includes/start.php';
require_once '../includes/function.php';
require_once '../includes/header.php';
if($game==0 OR $level==0 OR $ban!=0){
header('Location: ../index.php');
}
switch ($act) {
default:
div('Карта сектора','top');
echo '<div class="cont"><a href="?act=portal">Ваши порталы</a></div>';
$x12=$_GET['x'];
$y12=$_GET['y'];
$x2 = mysql_result(mysql_query("SELECT MAX(x) FROM `sector_loc`;"), 0);
$y2 = mysql_result(mysql_query("SELECT MAX(y) FROM `sector_loc`;"), 0);
if(!$_POST)
{
$mm = mysql_query("SELECT * FROM `sector_loc` WHERE `x`='".$x12."' AND `y`='".$y12."' LIMIT 1");
$map = mysql_fetch_array($mm);
$x1=$x12-3;
$y1=$y12+3;
$wave=1;
$table=1;
echo '<div class="conts" align="center"><table cellspacing="0" cellpadding="0">';
while($wave<='49'){
if($table=='8'){
$table='1';
$x1=$x1-'7';
$y1=$y1-'1';}
$mm1 = mysql_query("SELECT * FROM `sector_loc` WHERE `x`='".$x1."' and `y`='".$y1."' ORDER BY `loc` DESC LIMIT 1");
$map1 = mysql_fetch_array($mm1);
if($table=='1')echo'<tr border="0" HEIGHT="18">';
echo'<td BGCOLOR="black">';
$sp=rand(1,10);
if($map1['loc']==8)echo '<img src="../images/space/T_C.png" title="Торговая станция контробандистов" />';
if($map1['loc']==7)echo '<img src="../images/space/sun.jpg" alt="" />';
if($map1['loc']==6)echo '<img src="../images/space/zellnaga.jpg" alt="" />';
if($map1['loc']==5)echo '<img src="../images/space/teleport.jpg" alt="" />';
if($map1['loc']==4)echo '<img src="../images/space/moon'.$map1['type'].'.jpg" alt="" />';
if($map1['loc']==3)echo '<img src="../images/space/l'.$map1['type'].'.jpg" alt="" />';
if($map1['loc']==2)echo '<img src="../images/planet/'.$map1['type'].'.jpg" alt="" />';
if($map1['loc']==1)echo ''.otr($map1['type'], $map1['fr_id'], $fr_id, $map1['uid'], $use_id).'';
if($map1['loc']=='')echo '<img src="../images/space/space'.$sp.'.jpg" alt="image" />';
echo'</td>';
if($table=='7')echo'</tr>';
$wave++;
$table++;
$x1++;
}
echo'</table></div><div class="top">';
echo '<a href="?x='. ($x12-1) .'&y='. $y12 .'"><img src="../images/left.png" alt="image" /></a>';
echo '<a href="?y='. ($y12-1) .'&x='. $x12 .'"><img src="../images/down.png" alt="image" /></a>';
echo '<a href="?y='. ($y12+1) .'&x='. $x12 .'"><img src="../images/up.png" alt="image" /></a>';
echo '<a href="?x='. ($x12+1) .'&y='. $y12 .'"><img src="../images/right.png" alt="image" /></a>';
echo '</div>';
echo '<div class="conts"><form action="" method="POST">
x
<input type="text" value="'.check($x12).'" size="2" name="x" />
y
<input type="text" value="'.check($y12).'" size="2" name="y" />
<input type="submit" name="submit" value="Посмотреть"/></form></div>';
}
else
{
$xx = check(trim($_POST['x']));
$yy = check(trim($_POST['y']));
if($xx>$x2 or $yy>$y2 or $xx<=0 or $yy<=0){echo '<div class="conts">Такой локации не существует!<br/><a href="?x='.$x12.'&y='.$y12.'"><<Назад</a></div>';}else{
header("Location: sector.php?&x=$xx&y=$yy");}
}
break;
case 'portal':
div('Ваши порталы','top');
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `sector_loc` WHERE `loc`=5 AND `uid`='".$use_id."';"), 0);
$PAGINGS = new PAGINGS($elem, "SELECT * FROM `sector_loc` WHERE `loc`=5 AND `uid`='".$use_id."' ORDER BY `id` DESC");
if($PAGINGS->count_get > 0)
{
while($row = mysql_fetch_array($PAGINGS->get))
{
echo '<div class="conts">';
echo '<img src="../images/space/teleport.jpg" alt="" /> <a href="sector.php?x='.$row['x'].'&y='.$row['y'].'">Портал</a> [x:'.$row['x'].' y:'.$row['y'].']';
echo '</div>';
++$i;
}
if($count>$elem)echo $PAGINGS->Links('?'); // вывод меню навигации в аргументе указывать адрес страницы
}
else
{
div('Нет порталов под вашим контролем','conts');
}
echo '<div class="conts"><a href="sector.php?x='.$xnum.'&y='.($ynum+3).'"><<Назад</a></div>';
break;
}
div('<a href="../">В игру</a>','conts');
require_once '../includes/footer.php';
?>