-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
85 lines (66 loc) · 2.23 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
from flask import Flask, jsonify,render_template,request
import pymysql
pymysql.version_info=(1,4,6,'final',0)
pymysql.install_as_MySQLdb()
app = Flask(__name__)
host = 'localhost'
user = 'root'
password = 'tavish99'
database = 'sih'
connection = pymysql.connect(host=host, user=user, password=password, database=database)
cursor = connection.cursor()
@app.route('/')
def login():
return render_template("duplicate.html")
@app.route('/page1')
def register():
return render_template("page2.html")
@app.route('/page2.html')
def register1():
return render_template("page2.html")
@app.route('/doctorsih1.html')
def register2():
return render_template("doctorsih1.html")
@app.route('/community_review.html')
def register3():
sql="SELECT * FROM doc"
cursor.execute(sql)
data=cursor.fetchall()
#sql1="INSERT INTO mdoc() VALUES(%s,%s,%s,%s)"
#val=()
return render_template("community_review.html",data=data)
@app.route('/job_for_today.html')
def xyz():
sql="SELECT * FROM jobs ORDER BY timing"
cursor.execute(sql)
data=cursor.fetchall()
return render_template("jobs_for_today.html",data=data)
@app.route('/15677.html')
def zyz():
sql="SELECT * from patient"
cursor.execute(sql)
data=cursor.fetchall()
return render_template("15677.html",data=data)
@app.route('/patient_records.html')
def xyz1():
return render_template("patient_records.html")
@app.route('/jobs_for_today_2.html')
def xyz2():
return render_template("jobs_for_today_2.html")
@app.route('/docavailable.html')
def xyz3():
return render_template("docavailable.html")
@app.route('/submit',methods=['POST'])
def submit():
if request.method=='POST':
symptoms=request.form['symptoms']
prescription=request.form['prescription']
labt=request.form['lab-tests']
casef=request.form['Casef']
sql="INSERT INTO mdoc (sym,prescription,labt,casef) VALUES(%s,%s,%s,%s)"
val=(symptoms,prescription,labt,casef)
cursor.execute(sql,val)
connection.commit()
return "Data has been inserted into the table quite well!"
if __name__ == '__main__':
app.run(debug=True,port=8000)