def student(): if request.method == 'GET': lists = [0, 0, 0, 0, 0, 0, 0, 0] id = session.get('id') credit, cla = sub_query(id, '2016-2017', '1') lists[0] = credit[2] credit, cla = sub_query(id, '2016-2017', '2') lists[1] = credit[2] credit, cla = sub_query(id, '2017-2018', '1') lists[2] = credit[2] credit, cla = sub_query(id, '2017-2018', '2') lists[3] = credit[2] chart(lists) return render_template('student.html') else: return render_template('student.html')
def score(): if request.method == 'GET': id = session.get('id') stu = Score.query.filter(Score.stu_id == id).all() credit = exts(stu) credit.append('all') credit.append('all') return render_template("score.html", classes=stu, credit=credit) else: id = session.get('id') year = request.form.get('year') term = request.form.get('term') if year == 'all' and term == 'all': return redirect(url_for('score')) else: credit, cla = sub_query(id, year, term) credit.append(year) credit.append(term) return render_template("score.html", classes=cla, credit=credit)
def score(): if request.method == 'GET': id = session.get('id') stu = Student.query.filter(Student.id == id).first() credit = exts(stu.subject) credit.append('all') credit.append('all') return render_template("score.html", classes=stu.subject, credit=credit) else: id = session.get('id') year = request.form.get('year') term = request.form.get('term') if year == 'all' and term == 'all': stu = Student.query.filter(Student.id == id).first() credit = exts(stu.subject) else: credit, cla = sub_query(id, year, term) credit.append(year) credit.append(term) return render_template("score.html", classes=cla, credit=credit)