Skip to content

Commit

Permalink
Merge pull request #1 from 0xNuru/nuru-features
Browse files Browse the repository at this point in the history
Nuru features
  • Loading branch information
0xNuru authored Aug 15, 2024
2 parents 4494157 + b41466e commit c12af23
Show file tree
Hide file tree
Showing 25 changed files with 612 additions and 385 deletions.
Binary file modified __pycache__/app.cpython-310.pyc
Binary file not shown.
22 changes: 19 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ def shop():
def order():
if request.method == "POST":
product = request.form.get("product")
results = db.execute("SELECT * FROM products WHERE id = ?", product)
db.execute("INSERT INTO orders (userId, productId) VALUES(?, ?)", session["user_id"], int(product))
user_id = session["user_id"]
db.execute("INSERT INTO orders (userId, productId) VALUES(?, ?)", user_id, int(product))
results = db.execute("SELECT DISTINCT * FROM orders JOIN products ON orders.productId=products.id WHERE userId = ?", user_id)
return render_template("order.html", results=results)
return render_template("order.html")

Expand All @@ -182,10 +183,25 @@ def success():
return render_template("success.html")


@app.route("/cart")
@login_required
def cart():
user_id = session["user_id"]
results = db.execute("SELECT DISTINCT * FROM orders JOIN products ON orders.productId=products.id WHERE userId = ?", user_id)
return render_template("cart.html", results=results)

@app.route("/orders")
@login_required
def orders():
user_id = session["user_id"]
results = db.execute("SELECT DISTINCT * FROM orders JOIN products ON orders.productId=products.id WHERE userId = ?", user_id)
return render_template("orders.html", results=results)
return render_template("cart.html", results=results)


@app.route("/paid_appointments")
def paid_appointments():
return render_template("paid_appointments.html")

@app.route("/free_appointments")
def free_appointments():
return render_template("free_appointments.html")
Binary file modified flask_session/2029240f6d1128be89ddc32729463129
Binary file not shown.
Binary file modified flask_session/2438a582eea2af152de2113a38cf411a
Binary file not shown.
Binary file added flask_session/4bcf532c9eb1f583ab1d83ef79b6aa6a
Binary file not shown.
2 changes: 1 addition & 1 deletion helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def decorated_function(*args, **kwargs):

def usd(value):
"""Format value as USD."""
return f"${value:,.2f}"
return f"{value:,.2f}"
Empty file added main
Empty file.
Binary file modified pharmacy.db
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/doc-abdullahi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/new-black-doc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions static/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.order-img {
max-height: 255px;
}
14 changes: 2 additions & 12 deletions templates/orders.html → templates/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="card-body" style="padding-left:40px;">
<img src="{{result["image"]}}" class="order-img" alt="...">
<h5 class="card-title">{{result["name"]}}</h5>
<h4 class="card-title">${{result["price"]}}</h4>
<h4 class="card-title">{{result["price"]}}</h4>
<p class="card-text">{{result["description"]}}</p>
<button style="margin-bottom:10px;" class="btn btn-primary" type="submit" data-bs-toggle="modal" data-bs-target="#exampleModal">Place order!</button>
</div>
Expand Down Expand Up @@ -55,16 +55,6 @@ <h2>no items in cart</h2>
<div class="card" style="bottom:-460px;">
<div class="card-header" style="font-size: large;">
</div>
<div class="card-body mx-auto">
<div id="icons">
<a href="https://web.facebook.com/nurudeen.ahmad.71" class="fa fa-facebook icons" style="font-size: xx-large;"></a>
<a href="https://twitter.com/nurvdeen4?s=20&t=Du_tqiu6oraiU_O-FD9rGg" class="fa fa-twitter icons" style="font-size: xx-large;"></a>
<a href="https://www.google.com/" class="fa fa-google icons" style="font-size: xx-large;"></a>
<a href="https://www.linkedin.com/in/nurudeen-ahmed-80a1a11b8/?lipi=urn%3Ali%3Apage%3Ad_flagship3_feed%3BCbGh6YqnSouciAHLJF8rhw%3D%3D" class="fa fa-linkedin icons" style="font-size: xx-large;"></a>
<a href="https://www.youtube.com/channel/UCgD8FOOwIJjYZ0_9LLzA4LA" class="fa fa-youtube icons" style="font-size: xx-large;"></a>
<a href="https://www.instagram.com/nuru_4/" class="fa fa-instagram icons" style="font-size: xx-large;"></a>
<a href="https://media.tenor.com/udq1uD9WHSQAAAAC/oops.gif" class="fa fa-pinterest icons" style="font-size: xx-large;"></a>
</div>
</div>

</main>
{% endblock %}
Loading

0 comments on commit c12af23

Please sign in to comment.