def render_productmanager(UserName): listproduct = SQL.SelectAllProductA_Z() listcate = SQL.SelectAllCategoryWithId() return render_template('Product-Cat.html', UserName=UserName, listproduct=listproduct, listcate=listcate)
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)
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)
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)
def render_addproduct(UserName): listcate = SQL.SelectAllCategoryWithId() return render_template('addProduct.html', UserName=UserName, listcate=listcate)