getBrandByName($brandName); $geometryService = new GeometryService(); $geometries = $geometryService->getAllGeometriesByBrand($brand->id, is_updater()); $models = array(); foreach ($geometries as $geo) { $modelService = new ModelService(); $models[$geo->id] = $modelService->getAllModelsByGeometry($geo->id, is_updater()); } if ($geometries) { $smarty = new Smarty; $smarty->assign('brand', $brand); $smarty->assign('geometries', $geometries); if ($models) { $smarty->assign('models', $models); } $smarty->assign('geometries', $geometries); $smarty->assign('user_can_update', is_updater()); $smarty->assign('user_logged_in', is_logged_in($user)); $smarty->display('views/geometries.tpl'); } else { header('location:add_geometry.php?brand=' . $brand->name); } } else { $brandService = new BrandService(); $brands = $brandService->getAllBrands(); $smarty = new Smarty; $smarty->assign('brands', $brands); $smarty->assign('action', "geometries.php"); $smarty->display('views/selectbrand.tpl'); } } ?>