def edit2(id):
    cat = Category()
    pro = Product()
    a = cat.getCategories()
    b = pro.getProductById(id)
    print(b)
    return render_template('product/edit2.html', arr=a, u=b)
def index():
    cat = Category()
    brd = Brand()
    arr = Product()
    a = arr.getProducts()
    b = brd.getBrands()
    c = cat.getCategories()
    return render_template('home/index.html', arr=a, brr=b, crr=c)
Beispiel #3
0
def index():
    #khoi tao lop:
    cat = Category()
    #goi ham

    a = cat.getCategories()

    return render_template('category/index.html', arr = a)
Beispiel #4
0
def detail(id):
    cat = Category()
    brand = Brand()
    pro = Product()
    a = pro.getProductById(id)
    b = brand.getBrands()
    c = cat.getCategories()
    d = pro.getProductsRelation(id)
    return render_template('home/detail.html', u=a, crr=c, brr=b, arr=d)
Beispiel #5
0
def brand(id):
    cat = Category()
    brand = Brand()
    pro = Product()
    a = pro.getProductsByBrand(id)
    b = brand.getBrands()
    c = cat.getCategories()
    d = brand.getBrandById(id)
    return render_template('home/brand.html', arr=a, crr=c, brr=b, title=d[1])
Beispiel #6
0
def index(p=1):
    cat = Category()
    brand = Brand()
    pro = Product()
    a = pro.getProductsForHome(p, 8)
    b = brand.getBrands()
    c = cat.getCategories()
    total = pro.homeCount()
    n = ceil(total / 8)
    return render_template('home/index.html',
                           arr=a,
                           crr=c,
                           brr=b,
                           title="Mobile Store",
                           n=n)
Beispiel #7
0
def search(p=1):
    q = request.args.get('q')
    cat = Category()
    brand = Brand()
    pro = Product()
    a = pro.searchProducts(q, p, 4)
    b = brand.getBrands()
    c = cat.getCategories()
    total = pro.searchCount(q)
    n = ceil(total / 4)
    return render_template('home/search.html',
                           arr=a,
                           crr=c,
                           brr=b,
                           title=q,
                           n=n)
def add():
    cat = Category()
    return render_template('product/add.html', arr=cat.getCategories())
Beispiel #9
0
def edit(id):
    cat = Category()
    brand = Brand()
    pro = Product()
    return render_template('/product/edit.html', crr = cat.getCategories(), brr = brand.getBrands(), u = pro.getProductById(id))
Beispiel #10
0
def add():
    cat = Category()
    br = Brand()
    return render_template('/product/add.html', brr = br.getBrands(), crr = cat.getCategories())
Beispiel #11
0
def index():
    cat = Category()
    arr = cat.getCategories()
    return render_template('category/index.html', arr=arr)