Professional Documents
Culture Documents
Abstract
Objective:
The project titled “House Rental Management System” is designed using PHP as front
end And MYSQL as back end.
The House Rental Management System is a software application designed to automate the
process of managing rental properties. The system allows property owners and managers to keep
track of tenants, leases, and rent payments. The application also provides an online platform for
tenants to submit maintenance requests and communicate with property managers. The system is
designed to improve efficiency, reduce costs, and increase transparency in the rental property
management process. Overall, the House Rental Management System is a valuable tool for
property owners and managers to manage their rental properties more effectively.
1
2
3
Introduction
The House Rental Management System is a software application designed to help property
managers or landlords to manage their rental properties efficiently. The system allows for the
easy and centralized management of properties, tenants, payments, and maintenance
requests. This documentation aims to provide a comprehensive guide to understanding the
features and functionality of the House Rental Management System.
1.1Content
Property Management:
The system allows property managers to create and manage their properties effectively. The
system enables property managers to add, edit, and delete properties. The properties can be
categorized based on location, type, and availability.
Tenant Management:
The system allows property managers to manage tenants’ information, including their contact
details, lease agreements, and rental payment history. Property managers can create and manage
tenant accounts, assign properties to them, and track their payment history.
Payment Management:
The system provides a platform for managing rental payments. Property managers can track
payment history, generate payment receipts, and view payment summaries.
User Management:
The system provides an authentication system for users. Property managers and tenants can log
in to the system using their credentials. The system also enables property managers to create and
4
manage user accounts.
Analysis
A house rental management system is a software application designed to manage rental
properties. The system typically includes features such as property listings, tenant management,
lease tracking, rent collection, and accounting.
One of the main benefits of a house rental management system is that it streamlines the rental
process, making it easier for landlords and property managers to manage their properties. By
automating many of the processes involved in rental management, such as rent collection and
lease tracking, the system saves time and reduces the risk of errors.
5
Deposit paid Terms and conditions to follow acceptance. With the current system recording the
details of various activities of user is completely manual and entails a lot of paper work The
existing system only provides text based interface which is not as user friendly as Graphical user
interface. Since the system is implemented manually, the response is very slow.
System Specification
2. 256 MB Ram
4. Hard disk 10 GB
6
3.2 Software Requirements
1. Operation System: Windows/Linux any one
4. Front-End: PHP
Language Specification
How to Run PHP Files:
If you double click on a HTML file (files with .html or .htm extension),
it would open on your web browser. But same won’t happen if you double clicked on a PHP file
(probably it would open in an editor). The reason is PHP files first need be processed in a web
server before sending their output to the web browser. Therefore before running PHP files, they
should be placed inside the web folder of a web server and then make a request to desired PHP
file by typing its URL in the web browser. If you installed a web server in your computer,
usually the root of its web folder can be accessed by typing http://localhost in the web browser.
So, if you placed a file called House_rental inside its web folder, you can run that file by calling
http://localhost/ House_rental.php. Web folder can be changed based on your web
7
corporations to specialized embedded applications on every continent in the world. (Yes, even
Antarctica!) Not only is MYSQL the world's most popular open source database, it's also
Become the database of choice for a new generation of applications built on the LAMP stack
(Linux, Apache, MYSQL, PHP / Perl / Python.) MYSQL runs on more than 20 platforms
including Linux, Windows, OS/X, HP-UX, AIX, Netware, giving you the kind of flexibility that
puts you in control. Whether you're new to database technology or an experienced developer or
DBA, MYSQL offers a comprehensive range of certified software, support, training and
Consulting to make you successful.
2. High Performance :
A unique storage-engine architecture allows database professionals to configure the MySQL
database server specifically for particular applications, with the end result being amazing
performance results. Whether the intended application is a high-speed transactional processing
system or a high-volume web site that services a billion queries a day, MySQL can meet the
most demanding performance expectations of any system. With high-speed load utilities,
distinctive memory caches, full text indexes, and other performance-enhancing mechanisms,
MySQL offers all the right ammunition for today's critical business systems.
3. High Availability:
8
Rock-solid reliability and constant availability are hallmarks of MySQL, with customers relying
on MySQL to guarantee around-the-clock uptime. MySQL offers a variety of high-availability
options from high-speed master/slave replication configurations, to specialized Cluster servers
offering instant failover, to third party vendors offering unique high-availability solutions for the
MySQL database server.
9
level being possible. SSH and SSL support are also provided to ensure safe and secure
connections. A granular object privilege framework is present so that users only see the data they
should, and powerful data encryption and decryption functions ensure that sensitive data is
protected from unauthorized viewing. Finally, backup and recovery utilities provided through
MySQL and third party software vendors allow for complete logical and physical backup as well
as full and point-in-time recovery.
8. Management Ease:
MySQL offers exceptional quick-start capability with the average time from software download
to installation completion being less than fifteen minutes. This rule holds true whether the
platform is Microsoft Windows, Linux, Macintosh, or UNIX. Once installed, self-management
features like automatic space expansion, auto-restart, and dynamic configuration changes take
much of the burden off already overworked database administrators. MySQL also provides a
complete suite of graphical management and migration tools that allow a DBA to manage,
troubleshoot, and control the operation of many MySQL servers from a single workstation.
Many third party software vendor tools are also available for MySQL that handle tasks ranging
from data design and ETL, to complete database administration, job management, and
10
performance monitoring.
9. Open Source Freedom and 24 x 7 Support:
Many corporations are hesitant to fully commit to open source software because they believe
they can't get the type of support or professional service safety nets they currently rely on with
proprietary software to ensure the overall success of their key applications. The questions of
indemnification come up often as well. These worries can be put to rest with MySQL as
complete around-the-clock support as well as indemnification is available through MySQL
Network. MySQL is not a typical open source project as all the software is owned and supported
by MySQL AB, and because of this, a unique cost and support model are available that provides
a unique combination of open source freedom and trusted software with support
11
Meta Data Services MYSQL database consist of six type of objects,
They are,
1. TABLE
2. QUERY
3. FORM
4. REPORT
5. MACRO
TABLE:
A database is a collection of data about a specific topic.
VIEWS OF TABLE:
We can work with a table in two types,
1. Design View
2. Datasheet View
Design View
To build or modify the structure of a table we work in the table design view. We can specify
what kind of data will be hold.
Datasheet View
To add, edit or analyses the data itself we work in tables datasheet view mode.
QUERY:
A query is a question that has to be asked the data. Access gathers data that answers the question
from one or more table. The data that make up the answer is either dynaset (if you edit it) or a
snapshot(it cannot be edited).Each time we run query, we get latest information in the
dynaset.Access either displays the dynaset or snapshot for us to view or perform an action on it
12
,such as deleting or updating.
FORMS:
A form is used to view and edit information in the database record by record .A form displays
only the information we want to see in the way we want to see it. Forms use the familiar controls
such as textboxes and checkboxes. This makes viewing and entering data easy.
Views of Form:
We can work with forms in several primarily there are two views
They are,
1. Design View
2. Form View
Design View
To build or modify the structure of a form, we work in forms design view. We can add control
to the form that are bound to fields in a table or query, includes textboxes, option buttons, graphs
and pictures.
Form View
The form view which display the whole design of the form.
REPORT:
A report is used to vies and print information from the database. The report can ground records
into many levels and compute totals and average by checking values from many records at once.
Also the report is attractive and distinctive because we have control over the size and appearance
of it.
MACRO:
13
A macro is a set of actions. Each action in macros does something. Such as opening a form or
printing a report .We write macros to automate the common tasks the work easy and save the
time.
MODULE:
Modules are units of code written in access basic language. We can write and use module to
automate and customize the database in very sophisticated ways. It is a personal computer based
RDBMS. This provides most of the features available in the high-end RDBMS products like
Oracle, Sybase, and Ingress etc. VB keeps access as its native database. Developer can create a
database for development & further can create. The tables are required to store data. During the
initial Development phase data can be stored in the access database & during the implementation
phase depending on the volume data can use a higher – end database.
System Design
5.1 INPUT DESIGN:
Input design is the process of converting user oriented inputs to a computer based format, which
gets the credentials details from the supplier
INPUT DESIGN
14
5.2 OUTPUT DESIGN:
Output generally refers to the results and information that are generated by the system. For many
end users, outputs are the main reason for developing the system and the basics on which they
will evaluate the usefulness of the application.Users generally merit the system analyst works
easily with the user through an interactive process, until the result is considered to be
specification
OUTPUT DESIGN
15
DASHBOARD DESIGN
16
HOUSE LIST DESIGN
17
PAYMENT DESIGN
18
REPORT DESIGN
19
20
6.CODING
admin_class.php
<?php
session_start();
ini_set('display_errors', 1);
Class Action {
private $db;
ob_start();
include 'db_connect.php';
$this->db = $conn;
function __destruct() {
$this->db->close();
ob_end_flush();
function login(){
extract($_POST);
$_SESSION['login_'.$key] = $value;
if($_SESSION['login_type'] != 1){
unset($_SESSION[$key]);
return 2 ;
21
exit;
return 1;
}else{
return 3;
function login2(){
extract($_POST);
if(isset($email))
$username = $email;
$_SESSION['login_'.$key] = $value;
$_SESSION['bio'][$key] = $value;
if($_SESSION['bio']['status'] != 1){
unset($_SESSION[$key]);
return 2 ;
exit;
22
}
return 1;
}else{
return 3;
function logout(){
session_destroy();
unset($_SESSION[$key]);
header("location:login.php");
function logout2(){
session_destroy();
unset($_SESSION[$key]);
header("location:../index.php");
function save_user(){
extract($_POST);
if(!empty($password))
if($type == 1)
$establishment_id = 0;
23
return 2;
exit;
if(empty($id)){
}else{
if($save){
return 1;
function delete_user(){
extract($_POST);
if($delete)
return 1;
function signup(){
extract($_POST);
return 2;
exit;
if($save){
$uid = $this->db->insert_id;
$data = '';
24
if($k =='password')
continue;
else
if($_FILES['img']['tmp_name'] != ''){
$fname = strtotime(date('y-m-d
H:i')).'_'.$_FILES['img']['name'];
$move =
move_uploaded_file($_FILES['img']['tmp_name'],'assets/uploads/'. $fname);
if($data){
$aid = $this->db->insert_id;
$login = $this->login2();
if($login)
return 1;
function update_account(){
extract($_POST);
if(!empty($password))
25
return 2;
exit;
if($save){
$data = '';
if($k =='password')
continue;
else
if($_FILES['img']['tmp_name'] != ''){
$fname = strtotime(date('y-m-d
H:i')).'_'.$_FILES['img']['name'];
$move =
move_uploaded_file($_FILES['img']['tmp_name'],'assets/uploads/'. $fname);
if($data){
unset($_SESSION[$key]);
$login = $this->login2();
if($login)
return 1;
26
function save_settings(){
extract($_POST);
if($_FILES['img']['tmp_name'] != ''){
$fname = strtotime(date('y-m-d
H:i')).'_'.$_FILES['img']['name'];
$move =
move_uploaded_file($_FILES['img']['tmp_name'],'assets/uploads/'. $fname);
}else{
if($save){
if(!is_numeric($key))
$_SESSION['system'][$key] = $value;
return 1;
27
function save_category(){
extract($_POST);
if(empty($id)){
}else{
if($save)
return 1;
function delete_category(){
extract($_POST);
if($delete){
return 1;
function save_house(){
extract($_POST);
if($chk > 0 ){
return 2;
exit;
if(empty($id)){
28
}else{
if($save)
return 1;
function delete_house(){
extract($_POST);
if($delete){
return 1;
function save_tenant(){
extract($_POST);
if(empty($id)){
}else{
if($save)
return 1;
29
function delete_tenant(){
extract($_POST);
if($delete){
return 1;
function get_tdetails(){
extract($_POST);
$data =array();
if(!is_numeric($k)){
$$k = $v;
$data['months'] = $months;
$data['payable'] = number_format($payable,2);
$data['paid'] = number_format($paid,2);
$data['price'] = number_format($price,2);
$data['name'] = ucwords($name);
30
return json_encode($data);
function save_payment(){
extract($_POST);
$data = "";
if(empty($data)){
}else{
if(empty($id)){
$id=$this->db->insert_id;
}else{
if($save){
return 1;
function delete_payment(){
extract($_POST);
if($delete){
return 1;
31
}
ajax.php
<?php
ob_start();
$action = $_GET['action'];
include 'admin_class.php';
if($action == 'login'){
$login = $crud->login();
if($login)
echo $login;
if($action == 'login2'){
$login = $crud->login2();
if($login)
echo $login;
if($action == 'logout'){
$logout = $crud->logout();
if($logout)
echo $logout;
if($action == 'logout2'){
$logout = $crud->logout2();
if($logout)
echo $logout;
if($action == 'save_user'){
$save = $crud->save_user();
if($save)
echo $save;
32
if($action == 'delete_user'){
$save = $crud->delete_user();
if($save)
echo $save;
if($action == 'signup'){
$save = $crud->signup();
if($save)
echo $save;
if($action == 'update_account'){
$save = $crud->update_account();
if($save)
echo $save;
if($action == "save_settings"){
$save = $crud->save_settings();
if($save)
echo $save;
if($action == "save_category"){
$save = $crud->save_category();
if($save)
echo $save;
if($action == "delete_category"){
$delete = $crud->delete_category();
if($delete)
echo $delete;
if($action == "save_house"){
$save = $crud->save_house();
if($save)
33
echo $save;
if($action == "delete_house"){
$save = $crud->delete_house();
if($save)
echo $save;
if($action == "save_tenant"){
$save = $crud->save_tenant();
if($save)
echo $save;
if($action == "delete_tenant"){
$save = $crud->delete_tenant();
if($save)
echo $save;
if($action == "get_tdetails"){
$get = $crud->get_tdetails();
if($get)
echo $get;
if($action == "save_payment"){
$save = $crud->save_payment();
if($save)
echo $save;
if($action == "delete_payment"){
$save = $crud->delete_payment();
if($save)
echo $save;
34
ob_end_flush();
?>
balance_report.php
<?php include 'db_connect.php' ?>
<style>
.on-print{
display: none;
</style>
<noscript>
<style>
.text-center{
text-align:center;
.text-right{
text-align:right;
table{
width: 100%;
border-collapse: collapse
tr,td,th{
</style>
</noscript>
<div class="container-fluid">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="col-md-12">
35
<hr>
<div class="row">
</div>
</div>
<div id="report">
<div class="on-print">
<p><center>Rental Balances
Report</center></p>
</div>
<div class="row">
<thead>
<tr>
<th>#</th>
<th>Tenant</th>
<th>House #</th>
<th>Monthly
Rate</th>
<th>Payable
Months</th>
<th>Payable
Amount</th>
<th>Paid</th>
<th>Outstanding
Balance</th>
<th>Last
Payment</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
36
// $tamount = 0;
$tenants =$conn-
>query("SELECT t.*,concat(t.lastname,', ',t.firstname,' ',t.middlename) as
name,h.house_no,h.price FROM tenants t inner join houses h on h.id = t.house_id where
t.status = 1 order by h.house_no desc ");
if($tenants->num_rows >
0):
while($row=$tenants-
>fetch_assoc()):
$months =
abs(strtotime(date('Y-m-d')." 23:59:59") - strtotime($row['date_in']." 23:59:59"));
$months =
floor(($months) / (30*60*60*24));
$payable =
$row['price'] * $months;
$paid = $conn-
>query("SELECT SUM(amount) as paid FROM payments where tenant_id =".$row['id']);
$last_payment =
$conn->query("SELECT * FROM payments where tenant_id =".$row['id']." order by
unix_timestamp(date_created) desc limit 1");
$paid = $paid-
>num_rows > 0 ? $paid->fetch_array()['paid'] : 0;
$last_payment =
$last_payment->num_rows > 0 ? date("M d, Y",strtotime($last_payment-
>fetch_array()['date_created'])) : 'N/A';
$outstanding =
$payable - $paid;
?>
<tr>
<td><?php echo
ucwords($row['name']) ?></td>
<td><?php echo
$row['house_no'] ?></td>
<td class="text-
right"><?php echo number_format($row['price'],2) ?></td>
<td class="text-
right"><?php echo $months.' mo/s' ?></td>
<td class="text-
right"><?php echo number_format($payable,2) ?></td>
<td class="text-
right"><?php echo number_format($paid,2) ?></td>
37
<td class="text-
right"><?php echo number_format($outstanding,2) ?></td>
<td><?php echo
date('M d,Y',strtotime($last_payment)) ?></td>
</tr>
<tr>
<th
colspan="9"><center>No Data.</center></th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$('#print').click(function(){
var nw = window.open("","_blank","width=800,height=700");
nw.document.write(_style.html())
nw.document.write(_content.html())
nw.document.close()
nw.print()
setTimeout(function(){
nw.close()
},500)
})
$('#filter-report').submit(function(e){
38
e.preventDefault()
location.href = 'index.php?page=payment_report&'+$(this).serialize()
})
</script>
categories.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="row">
<div class="col-md-4">
<div class="card">
<div class="card-header">
Category Form
</div>
<div class="card-body">
<div class="form-group">
<label class="control-
label">Name</label>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12">
39
</div>
</div>
</div>
</div>
</form>
</div>
<div class="col-md-8">
<div class="card">
<div class="card-header">
<b>Category List</b>
</div>
<div class="card-body">
<thead>
<tr>
<th class="text-
center">#</th>
<th class="text-
center">Category</th>
<th class="text-
center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$category = $conn->query("SELECT
* FROM categories order by id asc");
while($row=$category-
>fetch_assoc()):
?>
<tr>
40
<td class="text-
center"><?php echo $i++ ?></td>
<td class="">
<p><b><?php echo
$row['name'] ?></b></p>
</td>
<td class="text-center">
<button class="btn
btn-sm btn-primary edit_category" type="button" data-id="<?php echo $row['id'] ?>"
data-name="<?php echo $row['name'] ?>" >Edit</button>
<button class="btn
btn-sm btn-danger delete_category" type="button" data-id="<?php echo $row['id']
?>">Delete</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
td{
</style>
<script>
$('#manage-category').submit(function(e){
e.preventDefault()
start_load()
41
$.ajax({
url:'ajax.php?action=save_category',
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
else if(resp==2){
setTimeout(function(){
location.reload()
},1500)
})
})
$('.edit_category').click(function(){
start_load()
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='name']").val($(this).attr('data-name'))
end_load()
})
42
$('.delete_category').click(function(){
})
function delete_category($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_category',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
})
$('table').dataTable()
</script>
db_connect.php
<?php
header.php
<meta content="" name="descriptison">
43
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700
,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,5
00,500i,600,600i,700,700i" rel="stylesheet">
<link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css"
rel="stylesheet">
<link href="assets/vendor/bootstrap-datepicker/css/bootstrap-datepicker.min.css"
rel="stylesheet">
<script src="assets/vendor/jquery/jquery.min.js"></script>
<script src="assets/DataTables/datatables.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<script src="assets/vendor/venobox/venobox.min.js"></script>
<script src="assets/vendor/waypoints/jquery.waypoints.min.js"></script>
<script src="assets/vendor/counterup/counterup.min.js"></script>
44
<script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
<script src="assets/vendor/bootstrap-datepicker/js/bootstrap-
datepicker.min.js"></script>
<script type="text/javascript"
src="assets/js/jquery.datetimepicker.full.min.js"></script>
home.php
<?php include 'db_connect.php' ?>
<style>
span.float-right.summary_icon {
font-size: 3rem;
position: absolute;
right: 1rem;
top: 0;
.imgs{
margin: .5em;
max-width: calc(100%);
max-height: calc(100%);
.imgs img{
max-width: calc(100%);
max-height: calc(100%);
cursor: pointer;
#imagesCarousel .carousel-item.active{
45
#imagesCarousel .carousel-item-next{
margin: auto;
#imagesCarousel img{
width: auto!important;
height: auto!important;
max-height: calc(100%)!important;
max-width: calc(100%)!important;
</style>
<div class="containe-fluid">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<hr>
<div class="row">
<h4><b>
</b></h4>
<p><b>Total Houses</b></p>
</div>
</div>
46
<div class="card-footer">
<div class="row">
<div class="col-lg-12">
<a href="index.php?page=houses"
class="text-primary float-right">View List <span class="fa fa-angle-right"></span></a>
</div>
</div>
</div>
</div>
</div>
<h4><b>
</b></h4>
<p><b>Total Tenants</b></p>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-lg-12">
<a href="index.php?page=tenants"
class="text-primary float-right">View List <span class="fa fa-angle-right"></span></a>
</div>
</div>
</div>
</div>
</div>
47
<div class="card-body text-white">
<h4><b>
<?php
$payment = $conn->query("SELECT
sum(amount) as paid FROM payments where date(date_created) = '".date('Y-m-d')."' ");
?>
</b></h4>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-lg-12">
<a href="index.php?page=invoices"
class="text-primary float-right">View Payments <span class="fa fa-angle-
right"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$('#manage-records').submit(function(e){
e.preventDefault()
48
start_load()
$.ajax({
url:'ajax.php?action=save_track',
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
resp=JSON.parse(resp)
if(resp.status==1){
setTimeout(function(){
location.reload()
},800)
})
})
$('#tracking_id').on('keypress',function(e){
if(e.which == 13){
get_person()
})
$('#check').on('click',function(e){
get_person()
})
function get_person(){
start_load()
$.ajax({
url:'ajax.php?action=get_pdetails',
49
method:"POST",
data:{tracking_id : $('#tracking_id').val()},
success:function(resp){
if(resp){
resp = JSON.parse(resp)
if(resp.status == 1){
$('#name').html(resp.name)
$('#address').html(resp.address)
$('[name="person_id"]').val(resp.id)
$('#details').show()
end_load()
end_load();
})
</script>
houses.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="row">
<div class="col-md-4">
<div class="card">
<div class="card-header">
50
House Form
</div>
<div class="card-body">
<div class="form-group">
<label class="control-
label">House No</label>
</div>
<div class="form-group">
<label class="control-
label">Category</label>
<?php
$categories = $conn-
>query("SELECT * FROM categories order by name asc");
if($categories->num_rows >
0):
while($row= $categories-
>fetch_assoc()) :
?>
<option selected=""
value="" disabled="">Please check the category list.</option>
</select>
</div>
<div class="form-group">
<textarea name="description"
id="" cols="30" rows="4" class="form-control" required></textarea>
</div>
51
<div class="form-group">
<label class="control-
label">Price</label>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12">
</div>
</div>
</div>
</div>
</form>
</div>
<div class="col-md-8">
<div class="card">
<div class="card-header">
<b>House List</b>
</div>
<div class="card-body">
<thead>
<tr>
<th class="text-
center">#</th>
<th class="text-
center">House</th>
52
<th class="text-
center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$house = $conn->query("SELECT
h.*,c.name as cname FROM houses h inner join categories c on c.id = h.category_id
order by id asc");
while($row=$house-
>fetch_assoc()):
?>
<tr>
<td class="text-
center"><?php echo $i++ ?></td>
<td class="">
<p>House #:
<b><?php echo $row['house_no'] ?></b></p>
<p><small>House
Type: <b><?php echo $row['cname'] ?></b></small></p>
<p><small>Price:
<b><?php echo number_format($row['price'],2) ?></b></small></p>
</td>
<td class="text-center">
<button class="btn
btn-sm btn-primary edit_house" type="button" data-id="<?php echo $row['id'] ?>" data-
house_no="<?php echo $row['house_no'] ?>" data-description="<?php echo
$row['description'] ?>" data-category_id="<?php echo $row['category_id'] ?>" data-
price="<?php echo $row['price'] ?>" >Edit</button>
<button class="btn
btn-sm btn-danger delete_house" type="button" data-id="<?php echo $row['id']
?>">Delete</button>
</td>
</tr>
</tbody>
</table>
53
</div>
</div>
</div>
</div>
</div>
</div>
<style>
td{
td p {
margin: unset;
padding: unset;
line-height: 1em;
</style>
<script>
$('#manage-house').on('reset',function(e){
$('#msg').html('')
})
$('#manage-house').submit(function(e){
e.preventDefault()
start_load()
$('#msg').html('')
$.ajax({
url:'ajax.php?action=save_house',
cache: false,
contentType: false,
processData: false,
method: 'POST',
54
type: 'POST',
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
else if(resp==2){
end_load()
})
})
$('.edit_house').click(function(){
start_load()
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='house_no']").val($(this).attr('data-house_no'))
cat.find("[name='description']").val($(this).attr('data-description'))
cat.find("[name='price']").val($(this).attr('data-price'))
cat.find("[name='category_id']").val($(this).attr('data-category_id'))
end_load()
})
$('.delete_house').click(function(){
})
function delete_house($id){
start_load()
$.ajax({
55
url:'ajax.php?action=delete_house',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
})
$('table').dataTable()
</script>
index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<?php
if(!isset($_SESSION['login_id']))
header('location:login.php');
include('./header.php');
56
// include('./auth.php');
?>
</head>
<style>
body{
background: #80808045;
.modal-dialog.large {
max-width: unset;
.modal-dialog.mid-large {
max-width: unset;
#viewer_modal .btn-close {
position: absolute;
z-index: 999999;
/*right: -4.5em;*/
background: unset;
color: white;
border: unset;
font-size: 27px;
top: 0;
#viewer_modal .modal-dialog {
width: 80%;
max-width: unset;
height: calc(90%);
max-height: unset;
#viewer_modal .modal-content {
background: black;
57
border: unset;
height: calc(100%);
display: flex;
align-items: center;
justify-content: center;
max-height: calc(100%);
max-width: calc(100%);
</style>
<body>
</div>
</div>
</main>
<div id="preloader"></div>
<div class="modal-content">
58
<div class="modal-header">
<h5 class="modal-title">Confirmation</h5>
</div>
<div class="modal-body">
<div id="delete_content"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"></h5>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div class="modal-content">
59
<button type="button" class="btn-close" data-dismiss="modal"><span
class="fa fa-times"></span></button>
</div>
</div>
</div>
</body>
<script>
window.start_load = function(){
$('body').prepend('<di id="preloader2"></di>')
window.end_load = function(){
$('#preloader2').fadeOut('fast', function() {
$(this).remove();
})
start_load()
var t = $src.split('.')
t = t[1]
if(t =='mp4'){
}else{
$('#viewer_modal .modal-content').append(view)
$('#viewer_modal').modal({
show:true,
backdrop:'static',
keyboard:false,
focus:true
})
end_load()
60
}
start_load()
$.ajax({
url:$url,
error:err=>{
console.log()
},
success:function(resp){
if(resp){
$('#uni_modal .modal-title').html($title)
$('#uni_modal .modal-body').html(resp)
if($size != ''){
$('#uni_modal .modal-dialog').addClass($size)
}else{
$('#uni_modal .modal-dialog').removeAttr("class").addClass("modal-
dialog modal-md")
$('#uni_modal').modal({
show:true,
backdrop:'static',
keyboard:false,
focus:true
})
end_load()
})
$('#confirm_modal #confirm').attr('onclick',$func+"("+$params.join(',')+")")
$('#confirm_modal .modal-body').html($msg)
61
$('#confirm_modal').modal('show')
$('#alert_toast').removeClass('bg-success')
$('#alert_toast').removeClass('bg-danger')
$('#alert_toast').removeClass('bg-info')
$('#alert_toast').removeClass('bg-warning')
if($bg == 'success')
$('#alert_toast').addClass('bg-success')
if($bg == 'danger')
$('#alert_toast').addClass('bg-danger')
if($bg == 'info')
$('#alert_toast').addClass('bg-info')
if($bg == 'warning')
$('#alert_toast').addClass('bg-warning')
$('#alert_toast .toast-body').html($msg)
$('#alert_toast').toast({delay:3000}).toast('show');
$(document).ready(function(){
$('#preloader').fadeOut('fast', function() {
$(this).remove();
})
})
$('.datetimepicker').datetimepicker({
format:'Y/m/d H:i',
startDate: '+3d'
})
$('.select2').select2({
width: "100%"
})
</script>
</html>
62
invoices.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<b>List of Payments</b>
</a></span>
</div>
<div class="card-body">
<thead>
<tr>
<th class="text-
center">#</th>
<th class="">Date</th>
<th class="">Tenant</th>
<th class="">Invoice</th>
<th class="">Amount</th>
63
<th class="text-
center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$invoices = $conn->query("SELECT
p.*,concat(t.lastname,', ',t.firstname,' ',t.middlename) as name FROM payments p inner
join tenants t on t.id = p.tenant_id where t.status = 1 order by date(p.date_created)
desc ");
while($row=$invoices-
>fetch_assoc()):
?>
<tr>
<td class="text-
center"><?php echo $i++ ?></td>
<td>
</td>
<td class="">
</td>
<td class="">
</td>
<td class="text-right">
</td>
<td class="text-center">
<button class="btn
btn-sm btn-outline-primary edit_invoice" type="button" data-id="<?php echo $row['id']
?>" >Edit</button>
64
<button class="btn
btn-sm btn-outline-danger delete_invoice" type="button" data-id="<?php echo $row['id']
?>">Delete</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
td{
td p{
margin: unset
img{
max-width:100px;
max-height: :150px;
</style>
<script>
$(document).ready(function(){
$('table').dataTable()
})
$('#new_invoice').click(function(){
65
uni_modal("New invoice","manage_payment.php","mid-large")
})
$('.edit_invoice').click(function(){
uni_modal("Manage invoice
Details","manage_payment.php?id="+$(this).attr('data-id'),"mid-large")
})
$('.delete_invoice').click(function(){
})
function delete_invoice($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_payment',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
})
</script>
66
login.php
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
include('./db_connect.php');
ob_start();
if(!isset($_SESSION['system'])){
$_SESSION['system'][$k] = $v;
ob_end_flush();
?>
<head>
<meta charset="utf-8">
<?php
if(isset($_SESSION['login_id']))
header("location:index.php?page=home");
?>
</head>
<style>
body{
width: 100%;
height: calc(100%);
67
/*background: #007bff;*/
main#main{
width:100%;
height: calc(100%);
background:white;
#login-right{
position: absolute;
right:0;
width:40%;
height: calc(100%);
background:white;
display: flex;
align-items: center;
#login-left{
position: absolute;
left:0;
width:60%;
height: calc(100%);
background:#59b6ec61;
display: flex;
align-items: center;
/*background: url(assets/uploads/blood-cells.jpg);
background-repeat: no-repeat;
background-size: cover;*/
#login-right .card{
margin: auto;
z-index: 1
.logo {
margin: auto;
68
font-size: 8rem;
background: white;
color: #000000b3;
z-index: 10;
div#login-right::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: calc(100%);
height: calc(100%);
/*background: #000000e0;*/
</style>
<body>
</div>
<div class="w-100">
<br>
<br>
<div class="card-body">
69
<form id="login-form" >
<div class="form-group">
</div>
<div class="form-group">
</div>
</form>
</div>
</div>
</div>
</div>
</main>
</body>
<script>
$('#login-form').submit(function(e){
e.preventDefault()
$('#login-form
button[type="button"]').attr('disabled',true).html('Logging in...');
if($(this).find('.alert-danger').length > 0 )
$(this).find('.alert-danger').remove();
$.ajax({
url:'ajax.php?action=login',
70
method:'POST',
data:$(this).serialize(),
error:err=>{
console.log(err)
$('#login-form
button[type="button"]').removeAttr('disabled').html('Login');
},
success:function(resp){
if(resp == 1){
location.href ='index.php?page=home';
}else{
$('#login-form
button[type="button"]').removeAttr('disabled').html('Login');
})
})
</script>
</html>
manage_payment.php
<?php
include 'db_connect.php';
if(isset($_GET['id'])){
$$k=$val;
?>
<div class="container-fluid">
71
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div id="msg"></div>
<div class="form-group">
<option value=""></option>
<?php
while($row=$tenant->fetch_assoc()):
?>
</select>
</div>
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
</div>
</form>
</div>
72
<div class='d'>
<large><b>Details</b></large>
<hr>
<hr>
</div>
</div>
<script>
$(document).ready(function(){
$('#tenant_id').trigger('change')
})
$('.select2').select2({
width:"100%"
})
$('#tenant_id').change(function(){
if($(this).val() <= 0)
return false;
start_load()
$.ajax({
url:'ajax.php?action=get_tdetails',
method:'POST',
success:function(resp){
if(resp){
resp = JSON.parse(resp)
73
details.find('.tname').text(resp.name)
details.find('.price').text(resp.price)
details.find('.outstanding').text(resp.outstanding)
details.find('.total_paid').text(resp.paid)
details.find('.rent_started').text(resp.rent_started)
details.find('.payable_months').text(resp.months)
console.log(details.html())
$('#details').html(details)
},
complete:function(){
end_load()
})
})
$('#manage-payment').submit(function(e){
e.preventDefault()
start_load()
$('#msg').html('')
$.ajax({
url:'ajax.php?action=save_payment',
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1000)
74
}
})
})
</script>
manage_tenant.php
<?php
include 'db_connect.php';
if(isset($_GET['id'])){
$$k=$val;
?>
<div class="container-fluid">
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
</div>
75
<div class="form-group row">
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
</div>
<div class="col-md-4">
<option value=""></option>
<?php
while($row= $house->fetch_assoc()):
?>
</select>
</div>
<div class="col-md-4">
76
<input type="date" class="form-control" name="date_in"
value="<?php echo isset($date_in) ? date("Y-m-d",strtotime($date_in)) :'' ?>"
required>
</div>
<div class="col-md-4">
</div>
</div>
</form>
</div>
<script>
$('#manage-tenant').submit(function(e){
e.preventDefault()
start_load()
$('#msg').html('')
$.ajax({
url:'ajax.php?action=save_tenant',
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1000)
})
77
})
</script>
manage_user.php
<?php
include('db_connect.php');
session_start();
if(isset($_GET['id'])){
foreach($user->fetch_array() as $k =>$v){
$meta[$k] = $v;
?>
<div class="container-fluid">
<div id="msg"></div>
<div class="form-group">
<label for="name">Name</label>
</div>
<div class="form-group">
<label for="username">Username</label>
</div>
<div class="form-group">
<label for="password">Password</label>
78
<small><i>Leave this blank if you dont want to change the
password.</i></small>
</div>
<div class="form-group">
</select>
</div>
</form>
</div>
<script>
$('#manage-user').submit(function(e){
e.preventDefault();
start_load()
$.ajax({
url:'ajax.php?action=save_user',
method:'POST',
data:$(this).serialize(),
success:function(resp){
if(resp ==1){
79
setTimeout(function(){
location.reload()
},1500)
}else{
end_load()
})
})
</script>
navbar.php
<style>
.collapse a{
text-indent:10px;
nav#sidebar{
</style>
<div class="sidebar-list">
80
<a href="index.php?page=tenants" class="nav-item nav-
tenants"><span class='icon-field'><i class="fa fa-user-friends "></i></span>
Tenants</a>
</div>
</nav>
<script>
$('.nav_collapse').click(function(){
console.log($(this).attr('href'))
$($(this).attr('href')).collapse()
})
</script>
payment_report.php
<?php include 'db_connect.php' ?>
<?php
?>
<style>
.on-print{
display: none;
81
</style>
<noscript>
<style>
.text-center{
text-align:center;
.text-right{
text-align:right;
table{
width: 100%;
border-collapse: collapse
tr,td,th{
</style>
</noscript>
<div class="container-fluid">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="col-md-12">
<form id="filter-report">
</div>
</form>
<hr>
<div class="row">
82
<div class="col-md-12 mb-2">
</div>
</div>
<div id="report">
<div class="on-print">
<p><center>Rental Payments
Report</center></p>
</div>
<div class="row">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Tenant</th>
<th>House #</th>
<th>Invoice</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$tamount = 0;
$payments = $conn-
>query("SELECT p.*,concat(t.lastname,', ',t.firstname,' ',t.middlename) as
name,h.house_no FROM payments p inner join tenants t on t.id = p.tenant_id inner join
houses h on h.id = t.house_id where date_format(p.date_created,'%Y-%m') = '$month_of'
order by unix_timestamp(date_created) asc");
if($payments->num_rows > 0
):
while($row=$payments-
>fetch_assoc()):
83
$tamount +=
$row['amount'];
?>
<tr>
<td><?php echo
date('M d,Y',strtotime($row['date_created'])) ?></td>
<td><?php echo
ucwords($row['name']) ?></td>
<td><?php echo
$row['house_no'] ?></td>
<td><?php echo
$row['invoice'] ?></td>
<td class="text-
right"><?php echo number_format($row['amount'],2) ?></td>
</tr>
<tr>
<th
colspan="6"><center>No Data.</center></th>
</tr>
</tbody>
<tfoot>
<tr>
<th
colspan="5">Total Amount</th>
<th class='text-
right'><?php echo number_format($tamount,2) ?></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
84
</div>
</div>
</div>
<script>
$('#print').click(function(){
var nw = window.open("","_blank","width=800,height=700");
nw.document.write(_style.html())
nw.document.write(_content.html())
nw.document.close()
nw.print()
setTimeout(function(){
nw.close()
},500)
})
$('#filter-report').submit(function(e){
e.preventDefault()
location.href = 'index.php?page=payment_report&'+$(this).serialize()
})
</script>
payments.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="col-md-12">
</div>
</div>
<div class="row">
85
<!-- FORM Panel -->
<div class="col-md-12">
<div class="card">
<div class="card-header">
<b>List of Payments</b>
</a></span>
</div>
<div class="card-body">
<thead>
<tr>
<th class="text-
center">#</th>
<th class="">Tenant</th>
<th class="">Outstanding
Balance</th>
<th class="">Last
Payment</th>
<th class="text-
center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$tenants =$conn->query("SELECT
t.*,concat(t.lastname,', ',t.firstname,' ',t.middlename) as name,h.house_no,h.price
FROM tenants t inner join houses h on h.id = t.house_id where t.status = 1 order by
h.house_no desc ");
while($row=$tenants-
>fetch_assoc()):
86
$months =
abs(strtotime(date('Y-m-d')." 23:59:59") - strtotime($row['date_in']." 23:59:59"));
$months = floor(($months)
/ (30*60*60*24));
$payable = $row['price'] *
$months;
$paid = $conn-
>query("SELECT SUM(amount) as paid FROM payments where tenant_id =".$row['id']);
$last_payment = $conn-
>query("SELECT * FROM payments where tenant_id =".$row['id']." order by
unix_timestamp(date_created) desc limit 1");
$last_payment =
$last_payment->num_rows > 0 ? date("M d, Y",strtotime($last_payment-
>fetch_array()['date_created'])) : 'N/A';
$outstanding = $payable -
$paid;
?>
<tr>
<td class="text-
center"><?php echo $i++ ?></td>
<td class="">
</td>
<td class="">
</td>
<td class="text-right">
</td>
<td class="">
<p><b><?php echo
$last_payment ?></b></p>
</td>
<td class="text-center">
87
<button class="btn
btn-sm btn-outline-primary view_payment" type="button" data-id="<?php echo $row['id']
?>" >View</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
td{
td p{
margin: unset
img{
max-width:100px;
max-height: :150px;
</style>
<script>
$(document).ready(function(){
$('table').dataTable()
})
$('#new_payment').click(function(){
88
uni_modal("New payment","manage_payment.php","mid-large")
})
$('.edit_payment').click(function(){
uni_modal("Manage payment
Details","manage_payment.php?id="+$(this).attr('data-id'),"mid-large")
})
$('.view_payment').click(function(){
uni_modal("Tenants Payments","view_payment.php?id="+$(this).attr('data-
id'),"mid-large")
})
$('.delete_payment').click(function(){
})
function delete_payment($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_payment',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
})
89
</script>
reports.php
<?php
include 'db_connect.php';
?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="col-md-12">
<div class="row">
<div class="col-sm-4">
<h4><b>Monthly Payments
Report</b></h4>
</div>
<div class="card-footer">
<div class="col-md-12">
<a
href="index.php?page=payment_report" class="d-flex justify-content-between">
<span>View Report</span> <span class="fa fa-chevron-circle-right"></span></a>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<h4><b>Rental Balances
Report</b></h4>
</div>
<div class="card-footer">
<div class="col-md-12">
90
<a
href="index.php?page=balance_report" class="d-flex justify-content-between">
<span>View Report</span> <span class="fa fa-chevron-circle-right"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
site_settings.php
<?php
include 'db_connect.php';
$meta[$k] = $val;
?>
<div class="container-fluid">
<div class="card-body">
<div class="form-group">
</div>
<div class="form-group">
91
<label for="email" class="control-
label">Email</label>
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
<center>
</center>
</form>
</div>
</div>
<style>
img#cimg{
max-height: 10vh;
92
max-width: 6vw;
</style>
<script>
function displayImg(input,_this) {
$('#cimg').attr('src', e.target.result);
reader.readAsDataURL(input.files[0]);
$('.text-jqte').jqte();
$('#manage-settings').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_settings',
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
error:err=>{
console.log(err)
},
success:function(resp){
if(resp == 1){
93
setTimeout(function(){
location.reload()
},1000)
})
})
</script>
<style>
</style>
</div>
tenants.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<b>List of Tenant</b>
94
<span class="float:right"><a class="btn btn-
primary btn-block btn-sm col-sm-2 float-right" href="javascript:void(0)"
id="new_tenant">
</a></span>
</div>
<div class="card-body">
<thead>
<tr>
<th class="text-
center">#</th>
<th class="">Name</th>
<th class="">House
Rented</th>
<th class="">Monthly
Rate</th>
<th class="">Outstanding
Balance</th>
<th class="">Last
Payment</th>
<th class="text-
center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$tenant = $conn->query("SELECT
t.*,concat(t.lastname,', ',t.firstname,' ',t.middlename) as name,h.house_no,h.price
FROM tenants t inner join houses h on h.id = t.house_id where t.status = 1 order by
h.house_no desc ");
while($row=$tenant-
>fetch_assoc()):
$months =
abs(strtotime(date('Y-m-d')." 23:59:59") - strtotime($row['date_in']." 23:59:59"));
$months = floor(($months)
/ (30*60*60*24));
$payable = $row['price'] *
$months;
95
$paid = $conn-
>query("SELECT SUM(amount) as paid FROM payments where tenant_id =".$row['id']);
$last_payment = $conn-
>query("SELECT * FROM payments where tenant_id =".$row['id']." order by
unix_timestamp(date_created) desc limit 1");
$last_payment =
$last_payment->num_rows > 0 ? date("M d, Y",strtotime($last_payment-
>fetch_array()['date_created'])) : 'N/A';
$outstanding = $payable -
$paid;
?>
<tr>
<td class="text-
center"><?php echo $i++ ?></td>
<td>
<?php echo
ucwords($row['name']) ?>
</td>
<td class="">
</td>
<td class="">
</td>
<td class="text-right">
</td>
<td class="">
<p><b><?php echo
$last_payment ?></b></p>
</td>
<td class="text-center">
<button class="btn
btn-sm btn-outline-primary view_payment" type="button" data-id="<?php echo $row['id']
?>" >View</button>
96
<button class="btn
btn-sm btn-outline-primary edit_tenant" type="button" data-id="<?php echo $row['id']
?>" >Edit</button>
<button class="btn
btn-sm btn-outline-danger delete_tenant" type="button" data-id="<?php echo $row['id']
?>">Delete</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
td{
td p{
margin: unset
img{
max-width:100px;
max-height: :150px;
</style>
<script>
$(document).ready(function(){
$('table').dataTable()
})
97
$('#new_tenant').click(function(){
uni_modal("New Tenant","manage_tenant.php","mid-large")
})
$('.view_payment').click(function(){
uni_modal("Tenants Payments","view_payment.php?id="+$(this).attr('data-
id'),"large")
})
$('.edit_tenant').click(function(){
uni_modal("Manage Tenant
Details","manage_tenant.php?id="+$(this).attr('data-id'),"mid-large")
})
$('.delete_tenant').click(function(){
})
function delete_tenant($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_tenant',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
98
}
})
</script>
topbar.php
<style>
.logo {
margin: auto;
font-size: 20px;
background: white;
color: #000000b3;
</style>
<div class="col-lg-12">
</div>
</div>
<div class="float-right">
99
<a class="dropdown-item" href="javascript:void(0)"
id="manage_my_account"><i class="fa fa-cog"></i> Manage Account</a>
</div>
</div>
</div>
</div>
</nav>
<script>
$('#manage_my_account').click(function(){
})
</script>
users.php
<?php
?>
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
</div>
</div>
<br>
<div class="row">
<div class="card-body">
100
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">Name</th>
<th class="text-center">Username</th>
<th class="text-center">Type</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
include 'db_connect.php';
$type = array("","Admin","Staff","Alumnus/Alumna");
$i = 1;
while($row= $users->fetch_assoc()):
?>
<tr>
<td class="text-center">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
<center>
101
<div class="btn-group">
<button type="button"
class="btn btn-primary">Action</button>
<button type="button"
class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle
Dropdown</span>
</button>
<div class="dropdown-menu">
<a class="dropdown-item
edit_user" href="javascript:void(0)" data-id = '<?php echo $row['id'] ?>'>Edit</a>
<div class="dropdown-
divider"></div>
<a class="dropdown-item
delete_user" href="javascript:void(0)" data-id = '<?php echo $row['id'] ?>'>Delete</a>
</div>
</div>
</center>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
$('table').dataTable();
$('#new_user').click(function(){
uni_modal('New User','manage_user.php')
})
$('.edit_user').click(function(){
uni_modal('Edit User','manage_user.php?id='+$(this).attr('data-id'))
})
102
$('.delete_user').click(function(){
})
function delete_user($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_user',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
setTimeout(function(){
location.reload()
},1500)
})
</script>
view_payment.php
<?php include 'db_connect.php' ?>
<?php
if(!is_numeric($k)){
$$k = $v;
103
$months = abs(strtotime(date('Y-m-d')." 23:59:59") - strtotime($date_in." 23:59:59"));
?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="row">
<div class="col-md-4">
<div id="details">
<large><b>Details</b></large>
<hr>
</div>
</div>
<div class="col-md-8">
<large><b>Payment List</b></large>
<hr>
<thead>
104
<tr>
<th>Date</th>
<th>Invoice</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php
while($row=$payments->fetch_assoc()):
?>
<tr>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<style>
#details p {
margin: unset;
padding: unset;
line-height: 1.3em;
105
td, th{
</style>
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
START TRANSACTION;
--
-- Database: `house_rental_db`
--
-- --------------------------------------------------------
--
--
106
CREATE TABLE `categories` (
--
--
(1, 'Duplex'),
-- --------------------------------------------------------
--
--
--
--
107
INSERT INTO `houses` (`id`, `house_no`, `category_id`, `description`, `price`) VALUES
-- --------------------------------------------------------
--
--
--
--
-- --------------------------------------------------------
--
--
108
`email` varchar(200) NOT NULL,
--
--
-- --------------------------------------------------------
--
--
109
`contact` varchar(50) NOT NULL,
--
--
-- --------------------------------------------------------
--
--
--
--
110
INSERT INTO `users` (`id`, `name`, `username`, `password`, `type`) VALUES
--
--
--
--
--
--
--
--
--
--
--
--
111
ALTER TABLE `tenants`
--
--
--
--
--
--
--
--
--
--
--
--
112
ALTER TABLE `system_settings`
--
--
--
--
COMMIT;
113
CONCLUSION:
Effectively resolving the apartment issues is important to the buyer's long-term future, the House
Rental Project will be an important tool for creating rental housing stability by helping tenants
speak with greater credibility through initiating and documenting communications and building
productive relationships with sellers. House Rental project provides buyers of specific housing
associations and social sellers International Journal of Pure and Applied Mathematics Special
Issue 1681 with a simple way to report and arrange repairs to properties. Finally, the goal of the
project is to create a better relationship between tenants and a sellers which can be achieved
114
BIBLIOGRAPHY
REFERENCES
115