summaryrefslogtreecommitdiffstats
path: root/products.php
blob: a7371090ee3da4bf14d948392b939d5ddb150a3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
session_start();
require_once('vendor.inc.php');

if(isset($_GET['id']))
{
	$id = $_GET['id'];
}
else
{
	header('Location: categories.php');
}

$category = CategoryQuery::create()->findOneById($id);
if ( !is_object($category) )
{
	header('Location: categories.php');
}

$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');

?>