From af6dd5f8f9844596e85db25a8e97df9e08cb795c Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 1 Jun 2015 18:46:12 +0200 Subject: Port alls sites to smarty and use the inheritance model --- products.php | 74 +++++++++++------------------------------------------------- 1 file changed, 13 insertions(+), 61 deletions(-) (limited to 'products.php') diff --git a/products.php b/products.php index 6e4d2bd..a737109 100644 --- a/products.php +++ b/products.php @@ -1,5 +1,7 @@ findOneById($id); if ( !is_object($category) ) { header('Location: categories.php'); } -$products = $category->getProducts(); -?> - - - - -Products - - - -

getName(); ?>

- -
- -"; - echo ""; - echo ""; - if(isset($username)) - { - echo ""; - echo ""; - } - echo ""; - -} -if(isset($username)) -{ - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; -} -?> -
getId()}&catid={$id}\">{$product->getName()}{$product->getDescription()}getId()}&catid={$id}\">EditgetId()}&catid={$id}\" onClick=\"return confirm('Confirm deletion.')\">Delete
Add
-
-
- - - \ No newline at end of file + +$smarty = new Smarty; + +$smarty->assign('loggedin', isset($_SESSION['username'])); +$smarty->assign('products', $category->getProducts()); +$smarty->assign('category', $category->getName()); +$smarty->assign('id', $id); + +$smarty->display('products.tpl'); + +?> \ No newline at end of file -- cgit v1.2.3-70-g09d2