示例#1
0
def employerViewInt():
    if escape(session['type']) == 'employer':
        sid = request.args.get('sid')
        iid = request.args.get('iid')

        cid = adb.get_cid(escape(session['uname']))
        if sid and iid:
            if adb.check_ci_ids(cid, iid):
                adb.student_seen(sid, iid)
                flash('Student has been removed.')
                return redirect('/Employer/ViewInternships/{}'.format(iid))

        internlist = []
        for r in adb.view_cjoini_t():
            if r[2] == cid and r[8]:
                internlist.append(r)

        return render_template('employerviewinternships.html', internlist=internlist)

    return 'employer'
示例#2
0
def studentSearch():
    if escape(session.get('type')) == 'student':
        table=[(i[0], i[4], i[5], i[6], os.path.isfile(os.path.join(app.config['UPLOAD_FOLDER'],
                                                  "desc{}.txt".format(i[6]))), is_imgfile(i[2]), i[2]) for i in adb.view_cjoini_t() if i[8]]
        if request.method == 'POST':#once we have search fields
            return render_template('studentsearch.html')
        else:
            return render_template('studentsearch.html',
                        table=table,
                        desc=True)


    return redirect('/Students')