示例#1
0
文件: knight.py 项目: neodeng/itxia
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)
示例#2
0
文件: knight.py 项目: neodeng/itxia
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)
示例#3
0
文件: knight.py 项目: neodeng/itxia
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)
示例#4
0
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")
示例#5
0
文件: knight.py 项目: neodeng/itxia
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
示例#6
0
文件: knight.py 项目: neodeng/itxia
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)
示例#7
0
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)
示例#8
0
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])
示例#9
0
def delorder(oid):
    OrderServer.delOrder(oid)
    return redirect("/helper/now")
示例#10
0
def helperReply():
    referer = request.environ['HTTP_REFERER']
    order = request.form['order']
    content = protect(request.form['content'])
    OrderServer.helperReply(order, content)
    return redirect(referer)
示例#11
0
def history():
    orderlist = OrderServer.getHelperOrder()
    return render_template('/helper/history.html', orderlist=orderlist)
示例#12
0
文件: knight.py 项目: neodeng/itxia
def towait(account):
    oid = account
    if oid:
        OrderServer.changeWait(oid)
    referer = request.environ['HTTP_REFERER']
    return redirect(referer)
示例#13
0
文件: knight.py 项目: neodeng/itxia
def towork(account):
    oid = account
    if oid:
        OrderServer.changeWork(oid)
    return redirect('/knight/work')