├── PROJECT ├── main.py ├── static │ ├── d1.jpg │ ├── d2.jpg │ ├── d3.jpg │ └── images │ │ ├── doc.jpg │ │ ├── friendspic │ │ ├── AR.jpg │ │ ├── bes.jpg │ │ └── ilya-pavlov-OqtafYT5kTw-unsplash.jpg │ │ ├── one.jpg │ │ ├── onee.jpg │ │ ├── small1.jpg │ │ ├── three.jpg │ │ ├── threee.jpg │ │ ├── two.jpg │ │ └── twoo.jpg └── templates │ ├── base.html │ ├── booking.html │ ├── doctor.html │ ├── edit.html │ ├── index.html │ ├── login.html │ ├── patient.html │ ├── signup.html │ └── trigers.html ├── config.json ├── hms.sql └── requirements.txt /PROJECT/main.py: -------------------------------------------------------------------------------- 1 | from flask import Flask,render_template,request,session,redirect,url_for,flash 2 | from flask_sqlalchemy import SQLAlchemy 3 | from flask_login import UserMixin 4 | from werkzeug.security import generate_password_hash,check_password_hash 5 | from flask_login import login_user,logout_user,login_manager,LoginManager 6 | from flask_login import login_required,current_user 7 | from flask_mail import Mail 8 | import json 9 | 10 | with open('config.json','r') as c: 11 | params = json.load(c)["params"] 12 | 13 | # MY db connection 14 | local_server= True 15 | app = Flask(__name__) 16 | app.secret_key='aneesrehmankhan' 17 | 18 | 19 | # this is for getting unique user access 20 | login_manager=LoginManager(app) 21 | login_manager.login_view='login' 22 | 23 | # SMTP MAIL SERVER SETTINGS 24 | 25 | app.config.update( 26 | MAIL_SERVER='smtp.gmail.com', 27 | MAIL_PORT='465', 28 | MAIL_USE_SSL=True, 29 | MAIL_USERNAME=params['gmail-user'], 30 | MAIL_PASSWORD=params['gmail-password'] 31 | ) 32 | mail = Mail(app) 33 | 34 | 35 | @login_manager.user_loader 36 | def load_user(user_id): 37 | return User.query.get(int(user_id)) 38 | 39 | 40 | 41 | 42 | # app.config['SQLALCHEMY_DATABASE_URL']='mysql://username:password@localhost/databas_table_name' 43 | app.config['SQLALCHEMY_DATABASE_URI']='mysql://root:@localhost/hms' 44 | db=SQLAlchemy(app) 45 | 46 | 47 | 48 | # here we will create db models that is tables 49 | class Test(db.Model): 50 | id=db.Column(db.Integer,primary_key=True) 51 | name=db.Column(db.String(100)) 52 | email=db.Column(db.String(100)) 53 | 54 | class User(UserMixin,db.Model): 55 | id=db.Column(db.Integer,primary_key=True) 56 | username=db.Column(db.String(50)) 57 | email=db.Column(db.String(50),unique=True) 58 | password=db.Column(db.String(1000)) 59 | 60 | class Patients(db.Model): 61 | pid=db.Column(db.Integer,primary_key=True) 62 | email=db.Column(db.String(50)) 63 | name=db.Column(db.String(50)) 64 | gender=db.Column(db.String(50)) 65 | slot=db.Column(db.String(50)) 66 | disease=db.Column(db.String(50)) 67 | time=db.Column(db.String(50),nullable=False) 68 | date=db.Column(db.String(50),nullable=False) 69 | dept=db.Column(db.String(50)) 70 | number=db.Column(db.String(50)) 71 | 72 | class Doctors(db.Model): 73 | did=db.Column(db.Integer,primary_key=True) 74 | email=db.Column(db.String(50)) 75 | doctorname=db.Column(db.String(50)) 76 | dept=db.Column(db.String(50)) 77 | 78 | class Trigr(db.Model): 79 | tid=db.Column(db.Integer,primary_key=True) 80 | pid=db.Column(db.Integer) 81 | email=db.Column(db.String(50)) 82 | name=db.Column(db.String(50)) 83 | action=db.Column(db.String(50)) 84 | timestamp=db.Column(db.String(50)) 85 | 86 | 87 | 88 | 89 | 90 | # here we will pass endpoints and run the fuction 91 | @app.route('/') 92 | def index(): 93 | a=params['gmail-user'] 94 | print(a) 95 | return render_template('index.html') 96 | 97 | 98 | 99 | @app.route('/doctors',methods=['POST','GET']) 100 | def doctors(): 101 | 102 | if request.method=="POST": 103 | 104 | email=request.form.get('email') 105 | doctorname=request.form.get('doctorname') 106 | dept=request.form.get('dept') 107 | 108 | query=db.engine.execute(f"INSERT INTO `doctors` (`email`,`doctorname`,`dept`) VALUES ('{email}','{doctorname}','{dept}')") 109 | flash("Information is Stored","primary") 110 | 111 | return render_template('doctor.html') 112 | 113 | 114 | 115 | @app.route('/patients',methods=['POST','GET']) 116 | @login_required 117 | def patient(): 118 | doct=db.engine.execute("SELECT * FROM `doctors`") 119 | 120 | if request.method=="POST": 121 | email=request.form.get('email') 122 | name=request.form.get('name') 123 | gender=request.form.get('gender') 124 | slot=request.form.get('slot') 125 | disease=request.form.get('disease') 126 | time=request.form.get('time') 127 | date=request.form.get('date') 128 | dept=request.form.get('dept') 129 | number=request.form.get('number') 130 | subject="HOSPITAL MANAGEMENT SYSTEM" 131 | query=db.engine.execute(f"INSERT INTO `patients` (`email`,`name`, `gender`,`slot`,`disease`,`time`,`date`,`dept`,`number`) VALUES ('{email}','{name}','{gender}','{slot}','{disease}','{time}','{date}','{dept}','{number}')") 132 | 133 | # mail starts from here 134 | 135 | # mail.send_message(subject, sender=params['gmail-user'], recipients=[email],body=f"YOUR bOOKING IS CONFIRMED THANKS FOR CHOOSING US \nYour Entered Details are :\nName: {name}\nSlot: {slot}") 136 | 137 | 138 | 139 | flash("Booking Confirmed","info") 140 | 141 | 142 | return render_template('patient.html',doct=doct) 143 | 144 | 145 | @app.route('/bookings') 146 | @login_required 147 | def bookings(): 148 | em=current_user.email 149 | query=db.engine.execute(f"SELECT * FROM `patients` WHERE email='{em}'") 150 | return render_template('booking.html',query=query) 151 | 152 | 153 | @app.route("/edit/",methods=['POST','GET']) 154 | @login_required 155 | def edit(pid): 156 | posts=Patients.query.filter_by(pid=pid).first() 157 | if request.method=="POST": 158 | email=request.form.get('email') 159 | name=request.form.get('name') 160 | gender=request.form.get('gender') 161 | slot=request.form.get('slot') 162 | disease=request.form.get('disease') 163 | time=request.form.get('time') 164 | date=request.form.get('date') 165 | dept=request.form.get('dept') 166 | number=request.form.get('number') 167 | db.engine.execute(f"UPDATE `patients` SET `email` = '{email}', `name` = '{name}', `gender` = '{gender}', `slot` = '{slot}', `disease` = '{disease}', `time` = '{time}', `date` = '{date}', `dept` = '{dept}', `number` = '{number}' WHERE `patients`.`pid` = {pid}") 168 | flash("Slot is Updates","success") 169 | return redirect('/bookings') 170 | 171 | return render_template('edit.html',posts=posts) 172 | 173 | 174 | @app.route("/delete/",methods=['POST','GET']) 175 | @login_required 176 | def delete(pid): 177 | db.engine.execute(f"DELETE FROM `patients` WHERE `patients`.`pid`={pid}") 178 | flash("Slot Deleted Successful","danger") 179 | return redirect('/bookings') 180 | 181 | 182 | 183 | 184 | 185 | 186 | @app.route('/signup',methods=['POST','GET']) 187 | def signup(): 188 | if request.method == "POST": 189 | username=request.form.get('username') 190 | email=request.form.get('email') 191 | password=request.form.get('password') 192 | user=User.query.filter_by(email=email).first() 193 | if user: 194 | flash("Email Already Exist","warning") 195 | return render_template('/signup.html') 196 | encpassword=generate_password_hash(password) 197 | 198 | new_user=db.engine.execute(f"INSERT INTO `user` (`username`,`email`,`password`) VALUES ('{username}','{email}','{encpassword}')") 199 | 200 | # this is method 2 to save data in db 201 | # newuser=User(username=username,email=email,password=encpassword) 202 | # db.session.add(newuser) 203 | # db.session.commit() 204 | flash("Signup Succes Please Login","success") 205 | return render_template('login.html') 206 | 207 | 208 | 209 | return render_template('signup.html') 210 | 211 | @app.route('/login',methods=['POST','GET']) 212 | def login(): 213 | if request.method == "POST": 214 | email=request.form.get('email') 215 | password=request.form.get('password') 216 | user=User.query.filter_by(email=email).first() 217 | 218 | if user and check_password_hash(user.password,password): 219 | login_user(user) 220 | flash("Login Success","primary") 221 | return redirect(url_for('index')) 222 | else: 223 | flash("invalid credentials","danger") 224 | return render_template('login.html') 225 | 226 | 227 | 228 | 229 | 230 | return render_template('login.html') 231 | 232 | @app.route('/logout') 233 | @login_required 234 | def logout(): 235 | logout_user() 236 | flash("Logout SuccessFul","warning") 237 | return redirect(url_for('login')) 238 | 239 | 240 | 241 | @app.route('/test') 242 | def test(): 243 | try: 244 | Test.query.all() 245 | return 'My database is Connected' 246 | except: 247 | return 'My db is not Connected' 248 | 249 | 250 | @app.route('/details') 251 | @login_required 252 | def details(): 253 | # posts=Trigr.query.all() 254 | posts=db.engine.execute("SELECT * FROM `trigr`") 255 | return render_template('trigers.html',posts=posts) 256 | 257 | 258 | @app.route('/search',methods=['POST','GET']) 259 | @login_required 260 | def search(): 261 | if request.method=="POST": 262 | query=request.form.get('search') 263 | dept=Doctors.query.filter_by(dept=query).first() 264 | name=Doctors.query.filter_by(doctorname=query).first() 265 | if name: 266 | 267 | flash("Doctor is Available","info") 268 | else: 269 | 270 | flash("Doctor is Not Available","danger") 271 | return render_template('index.html') 272 | 273 | 274 | 275 | 276 | 277 | 278 | app.run(debug=True) 279 | 280 | 281 | # username=current_user.username -------------------------------------------------------------------------------- /PROJECT/static/d1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/d1.jpg -------------------------------------------------------------------------------- /PROJECT/static/d2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/d2.jpg -------------------------------------------------------------------------------- /PROJECT/static/d3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/d3.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/doc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/doc.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/friendspic/AR.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/friendspic/AR.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/friendspic/bes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/friendspic/bes.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/friendspic/ilya-pavlov-OqtafYT5kTw-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/friendspic/ilya-pavlov-OqtafYT5kTw-unsplash.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/one.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/one.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/onee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/onee.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/small1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/small1.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/three.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/three.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/threee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/threee.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/two.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/two.jpg -------------------------------------------------------------------------------- /PROJECT/static/images/twoo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arkprocoder/FLASK-DBMS-PROJECT/fa1d26135a891b924d3ba4a87f138f418e4a5d89/PROJECT/static/images/twoo.jpg -------------------------------------------------------------------------------- /PROJECT/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {% block css %} 12 | {% endblock css %} 13 | 14 | 15 | 16 | {% block title %} 17 | 18 | {% endblock title %} 19 | 20 | 21 | 22 | 23 | 24 | 88 | 89 | {% block body %} 90 | 91 | {% endblock body %} 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /PROJECT/templates/booking.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | Booking 5 | {% endblock title %} 6 | 7 | {% block body %} 8 | {% with messages=get_flashed_messages(with_categories=true) %} 9 | {% if messages %} 10 | {% for category, message in messages %} 11 | 12 | 19 | 20 | 21 | {% endfor %} 22 | {% endif %} 23 | {% endwith %} 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | {% for post in query %} 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {% endfor %} 59 | 60 | 61 |
PIDEMAILNAMEGENDERSLOTDISEASEDATETIMED.DEPARTMENTPHONE NUMBEREDITDELETE
{{post.pid}}{{post.email}}{{post.name}}{{post.gender}}{{post.slot}}{{post.disease}}{{post.date}}{{post.time}}{{post.dept}}{{post.number}}
62 | 63 | 64 | {% endblock body %} -------------------------------------------------------------------------------- /PROJECT/templates/doctor.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | Doctors 5 | {% endblock title %} 6 | 7 | {% block body %} 8 | 9 |
10 | 11 |
12 | 13 |
14 |
15 | {% with messages=get_flashed_messages(with_categories=true) %} 16 | {% if messages %} 17 | {% for category, message in messages %} 18 | 19 | 26 | 27 | 28 | {% endfor %} 29 | {% endif %} 30 | {% endwith %} 31 |
32 |

Doctors Booking

33 | 34 |
35 |
36 | 37 |
38 | 39 | 40 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 | 50 |
51 | 52 | 53 | 54 |
55 | 56 | 57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 | 66 |
67 | 68 | {% endblock body %} -------------------------------------------------------------------------------- /PROJECT/templates/edit.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | Edit Patient BOOKING 5 | {% endblock title %} 6 | 7 | {% block body %} 8 | 9 |
10 | 11 |
12 |
13 | 14 |
15 |
16 | 17 |

Update Your Slot

18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 |
38 | 39 | 40 | 41 | 48 |
49 | 50 |
51 | 52 | 53 | 54 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 |
69 | 70 | 71 | 72 |
73 |
74 | 75 | 76 | 77 |
78 | 79 |
80 | 81 | 82 | 83 |
84 | 85 |
86 | 87 | 88 | 89 |
90 | 91 | 92 | 93 |
94 | 95 | 96 | 97 | 98 |
99 |
100 |
101 | 102 | 103 | {% endblock body %} -------------------------------------------------------------------------------- /PROJECT/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | HOME 5 | {% endblock title %} 6 | 7 | {% block body %} 8 | 9 | {% with messages=get_flashed_messages(with_categories=true) %} 10 | {% if messages %} 11 | {% for category, message in messages %} 12 | 13 | 20 | 21 | 22 | {% endfor %} 23 | {% endif %} 24 | {% endwith %} 25 | 26 | 27 | 28 | 66 | 67 | {% endblock body %} -------------------------------------------------------------------------------- /PROJECT/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | Login 5 | {% endblock title %} 6 | 7 | {% block body %} 8 |
9 | 10 |
11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 | 19 |

Login

20 |
21 | 22 | {% with messages=get_flashed_messages(with_categories=true) %} 23 | {% if messages %} 24 | {% for category, message in messages %} 25 | 26 | 33 | 34 | 35 | {% endfor %} 36 | {% endif %} 37 | {% endwith %} 38 | 39 | 40 |
41 | 42 | 43 | 44 |
45 | 46 | 47 | 48 |
49 | 50 | 51 |
52 | 53 | 54 |
55 | 56 | 57 |
58 | 59 |
60 | Not a User Signup 61 | 62 | 63 |
64 | 65 |
66 | 67 |
68 | 69 | 70 |
71 | 72 |
73 | 74 | 75 | {% endblock body %} -------------------------------------------------------------------------------- /PROJECT/templates/patient.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | Patients Booking 5 | {% endblock title %} 6 | 7 | {% block body %} 8 | 9 |
10 |
11 | 12 |
13 |
14 | ... 15 |
16 |
HOSPITAL DOCTORS
17 |

Doctors Names

18 |
19 |
    20 |
  • Cras justo odio
  • 21 |
  • Dapibus ac facilisis in
  • 22 |
  • Vestibulum at eros
  • 23 |
24 |
25 | Contact Us 26 | About US 27 |
28 |
29 | 30 |
31 | 32 |
33 | 34 |

Book Your Slot

35 |
36 | 37 | 38 | {% with messages=get_flashed_messages(with_categories=true) %} 39 | {% if messages %} 40 | {% for category, message in messages %} 41 | 42 | 49 | 50 | 51 | {% endfor %} 52 | {% endif %} 53 | {% endwith %} 54 | 55 | 56 | 57 |
58 | 59 | 60 | 61 |
62 | 63 | 64 | 65 |
66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 |
74 | 75 | 76 | 77 | 84 |
85 | 86 |
87 | 88 | 89 | 90 | 97 |
98 | 99 |
100 | 101 | 102 | 103 |
104 |
105 | 106 | 107 | 108 |
109 |
110 | 111 | 112 | 113 |
114 | 115 |
116 | 117 | 118 | 119 | 125 |
126 | 127 |
128 | 129 | 130 | 131 |
132 | 133 | 134 | 135 |
136 | 137 |
138 | 139 | 140 |
141 | 142 | 143 | 144 |
145 | 146 | 147 | 148 | 149 | {% endblock body %} -------------------------------------------------------------------------------- /PROJECT/templates/signup.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | Signup 5 | {% endblock title %} 6 | 7 | {% block body %} 8 |
9 | 10 |
11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |

Sign Up Here

19 |
20 | 21 | 22 | {% with messages=get_flashed_messages(with_categories=true) %} 23 | {% if messages %} 24 | {% for category, message in messages %} 25 | 26 | 33 | 34 | 35 | {% endfor %} 36 | {% endif %} 37 | {% endwith %} 38 | 39 | 40 |
41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 |
49 | 50 | 51 | We'll never share your email with anyone else. 52 |
53 | 54 | 55 |
56 | 57 | 58 |
59 | 60 | 61 |
62 |
63 | Already a User Login 64 | 65 |
66 | 67 |
68 | 69 |
70 | 71 | 72 |
73 | 74 |
75 | 76 | 77 | 78 | {% endblock body %} -------------------------------------------------------------------------------- /PROJECT/templates/trigers.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | Trigers 5 | {% endblock title %} 6 | 7 | {% block body %} 8 | {% with messages=get_flashed_messages(with_categories=true) %} 9 | {% if messages %} 10 | {% for category, message in messages %} 11 | 12 | 19 | 20 | 21 | {% endfor %} 22 | {% endif %} 23 | {% endwith %} 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | {% for post in posts %} 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | {% endfor %} 50 | 51 | 52 |
TIDPIDEMAILNAMEACTIONTIMESTAMP
{{post.tid}}{{post.pid}}{{post.email}}{{post.name}}{{post.action}}{{post.timestamp}}
53 |
54 | 55 | {% endblock body %} -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "params": { 3 | 4 | "gmail-user": "youremail", 5 | "gmail-password": "yourpassword" 6 | 7 | } 8 | 9 | 10 | 11 | 12 | } -------------------------------------------------------------------------------- /hms.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.0.2 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Dec 02, 2020 at 12:42 PM 7 | -- Server version: 10.4.11-MariaDB 8 | -- PHP Version: 7.2.29 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- Database: `hms` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- Table structure for table `doctors` 28 | -- 29 | 30 | CREATE TABLE `doctors` ( 31 | `did` int(11) NOT NULL, 32 | `email` varchar(50) NOT NULL, 33 | `doctorname` varchar(50) NOT NULL, 34 | `dept` varchar(100) NOT NULL 35 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 36 | 37 | -- 38 | -- Dumping data for table `doctors` 39 | -- 40 | 41 | INSERT INTO `doctors` (`did`, `email`, `doctorname`, `dept`) VALUES 42 | (1, 'anees@gmail.com', 'anees', 'Cardiologists'), 43 | (2, 'amrutha@gmail.com', 'amrutha bhatta', 'Dermatologists'), 44 | (3, 'aadithyaa@gmail.com', 'aadithyaa', 'Anesthesiologists'), 45 | (4, 'anees@gmail', 'anees', 'Endocrinologists'); 46 | 47 | -- -------------------------------------------------------- 48 | 49 | -- 50 | -- Table structure for table `patients` 51 | -- 52 | 53 | CREATE TABLE `patients` ( 54 | `pid` int(11) NOT NULL, 55 | `email` varchar(50) NOT NULL, 56 | `name` varchar(50) NOT NULL, 57 | `gender` varchar(50) NOT NULL, 58 | `slot` varchar(50) NOT NULL, 59 | `disease` varchar(50) NOT NULL, 60 | `time` time NOT NULL, 61 | `date` date NOT NULL, 62 | `dept` varchar(50) NOT NULL, 63 | `number` varchar(12) NOT NULL 64 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 65 | 66 | -- 67 | -- Dumping data for table `patients` 68 | -- 69 | 70 | INSERT INTO `patients` (`pid`, `email`, `name`, `gender`, `slot`, `disease`, `time`, `date`, `dept`, `number`) VALUES 71 | (2, 'anees1@gmail.com', 'anees1 rehman khan', 'Male1', 'evening1', 'cold1', '21:20:00', '2020-02-02', 'ortho11predict', '9874561110'), 72 | (5, 'patient@gmail.com', 'patien', 'Male', 'morning', 'fevr', '18:06:00', '2020-11-18', 'Cardiologists', '9874563210'), 73 | (7, 'patient@gmail.com', 'anees', 'Male', 'evening', 'cold', '22:18:00', '2020-11-05', 'Dermatologists', '9874563210'), 74 | (8, 'patient@gmail.com', 'anees', 'Male', 'evening', 'cold', '22:18:00', '2020-11-05', 'Dermatologists', '9874563210'), 75 | (9, 'aneesurrehman423@gmail.com', 'anees', 'Male', 'morning', 'cold', '17:27:00', '2020-11-26', 'Anesthesiologists', '9874563210'), 76 | (10, 'anees@gmail.com', 'anees', 'Male', 'evening', 'fever', '16:25:00', '2020-12-09', 'Cardiologists', '9874589654'); 77 | 78 | -- 79 | -- Triggers `patients` 80 | -- 81 | DELIMITER $$ 82 | CREATE TRIGGER `PatientDelete` BEFORE DELETE ON `patients` FOR EACH ROW INSERT INTO trigr VALUES(null,OLD.pid,OLD.email,OLD.name,'PATIENT DELETED',NOW()) 83 | $$ 84 | DELIMITER ; 85 | DELIMITER $$ 86 | CREATE TRIGGER `PatientUpdate` AFTER UPDATE ON `patients` FOR EACH ROW INSERT INTO trigr VALUES(null,NEW.pid,NEW.email,NEW.name,'PATIENT UPDATED',NOW()) 87 | $$ 88 | DELIMITER ; 89 | DELIMITER $$ 90 | CREATE TRIGGER `patientinsertion` AFTER INSERT ON `patients` FOR EACH ROW INSERT INTO trigr VALUES(null,NEW.pid,NEW.email,NEW.name,'PATIENT INSERTED',NOW()) 91 | $$ 92 | DELIMITER ; 93 | 94 | -- -------------------------------------------------------- 95 | 96 | -- 97 | -- Table structure for table `test` 98 | -- 99 | 100 | CREATE TABLE `test` ( 101 | `id` int(11) NOT NULL, 102 | `name` varchar(20) NOT NULL, 103 | `email` varchar(20) NOT NULL 104 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 105 | 106 | -- 107 | -- Dumping data for table `test` 108 | -- 109 | 110 | INSERT INTO `test` (`id`, `name`, `email`) VALUES 111 | (1, 'ANEES', 'ARK@GMAIL.COM'), 112 | (2, 'test', 'test@gmail.com'); 113 | 114 | -- -------------------------------------------------------- 115 | 116 | -- 117 | -- Table structure for table `trigr` 118 | -- 119 | 120 | CREATE TABLE `trigr` ( 121 | `tid` int(11) NOT NULL, 122 | `pid` int(11) NOT NULL, 123 | `email` varchar(50) NOT NULL, 124 | `name` varchar(50) NOT NULL, 125 | `action` varchar(50) NOT NULL, 126 | `timestamp` datetime NOT NULL 127 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 128 | 129 | -- 130 | -- Dumping data for table `trigr` 131 | -- 132 | 133 | INSERT INTO `trigr` (`tid`, `pid`, `email`, `name`, `action`, `timestamp`) VALUES 134 | (1, 12, 'anees@gmail.com', 'ANEES', 'PATIENT INSERTED', '2020-12-02 16:35:10'), 135 | (2, 11, 'anees@gmail.com', 'anees', 'PATIENT INSERTED', '2020-12-02 16:37:34'), 136 | (3, 10, 'anees@gmail.com', 'anees', 'PATIENT UPDATED', '2020-12-02 16:38:27'), 137 | (4, 11, 'anees@gmail.com', 'anees', 'PATIENT UPDATED', '2020-12-02 16:38:33'), 138 | (5, 12, 'anees@gmail.com', 'ANEES', 'Patient Deleted', '2020-12-02 16:40:40'), 139 | (6, 11, 'anees@gmail.com', 'anees', 'PATIENT DELETED', '2020-12-02 16:41:10'), 140 | (7, 13, 'testing@gmail.com', 'testing', 'PATIENT INSERTED', '2020-12-02 16:50:21'), 141 | (8, 13, 'testing@gmail.com', 'testing', 'PATIENT UPDATED', '2020-12-02 16:50:32'), 142 | (9, 13, 'testing@gmail.com', 'testing', 'PATIENT DELETED', '2020-12-02 16:50:57'); 143 | 144 | -- -------------------------------------------------------- 145 | 146 | -- 147 | -- Table structure for table `user` 148 | -- 149 | 150 | CREATE TABLE `user` ( 151 | `id` int(11) NOT NULL, 152 | `username` varchar(50) NOT NULL, 153 | `email` varchar(50) NOT NULL, 154 | `password` varchar(1000) NOT NULL 155 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 156 | 157 | -- 158 | -- Dumping data for table `user` 159 | -- 160 | 161 | INSERT INTO `user` (`id`, `username`, `email`, `password`) VALUES 162 | (1, 'anees', 'anees@gmail.com', 'pbkdf2:sha256:150000$qOazJJcZ$f5075ddfa6ff3762a50aeeec0fca9e29af238c12900f32ffa64077c60d1945bd'), 163 | (2, 'anant', 'anant@gmail.com', 'pbkdf2:sha256:150000$BgQmgmxX$e1931665c21165cc0a0976350c90bd2ace0ae332fead96706e3853a29476438f'), 164 | (3, 'harshith', 'harshit@gmail.com', 'pbkdf2:sha256:150000$hp3FYWOJ$07162a675cfd7b64a50ac674fa8736481ab671c6c9e8d8eb4babb108d102f986'), 165 | (4, 'abcd', 'abcd@gmail.com', 'pbkdf2:sha256:150000$hj5e3AC2$220f9dfc7f8545f92798eadb628be4ed25494612ba26667eba19eaf65ce55f46'), 166 | (5, 'testing', 'testin@gmal.com', 'pbkdf2:sha256:150000$Tl5vPQ8O$5a862a3c1d8ab0fab47c57a403f3b09c9d6f8e5fc285718f69f38d7a7d5a84ca'), 167 | (6, 'abc', 'abc@gmail.com', 'pbkdf2:sha256:150000$V7InBfpt$0a7da8fed41610f8e6ce204120d905c8f91414a9950c382fc57199ac5c517290'), 168 | (7, 'amrutha', 'amrutha@gmail.com', 'pbkdf2:sha256:150000$LTzH8Hpq$ea5f92c85a4d4cacc80aff688805c32a501a7418d2a79795cca35915b3b0c5e7'), 169 | (8, 'aadithyaa', 'aadithyaa@gmail.com', 'pbkdf2:sha256:150000$xnyJ2Nh9$4ca83d4a314a0bce6e96d875fd12490ac6f06a9e8946786404721716ea72c5da'), 170 | (9, 'patient', 'aneesurrehman423@gmail.com', 'pbkdf2:sha256:150000$sgvOgGig$3a23dafc906bbea4dbe14ac4ec9c53a2b30abada092dad6819cd8714c406355e'), 171 | (10, 'testing', 'testing@gmail.com', 'pbkdf2:sha256:150000$envTLrmD$b3859abccfd5b190ee46479d033e2283fe4858957f42bf0a39292aad14ea5ad7'); 172 | 173 | -- 174 | -- Indexes for dumped tables 175 | -- 176 | 177 | -- 178 | -- Indexes for table `doctors` 179 | -- 180 | ALTER TABLE `doctors` 181 | ADD PRIMARY KEY (`did`); 182 | 183 | -- 184 | -- Indexes for table `patients` 185 | -- 186 | ALTER TABLE `patients` 187 | ADD PRIMARY KEY (`pid`); 188 | 189 | -- 190 | -- Indexes for table `test` 191 | -- 192 | ALTER TABLE `test` 193 | ADD PRIMARY KEY (`id`); 194 | 195 | -- 196 | -- Indexes for table `trigr` 197 | -- 198 | ALTER TABLE `trigr` 199 | ADD PRIMARY KEY (`tid`); 200 | 201 | -- 202 | -- Indexes for table `user` 203 | -- 204 | ALTER TABLE `user` 205 | ADD PRIMARY KEY (`id`), 206 | ADD UNIQUE KEY `email` (`email`); 207 | 208 | -- 209 | -- AUTO_INCREMENT for dumped tables 210 | -- 211 | 212 | -- 213 | -- AUTO_INCREMENT for table `doctors` 214 | -- 215 | ALTER TABLE `doctors` 216 | MODIFY `did` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; 217 | 218 | -- 219 | -- AUTO_INCREMENT for table `patients` 220 | -- 221 | ALTER TABLE `patients` 222 | MODIFY `pid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; 223 | 224 | -- 225 | -- AUTO_INCREMENT for table `test` 226 | -- 227 | ALTER TABLE `test` 228 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; 229 | 230 | -- 231 | -- AUTO_INCREMENT for table `trigr` 232 | -- 233 | ALTER TABLE `trigr` 234 | MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; 235 | 236 | -- 237 | -- AUTO_INCREMENT for table `user` 238 | -- 239 | ALTER TABLE `user` 240 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; 241 | COMMIT; 242 | 243 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 244 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 245 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 246 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==1.1.2 2 | Flask-Mail==0.9.1 3 | Flask-SQLAlchemy==2.4.3 4 | future==0.18.2 5 | Jinja2==2.11.2 6 | jmespath==0.9.5 7 | Js2Py==0.70 8 | MarkupPy==1.14 9 | MarkupSafe==1.1.1 10 | mysqlclient==2.0.1 11 | Naked==0.1.31 12 | packaging==20.4 13 | Pillow==7.1.1 14 | pipenv==2018.11.26 15 | pipwin==0.5.0 16 | pyttsx3==2.90 17 | pytz==2020.1 18 | pywin32==228 19 | SQLAlchemy==1.3.17 20 | sqlparse==0.3.1 21 | 22 | --------------------------------------------------------------------------------