예제 #1
0
def searchBookByPrice():
    if request.method == 'POST':
        user = request.cookies.get('name')
        userid = bm.checkUseridByName(user)
        beginprice = request.form['beginprice']
        endprice = request.form['endprice']
        res = bm.checkBookByPrice(beginprice, endprice, userid)
        return render_template('list.html', prolist=res, userinfo=user)
예제 #2
0
def insertbook():
    if request.method == 'GET':
        user = request.cookies.get('name')
        return render_template('insertbook.html', userinfo=user)
    elif request.method == 'POST':
        bookname = request.form['bookname']
        author = request.form['author']
        price = request.form['price']
        abstract = request.form['abstract']
        user = request.cookies.get('name')
        userid = bm.checkUseridByName(user)
        try:
            bm.insertBook(bookname, author, price, abstract, userid)
            return redirect('/list')
        except:
            return redirect('/insertbook')
예제 #3
0
def checkBookByPriceAsc():
    user = request.cookies.get('name')
    userid = bm.checkUseridByName(user)
    res = bm.checkBookByPriceAsc(userid)
    return render_template('list.html', prolist=res, userinfo=user)