Example #1
0
def home_search():
	"""The search menu"""
	def outy(iny):
		x = db.checkins(iny.id)
		ui.srch1()
		y = 14 - len(iny.name)
		l = " "*y 
		print iny.name, l, iny.checkins
		ui.srch2()
		for i in x:
			y2 = 6 - len(str(i[1]))
			f = " "*y2
			print str(i[0]),"|",str(i[1])+f+"|",str(i[2]),"|",str(i[3])
	ui.srch()
	do = raw_input("Search by [N]ame or [I]D    ")
	if do in ("N", "n"):
		x = raw_input("Search by Full Name:   ")
		z = db.osearch("name",x)
		try: outy(z)
		except AttributeError: #@Error 004
			ui.err("#004")
			time.sleep(1)
			home_search()
	elif do in ("I","i"):
		x = raw_input("Search by ID:   ")
		z = db.osearch("id",x)
		outy(z)
	elif do == ":EXIT": home()
	raw_input("Press [enter] to go home")
	home()
Example #2
0
def home_search():
    """The search menu"""
    def outy(iny):
        x = db.checkins(iny.id)
        ui.srch1()
        y = 14 - len(iny.name)
        l = " " * y
        print iny.name, l, iny.checkins
        ui.srch2()
        for i in x:
            y2 = 6 - len(str(i[1]))
            f = " " * y2
            print str(i[0]), "|", str(i[1]) + f + "|", str(i[2]), "|", str(
                i[3])

    ui.srch()
    do = raw_input("Search by [N]ame or [I]D    ")
    if do in ("N", "n"):
        x = raw_input("Search by Full Name:   ")
        z = db.osearch("name", x)
        try:
            outy(z)
        except AttributeError:  #@Error 004
            ui.err("#004")
            time.sleep(1)
            home_search()
    elif do in ("I", "i"):
        x = raw_input("Search by ID:   ")
        z = db.osearch("id", x)
        outy(z)
    elif do == ":EXIT":
        home()
    raw_input("Press [enter] to go home")
    home()
Example #3
0
def checkinmode():
	"""The checkin screen"""
	clear()
	ui.chk()
	iny = raw_input("NAME:   ")
	if iny == ":EXIT": home()
	else: pass
	def markin(uid):
		db.checkin(uid)
	try:
		x = db.osearch("name",iny)
		if chky(x.id) is False:
			markin(x.id)
			ui.ok()
			time.sleep(1)
			checkinmode()
		elif chky(x.id) is True:
			ui.chkold()
			time.sleep(1)
			checkinmode()
		else:	#@error 003
			ui.err("#003")
			time.sleep(1)
			checkinmode()
	except AttributeError: #@Error 001
		ui.fail()
		time.sleep(1)
		checkinmode()
Example #4
0
def checkinmode():
    """The checkin screen"""
    clear()
    ui.chk()
    iny = raw_input("NAME:   ")
    if iny == ":EXIT": checkpremenu()
    else: pass

    def markin(uid):
        db.checkin(uid)

    try:
        x = db.osearch("name", iny)
        if chky(x.id) is False:
            markin(x.id)
            ui.ok()
            time.sleep(1)
            checkinmode()
        elif chky(x.id) is True:
            ui.chkold()
            time.sleep(1)
            checkinmode()
        else:  #@error 003
            ui.err("#003")
            time.sleep(1)
            checkinmode()
    except AttributeError:  #@Error 001
        ui.fail()
        time.sleep(1)
        checkinmode()