def setclassfuncs(): if request.forms.get('classname'): currentclass = request.forms.get('classname') setclassresult = attendance.setclass(currentclass) if setclassresult is False: return template( 'setclass.tpl', currentclass=attendance.readclass(), class_status="End the current Class before setting new Class", todaydate=time.strftime('%m-%d-%Y')) else: return template('setclass.tpl', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'), class_status='') else: if attendance.endclass() is False: return template('setclass.tpl', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'), class_status='Class Ended- Nothing to Record') else: return template('setclass.tpl', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'), class_status='Class Ended')
def getmanualname(): classname = attendance.readclass() if classname is False: return template('takeattendance.tpl', status="No class in session", todaydate=time.strftime('%m-%d-%Y'), currentclass=attendance.readclass()) else: userinput = request.forms.get('userinput') output = attendance.manualinput(userinput) return template('takeattendance.tpl', status=output, currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'))
def reports(): return dict(currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'), currentreport=attendance.currentclassreport(), currentagentcount=attendance.countcurrentclass(), classlist=attendance.getclasslist(), notfound=None)
def deleteclass(): classname = request.POST['classname'] attendance.deleteclass(classname) return template('reports.tpl', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'), currentreport=attendance.currentclassreport(), currentagentcount=attendance.countcurrentclass(), classlist=attendance.getclasslist(), notfound=None)
def agentreportsearch(): agent = request.POST['agentname'] agentreport = attendance.getagentstats(agent) if agentreport is not None: return template('userreport.tpl', name=agent, agentreport=agentreport) else: return template('reports.tpl', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'), currentreport=attendance.currentclassreport(), currentagentcount=attendance.countcurrentclass(), classlist=attendance.getclasslist(), notfound="Agent Not Found")
def do_takeattendance(): userinput = request.forms.get('userinput') classname = attendance.readclass() if classname is False: return template('takeattendance.tpl', status="No class in session", todaydate=time.strftime('%m-%d-%Y'), currentclass=attendance.readclass()) else: if len(userinput) == 20: searchkey = 'homePhone=' inputtype = 'card' output = attendance.usercheck(searchkey, userinput, inputtype) return template('takeattendance.tpl', status=output, currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y')) elif len(userinput) < 5: return template('takeattendance.tpl', status="Error! Five digits please!", todaydate=time.strftime('%m-%d-%Y'), currentclass=attendance.readclass()) elif len(userinput) > 5 and len(userinput) < 20: output = 'Error! Too many Digits. Last FIVE digits please.' return template('takeattendance.tpl', status=output, currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y')) elif len(userinput) == 5: inputstatus = 'Social Entered' searchkey = 'pager=' inputtype = 'social' cardninput = False output = attendance.usercheck(searchkey, userinput, inputtype) return template('takeattendance.tpl', status=output, currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'))
def takeattendance(): return dict(status='Ready', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'))
def setclass(): return dict(title='Set Current Class:', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'), class_status='')
def manualinput(): return dict(status='Getting Manual Input', currentclass=attendance.readclass(), todaydate=time.strftime('%m-%d-%Y'))