-
Notifications
You must be signed in to change notification settings - Fork 0
/
add-tenant.php
63 lines (61 loc) · 2.78 KB
/
add-tenant.php
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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Tenant</title>
<link href="tma.css" type="text/css" rel="stylesheet" media="all" />
</head>
<body>
<?php
require_once("Includes/db.php");
$result = TenantDB::getInstance()->get_all_lease("'" . $_GET['buildingName'] . "'", "'" . $_GET['aptNum'] . "'");
if (!$result) {
printf("Error: %s\n", mysqli_error(TenantDB::getInstance()));
exit();
}
?>
<h1>
Add new Tenant for Building <?php echo $_GET['buildingName']; ?>, Apartment# <?php echo $_GET['aptNum']; ?>
</h1>
Select Lease :
<select name="lease" form="addTen">
<?php
while ($row = mysqli_fetch_array($result)) {
echo "<option value=\"" . htmlentities($row['LEASE_ID']) . "\">" . htmlentities($row['LEASE_ID']) . "</option>";
}
mysqli_free_result($result);
?>
</select> <br/><br/>
<form name="addTenant" id="addTen" action="add-tenant-complete.php" method="post">
<input type="hidden" name="aptNum" value=<?php echo $_GET['aptNum']; ?> />
First Name :
<input type="text" name="first_name" value="" /><br/><br/>
Last Name :
<input type="text" name="last_name" value="" /><br/><br/>
ssn :
<input type="text" name="ssn" value="" /><br/><br/>
Current Address :
<input type="text" name="current_address" value="" /><br/><br/>
Email :
<input type="text" name="email" value="" /><br/><br/>
Phone :
<input type="text" name="phone" value="" /><br/><br/>
<input type="hidden" name="buildingName" value=<?php echo $_GET['buildingName']; ?> />
<input type="submit" style="cursor:pointer" value="Add Tenant"/>
</form>
<br/><br/>
<h2>
Add New Lease
</h2>
<form name="lease" action="add-lease.php" method="post">
<input type="hidden" name="aptNum" value=<?php echo $_GET['aptNum']; ?> />
<input type="hidden" name="buildingName" value=<?php echo $_GET['buildingName']; ?> />
<input type="submit" style="cursor:pointer" value="Add Lease" />
</form>
<br/><br/>
<form name="goBack" action="tenants.php">
<input type="hidden" name="buildingName" value=<?php echo $_GET['buildingName']; ?> />
<input type="hidden" name="aptNum" value=<?php echo $_GET['aptNum']; ?> />
<input type="submit" style="cursor:pointer" value="Return" />
</form>
</body>
</html>