예제 #1
0
def searching():
    listcategory = SQL.SelectAllCategory()
    if request.method == "POST":
        text = request.form.get("search-data")
        listproduct = SQL.SelectFromText(text)
    return render_template('Sub-page.html',
                           listitem=listproduct,
                           listcategory=listcategory)
예제 #2
0
def render_userpage(UserName):
    listproduct = SQL.SelectAll("product")
    listcategory = SQL.SelectAllCategory()
    numpro = SQL.GetAmountProductInCart(UserName)
    return render_template('userpage.html',
                           listitem=listproduct,
                           listcategory=listcategory,
                           UserName=UserName,
                           cartAmount=numpro)
예제 #3
0
def search_user(UserName):
    listcategory = SQL.SelectAllCategory()
    numpro = SQL.GetAmountProductInCart(UserName)
    if request.method == "POST":
        text = request.form.get("search-data")
        listproduct = SQL.SelectFromText(text)
    return render_template('sub_userpage.html',
                           listitem=listproduct,
                           listcategory=listcategory,
                           UserName=UserName,
                           cartAmount=numpro)
예제 #4
0
def loadCategory(category):
    listcategory = SQL.SelectAllCategory()
    if (category == "all"):
        listproduct = SQL.SelectAll("product")
        return render_template('Sub-page.html',
                               listitem=listproduct,
                               listcategory=listcategory)
    else:
        listproduct = SQL.SelectFromCategory(category)
        return render_template('Sub-page.html',
                               listitem=listproduct,
                               listcategory=listcategory)
예제 #5
0
def loadCategory_user(UserName, category):
    listcategory = SQL.SelectAllCategory()
    numpro = SQL.GetAmountProductInCart(UserName)
    if (category == "all"):
        listproduct = SQL.SelectAll("product")
        return render_template('sub_userpage.html',
                               listitem=listproduct,
                               listcategory=listcategory,
                               UserName=UserName,
                               cartAmount=numpro)
    else:
        listproduct = SQL.SelectFromCategory(category)
        return render_template('sub_userpage.html',
                               listitem=listproduct,
                               listcategory=listcategory,
                               UserName=UserName,
                               cartAmount=numpro)
예제 #6
0
def main():
    listproduct = SQL.SelectAll("product")
    listcategory = SQL.SelectAllCategory()
    return render_template('frontend.html',
                           listitem=listproduct,
                           listcategory=listcategory)