aboutsummaryrefslogtreecommitdiff
path: root/public/products.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/products.php')
-rw-r--r--public/products.php14
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");