Advertisement
Guest User

Untitled

a guest
Jul 7th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.99 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Testmap</title>
  5. <link href="css/default.css" rel="stylesheet" type="text/css" />
  6. <link href="css/demo1.css" rel="stylesheet" type="text/css" />
  7. <script src="js/jquery.js" type="text/javascript"></script>
  8. <script src="js/craftmap.js" type="text/javascript"></script>
  9. <script src="js/init.js" type="text/javascript"></script>
  10. </head>
  11.  
  12. <body>
  13.             <div class="demo1">
  14.                 <img src="map.jpg" class="imgMap" />
  15.                     <?php
  16.                     mysql_connect("","","");
  17.                     mysql_select_db("");
  18.                     $result = mysql_query("SELECT * FROM `vehicles` WHERE (`owner`='1')");
  19.                     while($row = mysql_fetch_array($result)){
  20.                     $id = $row["id"];
  21.                     $km = $row["km"];
  22.                     $tank = $row["tank"];
  23.                     $numplate = $row["numplate"];
  24.                     $model = $row["model"];
  25.                     if($row["x"] < 0 && $row["y"] < 0)
  26.                     {
  27.                     $x2 = $row["x"];
  28.                     $y2 = $row["y"] *= -1;
  29.                     $x  = $x2 + 2991;
  30.                     $y  = $y2 + 2984;
  31.                     } else if($row["x"] < 0 && $row["y"] > 0)
  32.                     {
  33.                     $x2 = $row["x"];
  34.                     $y2 = $row["y"] *= -1;
  35.                     $x  = $x2 + 2991;
  36.                     $y  = $y2 + 2984;
  37.                     } else if($row["x"] > 0 && $row["y"] > 0)
  38.                     {
  39.                     $x2 = $row["x"];
  40.                     $y2 = $row["y"] *= -1;
  41.                     $x  = 2991 + $x2;
  42.                     $y  = 2984 + $y2;
  43.                     } else if($row["x"] > 0 && $row["y"] < 0)
  44.                     {
  45.                     $x2 = $row["x"];
  46.                     $y2 = $row["y"] *= -1;
  47.                     $x  = 2991 + $x2;
  48.                     $y  = 2984 + $y2;
  49.                     }
  50.                     echo "<div class=\"marker\" id=\"$id\" data-coords=\"$x, $y\">";
  51.                     echo "<h3>$numplate</h3>";
  52.                     echo "<b>Kilometer:</b> $km km<br />";
  53.                     echo "<b>Treibstoff:</b> $tank l<br />";
  54.                     echo "</div>";
  55.                     }
  56.                     ?>
  57.             </div>
  58.            
  59.             <div class="controls">
  60.                 <?
  61.                 $result = mysql_query("SELECT * FROM `vehicles` WHERE (`owner`='1')");
  62.                     while($row = mysql_fetch_array($result)){
  63.                     $id = $row["id"];
  64.                     $numplate = $row["numplate"];
  65.                     print "<a href=\"#\" rel=\"$id\">$numplate</a>";
  66.                     }  
  67.                 ?> 
  68.             </div>
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement