def knightwait(): status = UserServer.checkInfo() location = UserServer.getLocation() data = OrderServer.getWaitList(location) number = OrderServer.getOrderNum(location) user = session['account'] return render_template('/knight/wait.html', number=number, waitlist=data, status=status, user=user)
def message(): status = UserServer.checkInfo() location = UserServer.getLocation() data = OrderServer.getNewReplyOrder(location) number = OrderServer.getOrderNum(location) user = session['account'] return render_template('/knight/message.html',number=number, data=data, status=status, user=user)
def finish(page=0): status = UserServer.checkInfo() page = int(page) location = UserServer.getLocation() number = OrderServer.getOrderNum(location) user = session['account'] data = OrderServer.getFinishList(location, page) return render_template('/knight/finish.html',number=number, data=data, page=page, status=status, user=user)
def addorder(): name = protect(request.form['name']) bbs = protect(request.form['bbs']) local = protect(request.form['local']) model = protect(request.form['model']) os = protect(request.form['os']) desc = protect(request.form['desc']) OrderServer.addOrder(bbs, local, model, os, desc, name) return redirect("/helper/now")
def reply(time): referer = request.environ['HTTP_REFERER'] + "?p=ihateie" try: order = request.form['order'] content = request.form['content'] OrderServer.knightReply(order, content) return redirect(referer) except Exception, e: print e
def work(): status = UserServer.checkInfo() location = UserServer.getLocation() data1 = OrderServer.getWorkList(location) number = OrderServer.getOrderNum(location) user = session['account'] data = [] for each in data1: if each['handler'] == user: data.append(each) for each in data1: if not each['handler'] == user: data.append(each) return render_template('/knight/work.html', number=number, data=data, user=user, status=status)
def now(): orderlist = OrderServer.getHelperOrder() if not orderlist or len(orderlist) == 0 or orderlist[0]['status'] == -1: return render_template('/helper/now_post.html', phone=session['id']) else: #data = OrderServer.getOrderNum(orderlist[0]['campus']) #number = data[0] + data[1] filelist = orderlist[0]['yunfile'] return render_template('/helper/now_exist.html', order=orderlist[0], filelist=filelist)
def modifyorder(): if request.method == 'POST': name = protect(request.form['name']) oid = request.form['oid'] bbs = protect(request.form['bbs']) local = protect(request.form['local']) model = protect(request.form['model']) os = protect(request.form['os']) desc = protect(request.form['desc']) OrderServer.modifyOrder(oid, bbs, local, model, os, desc, name) return redirect("/helper/now") else: orderlist = OrderServer.getHelperOrder() print orderlist if not orderlist or len( orderlist) == 0 or orderlist[0]['status'] == -1: return redirect("/helper/now") else: for each in orderlist[0]['comments']: if each['username'] == session['account']: each['username'] = "******" return render_template('/helper/modify.html', order=orderlist[0])
def delorder(oid): OrderServer.delOrder(oid) return redirect("/helper/now")
def helperReply(): referer = request.environ['HTTP_REFERER'] order = request.form['order'] content = protect(request.form['content']) OrderServer.helperReply(order, content) return redirect(referer)
def history(): orderlist = OrderServer.getHelperOrder() return render_template('/helper/history.html', orderlist=orderlist)
def towait(account): oid = account if oid: OrderServer.changeWait(oid) referer = request.environ['HTTP_REFERER'] return redirect(referer)
def towork(account): oid = account if oid: OrderServer.changeWork(oid) return redirect('/knight/work')