예제 #1
0
def render_productmanager(UserName):
    listproduct = SQL.SelectAllProductA_Z()
    listcate = SQL.SelectAllCategoryWithId()
    return render_template('Product-Cat.html',
                           UserName=UserName,
                           listproduct=listproduct,
                           listcate=listcate)
예제 #2
0
def addcategory(UserName):
    listcate = SQL.SelectAllCategoryWithId()
    if (request.method == "POST"):
        catename = request.form.get('name')
        SQL.InsertNewCategory(catename)
    return render_template('addProduct.html',
                           UserName=UserName,
                           listcate=listcate)
예제 #3
0
def search_pro(UserName):
    if (request.method == "POST"):
        namesearch = request.form.get('search')
        listproduct = SQL.SelectFromText(namesearch)
        listcate = SQL.SelectAllCategoryWithId()
        return render_template('Product-Cat.html',
                               UserName=UserName,
                               listproduct=listproduct,
                               listcate=listcate)
예제 #4
0
def addproduct(UserName):
    if (request.method == "POST"):
        listcate = SQL.SelectAllCategoryWithId()
        proname = request.form.get('name')
        imgpath = request.form.get('img')
        proprice = request.form.get('price')
        catepro = request.form.get('cate')
        despro = request.form.get('des')
        print(proname)
        print(imgpath)
        print(proprice)
        print(catepro)
        print(despro)
        SQL.AddNewProduct(proname, imgpath, proprice, catepro, despro)
    return render_template('addProduct.html',
                           UserName=UserName,
                           listcate=listcate)
예제 #5
0
def render_addproduct(UserName):
    listcate = SQL.SelectAllCategoryWithId()
    return render_template('addProduct.html',
                           UserName=UserName,
                           listcate=listcate)