Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(10800);
- if(!$_POST)
- {
- for($y=40;$y>=34;$y--) {
- for($x=1;$x<=7;$x++) {
- require_once('includes/db/DbConnector.php');
- $connector = new DbConnector();
- $result = $connector->query('SELECT * FROM map WHERE x = "'.$x.'" AND y = "'.$y.'" ');
- while($row = $connector->fetchArray($result))
- echo '<img src="images/map/lan_'.$row['tip'].$row['subtip'].'.gif" style="float: left;margin: 0;padding:0;">';
- }
- }
- echo '<div style="margin-top: 380px;">';
- echo '<form method="POST" action="map.php">';
- echo 'x: <input type="text" style="width:50px;" name="x"><br>';
- echo 'y: <input type="text" style="width:50px;" name="y"><br>';
- echo '<input type="submit" name="submit" value="Cauta!"><br>';
- echo '</form>';
- echo '</div>';
- }
- else
- {
- $cx = $_POST['x'];
- $cy = $_POST['y'];
- $cy1 = $cy+3;
- $cx1 = $cx-3;
- $cy2 = $cy-3;
- $cx2 = $cx+3;
- for($y=$cy1;$y>=$cy2;$y--) {
- for($x=$cx1;$x<=$cx2;$x++) {
- require_once('includes/db/DbConnector.php');
- $connector = new DbConnector();
- $result = $connector->query('SELECT * FROM map WHERE x = "'.$x.'" AND y = "'.$y.'" ');
- while($row = $connector->fetchArray($result))
- echo '<img src="images/map/lan_'.$row['tip'].$row['subtip'].'.gif" title="('.$row['x'].'|'.$row['y'].')" style="float: left;margin: 0;padding:0;">';
- }
- }
- echo '<div style="margin-top: 380px;">';
- echo '<form method="POST" action="map.php">';
- echo 'x: <input type="text" style="width:50px;" name="x" value="'.$_POST['x'].'"><br>';
- echo 'y: <input type="text" style="width:50px;" name="y" value="'.$_POST['y'].'"><br>';
- echo '<input type="submit" name="submit" value="Cauta!"><br>';
- echo '</form>';
- echo '</div>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement