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)
Exemple #2
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)
Exemple #3
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])
Exemple #4
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)
Exemple #5
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 index():
    brand = Brand()
    brr = brand.getBrands()
    return render_template('brand/index.html', brr=brr)
Exemple #7
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))
Exemple #8
0
def add():
    cat = Category()
    br = Brand()
    return render_template('/product/add.html', brr = br.getBrands(), crr = cat.getCategories())