-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect4.php
More file actions
130 lines (90 loc) · 2.19 KB
/
Copy pathconnect4.php
File metadata and controls
130 lines (90 loc) · 2.19 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html>
<head>
<title>CONNECT PHP</title>
</head>
<body>
<center>
<?php
session_start();
$conn = mysqli_connect("localhost", "root", "", "apt_mgmt");
if($conn === false){
die("ERROR: Could not connect. "
. mysqli_connect_error());
}
$tno = $_REQUEST['tno'];
$result = mysqli_query($conn,"SELECT * FROM tenant where tno=$tno");
while($row = mysqli_fetch_array($result))
{
echo "<table border='1'>
<tr>
<th>TENANT NUMBER</th>
<th>TENANT NAME</th>
<th>TENANT PHONE</th>
</tr>";
echo "<tr>";
echo "<td>" . $row['TNO'] . "</td>";
echo "<td>" . $row['TNAME'] . "</td>";
echo "<td>" . $row['TPHONE'] . "</td>";
echo "</tr>";
echo "<br/>";echo "<br/>";
echo "</table>";
echo "<br/>";
}
$result = mysqli_query($conn,"SELECT APTNO,TYPE,BLOCK FROM apartment,tenant where tenant.tno=$tno and apartment.tno=tenant.tno");
while($row = mysqli_fetch_array($result))
{
echo "<table border='2'>
<tr>
<th>APARTMENT NUMBER</th>
<th>APARTMENT TYPE</th>
<th>APARTMENT BLOCK</th>
</tr>";
echo "<tr>";
echo "<td>" . $row['APTNO'] . "</td>";
echo "<td>" . $row['TYPE'] . "</td>";
echo "<td>" . $row['BLOCK'] . "</td>";
echo "</tr>";
echo "<br/>";echo "<br/>";
echo "</table>";
echo "<br/>";
}
$result = mysqli_query($conn,"SELECT DNAME,DPHONE FROM dependent,tenant where tenant.tno=$tno and dependent.tno=tenant.tno");
while($row = mysqli_fetch_array($result))
{
echo "<table border='3'>
<tr>
<th>DEPENDENT NAME</th>
<th>DEPENDENT PHONE</th>
</tr>";
echo "<tr>";
echo "<td>" . $row['DNAME'] . "</td>";
echo "<td>" . $row['DPHONE'] . "</td>";
echo "</tr>";
echo "<br/>";echo "<br/>";
echo "</table>";
echo "<br/>";
}
$result = mysqli_query($conn,"SELECT DATE,AMOUNT FROM rent,tenant where tenant.tno=$tno and rent.tno=tenant.tno");
while($row = mysqli_fetch_array($result))
{
echo "<table border='4'>
<tr>
<th>PAYMENT DATE</th>
<th>TOTAL AMOUNT</th>
</tr>";
echo "<tr>";
echo "<td>" . $row['DATE'] . "</td>";
echo "<td>" . $row['AMOUNT'] . "</td>";
echo "</tr>";
echo "<br/>";echo "<br/>";
echo "</table>";
echo "<br/>";echo "<br/>";
}
;mysqli_close($conn);?>
<a href="Details.php">
<button style="color:black; background-color:red;">ADMIN</button>
</a>
</center>
</body>
</html>