Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table border="1" class="a1" style=""><tr>
- <?php
- //Draw the map
- //include drawing.php so to draw each property
- include 'scripts/drawing.php';
- // Create connection to database
- include 'scripts/sql.php';
- //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)
- $i=0;
- //Create an an array of all the data needed from the database
- $prop = array();
- //SQL Table Property
- $result = mysqli_query($con,"SELECT * FROM Properties");
- while($row = mysqli_fetch_array($result))
- {
- $prop[$i]['Name'] = $row['Name'];
- $prop[$i]['Band'] = $row['Band'];
- $prop[$i]['Price'] = $row['Price'];
- //increase the counter
- $i++;
- }
- for($i=0;$i<11;$i++){
- drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
- }
- echo "</tr><tr>";
- drawProperty(39,$prop[39]['Name'],$prop[39]['Band']); //mayfair
- //middle needs putting in
- echo '<td id="the" colspan="9" rowspan="9">';
- echo '<h1>Loading please wait...</h1>';
- echo '</td>';
- drawProperty(11,$prop[11]['Name'],$prop[11]['Band']);//pall mall
- for($r=0;$r<=6;$r++){
- $i = 38 - $r;
- drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
- $i = 12 + $r;
- drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
- echo "</tr><tr>";
- }
- for($i=30;$i=>20;$i=i-1){
- drawProperty($i,$prop[$i]['Name'],$prop[$i]['Band']);
- }
- //close connection to db
- mysqli_close($con);
- ?>
- </tr></table>
Add Comment
Please, Sign In to add comment