-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropertyList.php
More file actions
76 lines (59 loc) · 2.09 KB
/
Copy pathPropertyList.php
File metadata and controls
76 lines (59 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
include_once 'functions/Property.php';
include_once 'Header.php';
if (isset ( $_GET ['delRowPropertyno'] )) {
$rowPropertyNo = $_GET ['delRowPropertyno'];
$deleteResult = delProperty ($rowPropertyNo);
if ($deleteResult == - 1)
showErrorMessage ( "Failed to delete row PropertyNo $rowPropertyNo. FK Violation" );
elseif ($deleteResult == 0)
showErrorMessage ( "Failed to deleted row PropertyNo $rowPropertyNo" );
else
showInfoMessage ( "Successfully deleted row PropertyNo $rowPropertyNo" );
}
?>
<?php
$result = getAllProperty();
if(!$result)
echo "Failed to get Property list";
else
if ($result->num_rows > 0)
{
// Print table's header
echo '<table width="100%" border="1">
<tr>
<td><strong>Property Number</strong></td>
<td><strong>Type</strong></td>
<td><strong>Rooms</strong></td>
<td><strong>Rent</strong></td>
<td><strong>StaffNo</strong></td>
<td><strong>Branch Number</strong></td>
<td><strong>Address</strong></td>
<td><strong>Delete?</strong></td>
</tr>';
// Print table's body
while ( $rows = $result->fetch_assoc () ) {
echo"<tr>
<td>{$rows ['property_no']}</td>
<td>{$rows ['prop_type']}</td>
<td>{$rows ['rooms']}</td>
<td>{$rows ['rent']}</td>
<td>{$rows ['staff_no']}</td>
<td>{$rows ['branch_no']}</td>
<td>{$rows ['street1']},
{$rows ['street2']}<BR/>
{$rows ['city']},
{$rows ['sn']},
{$rows ['zip']}</td>
<td>
<form action=propertyList.php>
<input type=hidden name=delRowPropertyno value=\"{$rows ['property_no']}\" />
<button type=submit>Delete</button>
</form>
</td>
</tr>";
}
echo '</table>';
}
include_once 'footer.php';
?>