function __Construct($dictionary) { parent::__Construct(get_class()); $categories = array(); $list = ServiceCategory::GetAll(array('partnerCode' => Application::PARTNER_CODE, 'parentId' => null), null, $dictionary->getCode()); foreach ($list as $category) { $categories[] = $category->toArray(true); } $this->jsonData = array('categories' => $categories); }
function getServices() { $html = ''; $categories = ServiceCategory::GetAll(array('partnerCode' => Application::PARTNER_CODE)); foreach ($categories as $category) { if ($category->getLevel() == 3) { $services = $this->provider->getServices(true, $category->getId()); if (count($services) > 0) { $html .= HTML::Tr(HTML::Th(HTML::Encode($category->getFullName()), array('colspan' => 3))); foreach ($services as $service) { $html .= HTML::Tr(HTML::Td(HTML::Encode($service->getName())) . HTML::Td(Format::Money($service->getSalePrice(), $service->getCurrencyCode())) . HTML::Td(Format::Minutes($service->getDuration()))); } } } } return HTML::Table($html, 'servicesTable'); }