22011988-ai / www.ovizcard.com

Credit cards for bar owners stock purchases in south africa
1 stars 0 forks source link

Code for ovizzcard #1

Open 22011988-ai opened 1 year ago

22011988-ai commented 1 year ago

import required modules

import os import sys import json import uuid import flask from flask import Flask, render_template, request, redirect, url_for, session

initialize the flask app

app = Flask(name) app.secret_key = os.environ.get('SECRET_KEY') or str(uuid.uuid4())

Login/Registration page

@app.route("/", methods=["GET", "POST"]) def login_registration(): if request.method == "POST":

Get the user input

    name = request.form.get("name")
    email = request.form.get("email")
    bar_name = request.form.get("bar_name")
    license_info = request.form.get("license_info")

    # Store the user data in the session
    session["user"] = {
        "name": name,
        "email": email,
        "bar_name": bar_name,
        "license_info": license_info
    }

    # Redirect to the homepage
    return redirect(url_for("homepage"))
return render_template("login_registration.html")

Homepage

@app.route("/homepage") def homepage(): user = session.get("user") if not user:

If user is not logged in, redirect to the login page

    return redirect(url_for("login_registration"))

# Load the available merchandise from a JSON file
with open("merchandise.json") as f:
    merchandise = json.load(f)

return render_template("homepage.html", user=user, merchandise=merchandise)

Product Catalog

@app.route("/catalog/") def product_catalog(category): user = session.get("user") if not user:

If user is not logged in, redirect to the login page

    return redirect(url_for("login_registration"))

# Load the available merchandise from a JSON file
with open("merchandise.json") as f:
    merchandise = json.load(f)

# Filter the products by category
products = [p for p in merchandise if p["category"] == category]

return render_template("product_catalog.html", user=user, products=products)

Cart

@app.route("/cart", methods=["GET", "POST"]) def cart(): user = session.get("user") if not user:

If user is not logged in, redirect to the login page

    return redirect(url_for("login_registration"))

# Load the cart items from the session
cart_items = session.get("cart_items", [])

if request.method == "POST":
    # Get the product ID and quantity from the form
    product_id = request.form.get("product_id")
    quantity = int(request.form.get("quantity"))

    # Update the quantity of the item in the cart
    item_found = False
    for i, item in enumerate(cart_items):
        if item
22011988-ai commented 1 year ago

IMG_20191214_142027 Screenshot_20230126_221236 20220411_120601

22011988-ai commented 1 year ago

These pictures must be part of the card # Screenshot_20230206_144717 Screenshot_20230203_215514

22011988-ai commented 1 year ago

This will be the background of the card