示例#1
0
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')
示例#2
0
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'))
示例#3
0
def reports():
    return dict(currentclass=attendance.readclass(),
                todaydate=time.strftime('%m-%d-%Y'),
                currentreport=attendance.currentclassreport(),
                currentagentcount=attendance.countcurrentclass(),
                classlist=attendance.getclasslist(),
                notfound=None)
示例#4
0
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)
示例#5
0
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")
示例#6
0
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'))
示例#7
0
def takeattendance():
    return dict(status='Ready',
                currentclass=attendance.readclass(),
                todaydate=time.strftime('%m-%d-%Y'))
示例#8
0
def setclass():
    return dict(title='Set Current Class:',
                currentclass=attendance.readclass(),
                todaydate=time.strftime('%m-%d-%Y'),
                class_status='')
示例#9
0
def manualinput():
    return dict(status='Getting Manual Input',
                currentclass=attendance.readclass(),
                todaydate=time.strftime('%m-%d-%Y'))