├── requirements.txt ├── static ├── images │ ├── cards.jpg │ ├── Apartment.jpg │ ├── PayRent.jpg │ ├── adminBg.jpg │ ├── rooftop1.jpg │ ├── user_icon.jpg │ ├── admin_icon.jpg │ ├── background.jpg │ ├── TenantReg_img.jpg │ ├── Apartment1 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ ├── Apartment2 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ ├── Apartment3 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ ├── Apartment4 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ ├── Apartment5 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ ├── Apartment6 │ │ ├── Hall.jpeg │ │ ├── Bedroom.jpeg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpeg │ ├── Apartment7 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ ├── Apartment8 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ ├── Apartment9 │ │ ├── Hall.jpg │ │ ├── Bedroom.jpg │ │ ├── Kitchen.jpg │ │ └── Diningroom.jpg │ └── paymentSuccessful.png ├── js │ ├── AdminDashScripts.js │ ├── payment.js │ ├── Scripts.js │ ├── search.js │ ├── RegisterScripts.js │ └── welcomeScripts.js └── css │ ├── base.css │ ├── unoccupiedRoomsStyle.css │ ├── TotalUsersStyle.css │ ├── ReceiptStyle.css │ ├── AdminDashStyle.css │ ├── RentApartmentStyle.css │ ├── TenantDashStyle.css │ ├── detailsStyle.css │ ├── AdminLoginStyle.css │ ├── contractStyle.css │ ├── LoginStyle.css │ ├── TenantReportStyle.css │ ├── RegisterStyle.css │ ├── PaymentStyle.css │ ├── ApartmentRoomsStyle.css │ └── welcomeStyle.css ├── database ├── insertion.sql ├── trigger.sql ├── procedure.sql └── creation.sql ├── templates ├── Reciept.html ├── backup.html ├── alreadyTenant.html ├── TenantDashboard.html ├── TenantLogin.html ├── details.html ├── TotalUsers.html ├── RentStatus.html ├── AdminLogin.html ├── base.html ├── AdminDashboard.html ├── RentApartment.html ├── tenantReport.html ├── contract.html ├── Payment.html ├── welcome.html ├── TenantRegister.html └── ApartmentRooms.html ├── README.md └── main.py /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/requirements.txt -------------------------------------------------------------------------------- /static/images/cards.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/cards.jpg -------------------------------------------------------------------------------- /static/images/Apartment.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment.jpg -------------------------------------------------------------------------------- /static/images/PayRent.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/PayRent.jpg -------------------------------------------------------------------------------- /static/images/adminBg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/adminBg.jpg -------------------------------------------------------------------------------- /static/images/rooftop1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/rooftop1.jpg -------------------------------------------------------------------------------- /static/images/user_icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/user_icon.jpg -------------------------------------------------------------------------------- /static/images/admin_icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/admin_icon.jpg -------------------------------------------------------------------------------- /static/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/background.jpg -------------------------------------------------------------------------------- /static/images/TenantReg_img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/TenantReg_img.jpg -------------------------------------------------------------------------------- /static/images/Apartment1/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment1/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment2/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment2/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment3/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment3/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment4/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment4/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment5/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment5/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment6/Hall.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment6/Hall.jpeg -------------------------------------------------------------------------------- /static/images/Apartment7/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment7/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment8/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment8/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment9/Hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment9/Hall.jpg -------------------------------------------------------------------------------- /static/images/Apartment1/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment1/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment1/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment1/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment2/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment2/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment2/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment2/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment3/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment3/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment3/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment3/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment4/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment4/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment4/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment4/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment5/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment5/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment5/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment5/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment6/Bedroom.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment6/Bedroom.jpeg -------------------------------------------------------------------------------- /static/images/Apartment6/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment6/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment7/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment7/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment7/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment7/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment8/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment8/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment8/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment8/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/Apartment9/Bedroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment9/Bedroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment9/Kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment9/Kitchen.jpg -------------------------------------------------------------------------------- /static/images/paymentSuccessful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/paymentSuccessful.png -------------------------------------------------------------------------------- /static/images/Apartment1/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment1/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment2/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment2/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment3/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment3/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment4/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment4/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment5/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment5/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment7/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment7/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment8/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment8/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment9/Diningroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment9/Diningroom.jpg -------------------------------------------------------------------------------- /static/images/Apartment6/Diningroom.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralweena/Apartment-Rental-Management-System/HEAD/static/images/Apartment6/Diningroom.jpeg -------------------------------------------------------------------------------- /static/js/AdminDashScripts.js: -------------------------------------------------------------------------------- 1 | var checklist = document.getElementById("checklist"); 2 | var items = checklist.querySelectorAll("li"); 3 | 4 | for(var i=1; i<(items.length-1); i++) { 5 | items[i].addEventListener("click", onClick); 6 | } 7 | 8 | function onClick() { 9 | for(var i=1; i<(items.length-1); i++) { 10 | items[i].className= "menu"; 11 | } 12 | if(this.className == "menu") { 13 | this.className = "hidemenu"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /database/insertion.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO APARTMENT_BLOCK VALUES(1,'BLOCK-1','BANGALORE'); 2 | INSERT INTO APARTMENT_BLOCK VALUES(2,'BLOCK-2','BANGALORE'); 3 | INSERT INTO APARTMENT_BLOCK VALUES(3,'BLOCK-3','BANGALORE'); 4 | INSERT INTO APARTMENT_BLOCK VALUES(4,'BLOCK-4','BANGALORE'); 5 | INSERT INTO APARTMENT_BLOCK VALUES(5,'BLOCK-5','BANGALORE'); 6 | INSERT INTO APARTMENT_BLOCK VALUES(6,'BLOCK-6','BANGALORE'); 7 | INSERT INTO APARTMENT_BLOCK VALUES(7,'BLOCK-7','BANGALORE'); 8 | INSERT INTO APARTMENT_BLOCK VALUES(8,'BLOCK-8','BANGALORE'); 9 | INSERT INTO APARTMENT_BLOCK VALUES(9,'BLOCK-9','BANGALORE'); 10 | 11 | -------------------------------------------------------------------------------- /static/js/payment.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | $("#myModal").modal('show'); 3 | }); 4 | 5 | $(function () { 6 | $("#txtName").keypress(function (e) { 7 | var keyCode = e.keyCode || e.which; 8 | $("#lblError").html(""); 9 | //Regex for Valid Characters i.e. Alphabets and Numbers. 10 | var regex = /^[A-Za-z -']+$/; 11 | //Validate TextBox value against the Regex. 12 | var isValid = regex.test(String.fromCharCode(keyCode)); 13 | if (!isValid) { 14 | $("#lblError").html("Only Alphabets and allowed."); 15 | } 16 | return isValid; 17 | }); 18 | }); -------------------------------------------------------------------------------- /static/js/Scripts.js: -------------------------------------------------------------------------------- 1 | function openAddForm() { 2 | document.getElementById("addForm").style.display = "block"; 3 | 4 | } 5 | 6 | function closeAddForm() { 7 | document.getElementById("addForm").style.display = "none"; 8 | } 9 | 10 | function openUpdateForm() { 11 | document.getElementById("updateForm").style.display = "block"; 12 | 13 | } 14 | 15 | function closeUpdateForm() { 16 | document.getElementById("updateForm").style.display = "none"; 17 | } 18 | 19 | function openDeleteForm() { 20 | document.getElementById("deleteForm").style.display = "block"; 21 | 22 | } 23 | 24 | function closeDeleteForm() { 25 | document.getElementById("deleteForm").style.display = "none"; 26 | } -------------------------------------------------------------------------------- /static/js/search.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($){ 2 | 3 | $('.live-search-list').each(function(){ 4 | $(this).attr('data-search-term', $(this).text().toLowerCase()); 5 | }); 6 | 7 | $('.live-search-box').on('keyup', function(){ 8 | 9 | var searchTerm = $(this).val().toLowerCase(); 10 | 11 | $('.live-search-list').each(function(){ 12 | 13 | if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) { 14 | $(this).show(); 15 | } else { 16 | $(this).hide(); 17 | } 18 | 19 | }); 20 | 21 | }); 22 | 23 | }); -------------------------------------------------------------------------------- /database/trigger.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE TENANT_BACKUP( 2 | FNAME VARCHAR(25), 3 | LNAME VARCHAR(15), 4 | T_ID INTEGER AUTO_INCREMENT, 5 | PH_NO VARCHAR(12), 6 | EMAIL VARCHAR(30), 7 | GENDER CHAR, 8 | DOB DATE, 9 | OCCUPATION VARCHAR(30), 10 | ROOM_NO INTEGER, 11 | PSWD VARCHAR(25), 12 | PRIMARY KEY(T_ID), 13 | FOREIGN KEY(ROOM_NO) REFERENCES APARTMENT(ROOM_NO) ON DELETE SET NULL); 14 | 15 | 16 | DELIMITER // 17 | CREATE TRIGGER TRG_TENANT 18 | BEFORE DELETE ON TENANT 19 | FOR EACH ROW 20 | BEGIN 21 | INSERT INTO TENANT_BACKUP(FNAME, LNAME,T_ID, PH_NO, EMAIL, GENDER, DOB ,OCCUPATION, ROOM_NO) VALUES (OLD.FNAME, OLD.LNAME, OLD.T_ID, OLD.PH_NO, OLD.EMAIL, OLD.GENDER, OLD.DOB ,OLD.OCCUPATION, OLD.ROOM_NO); 22 | END ; // 23 | DELIMITER ; -------------------------------------------------------------------------------- /database/procedure.sql: -------------------------------------------------------------------------------- 1 | DELIMITER // 2 | CREATE PROCEDURE `RENTUPDATE`() 3 | BEGIN 4 | DECLARE ch_done INT DEFAULT 0; 5 | DECLARE U_LATEFEE INTEGER; 6 | DECLARE U_DUEDATE DATE; 7 | DECLARE U_RENTAMT INTEGER; 8 | DECLARE U_STATUS VARCHAR(10); 9 | DECLARE U_RENTID INTEGER; 10 | DECLARE U_RENT CURSOR FOR 11 | SELECT R.RENT_ID, R.RENT_FEE, R.DUE_DATE, R.LATE_FEE, S.R_STATUS 12 | FROM RENT AS R, RENT_STATUS AS S 13 | WHERE R.RENT_ID = S.RENT_ID AND R.DUE_DATE = CURDATE() 14 | FOR UPDATE; 15 | DECLARE EXIT HANDLER FOR NOT FOUND SET ch_done = 1; 16 | OPEN U_RENT; 17 | LOOP 18 | FETCH U_RENT INTO U_RENTID, U_RENTAMT, U_DUEDATE, U_LATEFEE, U_STATUS; 19 | IF ( U_STATUS != 'Unpaid' ) THEN 20 | SET U_LATEFEE = U_LATEFEE; 21 | ELSE 22 | SET U_LATEFEE = U_RENTAMT + U_LATEFEE + ((5 * U_RENTAMT)/100) ; 23 | END IF; 24 | UPDATE RENT_STATUS AS RS SET RS.R_STATUS = 'Unpaid' WHERE RS.R_STATUS = U_STATUS AND RS.RENT_ID = U_RENTID; 25 | UPDATE RENT AS R SET LATE_FEE = U_LATEFEE, DUE_DATE = (CURDATE() + INTERVAL 31 day ) 26 | WHERE DUE_DATE = U_DUEDATE AND R.RENT_ID = U_RENTID ; 27 | END LOOP; 28 | CLOSE U_RENT; 29 | END; // 30 | DELIMITER ; 31 | 32 | CALL RENTUPDATE(); -------------------------------------------------------------------------------- /templates/Reciept.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Payment Receipt 7 | 8 | 9 | 10 | 11 |
12 | 17 |
18 | 19 |

PAYMENT SUCESSFUL!

20 |
21 |

Name : {{ Tname }}

22 |

Payment Id : {{ pay_id }}

23 |

Payment Date : {{ pay_date }}

24 |

Amount : {{ pay_amt }}

25 |
26 |
27 |
28 | 29 | -------------------------------------------------------------------------------- /templates/backup.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Tenant Backup{% endblock%} 3 | {% block script %} 4 | 5 | 6 | {% endblock %} 7 | {% block content %} 8 |
9 | 15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {% for row in backup_status %} 28 | 29 | {% for col in row %} 30 | 31 | {% endfor %} 32 | 33 | {% endfor %} 34 |
Tenant IdFirst NameLast NameGenderPhone No.EmailRoom No.
{{row[col]}}
35 |
36 | {% endblock %} 37 | 38 | {% block endscript %} 39 | 40 | {% endblock %} -------------------------------------------------------------------------------- /static/js/RegisterScripts.js: -------------------------------------------------------------------------------- 1 | var myInput = document.getElementById("pswd"); 2 | var letter = document.getElementById("letter"); 3 | var capital = document.getElementById("capital"); 4 | var number = document.getElementById("number"); 5 | var length = document.getElementById("length"); 6 | 7 | // When the user clicks on the password field, show the message box 8 | myInput.onfocus = displayerror; 9 | 10 | // When the user clicks outside of the password field, hide the message box 11 | 12 | 13 | // When the user starts to type something inside the password field 14 | myInput.onkeyup = function() { 15 | var upperCaseLetters = /[A-Z]/g; 16 | var numbers = /[0-9]/g; 17 | var lowerCaseLetters = /[a-z]/g; 18 | 19 | err(upperCaseLetters); 20 | err(lowerCaseLetters); 21 | err(numbers); 22 | 23 | function err (constraints) { 24 | if(myInput.value.match(constraints)) 25 | { 26 | capital.classList.remove("invalid"); 27 | capital.classList.add("valid"); 28 | } 29 | else { 30 | capital.classList.remove("valid"); 31 | capital.classList.add("invalid"); 32 | } 33 | } 34 | 35 | if(myInput.value.length >= 8) { 36 | length.classList.remove("invalid"); 37 | length.classList.add("valid"); 38 | } 39 | else { 40 | length.classList.remove("valid"); 41 | length.classList.add("invalid"); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /static/js/welcomeScripts.js: -------------------------------------------------------------------------------- 1 | var checklist = document.getElementById("checklist"); 2 | var items = checklist.querySelectorAll("li"); 3 | 4 | for(var i=0; i 2 | 3 | 4 | 5 | 6 | Tenant Details 7 | 8 | 9 | 10 | 11 |
12 | 17 | 18 | {% if Error %} 19 |

Error: {{Error}}

20 | {% endif %} 21 |
22 |

Please Fill Out The Details

23 |
24 |

Username : 25 |

26 |

Apartment No. : 27 |

28 |
29 |
30 |
31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /templates/TenantDashboard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Tenant Dashboard 7 | 8 | 9 | 10 | 11 | {% with messages = get_flashed_messages() %} 12 | {% if messages %} 13 | {% for message in messages %} 14 |

{{message}}

15 | {% endfor %} 16 | {% endif %} 17 | {% endwith %} 18 |
19 | 20 |

Welcome To RoofTop Apartments

21 |

----------------------------------------

22 | Logout 23 |
24 | Apartment Image 25 | 26 |
27 |
28 | Payment Image 29 | 30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /templates/TenantLogin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login Page 7 | 8 | 9 | 10 | 11 | {% if error %} 12 |

Error: {{error}}

13 | {% endif %} 14 | {% if log %} 15 |

{{log}}

16 | {% endif %} 17 |
18 | 23 | 24 |
25 | 26 |

Tenant Sign In

27 |
28 |

Email :

29 | 30 |

Password :

31 | 32 |
33 | 36 |
37 |
38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /templates/details.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login Page 7 | 8 | 9 | 10 | 11 | {% if Error %} 12 |

Error: {{Error}}

13 | {% endif %} 14 |
15 | 20 | 21 |
22 |

Please Fill Out The Details

23 |
24 |

Username : 25 |

26 |

Apartment No. : 27 |

28 |

Father Name : 29 |

30 |

Address : 31 |

32 |
33 |
34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Apartment Rental Management System 2 | ### Description 3 |

4 | Apartment Rental Management System is based on searching the apartments available for rent in cities. The apartment owner updates details of the apartments available for rent and the customer is updated on these details such as area occupied, rent amount, location and so on. This system is best suitable for both owners as well as tenants and is also a best application in the city place. Tenants can easily search the suitable apartment with their preferred location and the rent amount. It also allows the tenants to pay their rent online. The Apartment Rental System helps to save a lot of time for both parties. Hence this system is best applicable for the above reasons making Apartment Rental an easy process through an online system.

5 | 6 | ### Technology Used 7 | * Front End - HTML, CSS, JavaScript 8 | * Back End - Python Flask 9 | * Database - MySql 10 | ### Requirements 11 | The source code of this project is written in Python. So, You'll require the following to run this project 12 | * Install libraries and dependencies listed in **requirements.txt** 13 | ```bash 14 | pip install -r requirements.txt 15 | ``` 16 | * Install **MYSQL Workbench** 17 | * Install **XAMPP** server 18 | ### How to Run the Project 19 | 1. Fork the repo and open the folder in your VSCode. 20 | 2. Copy all the sql commands listed in the **database** folder and run in on **MYSQL Workbench**. 21 | 3. Start the following two processes in **XAMPP** once it has been installed and loaded: 22 | * **Apache Webserver** - to serve HTTP requests. 23 | * **MySQL Server** - the database server. 24 | 4. Navigate to main.py file and run the file in VSCode. 25 | 5. Click on the link generated to run the project. 26 | 27 | -------------------------------------------------------------------------------- /templates/TotalUsers.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Total Users{% endblock%} 3 | {% block script %} 4 | 5 | 6 | {% endblock %} 7 | {% block content %} 8 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | {% for row in msg5 %} 27 | 28 | {% for col in row %} 29 | 30 | {% endfor %} 31 | 32 | {% endfor %} 33 |
First NameLast NameGenderPhone NoEmailApt No.
{{row[col]}}
34 |
35 | {% endblock %} 36 | 37 | {% block endscript %} 38 | 39 | 40 | 41 | {% endblock %} -------------------------------------------------------------------------------- /templates/RentStatus.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Tenants Report{% endblock%} 3 | {% block script %} 4 | 5 | 6 | {% endblock %} 7 | {% block content %} 8 |
9 | 18 |
19 |
20 |
41 | {% endblock %} 42 | 43 | {% block endscript %} 44 | 45 | {% endblock %} -------------------------------------------------------------------------------- /static/css/base.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Sofia"); 2 | 3 | .sideNavbar { 4 | position: fixed; 5 | top: 0; 6 | left: -270px; 7 | bottom: 0; 8 | height: 100vh; 9 | width: 325px; 10 | background-color: #00203FFF;; 11 | overflow: hidden; 12 | color: #ADEFD1FF; 13 | transition: 1s; 14 | margin: 0; 15 | padding: 0; 16 | } 17 | 18 | .sideNavbar:hover { 19 | top: 0; 20 | left: 0; 21 | width: 325px; 22 | } 23 | 24 | .sideNavbar:hover .fa-bars { 25 | color: #00203FFF; 26 | } 27 | 28 | .menu .logo{ 29 | text-align: center; 30 | display: flex; 31 | margin-top: 35px; 32 | margin-bottom: 100px; 33 | margin-left: -15px; 34 | } 35 | 36 | .sideNavbar .logout { 37 | display: flex; 38 | margin-top: 80px; 39 | margin-left: 30px; 40 | } 41 | .sideNavbar .logout:hover { 42 | color: ghostwhite; 43 | } 44 | 45 | .sideNavbar .logout:hover span { 46 | color: ghostwhite; 47 | } 48 | 49 | .sideNavbar li{ 50 | list-style: none !important; 51 | margin-bottom: 29px; 52 | margin-left: 35px; 53 | } 54 | 55 | #usr { 56 | margin-right: 90px; 57 | } 58 | 59 | 60 | .menu .logo span { 61 | font-weight: bold; 62 | padding-left: 6px; 63 | font-size: 20px; 64 | text-transform: uppercase; 65 | } 66 | 67 | .menu :hover{ 68 | color:ghostwhite; 69 | } 70 | 71 | a { 72 | text-decoration: none !important; 73 | color: #ADEFD1FF; 74 | } 75 | 76 | 77 | .nav-item { 78 | position: relative; 79 | color: #ADEFD1FF; 80 | font-size: 16px; 81 | text-transform: uppercase; 82 | padding-left: 10px; 83 | } 84 | 85 | .hidemenu { 86 | list-style: none !important; 87 | border-bottom:2px solid ghostwhite; 88 | padding-bottom: 10px; 89 | margin-top: -5px; 90 | transition: 0.2s; 91 | width: fit-content; 92 | } 93 | 94 | .hidemenu a, .hidemenu span{ 95 | color: ghostwhite; 96 | } 97 | 98 | -------------------------------------------------------------------------------- /static/css/unoccupiedRoomsStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | *{ 7 | padding: 0; 8 | margin: 0; 9 | outline: none; 10 | border: none; 11 | text-decoration: none; 12 | box-sizing: border-box; 13 | font-family: cursive; 14 | } 15 | 16 | body { 17 | background: #ADEFD1FF; 18 | color: #00203FFF; 19 | } 20 | 21 | a { 22 | text-decoration: none; 23 | color: #ADEFD1FF; 24 | } 25 | 26 | /* navbar styling */ 27 | .navbar { 28 | background: transparent; 29 | background-size: auto; 30 | display: inline; 31 | } 32 | 33 | .navbar .nav-bar { 34 | display: inline-block; 35 | list-style: none; 36 | } 37 | 38 | .rooms { 39 | padding-top: 30px; 40 | padding-left: 95px; 41 | font-size: 36px; 42 | font-family: 'Times New Roman', Times, serif; 43 | text-transform: uppercase; 44 | font-weight: bold; 45 | } 46 | 47 | .search { 48 | margin-top: -30px; 49 | padding-left: 920px; 50 | padding-bottom: 80px; 51 | } 52 | 53 | .search input[type="number"] { 54 | background: transparent; 55 | height: 25px; 56 | width: 200px; 57 | color: black; 58 | outline: none; 59 | border: none; 60 | font-size: 16px; 61 | border-bottom: 2px solid #00203FFF; 62 | margin-right: 25px; 63 | } 64 | 65 | .previous { 66 | left: 180px; 67 | } 68 | 69 | .next, .previous{ 70 | position: absolute; 71 | font-size: 30px; 72 | color: #00203FFF; 73 | top: 140px; 74 | right: 180px; 75 | } 76 | 77 | table { 78 | font-family: arial, sans-serif; 79 | border-collapse: collapse; 80 | width: 600px; 81 | background-color: #00203FFF; 82 | color: #ADEFD1FF; 83 | margin: 30px 340px; 84 | } 85 | 86 | th,td { 87 | border: 1.5px solid ghostwhite; 88 | text-align: center; 89 | padding: 9px; 90 | } 91 | 92 | tr th { 93 | padding: 14px; 94 | } -------------------------------------------------------------------------------- /static/css/TotalUsersStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Algerian; 3 | font-family: Lucida; 4 | src: url(sansation_light.woff); 5 | } 6 | 7 | *{ 8 | padding: 0; 9 | margin: 0; 10 | outline: none; 11 | border: none; 12 | text-decoration: none; 13 | box-sizing: border-box; 14 | font-family: cursive; 15 | } 16 | 17 | body { 18 | background: #ADEFD1FF; 19 | color: #00203FFF; 20 | } 21 | 22 | a { 23 | text-decoration: none; 24 | color: #ADEFD1FF; 25 | } 26 | 27 | /* navbar styling */ 28 | .navbar { 29 | background: transparent; 30 | background-size: auto; 31 | display: inline; 32 | } 33 | 34 | .navbar .nav-bar { 35 | display: inline-block; 36 | list-style: none; 37 | } 38 | 39 | .users { 40 | padding-left: 35px; 41 | font-size: 36px; 42 | font-family: 'Times New Roman', Times, serif; 43 | text-transform: uppercase; 44 | font-weight: bold; 45 | } 46 | 47 | .search { 48 | padding-left: 520px; 49 | padding-bottom: 80px; 50 | } 51 | 52 | .search input[type="text"] { 53 | background: transparent; 54 | height: 25px; 55 | width: 250px; 56 | color: black; 57 | outline: none; 58 | border: none; 59 | font-size: 16px; 60 | border-bottom: 2px solid #00203FFF; 61 | margin-right: 25px; 62 | font-family: Arial; 63 | } 64 | 65 | /* buttons*/ 66 | 67 | .nav-bar li { 68 | margin-top: 20px; 69 | display: inline-block; 70 | list-style: outside none none; 71 | } 72 | 73 | .next, .previous { 74 | font-size: 30px; 75 | color: #00203FFF; 76 | } 77 | 78 | .previous { 79 | margin-left: 80px; 80 | } 81 | 82 | .next { 83 | margin-left: 50px; 84 | } 85 | 86 | 87 | /*------------TABLE------------*/ 88 | 89 | table { 90 | font-family: arial, sans-serif; 91 | border-collapse: collapse; 92 | width: 1000px; 93 | background-color: #00203FFF; 94 | color: #ADEFD1FF; 95 | margin: 55px 0 30px 150px; 96 | } 97 | 98 | th,td { 99 | border: 1.5px solid ghostwhite; 100 | text-align: center; 101 | padding: 9px; 102 | } 103 | -------------------------------------------------------------------------------- /static/css/ReceiptStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | body { 7 | padding: 0; 8 | margin: 0; 9 | background: #00203FFF; 10 | } 11 | 12 | .box { 13 | position: absolute; 14 | background-position: center center; 15 | width: 100%; 16 | height: 100vh; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | .navbar { 22 | position: fixed; 23 | padding-top: 23px; 24 | background-color: transparent; 25 | } 26 | 27 | .lead { 28 | font-size: 24px; 29 | font-family: Lucida; 30 | color: #ADEFD1FF; 31 | margin-left: 35px; 32 | text-decoration: none; 33 | } 34 | 35 | i { 36 | padding-right: 5px; 37 | } 38 | 39 | .receiptbox { 40 | width: 620px; 41 | height: 460px; 42 | background: #ADEFD1FF; 43 | border-radius: 5%; 44 | border: 1px solid #000; 45 | box-shadow: 2px 2px 8px #000; 46 | color: #000; 47 | position: absolute; 48 | top: calc(50% - 230px); 49 | left: calc(50% - 310px); 50 | box-sizing: border-box; 51 | padding: 70px 30px; 52 | } 53 | 54 | .payment { 55 | border-radius: 50%; 56 | width: 180px; 57 | height: 180px; 58 | position: absolute; 59 | top: 30px; 60 | left: calc(50% - 90px); 61 | } 62 | 63 | h1 { 64 | margin: 0; 65 | padding-top: 180px; 66 | padding-bottom: 50px; 67 | text-align: center; 68 | font-size: 34px; 69 | font-family: Lucida; 70 | color: black; 71 | } 72 | 73 | .receiptbox p { 74 | margin: 0; 75 | padding: 0; 76 | padding-left: 80px; 77 | font-weight: bold; 78 | color: #000; 79 | font-family: monospace; 80 | font-size: 20px; 81 | } 82 | 83 | .receiptbox a { 84 | text-decoration: none; 85 | font-family: cursive; 86 | font-size: 16px; 87 | line-height: 20px; 88 | color: #000; 89 | } 90 | 91 | .receiptbox a:hover { 92 | color: #008080 ; 93 | } 94 | -------------------------------------------------------------------------------- /templates/AdminLogin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login Page 7 | 8 | 9 | 29 | 30 | 31 | {% if error %} 32 |

Error: {{error}}

33 | {% endif %} 34 | {% if log2 %} 35 |

{{log2}}

36 | {% endif %} 37 |
38 | 43 | 44 |
45 | 46 |

Admin Sign In

47 |
48 |

Username :

49 | 50 |

Password :

51 | 52 |

Security Password :

53 | 54 |
55 |
56 |
57 |
58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /database/creation.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS `apartmentRental` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 2 | USE `apartmentRental`; 3 | 4 | CREATE TABLE APARTMENT_BLOCK( 5 | BLOCK_NO INTEGER PRIMARY KEY, 6 | BLOCK_NAME VARCHAR(10), 7 | LOCATION VARCHAR(20)); 8 | 9 | CREATE TABLE APARTMENT( 10 | ROOM_NO INTEGER PRIMARY KEY, 11 | BLOCK_NO INTEGER, 12 | RENT_PER_MONTH INTEGER, 13 | APT_STATUS VARCHAR(15), 14 | FOREIGN KEY(BLOCK_NO) REFERENCES APARTMENT_BLOCK(BLOCK_NO) ON DELETE CASCADE); 15 | 16 | CREATE TABLE APARTMENT_DETAILS ( 17 | ROOM_NO INTEGER PRIMARY KEY, 18 | APT_TITLE VARCHAR(200) NOT NULL, 19 | AREA INTEGER NOT NULL, 20 | APARTMENT_DESC VARCHAR(1000) NOT NULL, 21 | FOREIGN KEY(ROOM_NO) REFERENCES APARTMENT(ROOM_NO) ON DELETE CASCADE); 22 | 23 | CREATE TABLE APARTMENT_PHOTOS( 24 | ROOM_NO INTEGER PRIMARY KEY, 25 | PATHNAME VARCHAR(100) NOT NULL, 26 | PHOTO1 VARCHAR(50) NOT NULL, 27 | PHOTO2 VARCHAR(50) NOT NULL, 28 | PHOTO3 VARCHAR(50) NOT NULL, 29 | PHOTO4 VARCHAR(50), 30 | FOREIGN KEY(ROOM_NO) REFERENCES APARTMENT(ROOM_NO) ON DELETE CASCADE); 31 | 32 | CREATE TABLE TENANT( 33 | FNAME VARCHAR(25), 34 | LNAME VARCHAR(15), 35 | T_ID INTEGER AUTO_INCREMENT, 36 | PH_NO VARCHAR(12), 37 | EMAIL VARCHAR(30), 38 | GENDER CHAR, 39 | DOB DATE, 40 | OCCUPATION VARCHAR(30), 41 | ROOM_NO INTEGER, 42 | PSWD VARCHAR(25), 43 | PRIMARY KEY(T_ID), 44 | FOREIGN KEY(ROOM_NO) REFERENCES APARTMENT(ROOM_NO) ON DELETE SET NULL); 45 | 46 | 47 | CREATE TABLE CONTRACT( 48 | CONTRACT_ID INTEGER AUTO_INCREMENT, 49 | T_ID INTEGER, 50 | ROOM_NO INTEGER, 51 | START_DATE DATE, 52 | END_DATE DATE, 53 | DEPOSIT INTEGER, 54 | TERMS VARCHAR(15), 55 | PRIMARY KEY(CONTRACT_ID), 56 | FOREIGN KEY(T_ID) REFERENCES TENANT(T_ID) ON DELETE CASCADE, 57 | FOREIGN KEY(ROOM_NO) REFERENCES APARTMENT(ROOM_NO) ON DELETE SET NULL); 58 | 59 | 60 | CREATE TABLE PAYMENT( 61 | PAYMENT_ID VARCHAR(20) PRIMARY KEY, 62 | ACC_NO VARCHAR(15), 63 | T_ID INTEGER, 64 | PAYMENT_DATE DATE, 65 | AMOUNT INTEGER, 66 | FOREIGN KEY(T_ID) REFERENCES TENANT(T_ID) ON DELETE SET NULL); 67 | 68 | CREATE TABLE RENT( 69 | RENT_ID INTEGER AUTO_INCREMENT , 70 | RENT_FEE INTEGER, 71 | T_ID INTEGER, 72 | DUE_DATE DATE, 73 | LATE_FEE INTEGER, 74 | PAYMENT_ID VARCHAR(20), 75 | PRIMARY KEY(RENT_ID), 76 | FOREIGN KEY(T_ID) REFERENCES TENANT(T_ID) ON DELETE SET NULL, 77 | FOREIGN KEY(PAYMENT_ID) REFERENCES PAYMENT(PAYMENT_ID) ON DELETE SET NULL); 78 | 79 | CREATE TABLE RENT_STATUS( 80 | RENT_ID INTEGER, 81 | R_STATUS VARCHAR(10), 82 | FOREIGN KEY(RENT_ID) REFERENCES RENT(RENT_ID) ON DELETE CASCADE 83 | ); 84 | -------------------------------------------------------------------------------- /static/css/AdminDashStyle.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Sofia"); 2 | 3 | *{ 4 | padding: 0; 5 | margin: 0; 6 | outline: none; 7 | border: none; 8 | text-decoration: none; 9 | box-sizing: border-box; 10 | font-family: "Poppins",cursive; 11 | } 12 | 13 | body { 14 | background: ghostwhite; 15 | } 16 | 17 | #dashboard { 18 | padding-left: 125px; 19 | width: 100%; 20 | height: 100vh; 21 | background: #ADEFD1FF; 22 | padding-top: 23px; 23 | } 24 | 25 | .cards { 26 | display: grid; 27 | grid-template-columns: repeat(3, 1fr); 28 | grid-gap: 30px; 29 | } 30 | 31 | .card-single { 32 | display: flex; 33 | height: 145px; 34 | width: 275px; 35 | border-radius: 9%; 36 | box-shadow: 6px 6px 12px 0 rgba(0, 0, 0, 0.29), 6px 6px 20px 0 rgba(0, 0, 0, 0.29); 37 | border: 1px solid black; 38 | color: #ADEFD1FF; 39 | background: #00203fff; 40 | } 41 | 42 | .card-single .fa-city, .card-single .fa-users, .card-single .fa-building, 43 | .card-single .fa-coins { 44 | font-size: 32px; 45 | padding-top: 22px; 46 | } 47 | 48 | .card-single h1, .card-single span { 49 | padding: 25px 0 25px 28px; 50 | } 51 | 52 | .card-single span { 53 | padding-left: 25px; 54 | } 55 | .card-single h1 { 56 | font-size: 26px; 57 | } 58 | 59 | .card-single #fa1 { 60 | padding-left: 3px ; 61 | } 62 | 63 | .card-single #fa2 { 64 | padding-left:30px ; 65 | } 66 | 67 | .card-single #fa3 { 68 | padding-left:55px ; 69 | } 70 | 71 | .card-single #fa4, .card-single #fa8 { 72 | padding-left:26px ; 73 | } 74 | 75 | .card-single #fa5 { 76 | padding-left:15px ; 77 | } 78 | 79 | .card-single #fa6, .card-single #fa7 { 80 | padding-left:75px ; 81 | } 82 | 83 | .card-single #fa9 { 84 | padding-left:10px ; 85 | } 86 | 87 | .msg { 88 | font-size: 22px; 89 | color: #fff; 90 | background-color: #000; 91 | border: 1px solid #00203FFF; 92 | width: 400px; 93 | height: 150px; 94 | text-align: center; 95 | padding-top: 59px; 96 | position: fixed; 97 | top: calc(50% - 75px); 98 | left: calc(50% - 200px); 99 | z-index: 9; 100 | -webkit-animation: cssAnimation 5s forwards; 101 | animation: cssAnimation 5s forwards; 102 | } 103 | 104 | @keyframes cssAnimation { 105 | 0% {opacity: 1;} 106 | 80% {opacity: 0.8;} 107 | 90% {opacity: 0.3;} 108 | 100% {opacity: 0;} 109 | } 110 | 111 | @-webkit-keyframes cssAnimation { 112 | 0% {opacity: 1;} 113 | 80% {opacity: 0.8;} 114 | 90% {opacity: 0.3;} 115 | 100% {opacity: 0;} 116 | } 117 | -------------------------------------------------------------------------------- /static/css/RentApartmentStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | *{ 7 | padding: 0; 8 | margin: 0; 9 | outline: none; 10 | border: none; 11 | text-decoration: none; 12 | box-sizing: border-box; 13 | font-family: cursive; 14 | } 15 | 16 | body { 17 | background: #ADEFD1FF; 18 | } 19 | 20 | a { 21 | text-decoration: none; 22 | color: black; 23 | } 24 | 25 | nav { 26 | background: #00203FFF; 27 | color: #ADEFD1FF; 28 | width: 100%; 29 | } 30 | 31 | section { 32 | padding-left: 70px; 33 | padding-top: 70px; 34 | } 35 | 36 | p { 37 | font-size: 32px; 38 | padding:20px 0 20px 52px; 39 | } 40 | 41 | .fa-arrow-left { 42 | margin-left: -30px; 43 | padding-right: 60px; 44 | } 45 | 46 | .fa-building { 47 | padding-right: 15px; 48 | } 49 | 50 | /* styling div container for apartment */ 51 | .container { 52 | display: block; 53 | width: 1000px; 54 | margin-left: auto; 55 | margin-right: auto; 56 | height: auto; 57 | padding: 30px; 58 | border-radius: 20px; 59 | } 60 | 61 | .container #box { 62 | border: 2px solid #fff; 63 | background-color: #00203FFF; 64 | color: #ADEFD1FF; 65 | height: auto; 66 | padding: 30px 0; 67 | margin-bottom: 100px; 68 | } 69 | 70 | 71 | .row1 .col1 img { 72 | float: left; 73 | width: 240px; 74 | } 75 | 76 | .col1 img, #row2 img { 77 | width: 240px; 78 | height: 240px; 79 | border-radius: 10px; 80 | border: 2px solid #fff; 81 | position: relative; 82 | left: 40px; 83 | top: 30px; 84 | } 85 | 86 | .col2 p{ 87 | font-size: 18px; 88 | margin-bottom: -10px; 89 | margin-left: 280px; 90 | padding-right: 40px; 91 | } 92 | 93 | .col2 h1 { 94 | margin-left: 300px; 95 | } 96 | 97 | #row2 div { 98 | display: inline; 99 | } 100 | 101 | #row2 .col3, #row2 .col5, #row2 .col4 { 102 | width: 240px; 103 | margin-right: 40px; 104 | } 105 | 106 | .col2 #desc { 107 | margin-bottom: 40px; 108 | } 109 | 110 | #btnSubmit { 111 | height:50px; 112 | width: 140px;; 113 | color:#00203FFF; 114 | background: #ADEFD1FF; 115 | text-align: center; 116 | border-radius: 15px; 117 | font-size: 16px; 118 | margin-top: 60px; 119 | margin-left: 340px; 120 | } 121 | 122 | #btnSubmit:hover a { 123 | color: #000; 124 | font-weight: bold; 125 | } 126 | 127 | .fa-indian-rupee-sign { 128 | padding-left: 5px; 129 | padding-right: 5px; 130 | font-size: 18px; 131 | } -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% block title %}{% endblock %} 5 | 6 | 7 | 8 | {% block script %}{% endblock %} 9 | 10 | 11 | {% block header %}{% endblock %} 12 | 45 | {% block content %} 46 | {% endblock %} 47 | 48 | {% block endscript %} 49 | {% endblock%} 50 | 51 | 52 | -------------------------------------------------------------------------------- /templates/AdminDashboard.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Admin Dashboard{% endblock%} 3 | {% block script %} 4 | 5 | 6 | {% endblock %} 7 | {% block content %} 8 |
9 | {% with messages2 = get_flashed_messages() %} 10 | {% if messages2 %} 11 | {% for message in messages2 %} 12 |

{{ message }}

13 | {% endfor %} 14 | {% endif %} 15 | {% endwith %} 16 |
17 |
18 |

{{ tot_blck }}

19 | Total Apartment-blocks 20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 |

9

28 | Total floors per block 29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 |

{{ tot_apt }}

37 | Total Apartments 38 |
39 |
40 | 41 |
42 |
43 |
44 |
45 |

{{ occ_apts }}

46 | Occupied Apartments 47 |
48 |
49 | 50 |
51 |
52 |
53 |
54 |

{{ unocc_apts }}

55 | Unoccupied Apartments 56 |
57 |
58 | 59 |
60 |
61 |
62 |
63 |

{{ t_tenants }}

64 | Total Tenants 65 |
66 |
67 | 68 |
69 |
70 |
71 |
72 |

{{ t_users }}

73 | Total Users 74 |
75 |
76 | 77 |
78 |
79 |
80 |
81 |

{{tot_rent}}

82 | Total Rent Collected 83 |
84 |
85 | 86 |
87 |
88 |
89 | {% endblock %} 90 | {% block endscript %} 91 | 92 | {% endblock %} 93 | -------------------------------------------------------------------------------- /static/css/TenantDashStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | *{ 7 | padding: 0; 8 | margin: 0; 9 | outline: none; 10 | border: none; 11 | text-decoration: none; 12 | box-sizing: border-box; 13 | font-family: cursive; 14 | } 15 | 16 | body { 17 | background: #ADEFD1FF; 18 | } 19 | 20 | .logo { 21 | position: fixed; 22 | display: block; 23 | top: 15px; 24 | left: 15px; 25 | width: 120px; 26 | height: 120px; 27 | border: 2px solid #00203fff; 28 | border-radius: 50%; 29 | } 30 | 31 | a { 32 | text-decoration: none; 33 | color: black; 34 | font-family: Lucida; 35 | font-size: 20px; 36 | } 37 | 38 | p { 39 | font-size: 42px; 40 | color: #00203FFF; 41 | text-align: center; 42 | padding-top: 80px; 43 | margin-bottom: 0; 44 | padding-bottom: 0; 45 | font-family: Lucida; 46 | } 47 | 48 | .logout { 49 | position: fixed; 50 | font-size: 28px; 51 | font-family: Lucida; 52 | right: 30px; 53 | top: 40px; 54 | color: #00203FFF; 55 | } 56 | 57 | .fa-star{ 58 | font-size: 24px; 59 | padding-left: 20px; 60 | padding-right: 20px; 61 | } 62 | 63 | .p2 { 64 | padding-top: 0px; 65 | } 66 | 67 | .col1, .col2 { 68 | display: flex; 69 | position: fixed; 70 | top: calc(50% - 120px); 71 | width: 400px; 72 | height: 300px; 73 | } 74 | 75 | .col1 { 76 | float: left; 77 | left: calc(20% - 85px); 78 | } 79 | 80 | .col2 { 81 | float: right; 82 | left: calc(60% - 85px); 83 | } 84 | 85 | img { 86 | position: fixed; 87 | top: calc(50% - 70px); 88 | width: 400px; 89 | height: 300px; 90 | border-radius: 10%; 91 | } 92 | 93 | .col1:hover img, .col2:hover img{ 94 | top: calc(50% - 90px); 95 | margin-left: -20px; 96 | width: 440px; 97 | height: 340px; 98 | border: 2px solid black; 99 | box-shadow: 1px 1px 12px black; 100 | } 101 | 102 | .btn1, .btn2 { 103 | position: fixed; 104 | top: 61%; 105 | background: rgba(255, 255, 255, 0.7); 106 | font-weight: bold; 107 | height: 34px; 108 | text-align: center; 109 | border-radius: 3%; 110 | border: 1px solid ghostwhite; 111 | display: none; 112 | } 113 | 114 | .btn1{ 115 | width: 160px; 116 | margin-left: 120px; 117 | } 118 | 119 | .btn2 { 120 | width: 100px; 121 | margin-left: 155px; 122 | } 123 | 124 | .col1:hover .btn1, .col2:hover .btn2 { 125 | display: block; 126 | } 127 | 128 | .msg { 129 | font-size: 22px; 130 | color: black; 131 | position: fixed; 132 | top: -55px; 133 | left: 465px; 134 | -webkit-animation: cssAnimation 5s forwards; 135 | animation: cssAnimation 5s forwards; 136 | } 137 | 138 | @keyframes cssAnimation { 139 | 0% {opacity: 1;} 140 | 80% {opacity: 0.8;} 141 | 90% {opacity: 0.3;} 142 | 100% {opacity: 0;} 143 | } 144 | 145 | @-webkit-keyframes cssAnimation { 146 | 0% {opacity: 1;} 147 | 80% {opacity: 0.8;} 148 | 90% {opacity: 0.3;} 149 | 100% {opacity: 0;} 150 | } -------------------------------------------------------------------------------- /templates/RentApartment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Apartment 7 | 8 | 9 | 10 | 11 |
12 | 15 |
16 |
17 |
18 | {% for aptRow in apartment %} 19 |
20 |
21 |
22 |
23 | {% for i in img_url %} 24 | {% if i['ROOM_NO'] == aptRow['ROOM_NO'] %} 25 | {% set hallImage = i['PATHNAME']+'/'+i['PHOTO1'] %} 26 | Hall 27 | {% endif %} 28 | {% endfor %} 29 |
30 |
31 | {% if aptRow['APT_TITLE'] %} 32 |

{{ aptRow['APT_TITLE'] }}

33 | {% endif %} 34 |

35 | {% if aptRow['ROOM_NO'] %} 36 | Apartment No : {{ aptRow['ROOM_NO'] }} 37 | {% endif %} 38 | {% if aptRow['RENT_PER_MONTH'] %} 39 | Rent :{{ aptRow['RENT_PER_MONTH'] }} 40 | {% endif %} 41 | {% if aptRow['AREA'] %} 42 | Area : {{ aptRow['AREA'] }} Sq.ft. 43 | {% endif %} 44 |

45 | {% if aptRow['APARTMENT_DESC'] %} 46 |

{{ aptRow['APARTMENT_DESC'] | replace('. ', '.
') | safe }}

47 | {% endif %} 48 |
49 |
50 | {% for i in img_url %} 51 | {% if i['ROOM_NO'] == aptRow['ROOM_NO'] %} 52 | {% set kitchenImage = i['PATHNAME']+'/'+i['PHOTO2'] %} 53 | {% set bedroomImage = i['PATHNAME']+'/'+i['PHOTO3'] %} 54 | {% set extraImage = i['PATHNAME']+'/'+i['PHOTO4'] %} 55 |
56 | Bedroom 57 |
58 |
59 | Kitchen 60 |
61 |
62 | Dinning 63 |
64 | {% endif %} 65 | {% endfor %} 66 |
67 |
68 |

69 |
70 |
71 |
72 | {% endfor %} 73 |
74 |
75 | 76 | -------------------------------------------------------------------------------- /static/css/detailsStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | body { 7 | padding: 0; 8 | margin: 0; 9 | background: #00203FFF; 10 | } 11 | 12 | .box { 13 | position: absolute; 14 | background-position: center center; 15 | width: 100%; 16 | height: 100vh; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | .navbar { 22 | position: fixed; 23 | padding-top: 23px; 24 | background-color: transparent; 25 | } 26 | 27 | .lead { 28 | font-size: 20px; 29 | font-family: Lucida; 30 | color: #ADEFD1FF; 31 | margin-left: 35px; 32 | text-decoration: none; 33 | } 34 | 35 | i { 36 | padding-right: 5px; 37 | } 38 | 39 | .formbox { 40 | position: absolute; 41 | width: 650px; 42 | height: 400px; 43 | background-color: #ADEFD1FF; 44 | border-radius: 5%; 45 | border: 1px solid #000; 46 | box-shadow: 2px 2px 8px #000; 47 | top: calc(50% - 200px); 48 | left: calc(50% - 325px); 49 | box-sizing: border-box; 50 | padding: 30px 60px; 51 | } 52 | 53 | h1 { 54 | margin: 0; 55 | padding-bottom: 50px; 56 | text-align: center; 57 | font-size: 26px; 58 | font-family: Lucida; 59 | color: black; 60 | } 61 | 62 | p { 63 | margin: 0; 64 | padding: 0; 65 | font-weight: bold; 66 | color: #000; 67 | font-family: monospace; 68 | font-size: 20px; 69 | } 70 | 71 | input { 72 | width: 100%; 73 | margin-bottom: 20px; 74 | } 75 | 76 | input[type="email"], input[type="number"], input[type="text"] { 77 | border: none; 78 | border-bottom: 1px solid #000; 79 | background: transparent; 80 | outline: none; 81 | height: 26px; 82 | color: #000; 83 | font-size: 18px; 84 | font-family: Lucida; 85 | width: 320px; 86 | } 87 | 88 | input[type="number"] { 89 | width: 200px; 90 | } 91 | 92 | input[type="submit"]{ 93 | outline: none; 94 | margin-left: 40%; 95 | height: 50px; 96 | width: 120px; 97 | background: #00203FFF; 98 | border-radius: 20px; 99 | border:1px solid #000; 100 | box-shadow: 2px 2px 4px #000; 101 | margin-bottom: 13px; 102 | color: #ADEFD1FF; 103 | font-size: 20px; 104 | font-family: Lucida; 105 | margin-top: 24px; 106 | } 107 | 108 | input[type="submit"]:hover 109 | { 110 | cursor: pointer; 111 | color: ghostwhite; 112 | } 113 | 114 | .error { 115 | font-size: 20px; 116 | color: #fff; 117 | background-color: #000; 118 | border: 1px solid #00203FFF; 119 | width: 500px; 120 | height: 50px; 121 | text-align: center; 122 | padding-top: 22px; 123 | position: fixed; 124 | top: calc(50% - 75px); 125 | left: calc(50% - 250px); 126 | z-index: 9; 127 | -webkit-animation: cssAnimation 5s forwards; 128 | animation: cssAnimation 5s forwards; 129 | } 130 | 131 | @keyframes cssAnimation { 132 | 0% {opacity: 1;} 133 | 80% {opacity: 0.8;} 134 | 90% {opacity: 0.3;} 135 | 100% {opacity: 0;} 136 | } 137 | 138 | @-webkit-keyframes cssAnimation { 139 | 0% {opacity: 1;} 140 | 80% {opacity: 0.8;} 141 | 90% {opacity: 0.3;} 142 | 100% {opacity: 0;} 143 | } -------------------------------------------------------------------------------- /templates/tenantReport.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Tenants Report{% endblock%} 3 | {% block script %} 4 | 5 | 6 | {% endblock %} 7 | {% block content %} 8 | 16 | 17 |
18 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {% for row in tenantReport %} 54 | 55 | {% for col in row %} 56 | 57 | {% endfor %} 58 | 59 | {% endfor %} 60 |
Tenant IdFirst NameLast NameGenderPhone No.EmailRoom No.
{{row[col]}}
61 |
62 | {% endblock %} 63 | 64 | {% block endscript %} 65 | 66 | 67 | 68 | {% endblock %} -------------------------------------------------------------------------------- /static/css/AdminLoginStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | body { 7 | padding: 0; 8 | margin: 0; 9 | } 10 | 11 | .box { 12 | position: absolute; 13 | width: 100%; 14 | height: 100vh; 15 | margin: 0; 16 | padding: 0; 17 | background-image: url('/static/images/adminBg.jpg'); 18 | background-color: #00203FFF; 19 | background-size: cover; 20 | background-position: center center; 21 | } 22 | 23 | .navbar { 24 | position: fixed; 25 | padding-top: 23px; 26 | background: #00203FFF; 27 | width: 100%; 28 | padding-bottom: 20px; 29 | } 30 | 31 | .lead { 32 | font-size: 24px; 33 | font-family: Lucida; 34 | color: #ADEFD1FF; 35 | margin-left: 35px; 36 | text-decoration: none; 37 | } 38 | 39 | i { 40 | padding-right: 5px; 41 | } 42 | 43 | .loginbox { 44 | width: 380px; 45 | height: 470px; 46 | background: #00203FFF; 47 | color: #ADEFD1FF; 48 | border-radius: 5%; 49 | border: 1px solid ghostwhite; 50 | box-shadow: 2px 2px 8px skyblue; 51 | position: absolute; 52 | top: 80px; 53 | right: 95px; 54 | box-sizing: border-box; 55 | padding: 10px 30px; 56 | } 57 | 58 | .user { 59 | border-radius: 50%; 60 | width: 120px; 61 | height: 120px; 62 | position: absolute; 63 | top: -60px; 64 | left: calc(50% - 60px); 65 | } 66 | 67 | h1 { 68 | padding-top: 40px; 69 | padding-bottom: 10px; 70 | text-align: center; 71 | font-size: 30px; 72 | font-family: Lucida; 73 | } 74 | 75 | .loginbox p { 76 | margin: 0; 77 | padding: 0; 78 | font-weight: bold; 79 | font-family: monospace; 80 | font-size: 19px; 81 | } 82 | 83 | .loginbox input { 84 | width: 100%; 85 | margin-bottom: 20px; 86 | } 87 | 88 | .loginbox input[type="text"], input[type="password"] 89 | { 90 | border: none; 91 | border-bottom: 1px solid ghostwhite; 92 | background: transparent; 93 | outline: none; 94 | height: 35px; 95 | color: ghostwhite; 96 | font-size: 18px; 97 | font-family: Lucida; 98 | } 99 | 100 | input[type="submit"] 101 | { 102 | outline: none; 103 | margin-top: 0; 104 | margin-bottom :14px; 105 | margin-left: calc(50% - 55px); 106 | height: 40px; 107 | width: 110px; 108 | background: #ADEFD1FF; 109 | border-radius: 20px; 110 | border: 1px solid #000; 111 | box-shadow: 2px 2px 6px #000; 112 | color: #00203FFF; 113 | font-size: 20px; 114 | font-family: monospace; 115 | } 116 | 117 | .loginbox input[type="submit"]:hover 118 | { 119 | cursor: pointer; 120 | color: #000; 121 | font-weight: bold; 122 | } 123 | 124 | .loginbox a { 125 | text-decoration: none; 126 | font-family: cursive; 127 | font-size: 16px; 128 | line-height: 20px; 129 | color: #ADEFD1FF; 130 | } 131 | 132 | .loginbox a:hover { 133 | color:#008080; 134 | } 135 | 136 | .error, .log{ 137 | font-size: 22px; 138 | color: white; 139 | position: fixed; 140 | z-index: 9; 141 | top: 5px; 142 | left: 580px; 143 | -webkit-animation: cssAnimation 5s forwards; 144 | animation: cssAnimation 5s forwards; 145 | } 146 | 147 | .log { 148 | left: 500px; 149 | } 150 | 151 | @keyframes cssAnimation { 152 | 0% {opacity: 1;} 153 | 80% {opacity: 0.8;} 154 | 90% {opacity: 0.3;} 155 | 100% {opacity: 0;} 156 | } 157 | 158 | @-webkit-keyframes cssAnimation { 159 | 0% {opacity: 1;} 160 | 80% {opacity: 0.8;} 161 | 90% {opacity: 0.3;} 162 | 100% {opacity: 0;} 163 | } -------------------------------------------------------------------------------- /static/css/contractStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | body { 7 | top: 0; 8 | left: 0; 9 | padding: 90px 110px 80px 110px; 10 | font-family: 'Times New Roman', Times, serif; 11 | background: #ADEFD1FF; 12 | color: black; 13 | font-size: 18px; 14 | } 15 | 16 | nav { 17 | position: fixed; 18 | width: 100%; 19 | top: 0; 20 | left: 0; 21 | background: #00203FFF; 22 | padding: 16px 0 16px 35px; 23 | margin: 0; 24 | } 25 | 26 | .back { 27 | text-decoration: none; 28 | color: #ADEFD1FF; 29 | font-family: Lucida; 30 | font-size: 28px; 31 | } 32 | 33 | .fa-arrow-left { 34 | padding-right: 10px; 35 | } 36 | 37 | .box { 38 | border: 2px solid black; 39 | padding-right: 80px; 40 | padding-left: 80px; 41 | text-align: justify; 42 | line-height: 1.6; 43 | } 44 | 45 | h4 { 46 | padding-top: 0; 47 | font-size: 32px; 48 | text-align: center; 49 | } 50 | 51 | .owner-info, .tenant-info { 52 | padding-left:120px; 53 | } 54 | 55 | input[type="date"], input[type="email"], input[type="number"]{ 56 | border: none; 57 | outline: none; 58 | background: transparent; 59 | border-bottom: 1px solid black; 60 | margin-left: 12px; 61 | margin-right: 12px; 62 | font-family: Lucida; 63 | } 64 | 65 | input[type="date"]{ 66 | font-size: 16px; 67 | } 68 | 69 | .if1, .if2, .if3, .if4{ 70 | border: none; 71 | outline: none; 72 | background: transparent; 73 | border-bottom: 1px solid black; 74 | font-size: 18px; 75 | font-family: Lucida; 76 | } 77 | 78 | .if1, .if2, input[type="email"] { 79 | width: 250px; 80 | margin-left: 0; 81 | font-size: 16px; 82 | } 83 | 84 | .if2, .if4, .if5 { 85 | margin-left: 10px; 86 | margin-right: 10px; 87 | } 88 | 89 | .if4 { 90 | width: 390px; 91 | font-size: 16px; 92 | } 93 | 94 | .if3 { 95 | font-size: 18px; 96 | } 97 | 98 | .if5, .if6 { 99 | width: 60px; 100 | text-align: center; 101 | font-size: 18px; 102 | font-weight: bold; 103 | } 104 | 105 | .if7 { 106 | width: 100px; 107 | } 108 | 109 | .btn, .reset { 110 | background: #00203FFF; 111 | color: #ADEFD1FF; 112 | padding: 16px 20px; 113 | border: 1px solid #000; 114 | border-radius: 10%; 115 | cursor: pointer; 116 | width: 100px; 117 | height: 60px; 118 | text-align: center; 119 | margin-top: 25px; 120 | font-size: 20px; 121 | box-shadow: 2px 2px 8px #000; 122 | font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; 123 | } 124 | 125 | .btn:hover, .reset:hover { 126 | color: ghostwhite; 127 | font-weight: bold; 128 | } 129 | 130 | .btn { 131 | margin:0 150px 60px 270px; 132 | } 133 | 134 | .msg { 135 | font-size: 22px; 136 | color: #fff; 137 | background-color: #000; 138 | border: 1px solid #00203FFF; 139 | width: 400px; 140 | height: 50px; 141 | text-align: center; 142 | padding-top: 22px; 143 | position: fixed; 144 | top: calc(50% - 75px); 145 | left: calc(50% - 200px); 146 | z-index: 9; 147 | -webkit-animation: cssAnimation 5s forwards; 148 | animation: cssAnimation 5s forwards; 149 | } 150 | 151 | @keyframes cssAnimation { 152 | 0% {opacity: 1;} 153 | 80% {opacity: 0.8;} 154 | 90% {opacity: 0.3;} 155 | 100% {opacity: 0;} 156 | } 157 | 158 | @-webkit-keyframes cssAnimation { 159 | 0% {opacity: 1;} 160 | 80% {opacity: 0.8;} 161 | 90% {opacity: 0.3;} 162 | 100% {opacity: 0;} 163 | } -------------------------------------------------------------------------------- /static/css/LoginStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | body { 7 | padding: 0; 8 | margin: 0; 9 | background: #00203FFF; 10 | } 11 | 12 | .box { 13 | position: absolute; 14 | background-position: center center; 15 | width: 100%; 16 | height: 100vh; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | .navbar { 22 | position: fixed; 23 | padding-top: 23px; 24 | background-color: transparent; 25 | } 26 | 27 | .lead { 28 | font-size: 24px; 29 | font-family: Lucida; 30 | color: #ADEFD1FF; 31 | margin-left: 35px; 32 | text-decoration: none; 33 | } 34 | 35 | i { 36 | padding-right: 5px; 37 | } 38 | 39 | .loginbox { 40 | width: 380px; 41 | height: 450px; 42 | background: #ADEFD1FF; 43 | border-radius: 5%; 44 | border: 1px solid #000; 45 | box-shadow: 2px 2px 8px #000; 46 | color: #000; 47 | position: absolute; 48 | top: 97px; 49 | left: calc(50% - 200px); 50 | box-sizing: border-box; 51 | padding: 70px 30px; 52 | } 53 | 54 | .user { 55 | border-radius: 50%; 56 | width: 120px; 57 | height: 120px; 58 | position: absolute; 59 | top: -60px; 60 | left: calc(50% - 60px); 61 | } 62 | 63 | h1 { 64 | margin: 0; 65 | padding-top: 0; 66 | padding-bottom: 30px; 67 | text-align: center; 68 | font-size: 34px; 69 | font-family: Lucida; 70 | color: black; 71 | } 72 | 73 | .loginbox p { 74 | margin: 0; 75 | padding: 0; 76 | font-weight: bold; 77 | color: #000; 78 | font-family: monospace; 79 | font-size: 20px; 80 | } 81 | 82 | .loginbox input { 83 | width: 100%; 84 | margin-bottom: 20px; 85 | } 86 | 87 | .loginbox input[type="email"], input[type="password"] 88 | { 89 | border: none; 90 | border-bottom: 1px solid #000; 91 | background: transparent; 92 | outline: none; 93 | height: 40px; 94 | color: #000; 95 | font-size: 18px; 96 | font-family: Lucida; 97 | } 98 | 99 | input[type="submit"] 100 | { 101 | outline: none; 102 | margin-left: calc(50% - 60px); 103 | height: 50px; 104 | width: 120px; 105 | background: #00203FFF; 106 | border-radius: 20px; 107 | border:1px solid #000; 108 | box-shadow: 2px 2px 4px #000; 109 | margin-bottom: 13px; 110 | color: #ADEFD1FF; 111 | font-size: 22px; 112 | font-family: Lucida; 113 | } 114 | 115 | .loginbox input[type="submit"]:hover 116 | { 117 | cursor: pointer; 118 | color: ghostwhite; 119 | } 120 | 121 | ul { 122 | list-style: none !important; 123 | margin-top: 0; 124 | padding-left: 0; 125 | margin-left: 0; 126 | } 127 | 128 | li { 129 | padding-top: 15px; 130 | padding-left: 8px; 131 | } 132 | 133 | .loginbox a { 134 | text-decoration: none; 135 | font-family: cursive; 136 | font-size: 16px; 137 | line-height: 20px; 138 | color: #000; 139 | } 140 | 141 | .loginbox a:hover { 142 | color: #008080 ; 143 | } 144 | 145 | .error, .log{ 146 | font-size: 18px; 147 | color: white; 148 | position: fixed; 149 | z-index: 9; 150 | top: -7px; 151 | left: 480px; 152 | -webkit-animation: cssAnimation 5s forwards; 153 | animation: cssAnimation 5s forwards; 154 | } 155 | 156 | .log { 157 | left: 500px; 158 | } 159 | 160 | @keyframes cssAnimation { 161 | 0% {opacity: 1;} 162 | 80% {opacity: 0.8;} 163 | 90% {opacity: 0.3;} 164 | 100% {opacity: 0;} 165 | } 166 | 167 | @-webkit-keyframes cssAnimation { 168 | 0% {opacity: 1;} 169 | 80% {opacity: 0.8;} 170 | 90% {opacity: 0.3;} 171 | 100% {opacity: 0;} 172 | } -------------------------------------------------------------------------------- /templates/contract.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Contract 7 | 8 | 9 | 10 | 11 |
12 | 15 |
16 |
17 | {% if msg7 %} 18 |

{{msg7}}

19 | {% endif %} 20 |
21 |

RENTAL AGREEMENT

22 |
23 |

This RENTAL AGREEMENT is executed for Apartment on through online by and between:

    By : 24 |

25 |

Joey Rudolph Flynn

26 |

S/o Robert Geraldo Flynn

27 |

'Flynn House', V P Road, Girgaon, Bengaluru.

28 |
29 |

30 |

    And, in favour of: 31 |

32 |

33 |

S/o or D/o.

34 |

35 |

having a permanent address at

36 |
37 |

38 |

The Owner is the absolute owner of the property situated at ' Rooftop Apartments ', K K Road, Shanti Nagar, Bangalore whereas the Tenant has requested the Owner to grant Rent with respect to the Schedule Premises and the Owner has agreed to rent out to the Tenant the Property with two-wheeler and four-wheeler parking space in the ground floor for residential purposes only, on the following TERMS and CONDITIONS:

39 |

1. The rent in respect of the “Demised Premises” shall commence from and shall be valid till . Thereafter, the same may be extended further on mutual consent of both the parties.

40 |

2. That the Tenant shall pay to the Owner a monthly rent of Rs., excluding electricity and water bill. The rent shall be paid on or before 7th day of each month without fail.

41 |

3. That during the Rent period, in addition to the rental amount payable to the Owner, the Tenant shall pay for the use of electricity and water as per bills received from the authorities concerned directly.

42 |

4. The Tenant will pay to the Owner an interest-free refundable security deposit of Rs. through online payment dated at the time of submitting the Rent Agreement.

43 |

I Agree to the terms and conditions stated above.

44 | 45 | 46 | 47 | 48 |
49 | 50 |
51 |
52 | 53 | -------------------------------------------------------------------------------- /static/css/TenantReportStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Algerian; 3 | font-family: Lucida; 4 | src: url(sansation_light.woff); 5 | } 6 | 7 | *{ 8 | padding: 0; 9 | margin: 0; 10 | outline: none; 11 | border: none; 12 | text-decoration: none; 13 | box-sizing: border-box; 14 | font-family: cursive; 15 | } 16 | 17 | body { 18 | background: #ADEFD1FF; 19 | color: #00203FFF; 20 | } 21 | 22 | a { 23 | text-decoration: none; 24 | color: #ADEFD1FF; 25 | } 26 | 27 | /* navbar styling */ 28 | .navbar { 29 | background: transparent; 30 | background-size: auto; 31 | display: inline; 32 | } 33 | 34 | .navbar .nav-bar { 35 | display: inline-block; 36 | list-style: none; 37 | margin-top: 20px; 38 | } 39 | 40 | .tenant{ 41 | padding-left: 35px; 42 | font-size: 36px; 43 | font-family: 'Times New Roman', Times, serif; 44 | text-transform: uppercase; 45 | font-weight: bold; 46 | } 47 | 48 | .search { 49 | padding-left: 460px; 50 | padding-bottom: 80px; 51 | } 52 | 53 | .search input[type="text"] { 54 | background: transparent; 55 | height: 25px; 56 | width: 250px; 57 | color: black; 58 | outline: none; 59 | border: none; 60 | font-size: 16px; 61 | border-bottom: 2px solid #00203FFF; 62 | margin-right: 25px; 63 | } 64 | 65 | /* buttons*/ 66 | 67 | .nav-bar li { 68 | display: inline-block; 69 | list-style: outside none none; 70 | } 71 | 72 | .operations { 73 | width: 140px; 74 | height: 60px; 75 | background: #00203FFF; 76 | border: 1px solid black; 77 | color: #ADEFD1FF; 78 | border-radius: 10%; 79 | margin-left: 990px; 80 | text-align: center; 81 | font-size: 20px; 82 | font-family: Lucida; 83 | } 84 | 85 | .operations:hover a { 86 | color: ghostwhite; 87 | font-weight: bold; 88 | } 89 | 90 | .operations:hover { 91 | color: ghostwhite; 92 | font-weight: bold; 93 | } 94 | 95 | .fa-trash { 96 | font-size: 20px; 97 | padding-left: 8px; 98 | } 99 | 100 | .next, .previous { 101 | font-size: 30px; 102 | color: #00203FFF; 103 | } 104 | 105 | .next { 106 | margin-left: 50px; 107 | } 108 | 109 | .previous { 110 | margin-left: 80px; 111 | } 112 | 113 | /* table styling */ 114 | 115 | table { 116 | font-family: arial, sans-serif; 117 | border-collapse: collapse; 118 | width: 1070px; 119 | background-color: #00203FFF; 120 | color: #ADEFD1FF; 121 | margin: 30px 130px; 122 | } 123 | 124 | th,td { 125 | border: 1.5px solid ghostwhite; 126 | text-align: center; 127 | padding: 9px; 128 | } 129 | 130 | th { 131 | margin-top: 0; 132 | } 133 | 134 | /*-------------------------POP UP-------------------------------- */ 135 | 136 | /* The popup form - hidden by default */ 137 | .form-popup { 138 | display: none; 139 | position: fixed; 140 | top: 90px; 141 | left: calc(50% - 350px); 142 | border: 2px solid #fff; 143 | z-index: 9; 144 | box-shadow: 2px 2px 6px #fff; 145 | padding-bottom: 0; 146 | } 147 | 148 | /* Add styles to the form container */ 149 | .form-container { 150 | width: 700px; 151 | height: 320px; 152 | padding: 10px; 153 | margin-bottom: 0; 154 | background-color: #00203FFF; 155 | color: #ADEFD1FF; 156 | } 157 | 158 | .heading { 159 | font-size: 28px; 160 | text-align: center; 161 | font-family: Lucida; 162 | } 163 | 164 | .divider-custom { 165 | text-align: center; 166 | } 167 | 168 | .tenant-info { 169 | font-family: cursive; 170 | font-size: 16px; 171 | margin-left: 25px; 172 | margin-right: 25px; 173 | padding: 0px; 174 | } 175 | 176 | .input-field input[type="number"] 177 | { 178 | border: none; 179 | border-bottom: 1px solid ghostwhite; 180 | background: transparent; 181 | outline: none; 182 | height: 24px; 183 | color: ghostwhite; 184 | font-size: 18px; 185 | font-family: Lucida; 186 | } 187 | 188 | #t_id { 189 | width: 165px; 190 | } 191 | 192 | .input-field { 193 | padding :37px 0 30px 30px; 194 | } 195 | 196 | .input-field .l2 { 197 | padding-left: 186px; 198 | } 199 | 200 | 201 | /* Set a style for the submit/login button */ 202 | 203 | .form-container .btn, .form-container .cancel { 204 | background-color: #ADEFD1FF; 205 | color: #000; 206 | padding: 16px 20px; 207 | border: 1px solid #000; 208 | border-radius: 10%; 209 | cursor: pointer; 210 | width: 95px; 211 | height: 48px; 212 | text-align: center; 213 | margin-top: 25px; 214 | font-size: 18px; 215 | box-shadow: 2px 2px 4px #000; 216 | } 217 | 218 | .btn { 219 | margin:30px 35px 0 240px; 220 | } 221 | -------------------------------------------------------------------------------- /templates/Payment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Rent Payment 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | {% with messages = get_flashed_messages() %} 28 | {% if messages %} 29 | {% for message in messages %} 30 |

{{message}}

31 | {% endfor %} 32 | {% endif %} 33 | {% endwith %} 34 | {% if err %} 35 |

Error: {{ err }}

36 | {% endif %} 37 |
38 |
39 |

PAYMENT

40 |
41 |
42 |
43 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 55 | 56 | 57 | 60 | 63 | 64 | 65 | 68 | 71 | 72 | 73 | 76 | 79 | 80 | 81 | 84 | 87 | 88 | 89 | 92 | 95 | 96 | 97 | 100 | 103 | 104 |
Personal Details
Card Details
50 |

51 |
53 |

54 |
58 |

59 |
61 |

62 |
66 |

67 |
69 |

70 |
74 |

75 |
77 |

78 |
82 |

83 |
85 |

86 |
90 |

91 |
93 |

94 |
98 |

99 |
101 |

102 |
105 | 106 | 107 |
108 |
109 |
110 | 111 | 112 | -------------------------------------------------------------------------------- /static/css/RegisterStyle.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Sofia'); 2 | @font-face { 3 | font-family: Algerian; 4 | font-family: Lucida; 5 | src: url(sansation_light.woff); 6 | } 7 | 8 | * { 9 | margin: 0; 10 | padding: 0; 11 | box-sizing: border-box; 12 | font-family: Alegreya; 13 | } 14 | 15 | body { 16 | background: #00203FFF; 17 | } 18 | 19 | .navbar { 20 | position: fixed; 21 | padding-top: 20px; 22 | background-color: transparent; 23 | } 24 | 25 | .lead { 26 | font-size: 24px; 27 | font-family: Lucida; 28 | color: #ADEFD1FF; 29 | margin-left: 30px; 30 | text-decoration: none; 31 | } 32 | 33 | .box { 34 | position: relative; 35 | top: 70px; 36 | left: calc(50% - 520px); 37 | width: 1040px; 38 | height: 480px; 39 | background: #ADEFD1FF; 40 | color: #000; 41 | box-sizing: border-box; 42 | border: 1px solid black; 43 | box-shadow: 3px 3px 8px skyblue; 44 | border-radius: 3%; 45 | padding: 10px; 46 | } 47 | 48 | .image { 49 | position: absolute; 50 | top: -2px; 51 | left: -2px; 52 | height: 482px; 53 | width: 385px; 54 | border-radius: 3%; 55 | box-sizing: border-box; 56 | border: 1px solid black; 57 | background-size: cover; 58 | background-position: center; 59 | background-repeat: no-repeat; 60 | } 61 | 62 | .row .column2 { 63 | 64 | float: right; 65 | width: 665px; 66 | padding-left: 35px; 67 | } 68 | 69 | .row .column1 { 70 | float: left; 71 | width: 385px; 72 | padding: 0; 73 | } 74 | 75 | .row:after { 76 | content: ""; 77 | display: table; 78 | clear: both; 79 | } 80 | 81 | .details h1 , h2{ 82 | margin-bottom: 24px; 83 | } 84 | 85 | .details h1 { 86 | margin-left: 146px; 87 | font-size: 38px; 88 | font-family: Lucida; 89 | } 90 | 91 | .details .input-field, .input-field7 { 92 | font-size: 18px; 93 | margin-bottom: 21px; 94 | font-family: cursive; 95 | font-weight: bold; 96 | } 97 | 98 | .input-field input[type="text"] , input[type="date"], input[type="number"], input[type="password"], input[type="email"] 99 | { 100 | border: none; 101 | border-bottom: 1px solid #000; 102 | background: transparent; 103 | outline: none; 104 | height: 24px; 105 | color: #000; 106 | font-size: 18px; 107 | font-family: Lucida; 108 | } 109 | 110 | .input-field input[placeholder="dd/mm/yyyy"] 111 | { 112 | font-size: 18px; 113 | font: lighter; 114 | color: grey; 115 | } 116 | 117 | .input-field input[type=radio] 118 | { 119 | accent-color: darkgrey; 120 | } 121 | 122 | .input-field .l1, .l2 { 123 | width: 185px ; 124 | } 125 | 126 | .input-field .l3 { 127 | width: 150px; 128 | } 129 | 130 | .input-field .l4 { 131 | width: 170px; 132 | } 133 | 134 | .input-field .occupation { 135 | margin-left: 20px; 136 | } 137 | 138 | .input-field #occ { 139 | width: 180px; 140 | } 141 | 142 | .input-field .l6 { 143 | width: 260px; 144 | } 145 | 146 | .input-field .l8 { 147 | margin-left: 40px; 148 | } 149 | 150 | .input-field #room_no { 151 | width: 100px; 152 | } 153 | 154 | .input-field .female, .others { 155 | margin-left: 10px; 156 | } 157 | 158 | .input-field .male { 159 | margin-left: 2px; 160 | } 161 | 162 | .input-field .lb2 , .lb4{ 163 | margin-left: 44px; 164 | } 165 | 166 | .input-field7 .l7{ 167 | width: 175px ; 168 | } 169 | 170 | .input-field7 .pswd { 171 | margin-left: 22px; 172 | } 173 | 174 | .input-field7 { 175 | margin-bottom:7px; 176 | } 177 | 178 | .fields .message { 179 | font-size: 11px; 180 | display: inline; 181 | visibility: visible; 182 | } 183 | 184 | .fields #message .invalid { 185 | font-family: Lucida; 186 | display: inline; 187 | color: #000; 188 | } 189 | 190 | .details .subBtn { 191 | height: 60px; 192 | width: 120px; 193 | background: #00203FFF; 194 | color: #fff; 195 | border: 1px solid #000; 196 | border-radius: 15%; 197 | text-align: center; 198 | font-size: 20px; 199 | font-family: Lucida; 200 | align-items: center; 201 | box-shadow: 2px 2px 4px #000; 202 | margin-left: 38%; 203 | transition: all 0.3s linear; 204 | cursor: pointer; 205 | margin-top: -5px; 206 | } 207 | 208 | input[type="submit"]:hover { 209 | color: #008080; 210 | font-weight: bold; 211 | } 212 | 213 | .msg1 { 214 | color:white; 215 | position:fixed; 216 | z-index: 9; 217 | top:13px; 218 | left:calc(50% - 100px); 219 | font-size:22px; 220 | -webkit-animation: cssAnimation 5s forwards; 221 | animation: cssAnimation 5s forwards; 222 | } 223 | 224 | @keyframes cssAnimation { 225 | 0% {opacity: 1;} 226 | 80% {opacity: 0.8;} 227 | 90% {opacity: 0.3;} 228 | 100% {opacity: 0;} 229 | } 230 | 231 | @-webkit-keyframes cssAnimation { 232 | 0% {opacity: 1;} 233 | 80% {opacity: 0.8;} 234 | 90% {opacity: 0.3;} 235 | 100% {opacity: 0;} 236 | } -------------------------------------------------------------------------------- /static/css/PaymentStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Lucida; 3 | src: url(sansation_light.woff); 4 | } 5 | 6 | *{ 7 | padding: 0; 8 | margin: 0; 9 | outline: none; 10 | border: none; 11 | text-decoration: none; 12 | box-sizing: border-box; 13 | font-family: cursive; 14 | } 15 | 16 | body { 17 | background: #adefd1ff; 18 | } 19 | 20 | /*-------------------Popup Window-----------------*/ 21 | /* 22 | .modal-dialog { 23 | width: 430px; 24 | } 25 | 26 | .modal-header { 27 | background: #00203fff; 28 | color: #adefd1ff; 29 | } 30 | 31 | button{ 32 | background: #00203fff; 33 | } 34 | 35 | .fa-xmark { 36 | color: #adefd1ff; 37 | background: #00203fff; 38 | } 39 | 40 | .modal-body img { 41 | width: 400px; 42 | height: 200px; 43 | padding: 0; 44 | margin: 0; 45 | } */ 46 | 47 | /*------------------Actual Window-----------------*/ 48 | 49 | .payment header { 50 | position: fixed; 51 | width: 100%; 52 | background: #00203fff; 53 | } 54 | 55 | .payment header a { 56 | text-decoration: none; 57 | color: #ADEFD1FF; 58 | } 59 | 60 | .payment header p { 61 | color: #ADEFD1FF; 62 | font-size: 26px; 63 | padding: 10px 0 0 35px; 64 | font-family: Lucida; 65 | } 66 | 67 | .payment .fa-arrow-left { 68 | padding-right: 30px; 69 | font-size: 30px; 70 | } 71 | 72 | .payment .fa-credit-card { 73 | padding-right: 10px; 74 | } 75 | 76 | .payment .payment-box { 77 | position: fixed; 78 | top: 40px; 79 | width: 100%; 80 | } 81 | 82 | /*---------Personal details----------*/ 83 | 84 | table { 85 | font-family: cursive; 86 | border-collapse: collapse; 87 | width: 1100px; 88 | background: transparent; 89 | color: #000; 90 | position: relative; 91 | margin-top: 35px; 92 | left: calc(50% - 550px); 93 | font-size: 18px; 94 | } 95 | 96 | th { 97 | border: 1px solid black; 98 | text-align: center; 99 | padding: 5px 0 5px 0; 100 | 101 | } 102 | 103 | td { 104 | border-left: 1px solid black; 105 | border-right: 1px solid black; 106 | text-align: center; 107 | } 108 | 109 | .tr7 { 110 | border-bottom: 1px solid black; 111 | } 112 | 113 | .name { 114 | padding-top: 9px; 115 | } 116 | 117 | input[type="text"], input[type="number"], input[type="email"], input[type="month"] { 118 | border: none; 119 | background: transparent; 120 | outline: none; 121 | border-bottom: 1px solid black; 122 | margin-left: 20px; 123 | height: 30px; 124 | font-size: 18px; 125 | font-family: Lucida; 126 | } 127 | 128 | input[type="month"] { 129 | width: 150px; 130 | } 131 | 132 | .user-details .if1, .user-details .if2 { 133 | width: 280px; 134 | } 135 | 136 | .user-details .if3, .user-details .if5, .user-details .if6, 137 | .user-details .if7 { 138 | width: 200px; 139 | } 140 | 141 | .user-details .if4 { 142 | width: 140px; 143 | } 144 | 145 | .user-details .if8 { 146 | width: 80px; 147 | } 148 | 149 | .user-details .l8 { 150 | margin-left: 40px; 151 | } 152 | 153 | .payment-box .pay-btn, .payment-box .cancel-btn { 154 | background: #00203fff; 155 | color: #adefd1ff; 156 | height: 40px; 157 | font-size: 20px; 158 | border-radius: 10%; 159 | margin-top: 20px; 160 | text-align: center; 161 | } 162 | 163 | .payment-box .pay-btn { 164 | width: 80px; 165 | margin-left: 460px; 166 | } 167 | 168 | .payment-box .cancel-btn { 169 | width: 100px; 170 | margin-left: 120px; 171 | } 172 | 173 | .payment-box button:hover { 174 | font-weight: bold; 175 | color: ghostwhite; 176 | } 177 | 178 | /*---------Flashed message---------*/ 179 | 180 | .msg { 181 | font-size: 22px; 182 | color: #fff; 183 | background-color: #000; 184 | border: 1px solid #00203FFF; 185 | width: 500px; 186 | height: 150px; 187 | text-align: center; 188 | padding-top: 59px; 189 | position: fixed; 190 | top: calc(50% - 75px); 191 | left: calc(50% - 250px); 192 | z-index: 9; 193 | -webkit-animation: cssAnimation 5s forwards; 194 | animation: cssAnimation 5s forwards; 195 | } 196 | 197 | @keyframes cssAnimation { 198 | 0% {opacity: 1;} 199 | 80% {opacity: 0.8;} 200 | 90% {opacity: 0.3;} 201 | 100% {opacity: 0;} 202 | } 203 | 204 | @-webkit-keyframes cssAnimation { 205 | 0% {opacity: 1;} 206 | 80% {opacity: 0.8;} 207 | 90% {opacity: 0.3;} 208 | 100% {opacity: 0;} 209 | } 210 | 211 | /*----------Error Msg------*/ 212 | 213 | .error { 214 | font-size: 20px; 215 | color: #fff; 216 | background-color: #000; 217 | border: 1px solid #00203FFF; 218 | width: 500px; 219 | height: 80px; 220 | text-align: center; 221 | padding-top: 22px; 222 | position: fixed; 223 | top: calc(50% - 75px); 224 | left: calc(50% - 200px); 225 | z-index: 9; 226 | -webkit-animation: cssAnimation 5s forwards; 227 | animation: cssAnimation 5s forwards; 228 | } 229 | 230 | @keyframes cssAnimation { 231 | 0% {opacity: 1;} 232 | 80% {opacity: 0.8;} 233 | 90% {opacity: 0.3;} 234 | 100% {opacity: 0;} 235 | } 236 | 237 | @-webkit-keyframes cssAnimation { 238 | 0% {opacity: 1;} 239 | 80% {opacity: 0.8;} 240 | 90% {opacity: 0.3;} 241 | 100% {opacity: 0;} 242 | } -------------------------------------------------------------------------------- /static/css/ApartmentRoomsStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Algerian; 3 | font-family: Lucida; 4 | src: url(sansation_light.woff); 5 | } 6 | 7 | 8 | *{ 9 | padding: 0; 10 | margin: 0; 11 | outline: none; 12 | border: none; 13 | text-decoration: none; 14 | box-sizing: border-box; 15 | font-family: cursive; 16 | } 17 | 18 | body { 19 | background: #ADEFD1FF; 20 | color: #00203FFF; 21 | } 22 | 23 | a { 24 | text-decoration: none; 25 | color: #ADEFD1FF; 26 | } 27 | 28 | 29 | /* navbar styling */ 30 | .navbar { 31 | background: transparent; 32 | background-size: auto; 33 | display: inline; 34 | } 35 | 36 | .navbar .nav-bar { 37 | display: inline-block; 38 | list-style: none; 39 | } 40 | 41 | .rooms { 42 | padding-top: 30px; 43 | padding-left: 35px; 44 | font-size: 36px; 45 | font-family: 'Times New Roman', Times, serif; 46 | text-transform: uppercase; 47 | font-weight: bold; 48 | } 49 | 50 | .search { 51 | padding-left: 320px; 52 | padding-bottom: 80px; 53 | } 54 | 55 | .search input[type="number"] { 56 | background: transparent; 57 | height: 25px; 58 | width: 210px; 59 | color: black; 60 | outline: none; 61 | border: none; 62 | font-size: 18px; 63 | border-bottom: 2px solid #00203FFF; 64 | margin-right: 25px; 65 | } 66 | 67 | .crud { 68 | margin-left: 700px; 69 | } 70 | 71 | /* buttons*/ 72 | .crud li, .nav-bar li { 73 | margin-top: -10px; 74 | display: inline-block; 75 | list-style: outside none none; 76 | } 77 | 78 | .next, .previous { 79 | font-size: 30px; 80 | color: #00203FFF; 81 | } 82 | 83 | .previous { 84 | margin-left: 80px; 85 | } 86 | 87 | .next { 88 | margin-left: 50px; 89 | } 90 | 91 | .operations { 92 | width: 140px; 93 | height: 60px; 94 | background: #00203FFF; 95 | border: 1px solid black; 96 | color: #ADEFD1FF; 97 | border-radius: 10%; 98 | margin-left: 20px; 99 | text-align: center; 100 | font-size: 20px; 101 | font-family: Lucida; 102 | } 103 | 104 | .operations:hover a { 105 | color: ghostwhite; 106 | font-weight: bold; 107 | } 108 | 109 | .operations:hover { 110 | color: ghostwhite; 111 | font-weight: bold; 112 | } 113 | 114 | .fa-plus { 115 | font-size: 24px; 116 | padding-left: 10px; 117 | } 118 | 119 | .fa-pen-to-square, .fa-trash { 120 | font-size: 20px; 121 | padding-left: 8px; 122 | } 123 | 124 | /* The popup form - hidden by default */ 125 | 126 | .form-popup, .add-form-popup { 127 | display: none; 128 | position: absolute; 129 | top: 115px; 130 | left: calc(50% - 310px); 131 | z-index: 9; 132 | } 133 | 134 | .add-form-popup { 135 | margin-left: auto; 136 | margin-right: auto; 137 | } 138 | 139 | /* Add styles to the form container */ 140 | .form-container, .add-form-container { 141 | width: 620px; 142 | height: auto; 143 | padding: 30px 10px 40px 20px; 144 | background-color: #00203FFF; 145 | color: #ADEFD1FF; 146 | border: 2px solid #fff; 147 | box-shadow: 2px 2px 6px #fff; 148 | } 149 | 150 | .add-form-container { 151 | margin-bottom: 40px; 152 | } 153 | 154 | .heading { 155 | font-size: 28px; 156 | text-align: center; 157 | font-family: Lucida; 158 | } 159 | 160 | .divider-custom { 161 | text-align: center; 162 | padding-bottom: 40px; 163 | } 164 | 165 | .apartment-info { 166 | font-family: cursive; 167 | font-size: 16px; 168 | margin-left: 25px; 169 | margin-right: 25px; 170 | padding: 0px; 171 | } 172 | 173 | .input-field input[type="text"], input[type="number"] 174 | { 175 | border: none; 176 | border-bottom: 1px solid ghostwhite; 177 | background: transparent; 178 | outline: none; 179 | height: 24px; 180 | color: ghostwhite; 181 | font-size: 18px; 182 | font-family: Lucida; 183 | margin-bottom: 25px; 184 | } 185 | 186 | textarea { 187 | border: none; 188 | border-bottom: 1px solid ghostwhite; 189 | background: transparent; 190 | outline: none;color: ghostwhite; 191 | font-size: 18px; 192 | font-family: Lucida; 193 | } 194 | 195 | .input-field input[type="text"] { 196 | width: 170px; 197 | } 198 | 199 | .input-field input[type="number"] { 200 | width: 90px; 201 | } 202 | 203 | .input-field .l1 { 204 | padding-left: 30px; 205 | } 206 | 207 | .input-field .l2 { 208 | padding-left: 70px; 209 | } 210 | 211 | .input-field p { 212 | padding: 20px 30px; 213 | } 214 | 215 | .input-field .Desc { 216 | margin-top: -30px; 217 | } 218 | 219 | .input-field #apartmentTitle { 220 | width: 400px; 221 | } 222 | 223 | #up_title { 224 | width:340px; 225 | } 226 | 227 | /* Set a style for the submit/login button */ 228 | 229 | .form-container .btn, .form-container .cancel ,.add-form-container .btn, .add-form-container .cancel { 230 | background-color: #ADEFD1FF; 231 | color: #000; 232 | padding: 10px 20px; 233 | border: 1px solid #000; 234 | border-radius: 10%; 235 | cursor: pointer; 236 | width: 95px; 237 | height: 48px; 238 | text-align: center; 239 | margin-top: 25px; 240 | font-size: 18px; 241 | box-shadow: 2px 2px 4px #000; 242 | } 243 | 244 | .btn { 245 | margin:0 35px 0 160px; 246 | } 247 | 248 | /* flexboxes for images */ 249 | 250 | table { 251 | border-collapse: separate; 252 | border-spacing: 0 85px; 253 | display: block; 254 | width: 900px; 255 | margin-left: 280px; 256 | } 257 | 258 | tr { 259 | border: 2px solid #fff; 260 | background-color: #00203FFF; 261 | color: #ADEFD1FF; 262 | } 263 | 264 | td { 265 | height: 300px; 266 | padding: 20px 50px 20px 20px; 267 | } 268 | 269 | #box #image { 270 | width: 220px; 271 | height: 220px; 272 | margin: 20px 60px 0 20px; 273 | float: left; 274 | border-radius: 10px; 275 | } 276 | 277 | #image img { 278 | width: 220px; 279 | height: 220px; 280 | border-radius: 10px; 281 | border: 2px solid #fff; 282 | } 283 | 284 | .details { 285 | padding: 10px; 286 | } 287 | 288 | #apartmentDetails { 289 | margin-top: 30px; 290 | } 291 | -------------------------------------------------------------------------------- /templates/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Welcome Page 7 | 8 | 9 | 10 | 11 |
12 |

Turn the key, walk through the door. This new HOUSE is all, you ever wanted and more...

13 |

Welcome To RoofTop Apartments

14 |

Quality Lifestyle

15 |
16 |
17 | 95 |
96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /static/css/welcomeStyle.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Algerian; 3 | font-family: Lucida; 4 | src: url(sansation_light.woff); 5 | } 6 | 7 | body { 8 | background: #00203FFF; 9 | font-family: cursive; 10 | margin: 0; 11 | padding: 0; 12 | } 13 | 14 | .navbar { 15 | background: #00203FFF; 16 | background-size: auto; 17 | display: inline; 18 | position: fixed; 19 | height: 75px; 20 | right: 0; 21 | left: 0; 22 | top: 0; 23 | } 24 | 25 | .container { 26 | display: flex; 27 | } 28 | 29 | .Roof { 30 | width: 120px; 31 | height: 120px; 32 | background-size: contain; 33 | margin-left: 25px; 34 | display: inline-block; 35 | border-radius: 50%; 36 | position: relative; 37 | bottom: -7px; 38 | } 39 | 40 | ul { 41 | display: inline-block; 42 | list-style: none; 43 | margin-left: 600px; 44 | margin-top: 20px; 45 | } 46 | 47 | li { 48 | display: inline-block; 49 | margin-right: 30px; 50 | } 51 | 52 | i { 53 | padding-left: 10px; 54 | } 55 | 56 | .menu1, .menu{ 57 | color: #ADEFD1FF; 58 | font-size: 20px; 59 | } 60 | 61 | .menu:hover, .menu1:hover { 62 | cursor: pointer; 63 | } 64 | 65 | .hidemenu{ 66 | color: #ADEFD1FF; 67 | font-size: 20px; 68 | margin-top: -5px; 69 | font-size: 20px; 70 | list-style: none !important; 71 | padding-bottom: 7px; 72 | border-bottom: 2px solid #ADEFD1FF; 73 | transition: 0.2s; 74 | } 75 | 76 | a { 77 | text-decoration: none; 78 | color: #ADEFD1FF; 79 | font-size: 20px; 80 | cursor: pointer; 81 | } 82 | 83 | .signin { 84 | color: #ADEFD1FF; 85 | font-size: 20px; 86 | } 87 | 88 | .dropdown { 89 | position: relative; 90 | display: inline-block; 91 | } 92 | 93 | .dropdown-content { 94 | padding: 5px; 95 | display: none; 96 | position: absolute; 97 | background-color: #00203FFF; 98 | left: -25px; 99 | min-width: 157px; 100 | box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); 101 | z-index: 1; 102 | text-align: center; 103 | border-radius: 10%; 104 | } 105 | 106 | .dropdown-content a { 107 | color: #ADEFD1FF; 108 | padding: 10px 10px; 109 | text-decoration: none; 110 | display: block; 111 | text-align: center; 112 | } 113 | 114 | .dropdown-content a:hover { 115 | border-bottom: 2px solid #ADEFD1FF; 116 | margin-bottom: -2px; 117 | } 118 | 119 | .dropdown:hover .dropdown-content { 120 | display: block; 121 | } 122 | 123 | .bg { 124 | width: 100%; 125 | height: 100vh; 126 | position: fixed; 127 | background-image: url('/static/images/background.jpg'); 128 | background-position: center center; 129 | background-size: cover; 130 | background-repeat: no-repeat; 131 | text-align: center; 132 | color: ghostwhite; 133 | } 134 | 135 | .quote { 136 | margin-top: 395px; 137 | margin-bottom: 0; 138 | padding-bottom: 0; 139 | font-size: 20px; 140 | font-family: Lucida; 141 | font-weight: bold; 142 | } 143 | 144 | .heading1 { 145 | font-size: 48px; 146 | margin-top: 0; 147 | margin-bottom: 0; 148 | padding-bottom: 0; 149 | font-family: Algerian; 150 | } 151 | 152 | .highlight { 153 | font-size: 60px; 154 | } 155 | 156 | .sub { 157 | padding-left: 20px; 158 | font-size: 24px; 159 | margin-top: -5px; 160 | padding-top: 0; 161 | font-family: Lucida; 162 | font-weight: bold; 163 | } 164 | 165 | /* --------------------------- POP UP FOR ABOUT US ------------------------------*/ 166 | 167 | /* Styling of POP UP Window for both about and contact us */ 168 | /* The popup form - hidden by default */ 169 | .form-popup { 170 | display: none; 171 | position: fixed; 172 | top: 90px; 173 | left: calc(50% - 450px); 174 | border: 2px solid #fff; 175 | box-shadow: 2px 2px 1px black; 176 | z-index: 9; 177 | box-shadow: 2px 2px 6px #fff; 178 | } 179 | 180 | /* Add styles to the form container */ 181 | .form-container { 182 | width: 900px; 183 | height: 420px; 184 | padding: 10px; 185 | background-color: #00203FFF; 186 | color: #ADEFD1FF; 187 | } 188 | 189 | .heading2{ 190 | font-size: 30px; 191 | font-family: Lucida; 192 | text-align: center; 193 | padding-bottom: 0; 194 | margin-bottom: 0; 195 | margin-top: 0; 196 | } 197 | 198 | .vision, .mission { 199 | font-family: cursive; 200 | font-size: 20px; 201 | text-align: center; 202 | padding-bottom: 0; 203 | margin-bottom: 0; 204 | padding-top: 15px; 205 | margin-top: 0; 206 | } 207 | 208 | .fa-star { 209 | padding-right: 10px; 210 | } 211 | 212 | .about-us { 213 | font-family: cursive; 214 | font-size: 16px; 215 | margin-left: 25px; 216 | margin-right: 25px; 217 | padding: 0px; 218 | } 219 | 220 | .form-container .cancel-btn { 221 | background-color: #ADEFD1FF; 222 | color: #000; 223 | padding: 16px 20px; 224 | border: 1px solid #000; 225 | border-radius: 15%; 226 | cursor: pointer; 227 | width: 95px; 228 | height: 48px; 229 | text-align: center; 230 | margin-top: 15px; 231 | margin-left: 400px; 232 | font-size: 18px; 233 | box-shadow: 2px 2px 4px #000; 234 | } 235 | 236 | 237 | /* ------------------------- POP UP FOR CONTACT US ----------------------------*/ 238 | 239 | .heading3 { 240 | font-size: 30px; 241 | font-family: Lucida; 242 | text-align: center; 243 | padding-bottom: 0; 244 | margin-bottom: 0; 245 | margin-top: 0; 246 | padding-top: 5px; 247 | } 248 | 249 | .divider-custom { 250 | text-align: center; 251 | } 252 | 253 | .form1 { 254 | padding-top: 20px; 255 | } 256 | 257 | label { 258 | font-family: cursive; 259 | font-size: 16px; 260 | margin-left: 10%; 261 | } 262 | 263 | .form2 { 264 | display: inline; 265 | padding: 0; 266 | margin: 0; 267 | } 268 | 269 | #msg { 270 | top: 0; 271 | } 272 | 273 | /* Full-width input fields */ 274 | input[type="text"], input[type="email"]{ 275 | border: none; 276 | border-bottom: 1px solid #fff; 277 | background: transparent; 278 | outline: none; 279 | width: 200px; 280 | height: 30px; 281 | margin-left: 10px; 282 | margin-bottom: 15px; 283 | padding-left: 0; 284 | font-size: 18px; 285 | font-family: Lucida; 286 | color: ghostwhite; 287 | } 288 | 289 | input[type="text"] { 290 | margin-top: 10px; 291 | } 292 | 293 | textarea[type="text"] { 294 | border: none; 295 | border-bottom: 1px solid #fff; 296 | background: transparent; 297 | outline: none; 298 | margin-top: 20px; 299 | height: 100px; 300 | width: 500px; 301 | font-size: 18px; 302 | font-family: Lucida; 303 | color: ghostwhite; 304 | } 305 | 306 | .msg { 307 | position: relative; 308 | top: -90px; 309 | } 310 | 311 | /* Set a style for the submit/login button */ 312 | .form-container .btn, .form-container .cancel { 313 | background-color: #ADEFD1FF; 314 | color: #000; 315 | padding: 16px 20px; 316 | border: 1px solid #000; 317 | border-radius: 10%; 318 | cursor: pointer; 319 | width: 95px; 320 | height: 48px; 321 | text-align: center; 322 | margin-top: 25px; 323 | font-size: 18px; 324 | box-shadow: 2px 2px 4px #000; 325 | } 326 | 327 | #submitButton { 328 | margin-right:30px; 329 | margin-left: 320px; 330 | } 331 | 332 | input[type="number"]{ 333 | border: none; 334 | background: transparent; 335 | width: 70px; 336 | border-bottom: 1px solid ghostwhite; 337 | color: ghostwhite; 338 | outline: none; 339 | } 340 | -------------------------------------------------------------------------------- /templates/TenantRegister.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Registration Page 7 | 8 | 9 | 10 | 48 | 49 | 50 | 51 |
52 | 57 | 58 | {% if msg1 %} 59 |

{{ msg1 }}

60 | 61 | {% endif %} 62 |
63 |
64 | 65 |
66 | 67 |
68 | 69 |
70 |
71 |

Registration Form

72 |
73 |
74 |

Personal Details

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 |

Password must contain a lowercase letter,

109 |

a uppercase letter,

110 |

a number

111 |

and minimum
of 8 characters.

112 |

113 |
114 |
115 | 116 |
117 |
118 |
119 | 120 |
121 |
122 |
123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /templates/ApartmentRooms.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Apartment Rooms{% endblock%} 3 | {% block script %} 4 | 5 | 6 | 7 | {% endblock %} 8 | {% block content %} 9 |
10 | 18 |
19 |
20 | 145 |
146 | 147 | {% for msg3Row in msg3 %} 148 | 149 | 157 | 176 | 177 | {% endfor %} 178 |
150 | {% for i in img_url %} 151 | {% if i['ROOM_NO'] == msg3Row['ROOM_NO'] %} 152 | {% set value = i['PATHNAME']+'/'+i['PHOTO1'] %} 153 | Hall 154 | {% endif %} 155 | {% endfor %} 156 | 158 | {% if msg3Row['APT_TITLE'] %} 159 |

{{ msg3Row['APT_TITLE'] }}

160 | {% endif %} 161 |

162 | {% if msg3Row['ROOM_NO'] %} 163 | Apartment : {{ msg3Row['ROOM_NO'] }} 164 | {% endif %} 165 | {% if msg3Row['AREA'] %} 166 | Area : {{ msg3Row['AREA'] }} Sqft. 167 | {% endif %} 168 | {% if msg3Row['RENT_PER_MONTH'] %} 169 | Rent : {{ msg3Row['RENT_PER_MONTH'] }} 170 | {% endif %} 171 |

172 | {% if msg3Row['APARTMENT_DESC'] %} 173 |

{{ msg3Row['APARTMENT_DESC'] | replace('. ', '.
') | safe }}

174 | {% endif %} 175 |
179 |
180 |
181 | {% endblock %} 182 | 183 | {% block endscript %} 184 | 185 | 186 | {% endblock %} -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | #import libraries 2 | from flask import Flask, redirect, render_template, flash, request, url_for, session 3 | from flask_mysqldb import MySQL 4 | import MySQLdb.cursors 5 | from datetime import date, datetime 6 | from dateutil.relativedelta import relativedelta 7 | import uuid 8 | from werkzeug.utils import secure_filename 9 | import os 10 | import shutil 11 | 12 | app = Flask(__name__) 13 | 14 | # Change this to your secret key (can be anything, it's for extra protection) 15 | # app.secret_key = 'your secret key' 16 | app.secret_key = "apartment_rental" 17 | 18 | #code for connection 19 | app.config['MYSQL_HOST'] = 'localhost' #hostname 20 | app.config['MYSQL_USER'] = 'root' #username 21 | app.config['MYSQL_PASSWORD'] = '' #password 22 | #in my case password is null so i am keeping empty 23 | app.config['MYSQL_DB'] = 'apartmentRental' #database name 24 | # Intialize MySQL 25 | mysql = MySQL(app) 26 | 27 | @app.route('/') 28 | def home() : 29 | return render_template('welcome.html') 30 | 31 | 32 | @app.route('/AdminLogin', methods=['GET', 'POST']) 33 | def AdminLogin() : 34 | error = None 35 | if request.method == 'POST' and 'adminUsername' in request.form and 'adminPass' in request.form and 'securityPass' in request.form: 36 | if request.form['adminUsername'] != 'admin' or \ 37 | request.form['adminPass'] != 'secret@123' or \ 38 | request.form['securityPass'] != 'apartment': 39 | error = 'Invalid credentials' 40 | else: 41 | flash('You have logged in successfully!!') 42 | return redirect(url_for('AdminDashboard')) 43 | return render_template('AdminLogin.html', error=error) 44 | 45 | 46 | @app.route('/AdminLogout') 47 | def AdminLogout() : 48 | log2 = '' 49 | log2 = 'You have logged out successfully!!' 50 | return render_template('AdminLogin.html', log2=log2) 51 | 52 | 53 | @app.route('/TenantLogin', methods=['GET', 'POST']) 54 | def TenantLogin() : 55 | error = None 56 | if request.method == 'POST' and 'username' in request.form and 'pswd1' in request.form : 57 | username = request.form['username'] 58 | password = request.form['pswd1'] 59 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 60 | cursor.execute('SELECT * FROM TENANT WHERE EMAIL = % s AND PSWD = % s', (username, password, )) 61 | account = cursor.fetchone() 62 | # If account exists in TENANT table in out database 63 | if account: 64 | # Create session data, we can access this data in other routes 65 | session['loggedin'] = True 66 | session['id'] = account['T_ID'] 67 | session['username'] = account['EMAIL'] 68 | # Redirect to home page 69 | flash('You have logged in successfully!!') 70 | return redirect(url_for('TenantDashboard')) 71 | else: 72 | # Account doesnt exist or username/password incorrect 73 | error = ' Invalid Username or Password !!' 74 | return render_template('TenantLogin.html', error=error) 75 | 76 | 77 | @app.route('/Logout') 78 | def Logout() : 79 | # Remove session data, this will log the user out 80 | session.pop('loggedin', None) 81 | session.pop('id', None) 82 | session.pop('username', None) 83 | # Redirect to login page 84 | log = '' 85 | log = 'You have logged out successfully!!' 86 | return render_template('TenantLogin.html', log=log) 87 | 88 | 89 | @app.route('/Register', methods=['GET','POST']) 90 | def Register(): 91 | msg1 = '' 92 | log = '' 93 | #applying empty validation 94 | if request.method == 'POST' and 'firstname' in request.form and 'lastname' in request.form and 'phNo' in request.form and 'dob' in request.form and 'occupation' in request.form and 'gender' in request.form and 'email' in request.form and 'pswd' in request.form: 95 | #passing HTML form data into python variable 96 | fname = request.form['firstname'] 97 | lname = request.form['lastname'] 98 | ph = request.form['phNo'] 99 | dob = request.form['dob'] 100 | gender = request.form['gender'] 101 | occupation = request.form['occupation'] 102 | email = request.form['email'] 103 | pswd = request.form['pswd'] 104 | if len(ph) != 10 : 105 | msg1 = 'Phone No. must be of 10 digits!!' 106 | return render_template('TenantRegister.html', msg1=msg1) 107 | #creating variable for connection 108 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 109 | #query to check given data is present in database or no 110 | cursor.execute('SELECT * FROM TENANT WHERE EMAIL = % s', (email,)) 111 | #fetching data from MySQL 112 | result = cursor.fetchone() 113 | if result: 114 | msg1 = 'Email already exists !' 115 | else: 116 | #executing query to insert new data into MySQL 117 | cursor.execute('INSERT INTO TENANT VALUES (% s, % s, NULL , % s, % s, % s , % s , % s , NULL, % s)', (fname, lname, ph, email, gender ,dob, occupation,pswd)) 118 | mysql.connection.commit() 119 | #displaying message 120 | log = 'You have successfully registered !' 121 | return render_template('TenantLogin.html', log=log) 122 | elif request.method == 'POST': 123 | msg1 = 'Please fill out the form !' 124 | return render_template('TenantRegister.html', msg1=msg1) 125 | 126 | 127 | @app.route('/TenantRegister') 128 | def tregister() : 129 | return render_template('TenantRegister.html') 130 | 131 | 132 | #----------- ADMIN DASHBOARD---------------- 133 | 134 | 135 | @app.route('/AdminDashboard') 136 | def AdminDashboard() : 137 | occ_apts='' 138 | unocc_apts='' 139 | t_tenants='' 140 | t_users='' 141 | #creating variable for connection 142 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 143 | cursor.execute('SELECT COUNT(T_ID) AS T_USERS FROM TENANT') 144 | mysql.connection.commit() 145 | result1=cursor.fetchone() 146 | t_users = result1['T_USERS'] 147 | cursor.execute('SELECT COUNT(T_ID) AS T_TENANTS FROM TENANT WHERE ROOM_NO IS NOT NULL') 148 | mysql.connection.commit() 149 | result2=cursor.fetchone() 150 | t_tenants = result2['T_TENANTS'] 151 | cursor.execute('SELECT COUNT(ROOM_NO) AS T_APTS FROM APARTMENT WHERE APT_STATUS = "Occupied"') 152 | mysql.connection.commit() 153 | result3=cursor.fetchone() 154 | occ_apts = result3['T_APTS'] 155 | cursor.execute('SELECT COUNT(ROOM_NO) AS T_APTS FROM APARTMENT WHERE APT_STATUS = "Unoccupied"') 156 | mysql.connection.commit() 157 | result4=cursor.fetchone() 158 | unocc_apts = result4['T_APTS'] 159 | tot_apt = unocc_apts + occ_apts 160 | cursor.execute('SELECT COUNT(BLOCK_NO) AS T_BLOCK FROM APARTMENT_BLOCK') 161 | mysql.connection.commit() 162 | result5=cursor.fetchone() 163 | tot_blck = result5['T_BLOCK'] 164 | cursor.execute('SELECT SUM(R.RENT_FEE) AS T_RENT FROM RENT AS R, RENT_STATUS AS S WHERE R.RENT_ID = S.RENT_ID AND S.R_STATUS = "Paid"') 165 | mysql.connection.commit() 166 | result6=cursor.fetchone() 167 | tot_rent = result6['T_RENT'] 168 | if tot_rent == None : 169 | tot_rent = 0 170 | return render_template('AdminDashboard.html', occ_apts=occ_apts, unocc_apts=unocc_apts, t_tenants=t_tenants, t_users=t_users, tot_apt=tot_apt, tot_blck=tot_blck, tot_rent=tot_rent) 171 | 172 | @app.route('/TotalUsers') 173 | def TotalUsers() : 174 | msg5='' 175 | #creating variable for connection 176 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 177 | cursor.execute('SELECT FNAME, LNAME, GENDER, PH_NO, EMAIL, ROOM_NO FROM TENANT') 178 | mysql.connection.commit() 179 | msg5=cursor.fetchall() 180 | return render_template('TotalUsers.html', msg5=msg5) 181 | 182 | 183 | @app.route('/tenantReport', methods=['GET','POST']) 184 | def tenantReport() : 185 | tenantReport='' 186 | msg6='' 187 | #creating variable for connection 188 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 189 | #applying empty validation 190 | if request.method == 'POST' and 'tid' in request.form : 191 | #passing HTML form data into python variable 192 | T_ID = request.form['tid'] 193 | #query to check given data is present in database or no 194 | cursor.execute('SELECT * FROM TENANT WHERE T_ID = % s', (T_ID,)) 195 | #fetching data from MySQL 196 | result = cursor.fetchone() 197 | if result: 198 | #executing query to insert new data into MySQL 199 | cursor.execute('DELETE FROM TENANT WHERE T_ID = % s',(T_ID,)) 200 | mysql.connection.commit() 201 | else: 202 | msg6 = 'Tenant doesn\'t exists !' 203 | elif request.method == 'POST': 204 | msg6 = 'Please fill out the details !' 205 | cursor.execute('SELECT T_ID, FNAME, LNAME, GENDER, PH_NO, EMAIL, ROOM_NO FROM TENANT WHERE ROOM_NO IS NOT NULL') 206 | mysql.connection.commit() 207 | tenantReport=cursor.fetchall() 208 | return render_template('tenantReport.html', msg6=msg6,tenantReport=tenantReport) 209 | 210 | 211 | @app.route('/ApartmentRooms', methods=['POST','GET']) 212 | def ApartmentRooms() : 213 | msg2='' 214 | msg3='' 215 | aptTitle = '' 216 | description = '' 217 | area = '' 218 | Rent=0 219 | Room = 0 220 | #creating variable for connection 221 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 222 | #applying empty validation 223 | if request.method == 'POST' and 'room' in request.form and 'block' in request.form and 'status' in request.form and 'rentPerMonth' in request.form: 224 | #passing HTML form data into python variable 225 | Room = request.form['room'] 226 | Block = request.form['block'] 227 | Status = request.form['status'] 228 | Rent = request.form['rentPerMonth'] 229 | aptTitle = request.form['apartmentTitle'] 230 | description = request.form.get('desc') 231 | area = request.form['area'] 232 | file1 = request.files['hall'] 233 | file2 = request.files['kitchen'] 234 | file3 = request.files['bedroom'] 235 | file4 = request.files['extra'] 236 | path = 'static/images/apartment'+Room 237 | isExist = os.path.exists(path) 238 | if not isExist: 239 | os.makedirs(path) 240 | file1.save(os.path.join('static/images/apartment'+Room, secure_filename(file1.filename))) 241 | file2.save(os.path.join('static/images/apartment'+Room, secure_filename(file2.filename))) 242 | file3.save(os.path.join('static/images/apartment'+Room, secure_filename(file3.filename))) 243 | file4.save(os.path.join('static/images/apartment'+Room, secure_filename(file4.filename))) 244 | #query to check given data is present in database or no 245 | cursor.execute('SELECT * FROM APARTMENT WHERE ROOM_NO = % s', (Room,)) 246 | #fetching data from MySQL 247 | result = cursor.fetchone() 248 | if result: 249 | msg2 = 'Apartment already exists !' 250 | else: 251 | #executing query to insert new data into MySQL 252 | cursor.execute('INSERT INTO APARTMENT VALUES (% s, % s, % s, % s)', (Room, Block, Rent, Status)) 253 | mysql.connection.commit() 254 | cursor.execute('INSERT INTO APARTMENT_DETAILS VALUES (% s, % s, % s, % s)', (Room, aptTitle, area, description)) 255 | mysql.connection.commit() 256 | Image_url = 'images/apartment'+Room 257 | cursor.execute('INSERT INTO APARTMENT_PHOTOS VALUES (% s, % s, %s, %s, %s, %s)', (Room, Image_url, file1.filename, file2.filename, file3.filename, file4.filename)) 258 | mysql.connection.commit() 259 | #displaying message 260 | msg2 = 'You have successfully added an Apartment !' 261 | elif request.method == 'POST': 262 | msg2 = 'Please fill out the form !' 263 | cursor.execute('SELECT APT_TITLE, A.ROOM_NO, AREA, RENT_PER_MONTH, APARTMENT_DESC FROM APARTMENT AS A, APARTMENT_DETAILS AS AD WHERE A.ROOM_NO = AD.ROOM_NO AND A.APT_STATUS = "Unoccupied"') 264 | mysql.connection.commit() 265 | msg3=cursor.fetchall() 266 | cursor.execute('SELECT * FROM APARTMENT_PHOTOS') 267 | mysql.connection.commit() 268 | img_url = cursor.fetchall() 269 | return render_template('ApartmentRooms.html',msg2=msg2,msg3=msg3,img_url=img_url) 270 | 271 | 272 | @app.route('/UpdateApartment', methods=['GET','POST']) 273 | def UpdateApartment(): 274 | msg2='' 275 | msg3='' 276 | #creating variable for connection 277 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 278 | #applying empty validation 279 | if request.method == 'POST' and 'room1' in request.form and 'status1' in request.form and 'rentPerMonth1' in request.form : 280 | #passing HTML form data into python variable 281 | Room1 = request.form['room1'] 282 | Status1 = request.form['status1'] 283 | Rent1 = request.form['rentPerMonth1'] 284 | area1 = request.form['up_area'] 285 | title1 = request.form['up_title'] 286 | #query to check given data is present in database or no 287 | cursor.execute('SELECT * FROM APARTMENT WHERE ROOM_NO = % s', (Room1,)) 288 | #fetching data from MySQL 289 | result = cursor.fetchone() 290 | if result: 291 | #executing query to insert new data into MySQL 292 | cursor.execute('UPDATE APARTMENT SET RENT_PER_MONTH = % s, APT_STATUS = % s WHERE ROOM_NO = % s',(Rent1,Status1,Room1)) 293 | mysql.connection.commit() 294 | cursor.execute('UPDATE APARTMENT_DETAILS SET AREA = % s, APT_TITLE = % s WHERE ROOM_NO = % s',(area1,title1,Room1)) 295 | mysql.connection.commit() 296 | else: 297 | msg2 = 'Apartment doesn\'t exists !' 298 | elif request.method == 'POST': 299 | msg2 = 'Please fill out the form !' 300 | cursor.execute('SELECT APT_TITLE, A.ROOM_NO, AREA, RENT_PER_MONTH, APARTMENT_DESC FROM APARTMENT AS A, APARTMENT_DETAILS AS AD WHERE A.ROOM_NO = AD.ROOM_NO AND A.APT_STATUS = "Unoccupied"') 301 | mysql.connection.commit() 302 | msg3=cursor.fetchall() 303 | cursor.execute('SELECT * FROM APARTMENT_PHOTOS') 304 | mysql.connection.commit() 305 | img_url = cursor.fetchall() 306 | return render_template('ApartmentRooms.html', msg2=msg2,msg3=msg3,img_url=img_url) 307 | 308 | 309 | @app.route('/DeleteApartment', methods=['GET','POST']) 310 | def DeleteApartment() : 311 | msg2='' 312 | msg3='' 313 | #creating variable for connection 314 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 315 | #applying empty validation 316 | if request.method == 'POST' and 'room2' in request.form : 317 | #passing HTML form data into python variable 318 | Room2 = request.form['room2'] 319 | #query to check given data is present in database or no 320 | cursor.execute('SELECT * FROM APARTMENT WHERE ROOM_NO = % s', (Room2,)) 321 | #fetching data from MySQL 322 | result = cursor.fetchone() 323 | if result: 324 | #executing query to insert new data into MySQL 325 | cursor.execute('SELECT PATHNAME FROM APARTMENT_PHOTOS WHERE ROOM_NO = % s',(Room2,)) 326 | mysql.connection.commit() 327 | path = cursor.fetchone() 328 | pathname = 'static/'+path['PATHNAME'] 329 | shutil.rmtree(pathname, ignore_errors=False, onerror=None) 330 | cursor.execute('DELETE FROM APARTMENT WHERE ROOM_NO = % s',(Room2,)) 331 | mysql.connection.commit() 332 | else: 333 | msg2 = 'Apartment doesn\'t exists !' 334 | elif request.method == 'POST': 335 | msg2 = 'Please fill out the form !' 336 | cursor.execute('SELECT APT_TITLE, A.ROOM_NO, AREA, RENT_PER_MONTH, APARTMENT_DESC FROM APARTMENT AS A, APARTMENT_DETAILS AS AD WHERE A.ROOM_NO = AD.ROOM_NO AND A.APT_STATUS = "Unoccupied"') 337 | mysql.connection.commit() 338 | msg3=cursor.fetchall() 339 | cursor.execute('SELECT * FROM APARTMENT_PHOTOS') 340 | mysql.connection.commit() 341 | img_url = cursor.fetchall() 342 | return render_template('ApartmentRooms.html', msg2=msg2,msg3=msg3,img_url=img_url) 343 | 344 | 345 | @app.route('/RentStatus') 346 | def RentStatus() : 347 | rent_status='' 348 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 349 | cursor.execute('SELECT FNAME, LNAME, T.ROOM_NO, RENT_PER_MONTH, DUE_DATE, R_STATUS, LATE_FEE FROM RENT AS R, APARTMENT AS A, RENT_STATUS AS RS, TENANT AS T WHERE R.RENT_ID = RS.RENT_ID AND T.T_ID = R.T_ID AND A.ROOM_NO = T.ROOM_NO') 350 | mysql.connection.commit() 351 | rent_status=cursor.fetchall() 352 | # cursor.execute('CALL RENTUPDATE()') 353 | # mysql.connection.commit() 354 | return render_template('RentStatus.html',rent_status=rent_status) 355 | 356 | @app.route('/UpdatedRentStatus') 357 | def UpdatedRentStatus() : 358 | rent_status='' 359 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 360 | cursor.execute('CALL RENTUPDATE()') 361 | mysql.connection.commit() 362 | cursor.execute('SELECT FNAME, LNAME, T.ROOM_NO, RENT_PER_MONTH, DUE_DATE, R_STATUS, LATE_FEE FROM RENT AS R, APARTMENT AS A, RENT_STATUS AS RS, TENANT AS T WHERE R.RENT_ID = RS.RENT_ID AND T.T_ID = R.T_ID AND A.ROOM_NO = T.ROOM_NO') 363 | mysql.connection.commit() 364 | rent_status=cursor.fetchall() 365 | return render_template('RentStatus.html',rent_status=rent_status) 366 | 367 | @app.route('/Backup') 368 | def Backup() : 369 | backup_status='' 370 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 371 | cursor.execute('SELECT T_ID, FNAME, LNAME, GENDER, PH_NO, EMAIL, ROOM_NO FROM TENANT_BACKUP ') 372 | mysql.connection.commit() 373 | backup_status=cursor.fetchall() 374 | # cursor.execute('CALL RENTUPDATE()') 375 | # mysql.connection.commit() 376 | return render_template('backup.html',backup_status=backup_status) 377 | 378 | 379 | #---------------------------------------------- TENANT DASHBOARD--------------------------------------------- 380 | 381 | 382 | @app.route('/TenantDashboard') 383 | def TenantDashboard() : 384 | if 'loggedin' in session: 385 | return render_template('TenantDashboard.html') 386 | return render_template('TenantLogin.html') 387 | 388 | @app.route('/RentApartment') 389 | def rentApartment() : 390 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 391 | cursor.execute('SELECT APT_TITLE, A.ROOM_NO, AREA, RENT_PER_MONTH, APARTMENT_DESC FROM APARTMENT AS A, APARTMENT_DETAILS AS AD WHERE A.ROOM_NO = AD.ROOM_NO AND A.APT_STATUS = "Unoccupied"') 392 | mysql.connection.commit() 393 | apartment=cursor.fetchall() 394 | cursor.execute('SELECT * FROM APARTMENT_PHOTOS') 395 | mysql.connection.commit() 396 | img_url = cursor.fetchall() 397 | return render_template('RentApartment.html',apartment=apartment, img_url=img_url) 398 | 399 | @app.route('/Details', methods=['GET','POST']) 400 | def Details() : 401 | Error='' 402 | Uname='' 403 | Tname='' 404 | PAddress='' 405 | aptNo='' 406 | TFatherName='' 407 | Date = date.today() 408 | rentAmt= 0 409 | Deposit= 0 410 | #creating variable for connection 411 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 412 | #applying empty validation 413 | if request.method == 'POST' and 'Username' in request.form and 'aptNo' in request.form and 'TFatherName' in request.form and 'PerAddr' in request.form : 414 | Uname = request.form['Username'] 415 | aptNo = request.form['aptNo'] 416 | TFatherName = request.form['TFatherName'] 417 | PAddress = request.form['PerAddr'] 418 | cursor.execute('SELECT T_ID FROM TENANT WHERE EMAIL= % s',(Uname,)) 419 | mysql.connection.commit() 420 | tid_list1 = cursor.fetchone() 421 | t_id = tid_list1['T_ID'] 422 | cursor.execute('SELECT RENT_PER_MONTH FROM APARTMENT WHERE ROOM_NO = %s AND APT_STATUS = "Unoccupied"',(aptNo,)) 423 | mysql.connection.commit() 424 | res1 = cursor.fetchone() 425 | if t_id != None and res1 != None : 426 | cursor.execute('SELECT FNAME,LNAME FROM TENANT WHERE T_ID = %s',(t_id,)) 427 | mysql.connection.commit() 428 | res = cursor.fetchone() 429 | Tname = res['FNAME']+' '+res['LNAME'] 430 | rentAmt=res1['RENT_PER_MONTH'] 431 | Deposit = rentAmt * 2 432 | return redirect(url_for('Contract', aptNo=aptNo ,Tname=Tname, TFatherName=TFatherName, PAddress=PAddress, Date=Date, rentAmt=rentAmt, Deposit=Deposit)) 433 | else : 434 | Error = 'Invalid Username or Apartment No.!!' 435 | elif request.method == 'POST' : 436 | Error= 'Please fill out the form!' 437 | return render_template('Details.html', Error=Error) 438 | 439 | 440 | 441 | @app.route('/alreadyTenant', methods=['GET','POST']) 442 | def alreadyTenant() : 443 | Error='' 444 | Uname='' 445 | Tname='' 446 | aptNo='' 447 | rentAmt= 0 448 | PhNo='' 449 | late_fee=0 450 | #creating variable for connection 451 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 452 | #applying empty validation 453 | if request.method == 'POST' and 'Username' in request.form and 'aptNo' in request.form : 454 | Uname = request.form['Username'] 455 | aptNo = request.form['aptNo'] 456 | cursor.execute('SELECT T_ID, PH_NO FROM TENANT WHERE EMAIL = % s',(Uname,)) 457 | mysql.connection.commit() 458 | tid_list1 = cursor.fetchone() 459 | t_id = tid_list1['T_ID'] 460 | PhNo = tid_list1['PH_NO'] 461 | cursor.execute('SELECT LATE_FEE FROM RENT WHERE T_ID = % s',(t_id,)) 462 | mysql.connection.commit() 463 | latefee_list = cursor.fetchone() 464 | late_fee = latefee_list['LATE_FEE'] 465 | totAmt = int(rentAmt) + int(late_fee) 466 | # PhNo='9876543212' 467 | cursor.execute('SELECT RENT_PER_MONTH FROM APARTMENT WHERE ROOM_NO = %s AND APT_STATUS = "Occupied"',(aptNo,)) 468 | mysql.connection.commit() 469 | res1 = cursor.fetchone() 470 | if t_id != None and res1 != None : 471 | cursor.execute('SELECT FNAME,LNAME FROM TENANT WHERE T_ID = %s',(t_id,)) 472 | mysql.connection.commit() 473 | res = cursor.fetchone() 474 | Tname = res['FNAME']+' '+res['LNAME'] 475 | rentAmt=res1['RENT_PER_MONTH'] 476 | late_fee = late_fee 477 | totAmt = int(rentAmt) + int(late_fee) 478 | return redirect(url_for('Payment1', aptNo=aptNo ,Tname=Tname, Uname=Uname,PhNo=PhNo , rentAmt=rentAmt, late_fee=late_fee, totAmt=totAmt)) 479 | else : 480 | Error = 'Invalid Username or Apartment No.!!' 481 | elif request.method == 'POST' : 482 | Error= 'Please fill out the form!' 483 | return render_template('alreadyTenant.html', Error=Error) 484 | 485 | 486 | @app.route('/Contract////////', methods=['GET','POST']) 487 | def Contract(aptNo,Tname, TFatherName, Uname, PAddress, Date, rentAmt, Deposit) : 488 | msg7='' 489 | late_fee=0 490 | totAmt=0 491 | #creating variable for connection 492 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 493 | #applying empty validation 494 | if request.method == 'POST' and 'UserName' in request.form and 'aptno' in request.form and 'rent-amt' in request.form and 'deposit' in request.form and 'start_date' in request.form and 'end_date' in request.form and 'pay_date' in request.form and 'terms' in request.form: 495 | #passing HTML form data into python variable 496 | end_date = request.form['end_date'] 497 | # pay_date = request.form['pay_date'] 498 | terms = request.form['terms'] 499 | Username = request.form['UserName'] 500 | Apt_no = request.form['aptno'] 501 | start_date = request.form['start_date'] 502 | Deposit = request.form['deposit'] 503 | rentAmt = request.form['rent-amt'] 504 | #creating variable for connection 505 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 506 | #query to check given data is present in database or no 507 | cursor.execute('SELECT T_ID FROM TENANT WHERE EMAIL= % s',(Username,)) 508 | mysql.connection.commit() 509 | tid_list2 = cursor.fetchone() 510 | T_id = tid_list2['T_ID'] 511 | resDate = datetime.strptime(start_date, '%Y-%m-%d') 512 | due_date = resDate + relativedelta(months=+2) 513 | totAmt = int(rentAmt) + int(late_fee) 514 | #executing query to insert new data into MySQL 515 | cursor.execute('INSERT INTO CONTRACT VALUES ( NULL , % s, % s, % s , % s , % s , % s)', (T_id, Apt_no, start_date, end_date, Deposit ,terms)) 516 | cursor.execute('INSERT INTO RENT VALUES ( NULL , % s, % s, % s , % s , NULL)', (rentAmt, T_id,due_date, late_fee)) 517 | mysql.connection.commit() 518 | cursor.execute('SELECT RENT_ID FROM RENT WHERE T_ID = % s',(T_id,)) 519 | mysql.connection.commit() 520 | rent_id_list = cursor.fetchone() 521 | rent_id = rent_id_list['RENT_ID'] 522 | cursor.execute('INSERT INTO RENT_STATUS VALUES ( % s, % s)', (rent_id,'Unpaid')) 523 | cursor.execute('UPDATE TENANT SET ROOM_NO = % s WHERE T_ID = % s',(Apt_no,T_id)) 524 | cursor.execute('UPDATE APARTMENT SET APT_STATUS = "Occupied" WHERE ROOM_NO = % s',(Apt_no,)) 525 | mysql.connection.commit() 526 | cursor.execute('SELECT PH_NO FROM TENANT WHERE T_ID = % s',(T_id,)) 527 | mysql.connection.commit() 528 | phone_no = cursor.fetchone() 529 | PhNo = phone_no['PH_NO'] 530 | #displaying message 531 | flash('Hope you love Rooftop Apartments... ') 532 | return redirect(url_for('Payment', aptNo=aptNo ,Tname=Tname, PhNo=PhNo, Uname=Uname, rentAmt=rentAmt, late_fee=late_fee, totAmt=totAmt)) 533 | elif request.method == 'POST' : 534 | msg7 = 'Please fill out the form !' 535 | return render_template('contract.html', msg7=msg7, aptNo=aptNo , Date=Date, Tname=Tname, TFatherName=TFatherName, Uname=Uname, PAddress=PAddress, Date1=Date, rentAmt=rentAmt, Deposit=Deposit) 536 | 537 | 538 | @app.route('/Payment///////', methods=['GET','POST']) 539 | def Payment(aptNo,Tname,PhNo, Uname, rentAmt, late_fee, totAmt) : 540 | err='' 541 | Date = date.today() 542 | id = uuid.uuid1() 543 | fields = id.fields 544 | pay_id = fields[0] 545 | pay_date = date.today() 546 | #creating variable for connection 547 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 548 | #applying empty validation 549 | if request.method == 'POST' and 'email' in request.form and 'roomNo' in request.form and 'acc-no' in request.form and 'cardNo' in request.form and 'cvv' in request.form : 550 | Uname = request.form['email'] 551 | aptNo = request.form['roomNo'] 552 | Acc_No = request.form['acc-no'] 553 | card_No = request.form['cardNo'] 554 | cvv = request.form['cvv'] 555 | if len(card_No) != 11 and len(cvv) != 3: 556 | err = 'Invalid Card No or cvv!!' 557 | return render_template('Payment.html',err=err, aptNo=aptNo ,Tname=Tname, PhNo=PhNo, Uname=Uname, rentAmt=rentAmt, late_fee=late_fee, totAmt=totAmt) 558 | cursor.execute('SELECT T_ID FROM TENANT WHERE EMAIL= % s',(Uname,)) 559 | mysql.connection.commit() 560 | tid_list1 = cursor.fetchone() 561 | t_id = tid_list1['T_ID'] 562 | cursor.execute('SELECT RENT_ID FROM RENT WHERE T_ID= % s',(t_id,)) 563 | mysql.connection.commit() 564 | rentid_list = cursor.fetchone() 565 | rent_id = rentid_list['RENT_ID'] 566 | if t_id != None and aptNo != None : 567 | cursor.execute('INSERT INTO PAYMENT VALUES(% s, % s, % s, % s, % s)',(pay_id,Acc_No,t_id,Date,rentAmt)) 568 | cursor.execute('UPDATE RENT SET PAYMENT_ID = % s WHERE RENT_ID = % s',(pay_id, rent_id)) 569 | cursor.execute('UPDATE RENT_STATUS SET R_STATUS = "Paid" WHERE RENT_ID = % s',(rent_id,)) 570 | mysql.connection.commit() 571 | pay_amt = rentAmt 572 | return redirect(url_for('Receipt',Tname=Tname, pay_id=pay_id, pay_date=pay_date ,pay_amt=pay_amt)) 573 | elif request.method == 'POST' : 574 | err= 'Please fill out the form!' 575 | return render_template('Payment.html',err=err, aptNo=aptNo ,Tname=Tname, PhNo=PhNo, Uname=Uname, rentAmt=rentAmt, late_fee=late_fee, totAmt=totAmt) 576 | 577 | 578 | @app.route('/Payment1///////', methods=['GET','POST']) 579 | def Payment1(aptNo,Tname,PhNo, Uname, rentAmt, late_fee, totAmt) : 580 | err='Payment Unsuccessfull' 581 | cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor) 582 | if request.method == 'POST' and 'email' in request.form and 'roomNo' in request.form and 'acc-no' in request.form : 583 | Uname = request.form['email'] 584 | aptNo = request.form['roomNo'] 585 | pay_date = request.form['pay_date'] 586 | Acc_No = request.form['acc-no'] 587 | id = uuid.uuid1() 588 | fields = id.fields 589 | pay_id = fields[0] 590 | Date = date.today() 591 | cursor.execute('SELECT T_ID FROM TENANT WHERE EMAIL= % s',(Uname,)) 592 | mysql.connection.commit() 593 | tid_list1 = cursor.fetchone() 594 | t_id = tid_list1['T_ID'] 595 | cursor.execute('SELECT RENT_ID FROM RENT WHERE T_ID= % s',(t_id,)) 596 | mysql.connection.commit() 597 | rentid_list = cursor.fetchone() 598 | rent_id = rentid_list['RENT_ID'] 599 | if t_id != None and aptNo != None : 600 | cursor.execute('INSERT INTO PAYMENT VALUES(% s, % s, % s, % s, % s)',(pay_id,Acc_No,t_id,Date,rentAmt)) 601 | cursor.execute('UPDATE RENT SET PAYMENT_ID = % s WHERE RENT_ID = % s',(pay_id, rent_id)) 602 | cursor.execute('UPDATE RENT_STATUS SET R_STATUS = "Paid" WHERE RENT_ID = % s',(rent_id,)) 603 | mysql.connection.commit() 604 | pay_amt = rentAmt 605 | return redirect(url_for('Receipt',Tname=Tname, pay_id=pay_id, pay_date=pay_date ,pay_amt=pay_amt)) 606 | return render_template('Payment.html', err=err,aptNo=aptNo ,Tname=Tname, PhNo=PhNo, Uname=Uname, rentAmt=rentAmt, late_fee=late_fee, totAmt=totAmt) 607 | 608 | 609 | 610 | @app.route('/Receipt////', methods=['GET','POST']) 611 | def Receipt(Tname,pay_id,pay_date,pay_amt) : 612 | return render_template('Reciept.html', Tname=Tname, pay_id=pay_id, pay_date=pay_date ,pay_amt=pay_amt) 613 | 614 | 615 | if __name__ == '__main__': 616 | app.run(port=5000,debug=True) 617 | --------------------------------------------------------------------------------