-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
60 lines (34 loc) · 1.1 KB
/
main.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
from flask import Flask, redirect
from flask import render_template
from flask import request
import models as dbHandler
app = Flask(__name__)
@app.route("/")
def index():
return render_template('homepage.html')
@app.route("/login", methods =["GET", "POST"])
def shuttle():
if request.method == 'GET':
return render_template('index.html')
else:
email = request.form['email']
shuttletime = request.form['shuttletime']
dbHandler.insertUser(email,shuttletime)
id = dbHandler.retrieveID()
for row in id:
s=row #not fully functional
count = dbHandler.countFunction()
for row in count:
if row[1] == shuttletime:
if row[0]< 21:
return render_template('confirmed.html')
else:
return render_template('waitlisted.html', id=s)
users = dbHandler.retrieveUsers()
return render_template('index.html',users=users)
@app.route("/admin", methods =["GET", "POST"])
def admin():
count = dbHandler.countFunction()
return render_template('admin.html', count=count)
if __name__ == '__main__':
app.run(debug = True, host='10.1.36.30')