-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
75 lines (67 loc) · 3.7 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
from flask import Flask,render_template,request,redirect,url_for
import datetime
app = Flask(__name__)
entries=[]
@app.route('/', methods=['GET', 'POST'])
def main():
if request.method == 'POST':
entry_content = request.form.get("content")
formatted_date = datetime.datetime.today().strftime("%Y-%m-%d")
entries.append((entry_content, formatted_date))
if request.form.get('action1') == 'Noise/Vibration':
return render_template('tl/noise.html') # do something
elif request.form.get('action1') == 'Clothing Issue':
return render_template('tl/clothing.html') # do something
elif request.form.get('action1') == 'Cycle/Operation':
return render_template('tl/cycle.html') # do something
elif request.form.get('action1') == 'Leaking':
return render_template('tl/leaking.html') # do something
elif request.form.get('action1') == 'Error Code':
return render_template('tl/error.html') # do something'
elif request.form.get('action1') == 'Filling':
return render_template('tl/filling.html') # do something
elif request.form.get('action1') == 'Drainage':
return render_template('tl/drainage.html') # do something
elif request.form.get('action2') == 'Dispenser':
return render_template('tl/dispenser.html') # do something
elif request.form.get('action1') == 'Door Issue':
return render_template('tl/door.html') # do something
elif request.form.get('action1') == 'Not Working':
return render_template('tl/power.html') # do something
elif request.form.get('action1') == 'Smell/Odor':
return render_template('tl/smell.html') # do something
elif request.form.get('action1') == 'ThinQ App':
return render_template('tl/thinq.html') # do something
elif request.form.get('action2') == 'Clothing Issue':
return render_template('fl/clothing.html') # do something
elif request.form.get('action2') == 'Not Working':
return render_template('fl/power.html') # do something
elif request.form.get('action2') == 'Dispenser':
return render_template('fl/dispenser.html') # do something
elif request.form.get('action2') == 'Door Issue':
return render_template('fl/door.html') # do something
elif request.form.get('action2') == 'Drainage':
return render_template('fl/drain.html') # do something'
elif request.form.get('action2') == 'Cycle/Operation':
return render_template('fl/cycle.html') # do something
elif request.form.get('action2') == 'Leaking':
return render_template('fl/leak.html') # do something
elif request.form.get('action2') == 'Error Code':
return render_template('fl/error.html') # do something
elif request.form.get('action2') == 'Noise/Vibration':
return render_template('fl/noise.html') # do something
elif request.form.get('action2') == 'Smell/Odor':
return render_template('fl/smell.html') # do something
elif request.form.get('action2') == 'Water Level':
return render_template('fl/water.html') # do something
elif request.form.get('action2') == 'ThinQ App':
return render_template('fl/thinq.html') # do something
elif request.form.get('action3') == 'Homepage':
return render_template('index.html') # do something
else:
pass # unknown
elif request.method == 'GET':
pass
return render_template("index.html", entries=entries)
if __name__ == '__main__':
app.run()