You are on page 1of 39

ONLINE APPOINTMENT BOOKING FOR

PHOTOGRAPHY

Submitted in partial fulfillment of the requirements for the award of a degree of

BACHELOR OF COMPUTER APPLICATIONS

Submitted by:

DHIVYA BHARATHI N Register No: 21UCAV044


Register No: 21UCAV040
BABYSHALINI K

Under the Guidance of

Mr. K.SENTHILKUMAR M.C.A., M.Phil., (Ph.D)

Assistant Professor

PG & Research Department of Computer Science & Applications

VIVEKANANDHA COLLEGE OF ARTS AND SCIENCES FOR WOMEN

[Autonomous]

[An ISO 9001: 2015 Certified Institution]

(Affiliated to Periyar University. Approved by AICTE &


Reaccredited with” A+" Grade by NAAC & Recognized U/S 2(f) & 12(B)

UGC 1956) Elayampalayam, Tiruchengode (Tk), Namakkal (DT).


MARCH-2024
VIVEKANANDHA
COLLEGE OF ARTS AND SCIENCES FOR WOMEN
[Autonomous]

[An ISO 9001: 2015 Certified Institution]

(Affiliated to Periyar University, Approved by AICTE &


Reaccredited with “A+"grade by NAAC & Recognized U/S2 (f) & 12(B) by UGC 1956)

Elayampalayam , Tiruchengode (Tk), Namakkal (DT)

PG & Research Department of Computer Science & Applications

PROJECT REPORT

CERTIFICATE

This certifies the project work entitled “ONLINE APPOINTMENT BOOKING FOR
PHOTOGRAPHY” is bonafide record of original work done by BABYSHALINI K
(21UCAV040) DHIVYA BHARATHI N (21UCAV044) during the academic year (2023-
2024) partially fulfilled their requirements for the degree of BACHELOR OF COMPUTER
APPLICATION.

Project Guide Head of the department

This is submitted for the project viva-voce examination held on at

PG & Research Department of Computer Science & Applications, Vivekanandha College of Arts
and Sciences for Women (Autonomous), Tiruchengode.

Internal Examiner External Examiner


DECLARATION

I affirm that the project work titled “ONLINE APPOINTMENT BOOKING FOR
PHOTOGRAPHY" was submitted to Vivekananda College of Arts and Sciences for Women
(Autonomous), Tiruchengode. In partial fulfillment for the award of the degree of Bachelor of
computer applications are cord of original work done by us under the supervision and guidance of
Mr. K.SENTHILKUMAR M.C.A., M.Phil., (Ph.D), Assistant Professor PG & Research Department
of Computer Science & Applications Vivekanandha College of Arts and Sciences for Women
(Autonomous), Tiruchengode. It has not formed the part of any other project work, submitted for the
award of any degree or diploma, either in this or any other University.

(Signature of the Candidate)

DHIVYA BHARTHI N [21UCAV044]


BABY SHALINI K [21UCAV040]

I certify that the declaration made above by the candidate is true to my knowledge.

Signature of the Guide

Mr.K.SENTHILKUMAR, M.C.A., M.Phil., (Ph.D),

Assistant Professor,

PG & Research Department of Computer Science & Applications


ACKNOWLEDGEMENT

I am very much grateful to the almighty who has helped me through the project work and
who has modeled me into what I am today,

I would like to thank Vidhya Rathna, Chairman & Secretary and Tint Prof. Dr. M.
KARUNANITHI B. Pharm MS, Ph.D. D.Litt. and K. KRISHNAVENI KARUNANITHI
MA. Managing Director, Vivekananda Educational Institutions, has allowed me to undergo this
project work successfully in this esteemed Institution

I express my sincere thanks to Dr. S. ARTHANAREESWARAN M.D.,(GenMedi.).,


Join Managing Director, Dr. K. SREERAGHANITHI ARTHANAREESWARAN M.S
(OPHTHAL), Joint Secretary. Dr. K. KIRUPANITHI M.D (Emer Medi.), Vice-Chairman and
Dr. K.R. NIVETHANA KIRUPANITHI MS, (OG), Director, Vivekananda Educational
Institutions, who encouraged me by giving their valuable suggestions in fulfilling this project.

I express my sincere thanks to Prof. Dr. S. KUPPUSWAMI B.E. M.Sc. (Engg). Dr.
Ing (France) Executive Director and Mr. M. CHOKKALINGAM M.Sc. B.Ed., Chief
Executive. Vivekananda Educational Institutions, who has allowed me to undergo this project
work successfully in this esteemed Institution.

I would like to express my warm thanks to Dr. V. KUMARAVEL, M.Com.,


MBA, M. Phil, M.Sc. (Phy). M.SIT, Ph.D. Corporate Relationship & Skill Development,
Vivekananda Colleges of Arts and Sciences, who encouraged me by giving his valuable
suggestions in fulfilling this project successfully.

I would like to express my deep sense of gratitude to Principal, Dr. P. BABY SHAKILA
M.Sc.,M. Phil, M. Ed Ph.D., M.B.A. Vivekananda College of Arts and Sciences for Women
(Autonomous), for her valuable encouragement and guidance given to me for the successful
completion of this project. I am grateful to her in all ways

I extend my sincere thanks to Dr. K. Ramesh M.C.A., M.Phil., (Ph.D) Assistant


Professor, PG and Research Department of Computer Science and Applications for his valuable
guidance and suggestions and assistance rendered towards us to complete the project work in
time.

My heart felt thanks to my Guide Mr.K.SENTHILKUMAR M.C.A., M.Phil., (Ph.D)


Assistant Professor, PG and Research Department of Computer Science and Applications for his
valuable guidance and suggestions throughout my project, I am grateful to all the staff members
of any department. Who encouraged us throughout this project work.
CONTENTS

S.No Title Page No

1 INTRODUCTION

2 SYSTEM ANALYSIS

3 SYSTEM REQUIREMENTS

4
SYSTEM ANALYSIS DESIGN

5
SYSTEM ARCHITECTURE

6
IMPLEMENTATION

7
TESTING

8 TEST CASE

9 FUTURE ENHANCEMENT

10 APPENDIX
ONLINE APPOINTMENT BOOKING FOR
PHOTOGRAPHY

ABSTRACT

The online appointment booking system for photography, developed using Python,
MySQL, and the Flask framework, offers a comprehensive solution for both users and
administrators. For photography users, the platform simplifies the process of scheduling
photography sessions by allowing them to book appointments conveniently online. Users can
explore available offers, review photographers' portfolios, access studio locations, and easily
communicate with photographers for inquiries or assistance. Additionally, after their
photography sessions, users can provide valuable feedback and ratings, enhancing the overall
experience.On the administrative side, the system equips administrators with powerful tools to
manage appointments efficiently. Admin can oversee a comprehensive list of appointments,
approving or rejecting requests as necessary with advanced filtering options, admins can easily
sort appointments based on various parameters, facilitating better organization and planning.
They can also view appointments within specific date ranges and reschedule them when
needed, ensuring optimal utilization of resources. Furthermore, administrators can create and
manage promotional offers, upload and update photographers' portfolios, and monitor customer
feedback to continually improve service quality. The inclusion of a calendar view enhances
visibility into appointment schedules, enabling administrators to optimize booking processes
effectively.

CHAPTER 1

INTRODUCTION
Online Photo shoot Booking Service is a bunch of benefits from the various point of
views. As this online application enables the end user to register to the system online, select the
photographers of their choice from the menu list, and book shoot online. Also, the payment can
be made through online mode or at the time of shoot depending upon the customer’s choice and
convenience. The selection made by the customers will be available to the admin. Now this
same person will assign the advance to the specialist photographer with the details .As soon as
the shoot is completed the photographer will receive the whole money. Therefore, this system
enhances the speed of booking and quality and manner of taking the order from the customer. It
provides a better communication platform. The user’s details are stored using the electronic
media. Online photo shoot booking service provides photographers online and the customers
can easily place the order by just clicking the mouse or by touching a button on their smart
phones.
 User Registration and Authentication: Allows users to create accounts securely and
authenticate themselves to access the booking system.
 Appointment Booking: Enables users to schedule photography sessions by selectin preferred
dates, times, and photography services.
 Availability Calendar: Provides a visual representation of photographers' availability,
allowing users to choose open slots for their appointments.
 View Offers and Packages: Users can explore available offers, packages, and promotions
offered by photographers or studios.
 Portfolio Viewing: Allows users to browse through photographers' portfolios to evaluate
their style, expertise, and previous work.
 Rating and Feedback: Enables users to leave ratings and feedback based on their experience
with the photography service, contributing to transparency and credibility.
OBJECTIVE:
The objective of implementing an online appointment booking system for photography is
to provide a convenient and efficient platform for both photographers and clients to schedule
and manage photography sessions. The system aims to streamline the process of appointment
booking, reduce administrative overhead, and improve communication between
photographers and clients.
 Improving Efficiency: Automate the appointment scheduling process to eliminate
manual tasks such as phone calls or emails, reducing the time and effort required forb
both photographers and clients.
 Enhancing Convenience: Enable clients to easily view photographers' availability,
select preferred dates and times, and book appointments online from the comfort of
their own homes.
 Enhancing implementation: Implement a notification system to keep photographers
and clients informed about appointment bookings, reminders, and any changes or
cancellations.
SCOPE:

 User Registration/Login: Users can register for an account or log in if they already
have one.
 Photographer Profiles: Display profiles of photographers along with their portfolios
and available time slots.
 Calendar Interface: Users can select dates for their appointments using a calendar
interface.
 Available Time Slots: Dynamically display available time slots based on the
photographer's schedule.
 Booking Confirmation: Users can confirm their booking by selecting a date and time
slot.
 Appointment Management: Users can view and manage their appointments,
including editing or canceling existing bookings.
 Admin Dashboard: Administrators have access to a dashboard to manage user accounts,
appointments, photographer profiles, and system settings.
 Appointment Management: Admin can view, approve, reschedule, or cancel appointments.
They can also generate reports on appointment metrics and trends.
 Offer Management: Admin can create and manage promotional offers, discounts, and
packages offered by photographers to attract more bookings.
 Feedback Analysis: The system provides tools for admins to analyze user feedback and take
corrective actions or improvements to enhance the user experience.
 Communication: Users can contact photographers or admins for inquiries, special requests,
or assistance through integrated communication channels.
 Security and Privacy: The system ensures the security and privacy of user data, including
encryption of sensitive information and compliance with data protection regulations.
 Scalability: The system is designed to accommodate growth in users, photographers, and
bookings over time without compromising performance or user experience.
 Integration: The system may integrate with external services or platforms for features such
as payment processing, calendar synchronization, or social media sharing.
 Support and Maintenance: The system provides ongoing support and maintenance to
address user inquiries, resolve issues, and update system functionalities based on user
feedback and technological advancements.

CHAPTER 2

SYSTEM ANALYSIS

System analysis is a crucial phase in the development or improvement of any software


system, including an Appointment Booking System for Photography. It involves a comprehensive
examination of the current system or the requirements for a new system to understand its
functionality, limitations, and potential improvements. Here are the key components and steps of
system analysis:

 Understanding Business Needs: The first step is to gather detailed information about the
organization's business needs and objectives related to appointment booking for
photography. This involves meetings with stakeholders such as photographers, clients,
and administrative staff to identify pain points and requirements.

 Defining Objectives: Clearly define the objectives and goals of the Appointment
Booking System for Photography. What problems should it solve? What improvements
are expected? Objectives might include streamlining the booking process, improving
scheduling efficiency, enhancing user experience, and ensuring accurate record-

keeping.

 Requirements Gathering: Document functional and non-functional requirements for the


system. Functional requirements specify what the system should do, such as allowing
clients to book appointments, enabling photographers to manage their schedules, and
generating booking reports. Non-functional requirements cover aspects like performance,
security, and user accessibility.

 Current System Analysis: If an existing appointment booking system for photography is


in place, analyze its strengths and weaknesses. Identify any bottlenecks, usability issues,
or compliance gaps. Consider feedback from photographers, clients, and administrative
staff to pinpoint areas for improvement.

 Process Modeling: Create process flowcharts or diagrams to visualize the current


appointment booking process for photography and identify areas for improvement. This
helps in understanding how the new system should integrate with existing workflows and
where efficiency gains can be made.
EXISTING SYSTEMS

The “existing system” refers to the current state of a process, operation, or software
Application in an organization before any improvements or changes are made. In the contex to
the existing system represent show an organization manages before implementing a new or up
graded. Here are some key aspects to consider when an laying the existing in online appointment
booking:
Manual Processes:

 Current Process Overview:Photographers and clients currently schedule


photography sessions. Identify the methods used for communication, such as phone
calls, emails, or in-person meetings. Highlight any existing online platforms or tools
used for appointment booking.
 Strengths of the Current System: Identify any aspects of the current process that
work well or are successful. Consider factors such as reliability, flexibility, and user
satisfaction. Note any positive feedback or testimonials from users.
 Record Keeping The system should maintain accurate records of appointments,
including client details, booking history, and photographer availability, to avoid
discrepancies and disputes.
 Reporting Incorporate reporting features to generate insights into appointment
usage, client preferences, and business performance for better decision-making.
 Security and Compliance: Ensure that the system adheres to data security
standards and complies with relevant privacy regulations to protect client
information..
 User Experience: Design the system with a user-friendly interface for both
photographers and clients, allowing easy navigation, appointment scheduling, and
management.
 Scalability: Build the system to handle growing demands as the photography
business expands, ensuring scalability in terms of handling more appointments and
users.
CHAPTER 3

SYSTEM REQUIREMENTS

 Processor:2.0GHz
 Memory:4.00 GB
 HardDisk:1TB
 Others: Other required standard computer peripherals, such as keyboard and mouse

Server:
A dedicated server or cloud hosting with sufficient processing power and memory to
Handle the expected user load. Redundancy and backup solutions to ensure system
availability.

Hardware Requirements:
System requirements for online appointment booking for photography encompass
both hardware and software components. These requirements ensure that the online
appointment booking for photography operates efficiently, securely and effectively with in an
organization. Below are typical hardware and software requirements for online appointment
booking for photography.

Storage:
Consideration for data backup and disaster recovery.

Network Infrastructure:
Reliable network connectivity to ensure seamless accost the from various locations
within the organization. Secure network architecture to protect sensitive employee data.

Client Devices:
Employee devices (computers, smart phones,tablets)capable of accessing OBA
through
web browser or dedicated apps .Compatibility with common web browsers(e.g.,Chrome,
Firefox, Edge).
Security Measures:
Fire walls, intrusion detection systems, and encryption protocols to safe guard data
Transmission and storage, User authentication mechanisms, such as username and password
ormulti- factor authentication.
Software Requirements:
Server Environment:
 Operating System: Windows 7
 Front End: PYTHON, HTML, CSS, JS
 Back End: PYTHON, MYSQL
 Database Server: MYSQL
 Web Server: Local Server
Client Environment:
 Operating System (Server): Choice of operating system (e.g., Windows Server,
Linux)that supports the online Appointment booking for photography Application and
database.
 Database Management System (DBMS):A robust DBMS (e.g., MySQL ,and Microsoft
SQL Server)for storing and Managing client data, appointment records, and system
configurations.
Web Server:
A web server software to host the application and server webpages to users.
Programming Framework:
Depending on the technology stack used for the OAB, a programming
framework(e.g.,PYTHON, flash frame work,.NET) maybe required.
Web Application:
Development of the OAB application using web technologies (HTML, CSS,
JavaScript)to Provide a user-friendly interface.
CHAPTER 4

SYSTEM DESIGN

Modules description
The Appointment Booking Module streamlines photography session scheduling by
enabling users to browse available slots and book appointments conveniently. It offers features
such as filtering by service type, location, and pricing, ensuring tailored booking experiences.
Administrators gain control through a dashboard for managing bookings, confirming
appointments, and generating insightful reports on appointment statistics.

This module allows users, including customers and clients, to browse available
appointment slots and book appointments for photography sessions.Users can view the
photographer's availability based on a calendar view or time slots and select a convenient date
and time for their appointment.The module should include features such as filtering by service
type (e.g., portrait, wedding, and event), photographer availability, location, and pricing.Users
should be able to provide additional details or requirements for their appointment during the
booking process, such as the purpose of the session, preferred location, and any special
requests.Upon booking, users should receive confirmation notifications via email or SMS,
including details of the appointment, payment information (if applicable), and any additional
instructions.The module should also integrate with the photographer's calendar to update
availability in real-time and prevent double bookings.Administrators should have access to a
dashboard where they can manage and view all appointment bookings, confirm or reschedule
appointments, assign photographers to sessions, and generate reports on appointment statistics
and revenue.Additionally, the module may include features for handling cancellations,
rescheduling requests, and issuing refunds or credits as per the company's policies.
CHAPTER 5
Home
page
SYSTEM ARCHITECTURE

Data flow diagram


Home page

View Studio
Portfolio Dash Board
Location

User Admin

Register Login Register Login

User dashboard

Appointment Feedback Contact View


from Us Offers

Reschedule
appointments

Cancel
appointments
Admin Dashboard

Dash Board

Appointment Create Offer Appointment Customer Calendar


Reschedule Feedback

Add event
Pending Appointment
Appointments list
Update event

Appointment Appointment
Filter approve/reject Delete event

Appointment
Range
UML DIAGRAM

Use
ER Diagram
CHAPTER 6

IMPLEMENTATION

ENVIRONMENT SETUP:
Setting up an environment for software development can vary depending on the specific
Project and technologies you are using. However, I can provide you with a general guide line
for Setting up a development environment:

 Choose a Development Machine: Select a computer or server that meets the hardware
Requirements for your development tasks. Ensure it has sufficient CPU, RAM, and
storage space.
 Operating System: Choose an operating system based on your project requirements
and personal preferences. Common choices include Windows, macOS, and various
linux distributions.
 Text Editor or Integrated Development Environment(IDE):Install at exteditor or
IDE that issuitable for your programming language.Popular choices include Visual
Studio Code, Intelli J IDEA, Eclipse, PyCharm, and others.
 Version Control System(VCS):Install and configure a version control system like git.
Setup your Git identity(name and email).
 Terminal or Command Prompt: Familiarize yourself with the terminal or command
Prompt on your operating system, as you’ll use it for running commands, managing
Files, and interacting with Git.
 Programming Languages and Run time: Install the programming languages and
Runtimes required for your project. This could include Python,flask,MySQL,js ,or
others.
 Database Management System (DBMS):Install a DBMS if your project requires one
(e.g., MySQL, Postgre SQL, SQLite, MongoDB).Setup and configure the database as
needed.
CHAPTER 7

TESTING

Testing is a crucial phase in the development of an Online Appointment Booking System to


ensure that the system functions as expected, is free of errors, and meets the requirements of both
photographers and clients. The main types of testing conducted in an Online Appointment
Booking System include:
 Functionality Testing: Appointment Booking Testing: Ensure that clients can
successfully book appointments with accurate details and that the system handles
various appointment types (e.g., portrait sessions, event coverage) correctly.
 Availability Testing: Verify that the system accurately displays available time slots
based on photographer User Interface (UI) Testing availability and that clients can
choose from these options without errors.
 User-Friendly Interface Testing: Check that the user interface is intuitive and user-
friendly for both photographers and clients. Verify that it works correctly on various
devices and browsers, allowing for easy navigation and appointment scheduling.
 Booking Process Testing: Test the entire booking process from start to finish,
including selecting a date and time, providing client details, and confirming the
appointment. Ensure that each step flows smoothly without any glitches.
 Security Testing: Authentication and Authorization Testing: Ensure that user
registration and authentication mechanisms are secure. Verify that only authorized
users can access the system and perform actions such as booking appointments or
managing schedules.
 Data Protection Testing: Test the system's data encryption, secure connections, and
measures to protect sensitive client and photographer information. Verify that personal
data is handled securely and in compliance with privacy regulations.
 Performance Testing: Load Testing: Assess the system's performance under different
levels of load to ensure it can handle multiple concurrent users booking appointments
without slowdowns or crashes.
 Response Time Testing: Measure the system's response time for various actions, such
as loading the booking interface, submitting appointment requests, and updating
availability. Ensure that response times are acceptable and consistent.
CHAPTER 8
Test Case
INPUT

OUTPUT
CHAPTER 9

FUTURE ENHANCEMENTS

 Mobile Accessibility: Develop a mobile application to facilitate easy appointment

scheduling and management on-the-go.

 Advanced Reporting: Enhance reporting capabilities with customizable reports and

dashboards for better insights into appointment statistics and trends.

 AI-Powered Chatboats: Integrate chat bots to handle customer inquiries, provide quick

assistance, and offer personalized recommendations.

 Calendar Integration: Enable synchronization with popular calendar applications to ensure

seamless scheduling and reminders.

 Geolocation and Tracking: Implement Geolocation features for tracking appointment

locations and providing directions to users.

 Multi-Language Support: Provide support for multiple languages to cater to a diverse

range of users and enhance accessibility.

 Automated Reminders: Set up automated appointment reminders via SMS or email to

reduce no-shows and improve overall efficiency.

 Payment Integration: Integrate secure payment gateways to enable online payment for

bookings, enhancing convenience for customers.

 Social Media Integration: Allow users to share their booked appointments on social media

platforms, increasing visibility and attracting more customers.


CHAPTER 9

APPENDIX

SAMPLECODE
from flask import Flask, render_template, url_for, redirect, request,
jsonify,json,session,flash
import MySQLdb.cursors
from flask_mysqldb import MySQL,MySQLdb
import smtplib
from flask_mail import Mail, Message
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import googlemaps
from flask_login import LoginManager , UserMixin, login_user ,
login_required ,current_user, logout_user
appointment =[]
import os
from werkzeug.utils import secure_filename

#import magic
import urllib.request
import re
from datetime import datetime
from flask_login import LoginManager , UserMixin, login_user ,
login_required ,current_user, logout_user
app = Flask(__name__)

# MySQL database connection


app.config["MYSQL_HOST"] = "127.0.0.1"
app.config["MYSQL_USER"] = "root"
app.config["MYSQL_PASSWORD"] = "root"
app.config["MYSQL_DB"] = "online_appointment"
app.config["MYSQL_CURSORCLASS"] = "DictCursor"
mysql = MySQL(app)

@app.route("/view_offers", methods=['GET'])
def view_offers():
try:
con = mysql.connection.cursor()
# Retrieve offers from the database
select_query = "SELECT * FROM images"
con.execute(select_query)
offers = con.fetchall()
# Function to send confirmation email
def send_emailC(name, email,message):
subject = 'New Message from Contact Form'
body = f"Name: {name}\nEmail: {email}\n\nMessage:\n{message}"

msg = Message(subject, recipients=['coding2923@gmail.com'], body=body)


mail.send(msg)

UPLOAD_FOLDER = 'static/uploads'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])

def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS

@app.route('/gallery',methods=["POST","GET"])
def gallery():
return render_template('gallery.html')

@app.route('/home_page',methods=["POST","GET"])
def home_page():
return render_template('home_page.html')

@app.route('/model',methods=["POST","GET"])
def model():
return render_template('model.html')

@app.route('/',methods=["POST","GET"])
def dashboard():
return render_template('dashboard.html')

@app.route('/singout',methods=["POST","GET"])
def singout():
return render_template('dashboard.html')

@app.route('/maps',methods=["POST","GET"])
def maps():
return render_template('maps.html')

#USER login
@app.route("/user_homepage", methods=['GET', 'POST'])
def user_homepage():
password = request.form['password'] = % s',(email,password,))
user = cursor.fetchone()
if user:
session['loggedin']= True
from flask import render_template, request

@app.route('/appointment_view_details', methods=['GET', 'POST'])


def appointment_view_details():
con = mysql.connection.cursor()
select_query = "SELECT * FROM `appointment`"
con.execute(select_query)
orders = con.fetchall()
return render_template('appointment_view_details.html', orders=orders)

@app.route("/range",methods=["POST","GET"])
def range():
cur = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
if request.method == 'POST':
From = request.form['From']
to = request.form['to']
print(From)
print(to)
query = "SELECT * from appointment WHERE date BETWEEN '{}' AND
'{}'".format(From,to)
cur.execute(query)
ordersrange = cur.fetchall()
return jsonify({'htmlresponse': render_template('response.html', ordersrange=ordersrange)})

@app.route('/appointment_view',methods=['GET','POST'])
def appointment_view():
con = mysql.connection.cursor()
select_query = "SELECT * FROM appointment "
con.execute(select_query)
data = con.fetchall()
return render_template("appointment_view.html", data = data)
@app.route('/reschedule')
def reschedule():
con = mysql.connection.cursor()
select_query = "SELECT * FROM appointment "
con.execute(select_query)
data = con.fetchall()
return render_template("reschedule.html", data = data)

@app.route('/admin_dashboard', methods=['GET', 'POST'])


def admin_dashboard():
cursor = mysql.connection.cursor()

# Count pending requests


pending_query = "SELECT COUNT(*) AS pending_count FROM `appointment` WHERE
status='pending'"
cursor.execute(pending_query)
pending_count = cursor.fetchone()['pending_count'] if cursor.rowcount > 0 else 0

# Count approved requests


#student register
@app.route("/register",methods=['GET','POST'])
def register():
message = ''
if request.method == 'POST' and 'name' in request.form and 'password' in request.form and 'email' in
request.form :
name = request.form['name']
password = request.form['password']
email = request.form['email']
con = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
con.execute('select * FROM admin WHERE email = % s',(email, ))
sql = "insert into admin (email, password) value (%s,%s)"
account = con.fetchone()
if account:
message= 'Account already exists !'
elif not re.match(r'[^@]+@[^@]+\.[^@]+', email):
message ='invalid email address !'
elif not email or not password:
message ='please fill out the form !'
else:
con.execute('INSERT INTO admin VALUES(% s,% s,%s)', (name, email, password, ))
mysql.connection.commit()
message = 'you have successfully registered !'
return render_template('user_homepage.html',message=message)

return render_template('register.html',message = message)

@app.route("/login",methods=['GET','POST'])
def login():
message = ''
if request.method == 'POST' and 'name' in request.form and 'password' in request.form and 'email' in
request.form :

name = request.form['name']
password = request.form['password']
email = request.form['email']
con = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
con.execute('select * FROM admin WHERE email = % s',(email, ))
sql = "insert into admin (email, password) value (%s,%s)"
account = con.fetchone()
if account:
message= 'Account already exists !'
elif not re.match(r'[^@]+@[^@]+\.[^@]+', email):
message ='invalid email address !'
elif not email or not password:
message ='please fill out the form !'
else:
con.execute('INSERT INTO admin VALUES( null,% s,% s,%s)', (name, email, password, ))
mysql.connection.commit()
message = 'you have successfully registered !'
</div>
@app.route("/login",methods=['GET','POST'])
def login():
message = ''
if request.method == 'POST' and 'name' in request.form and 'password' in request.form and 'email' in
request.form :

name = request.form['name']
password = request.form['password']
email = request.form['email']
con = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
con.execute('select * FROM admin WHERE email = % s',(email, ))
sql = "insert into admin (email, password) value (%s,%s)"
account = con.fetchone()
if account:
message= 'Account already exists !'
elif not re.match(r'[^@]+@[^@]+\.[^@]+', email):
message ='invalid email address !'
elif not email or not password:
message ='please fill out the form !'
@app.route("/login",methods=['GET','POST'])
def login():
message = ''
if request.method == 'POST' and 'name' in request.form and 'password' in request.form and 'email' in
request.form :

name = request.form['name']
password = request.form['password']
email = request.form['email']
con = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
con.execute('select * FROM admin WHERE email = % s',(email, ))
sql = "insert into admin (email, password) value (%s,%s)"
account = con.fetchone()
if account:
message= 'Account already exists !'
elif not re.match(r'[^@]+@[^@]+\.[^@]+', email):
message ='invalid email address !'
elif not email or not password:
message ='please fill out the form !'
@app.route("/login",methods=['GET','POST'])
def login():
message = ''
if request.method == 'POST' and 'name' in request.form and 'password' in request.form and 'email' in
request.form :

name = request.form['name']
password = request.form['password']
email = request.form['email']
con = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
con.execute('select * FROM admin WHERE email = % s',(email, ))
sql = "insert into admin (email, password) value (%s,%s)"
account = con.fetchone()
if account:
message= 'Account already exists !'
elif not re.match(r'[^@]+@[^@]+\.[^@]+', email):
message ='invalid email address !'
elif not email or not password:
message ='please fill out the form !'
else:
con.execute('INSERT INTO admin VALUES( null,% s,% s,%s)', (name, email, password, ))
mysql.connection.commit()
message = 'you have successfully registered !'
return render_template('appointment.html',message=message)
return render_template('login.html',message = message)

@app.route("/ratingform",methods=['GET','POST'])
def ratingform():
if request.method== 'POST':
name=request.form['name']
email=request.form['email']
feedback=request.form['feedback']
con = mysql.connection.cursor()
sql = "insert into feedback (name,email,feedback) value (%s,%s,%s)"
con.execute(sql, [name, email,feedback])
mysql.connection.commit()
con.close()
return redirect(url_for("user_homepage"))

return render_template("ratingform.html")

@app.route('/view_feedback',methods=['GET','POST'])
def view_feedback():
con = mysql.connection.cursor()
select_query = "SELECT * FROM feedback "
con.execute(select_query)
data = con.fetchall()
return render_template("view_feedback.html", data = data)
#leave reject

@app.route('/reject/<int:id>',methods=['GET','POST'])

def reject(id):

' # Update the status of the leave request to 'rejected'

con = mysql.connection.cursor()

con.execute(f"UPDATE appointment SET status='rejected' WHERE id={id}")

mysql.connection.commit()

con.close()

return redirect(url_for("reject_order"))

#student register

@app.route("/register",methods=['GET','POST'])

def register():

message = ''

if request.method == 'POST' and 'name' in request.form and 'password' in


request.form and 'email' in request.form :

name = request.form['name']

password = request.form['password']

email = request.form['email']

con = mysql.connection.cursor(MySQLdb.cursors.DictCursor)

con.execute('select * FROM admin WHERE email = % s',(email, ))

sql = "insert into admin (email, password) value (%s,%s)"

account = con.fetchone()

if account:

message= 'Account already exists !'

elif not re.match(r'[^@]+@[^@]+\.[^@]+', email):

message ='invalid email address !'


@app.route("/ratingform",methods=['GET','POST'])
def ratingform():
if request.method== 'POST':
name=request.form['name']
email=request.form['email']
feedback=request.form['feedback']
con = mysql.connection.cursor()
sql = "insert into feedback (name,email,feedback) value (%s,%s,%s)"
con.execute(sql, [name, email,feedback])
mysql.connection.commit()
con.close()
return redirect(url_for("user_homepage"))

return render_template("ratingform.html")

@app.route('/view_feedback',methods=['GET','POST'])
def view_feedback():
con = mysql.connection.cursor()
select_query = "SELECT * FROM feedback "
con.execute(select_query)
data = con.fetchall()
return render_template("view_feedback.html", data = data)
app.route('/admin_dashboard', methods=['GET', 'POST'])
def admin_dashboard():
cursor = mysql.connection.cursor()

# Count pending requests


pending_query = "SELECT COUNT(*) AS pending_count FROM
`appointment` WHERE status='pending'"
cursor.execute(pending_query)
pending_count = cursor.fetchone()['pending_count'] if cursor.rowcount > 0 else 0

# Count approved requests


approved_query = "SELECT COUNT(*) AS approved_count FROM
`appointment` WHERE status='approved'"
cursor.execute(approved_query)
approved_count = cursor.fetchone()['approved_count'] if cursor.rowcount > 0
else 0

# Count rejected requests


rejected_query = "SELECT COUNT(*) AS rejected_count FROM `appointment`
WHERE status='rejected'"
cursor.execute(rejected_query)
rejected_count = cursor.fetchone()['rejected_count'] if cursor.rowcount > 0 else 0

# Count total requests


total_query = "SELECT COUNT(*) AS total_count FROM `appointment`"
cursor.execute(total_query)
total_count = cursor.fetchone()['total_count'] if cursor.rowcount > 0 else 0

# Fetch all appointments


select_query = "SELECT * FROM `appointment`"
cursor.execute(select_query)
data = cursor.fetchall()
liclass
# Function to send confirmation email
def send_emailR(name, email):
subject = 'Mati photograpy Order rejected'
body = f'Your
< order rejected {name}, Your order has been unexpectedly
rejected Any question call this number 9363254568.'

msg = Message(subject, recipients=[email], body=body)


mail.send(msg)
@app.route('/edit_order', methods=['GET','POST'])
def edit_order():
if request.method == 'POST':
cursor = mysql.connection.cursor()
name = request.form['name']
email = request.form['email']

# Save order to MySQL


cursor.execute("INSERT INTO edit_order (name, email) VALUES (%s,
%s)", (name, email))
mysql.connection.commit()

# Send confirmation email


send_emailE(name, email)

flash('Your Order Approved successfully!', 'success')


return redirect(url_for('home_page'))
return render_template("edit_order.html")
# Function to send confirmation email
def send_emailR(name, email):
subject = 'Mati photograpy Order rejected'
body = f'Your order rejected {name}, Your order has been unexpectedly
rejected Any question call this number 9363254568.'

msg = Message(subject, recipients=[email], body=body)


mail.send(msg)
@app.route('/edit_order', methods=['GET','POST'])
def edit_order():
if request.method == 'POST':
cursor = mysql.connection.cursor()
name = request.form['name']
email = request.form['email']

# Save order to MySQL


cursor.execute("INSERT INTO edit_order (name, email) VALUES (%s,
%s)", (name, email))
mysql.connection.commit()

# Send confirmation email


send_emailE(name, email)

flash('Your Order Approved successfully!', 'success')


return redirect(url_for('home_page'))
return render_template("edit_order.html")
<divclass="card-boxmb-30"> contact Submission Route
@app.route('/contact', methods=['GET','POST'])
def contact():
if request.method == 'POST':
cursor = mysql.connection.cursor()
name = request.form['name']
email = request.form['email']
message = request.form['message']

# Save order to MySQL


cursor.execute("INSERT INTO contact (name, email, message) VALUES
(%s, %s,%s)", (name, email,message))
mysql.connection.commit()

# Send confirmation email


send_emailC(name, email,message)

flash('message submitted successfully!', 'success')


return redirect(url_for('user_homepage'))
return render_template("contact.html")

from flask import request, render_template, redirect, url_for


from werkzeug.utils import secure_filename
import os

UPLOAD_FOLDER = 'static/uploads/' # Update with the path to your uploads


folder
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}

app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in
ALLOWED_EXTENSIONS@app.route("/creat_offer", methods=['GET',
'POST'])
def creat_offer():
if request.method == 'POST':
try:
title = request.form['title']
description = request.form['description']
discount = request.form['discount']
validity_date = request.form['validity_date']

# Check if the post request has the file part


if 'image_url' not in request.files:
return "No file part"

image_file = request.files['image_url'] if image_file.filename == '':


return "No selected file"

# Check if the file has an allowed extension


if image_file and allowed_file(image_file.filename):
filename = secure_filename(image_file.filename)
filepath = os.path.join(app.config['UPLOAD_FOLDER'], filename)
if($query->rowCount()>0)
@app.route("/view_offers", methods=['GET'])
def view_offers():
try:
con = mysql.connection.cursor()
# Retrieve offers from the database
select_query = "SELECT * FROM images"
con.execute(select_query)
offers = con.fetchall()
con.close()

# Pass the offers data to the template for rendering


return render_template("view_offers.html", offers=offers)

except Exception as e:
# Handle any exceptions, print or log the error for debugging
print("Error:", str(e))
return "An error occurred while processing your request. Please try again later."

# Function to send confirmation email


def send_emailC(name, email,message):
subject = 'New Message from Contact Form'
body = f"Name: {name}\nEmail: {email}\n\nMessage:\n{message}"

msg = Message(subject, recipients=['coding2923@gmail.com'], body=body)


mail.send(msg)

UPLOAD_FOLDER = 'static/uploads'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])

def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS

@app.route('/display/<filename>')
def display_image(filename):
return redirect(url_for('static', filename='uploads/' + filename), code=301)

@app.route('/calender')
def calender():
cursor = mysql.connection.cursor()
cur = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
cur.execute("SELECT * FROM events ORDER BY id")
calendar = cur.fetchall()
return render_template('calender.html', calendar = calendar) except Exception as e:
app.logger.error('An error occurred during file upload: %s', str(e))
flash('An error occurred during file upload.')
return redirect(request.url)
<?php}if($stats==0){?>
@app.route('/calender')
def calender():
cursor = mysql.connection.cursor()
cur = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
cur.execute("SELECT * FROM events ORDER BY id")
calendar = cur.fetchall()
return render_template('calender.html', calendar = calendar)

@app.route("/insert",methods=["POST","GET"])
def insert():
cursor = mysql.connection.cursor()
cur = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
if request.method == 'POST':
title = request.form['title']
start = request.form['start']
end = request.form['end']
print(title)
print(start)
cur.execute("INSERT INTO events (title,start_event,end_event) VALUES (%s,%s,%s)",
[title,start,end])
mysql.connection.commit()
cur.close()
msg = 'success'
return jsonify(msg)

@app.route("/update",methods=["POST","GET"])
def update():
cursor = mysql.connection.cursor()
cur = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
if request.method == 'POST':
title = request.form['title']
start = request.form['start']
end = request.form['end']
id = request.form['id']
print(title)
print(start)
cur.execute("UPDATE events SET title = %s, start_event = %s, end_event = %s WHERE id = %s
", [title, start, end, id])
mysql.connection.commit()
cur.close()
msg = 'success'
return jsonify(msg)
@app.route("/ajax_delete",methods=["POST","GET"])
def ajax_delete():
cursor = mysql.connection.cursor()
cur = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
if request.method == 'POST':
getid = request.form['id']
print(getid)
cur.execute('DELETE FROM events WHERE id = {0}'.format(getid))
mysql.connection.commit()
cur.close()
msg = 'Record deleted successfully'
return jsonify(msg)
SCREENSHOTS

Fig1.1 Admin Register Page

Fig1.2 reschedule Dashboard


Fig1.3user dashboard

Fig1.4 admin dashboard


Fig1.5 All Appointment Details

Fig1.6 Pending requests


f

CHAPTER 10

REFERENCES

References:
1. Mark Myers “A Smarter Way To Learn JavaScript”, Third Edition,
Create Space Independent Publishing Platform (2017)
2. Eric Matthes “Python Crash Course”, Second Edition,
Lay Flat binding (15th Dec 2022)
3. www.youtube.com

Fig1.7 Shorting Date


4. https://chat.openai.com

Fig1.8 Filtering Names

You might also like