Fifth pass at adding key files
This commit is contained in:
25
site/stackreach/selectbrand.php
Executable file
25
site/stackreach/selectbrand.php
Executable file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
include_once './config.php';
|
||||
include_once './models/services/BrandService.php';
|
||||
include_once './libs/Smarty.class.php';
|
||||
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset ($_POST['brand']))
|
||||
{
|
||||
$_SESSION['brand'] = $_POST['brand'];
|
||||
|
||||
header ('location:' . $_POST['action']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$brandService = new BrandService();
|
||||
$brands = $brandService->getAllBrands ();
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign ('brands', $brands);
|
||||
$smarty->assign ('action', "selectbrand.php");
|
||||
$smarty->assign ('current_brand', $_SESSION['brand']);
|
||||
$smarty->display ('views/selectbrand.tpl');
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user