diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-05-13 14:35:04 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-05-13 14:35:04 +0200 |
commit | d99d91293fe9e9ad683bbd079848df4031f0a77a (patch) | |
tree | 26b234f733248a3f22503f1fef7644c3bc739f0c /public/products.php | |
parent | b8e90ea5ea7c41444d7fbce6848e4c3cf37c87e5 (diff) |
add links to admin pages + more login
Diffstat (limited to 'public/products.php')
-rw-r--r-- | public/products.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/public/products.php b/public/products.php index 433475f..da337ad 100644 --- a/public/products.php +++ b/public/products.php @@ -1,5 +1,6 @@ <!DOCTYPE html> <?php require "../lib/db.php"; ?> +<?php require "../lib/login.php"; ?> <?php function product_template($product) { $image_path = $product->image ? "/img/product/$product->id-thumb.jpg" : "/img/placeholder.png"; @@ -22,6 +23,19 @@ EOF; <?php include 'navbar.php' ?> <div class="main limwidth"> <h2>lijst met producten:</h2> + <?php do { + if (($user_privileges & PRIVILEGE_ADMIN) == 0) break; + echo <<<"EOF" + <div class="center"> + <form action="/admin-product.php" method="get" class="d-ib"> + <input type="submit" value="Nieuw product toevoegen" class="button filled"> + </form> + <form action="/admin-category.php" method="get" class="d-ib"> + <input type="submit" value="Nieuwe categorie toevoegen" class="button filled"> + </form> + </div> + EOF; + } while (false); ?> <div class="products"> <?php $res = $cursor->query("select id, image, price, name from webs.product"); |