jhylands

dump

Apr 8th, 2013
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <table border="1" class="a1" style=""><tr>
  2. <?php
  3. //Draw the map
  4. //include drawing.php so to draw each property
  5. include 'scripts/drawing.php';
  6. // Create connection to database
  7. include 'scripts/sql.php';
  8. //use $i as a counter, for 0<$i<=10{first line} for 10<$i<=28{[($i-10)/2]th line} for 28<$i<38{10th line)
  9. $i=0;
  10. //Create an an array of all the data needed from the database
  11. $prop = array();
  12. //SQL Table Property
  13. $result = mysqli_query($con,"SELECT * FROM Properties");
  14. while($row = mysqli_fetch_array($result))
  15.   {
  16.     $prop[$i]['Name'] = $row['Name'];
  17.     $prop[$i]['Band'] = $row['Band'];
  18.     $prop[$i]['Price'] = $row['Price'];
  19.     //increase the counter
  20.     $i++;
  21.   }
  22. for($i=0;$i<11;$i++){
  23.     drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
  24. }
  25. echo "</tr><tr>";
  26. drawProperty(39,$prop[39]['Name'],$prop[39]['Band']); //mayfair
  27. //middle needs putting in
  28. echo '<td id="the" colspan="9" rowspan="9">';
  29. echo '<h1>Loading please wait...</h1>';
  30. echo '</td>';
  31. drawProperty(11,$prop[11]['Name'],$prop[11]['Band']);//pall mall
  32. for($r=0;$r<=6;$r++){
  33.     $i = 38 - $r;
  34.     drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
  35.     $i = 12 + $r;
  36.     drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
  37.     echo "</tr><tr>";
  38. }
  39. for($i=30;$i=>20;$i=i-1){
  40.     drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
  41. }
  42. //close connection to db
  43. mysqli_close($con);
  44. ?>
  45. </tr></table>
Add Comment
Please, Sign In to add comment