예제 #1
0
def printp():
    tid = request.args.get('track_id')
    ret = retrieve()
    pdet = ret.disp_pdetails(tid)
    oaddr = ret.disp_oaddress(tid)
    daddr = ret.disp_daddress(tid)
    return render_template('print.html', track_id=tid,
                           pdet=pdet, oaddr=oaddr, daddr=daddr)
예제 #2
0
def succ_reg():
    track_id = request.args.get('track_id')
    ret = retrieve()
    pdet = ret.disp_pdetails(track_id)
    oaddr = ret.disp_oaddress(track_id)
    daddr = ret.disp_daddress(track_id)
    return render_template('success.html', track_id=track_id,
                           pdet=pdet, oaddr=oaddr, daddr=daddr)
예제 #3
0
def authenticate():
    error = ''
    if request.method == 'POST':
        data = request.form
        tid = data['id']
        ret = retrieve()
        if ret.check_cust(tid):
            return redirect(url_for('success', tid=tid))
        else:
            error = "Invalid Tracking ID!"
            return redirect(url_for('track', title='Track', error=error))
    return redirect(url_for('track', title='Track', error=error))
예제 #4
0
def submit():
    if request.method == 'POST':
        uid = request.form.get('id')
        ret = retrieve()
        if ret.check_password(uid, request.form.get('password')):
            session['user'] = uid
            session['super_user'] = ret.getsu(uid)
            session['name'] = ret.getname(uid)
            return redirect(url_for('register'))
        else:
            error = "Invalid credentials!"
            return redirect(url_for('login', title='Track', error=error))
    return redirect(url_for('login', title='Track', error="error"))
예제 #5
0
def success():
    tid = request.args.get('tid')
    ret = retrieve()
    pdet = ret.disp_pdetails(tid)
    oaddr = ret.disp_oaddress(tid)
    daddr = ret.disp_daddress(tid)
    pr = ret.disp_priority(tid)
    if(pr[0] == 0):
        pr = 'NO'
    else:
        pr = 'YES'
    st = ret.disp_status(tid)
    if(st[0] == 0):
        st = 'IN TRANSIT'
    else:
        st = 'DELIVERED'
    le = ret.disp_levent(tid)
    return render_template('track_succ.html', tid=tid, title='Track',
                           pdet=pdet, oaddr=oaddr, daddr=daddr,
                           pr=pr, st=st, le=le)