public/index-app.php line 1428

Open in your IDE?
  1. <?php
  2. $time_start microtime(true);
  3. ob_start();
  4. $dataLayer = array();
  5. /**
  6.  * @var mysqli $db
  7.  * @var Trans $trans
  8.  * @var UrlGeneratorInterface $urlGenerator
  9.  * @var ContainerInterface $container
  10.  * @var ManifestAssets $manifestAssets
  11.  * @var \Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface $parameters
  12.  */
  13. require_once __DIR__ "/require.phtml";
  14. require_once __DIR__ "/includes/monthNames.inc";
  15. require_once __DIR__ "/includes/approvedAgreement.php";
  16. require_once __DIR__ '/includes/Categories.php';
  17. require_once __DIR__ '/includes/JsonHelper.php';
  18. require_once __DIR__ '/includes/renderHeroPagePart.php';
  19. require_once __DIR__ '/includes/registerLoginFunctions.php';
  20. require_once __DIR__ '/includes/bankID/bankID-overlay.php';
  21. use Klaravik\Assets\ManifestAssets;
  22. use Klaravik\Category\Cache\ActiveCategoryCache;
  23. use Klaravik\Common\Collections\RegisterCollection;
  24. use Klaravik\Exception\RepositoryException;
  25. use Klaravik\includes\Categories;
  26. use Symfony\Component\DependencyInjection\ContainerInterface;
  27. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  28. use Klaravik\Translate\Trans;
  29. use function Symfony\Component\String\u;
  30. // Initiate categories object.
  31. $categoriesObject = new Categories($trans$urlGenerator);
  32. $cachedCategories = new ActiveCategoryCache();
  33. $parameters $container->get('parameter_bag');
  34. $language LANGUAGE_ID;
  35. $url "";
  36. $siteConfigQuery "SELECT * FROM siteconfig WHERE language=" $language;
  37. $siteConfigResult mysqli_query($db$siteConfigQuery);
  38. $shortTitle "";
  39. if (mysqli_num_rows($siteConfigResult) > 0) {
  40.     $siteConfig mysqli_fetch_object($siteConfigResult);
  41.     $title $siteConfig->title;
  42.     $shortTitle $siteConfig->title;
  43.     $keywords $siteConfig->metakeywords;
  44.     $description $siteConfig->metadescription;
  45. } else {
  46.     include __DIR__ '/page_db_down.php';
  47.     exit();
  48. }
  49. if (isset($_REQUEST["vote"]) && is_numeric($_REQUEST["vote"])) {
  50.     $pollQuery "SELECT sida FROM answers WHERE id=" $_REQUEST["vote"];
  51.     $pollResult mysqli_query($db$pollQuery);
  52.     if (mysqli_num_rows($pollResult) > 0) {
  53.         $poll mysqli_fetch_object($pollResult);
  54.         if (!empty($_COOKIE["rostat"])) {
  55.             $value $_COOKIE["rostat"] . "|" $poll->sida;
  56.         } else {
  57.             $value $poll->sida;
  58.         }
  59.         setcookie("rostat"$value0"/");
  60.     }
  61. }
  62. include("includes/loginHandler.php");
  63. require_once(__DIR__ "/requestHandlers.phtml");
  64. $dataLayer['userInfo'] = array(
  65.     'id' => (array_key_exists("register_id"$_SESSION) ? $_SESSION['register_id'] : ''),
  66.     'idEmarsys' => (array_key_exists("register_id"$_SESSION) ? 'B' $_SESSION['register_id'] : 'NOTLOGGEDIN'),
  67.     'userType' => (array_key_exists("register_clientType"$_SESSION) ? $_SESSION['register_clientType'] : ''),
  68.     'country' => (array_key_exists("register_country"$_SESSION) ? $_SESSION['register_country'] : ''),
  69. );
  70. if (array_key_exists('is_admin'$_SESSION)) {
  71.     $dataLayer['isAdmin'] = true;
  72. }
  73. if (array_key_exists('registerInfo'$_SESSION)) {
  74.     $dataLayer['userEvent'] = 'createAccount';
  75.     $dataLayer['userRegisterInfo'] = array(
  76.         'id' => $_SESSION['registerInfo']['id'],
  77.         'userType' => $_SESSION['registerInfo']['clientType'],
  78.         'country' => $_SESSION['registerInfo']['country'],
  79.         'sellerLeadCheckbox' => $_SESSION['registerInfo']['sellerLeadCheckbox'],
  80.     );
  81.     unset($_SESSION['registerInfo']);
  82. }
  83. $pid null;
  84. // klaravik.se/<products_id> -> /auktion/produkt/<urlname>
  85. if (isset($_REQUEST['shorturl'])) {
  86.     $productId = (int) $_REQUEST['shorturl'];
  87.     $queryShortUrl mysqli_query($db"SELECT `urlname` FROM `products_description` WHERE `products_id` = " $productId " LIMIT 1");
  88.     if (mysqli_num_rows($queryShortUrl) > 0) {
  89.         $gotoShortUrl mysqli_fetch_object($queryShortUrl);
  90.         $urlParams = ['produrlname' => $gotoShortUrl->urlname];
  91.         if (isset($_REQUEST['s'])) {
  92.             // From SMS
  93.             $urlParams array_merge(
  94.                 $urlParams,
  95.                 ['utm_source' => 'sms''utm_medium' => 'autosms''utm_campaign' => 'smsalert30']
  96.             );
  97.         }
  98.         $url $urlGenerator->generate('app.legacy.auction.object'$urlParams);
  99.         header('Location: ' $url);
  100.         exit();
  101.     }
  102.     // If products_id not found, show 404.
  103.     $_REQUEST['page'] = '404';
  104. }
  105. if (!empty($_REQUEST["produrlname"])) {
  106.     $query "SELECT products_id FROM products_description WHERE urlname='" $db->escape_string($_REQUEST["produrlname"]) . "' AND language_id=" $language;
  107.     $result mysqli_query($db$query);
  108.     if (mysqli_num_rows($result) > 0) {
  109.         $obj mysqli_fetch_object($result);
  110.         $products_id $obj->products_id;
  111.         if ($parameters->get('app.instance') === 'se' && in_array($products_id, [2244862016555])) {
  112.             header("Location:/"true301);
  113.             exit();
  114.         }
  115.         $dataLayer['pageType'] = 'product';
  116.     } else {
  117.         $_REQUEST['page'] = '404';
  118.     }
  119. }
  120. if (!empty($_REQUEST['caturlname'])) {
  121.     $categoriesUrl $_REQUEST['caturlname'];
  122.     $categoryModel $categoriesObject->getCategoryByUrl($categoriesUrl);
  123.     if (!is_null($categoryModel->getId())) {
  124.         $_REQUEST['catid'] = $categoryModel->getId();
  125.         if ($categoryModel->getCtLevel() > 0) {
  126.             $urlArray explode('/'$categoryModel->getUrl());
  127.             if (count($urlArray)) {
  128.                 $parent $categoriesObject->getCategoryByUrl($urlArray[0]);
  129.                 $_REQUEST['catid'] = $parent->getId();
  130.                 $_REQUEST['subcatid'] = $categoryModel->getId();
  131.             }
  132.         }
  133.         $dataLayer['pageType'] = 'category';
  134.         $dataLayer['categoryName'] = $categoryModel->getName();
  135.     } else {
  136.         // Redirect with 301 to new URL if old URL found.
  137.         // If a matching url is found in the categoriesUrlHistory.
  138.         $categoriesUrlHistoryResult mysqli_query(
  139.             $db,
  140.             sprintf(
  141.                 "SELECT categories_id FROM categoriesUrlHistory WHERE url='%s'",
  142.                 $db->escape_string($categoriesUrl)
  143.             )
  144.         );
  145.         if ($categoriesUrlHistoryResult && mysqli_num_rows($categoriesUrlHistoryResult)) {
  146.             $categoryModel $categoriesObject->getCategory(
  147.                 mysqli_fetch_object($categoriesUrlHistoryResult)->categories_id
  148.             );
  149.             if (!is_null($categoryModel->getId())) {
  150.                 header('HTTP/1.1 301 Moved Permanently');
  151.                 header(sprintf('Location: %s'$categoryModel->getCompleteUrl()));
  152.                 die;
  153.             }
  154.         }
  155.         $explodedCategoriesUrl explode('/'$categoriesUrl);
  156.         $categoriesUrlEnd end($explodedCategoriesUrl);
  157.         $categoryModel $categoriesObject->getCategoryByOldUrlName($categoriesUrlEnd);
  158.         if (!is_null($categoryModel->getId())) {
  159.             $routeName 'app.legacy.auction.listing.category';
  160.             if (!empty($_REQUEST['specialcat']) && 'closed' === $_REQUEST['specialcat']) {
  161.                 $routeName 'app.legacy.auction.listing.closed.category';
  162.             }
  163.             $redirectUrl $urlGenerator->generate($routeName, ['caturlname' => $categoryModel->getUrl()]);
  164.             header('HTTP/1.1 301 Moved Permanently');
  165.             header('Location: ' $redirectUrl);
  166.             die;
  167.         }
  168.         header('Location: /');
  169.         exit();
  170.     }
  171. }
  172. if (
  173.     (isset($_REQUEST['specialcat']) && $_REQUEST['specialcat'] === 'all')
  174.     || (isset($_REQUEST['cat']) && $_REQUEST['cat'] === 'all')
  175. ) {
  176.     $_REQUEST['catid'] = 0;
  177. }
  178. if (!empty($_REQUEST["urlname"])) {
  179.     $query "SELECT id, pagetype FROM pages WHERE url='" $db->escape_string($_REQUEST["urlname"]) . "' AND language=" $language;
  180.     $result mysqli_query($db$query);
  181.     if (mysqli_num_rows($result) > 0) {
  182.         $obj mysqli_fetch_object($result);
  183.         $pid $obj->id;
  184.         $dataLayer['pageType'] = $obj->pagetype;
  185.     }
  186. } elseif (!empty($_REQUEST["page"])) {
  187.     $cres $db->query("SELECT id, pagetype FROM pages WHERE pagetype='" $db->escape_string($_REQUEST['page']) . "' AND language=" $language);
  188.     if (mysqli_num_rows($cres)) {
  189.         $crow mysqli_fetch_object($cres);
  190.         $pid $crow->id;
  191.         $dataLayer['pageType'] = $crow->pagetype;
  192.     } elseif (!isset($dataLayer['pageType'])) {
  193.         $pageName $_REQUEST['page'];
  194.         switch ($pageName) {
  195.             case "auction":
  196.                 if (isset($_REQUEST['specialcat'])) {
  197.                     $pageName "category_" $_REQUEST['specialcat'];
  198.                 }
  199.                 break;
  200.             case "login":
  201.                 if (isset($_REQUEST['logintab'])) {
  202.                     $pageName .= "_" $_REQUEST['logintab'];
  203.                 }
  204.                 break;
  205.             case "buyer":
  206.                 if (isset($_REQUEST['buyertab'])) {
  207.                     $pageName .= "_" $_REQUEST['buyertab'];
  208.                 }
  209.                 break;
  210.             case "vendor":
  211.                 if (isset($_REQUEST['vendortab'])) {
  212.                     $pageName .= "_" $_REQUEST['vendortab'];
  213.                     if ($_REQUEST['vendortab'] === 'reports' || $_REQUEST['vendortab'] === 'overview' || $_REQUEST['vendortab'] === 'info') {
  214.                         $manifestAssets->add('bundle-ui-Tooltip/kTooltip');
  215.                     }
  216.                 } else {
  217.                     $manifestAssets->add('bundle-ui-Tooltip/kTooltip');
  218.                 }
  219.                 break;
  220.             case "register":
  221.             case "register_thanks":
  222.                 if (isset($_REQUEST['clienttype'])) {
  223.                     $pageName .= "_" $_REQUEST['clienttype'];
  224.                 }
  225.                 break;
  226.             default:
  227.                 break;
  228.         }
  229.         $dataLayer['pageType'] = $pageName;
  230.     }
  231. } else {
  232.     $cres mysqli_query($db"SELECT id, pagetype FROM pages WHERE pagetype='frontpage' AND language=" $language);
  233.     if (mysqli_num_rows($cres)) {
  234.         $crow mysqli_fetch_object($cres);
  235.         $pid $crow->id;
  236.         $dataLayer['pageType'] = "frontpage";
  237.     }
  238. }
  239. // The variable $page is used in various places with wildy different
  240. // data. Somtimes it is a string of the pagetype, other times it is
  241. // an object with page data. Unfortunately I don't know why that is,
  242. // so I don't dare change it. I'll just add another variable to the
  243. // fray. It is used to add a unique class to the body element in
  244. // order to be able to style pages with unique layouts, e.g. the
  245. // about page.
  246. $pagetype call_user_func(static function ($pid) use ($db) {
  247.     if (!is_numeric($pid)) {
  248.         return null;
  249.     }
  250.     $res mysqli_query($db"SELECT pagetype FROM pages WHERE id = " . (int) $pid);
  251.     return mysqli_fetch_object($res)->pagetype;
  252. }, $pid);
  253. $continueUrlParams = [];
  254. if ((isset($_REQUEST['page'])) && ($_REQUEST['page'] == 'auction')) {
  255.     $continueUrlParams['continue'] = $_SERVER['REQUEST_URI'];
  256. }
  257. $jsParams = [];
  258. foreach ($parameters->all() as $key => $value) {
  259.     $stringKey u($key);
  260.     if (!$stringKey->startsWith('js.param.')) {
  261.         continue;
  262.     }
  263.     $jsKey strtolower($stringKey->trimStart('js.param.'));
  264.     $jsParams[$jsKey] = $value;
  265. }
  266. if (isset($_SESSION['dataLayer']) && count($_SESSION['dataLayer'])) {
  267.     $dataLayer array_merge($dataLayer$_SESSION['dataLayer']);
  268.     unset($_SESSION['dataLayer']);
  269. }
  270. /**
  271.  * @var \Symfony\Component\HttpFoundation\Request $request
  272.  */
  273. if (isset($_REQUEST['page'], $products_id) && $_REQUEST["page"] === "auction") {
  274.     $ogImage getFirstProductImageUrl($db$products_id);
  275. } else {
  276.     $ogImage $request->getSchemeAndHttpHost() . '/images/klaravik-share-icon-200x200.png';
  277. }
  278. /** @var \Klaravik\Page\PropUserData $propUserData */
  279. $propUserData $container->get(\Klaravik\Page\PropUserData::class);
  280. $propUserName $propUserData->getUserName();
  281. $propLogged $propUserData->isLogged();
  282. $propUser $propUserData->getUserType();
  283. $propAlias $propUserData->getAlias();
  284. $propMultiUser $propUserData->isMultiUser();
  285. $multiRegisterCollection $propUserData->getMultiRegisterCollection();
  286. $multiUserCollection $propUserData->getMultiUserCollection();
  287. if (isset($pid) && is_numeric($pid)) {
  288.     try {
  289.         $pageObject = (new \Klaravik\Repository\PageRepository())->getById($pid);
  290.         if (!empty($pageObject->getTitle())) {
  291.             $title $pageObject->getTitle();
  292.             $shortTitle $pageObject->getTitle();
  293.         }
  294.         if (!empty($pageObject->getMetaKeyword())) {
  295.             $keywords $pageObject->getMetaKeyword();
  296.         }
  297.         if (!empty($pageObject->getMetaDescription())) {
  298.             $description $pageObject->getMetaDescription();
  299.         }
  300.         // Kontrollera om det finns nÃ¥gon enkät pÃ¥ sidan
  301.         $textEnkatQuery "SELECT enkat_id FROM text WHERE sida=" . (int) $pid " AND enkat_id > 0";
  302.         $textEnkatResult mysqli_query($db$textEnkatQuery);
  303.         if (mysqli_num_rows($textEnkatResult)) {
  304.             $textEnkat mysqli_fetch_object($textEnkatResult);
  305.             $enkatQuery "SELECT id, overskrift FROM enkat WHERE id=" . (int) $textEnkat->enkat_id;
  306.             $enkatResult mysqli_query($db$enkatQuery);
  307.             if (mysqli_num_rows($enkatResult)) {
  308.                 $enkat mysqli_fetch_object($enkatResult);
  309.                 if (!array_key_exists('formEditor'$dataLayer)) {
  310.                     $dataLayer['formEditor'] = array(
  311.                         'id' => $enkat->id,
  312.                         'name' => $enkat->overskrift,
  313.                         'submitted' => false
  314.                     );
  315.                 }
  316.             }
  317.         }
  318.         if ($pageObject->getWordpressPageId() > 0) {
  319.             /** @var \Klaravik\Page\MarketWpClient $marketWordPressClient */
  320.             $marketWordPressClient $container->get(\Klaravik\Page\MarketWpClient::class);
  321.             echo $marketWordPressClient->getPageHTML($pageObject$propUserData$jsParams$dataLayercompact(
  322.                 'title',
  323.                 'keywords',
  324.                 'description',
  325.                 'ogImage',
  326.                 'shortTitle',
  327.             ));
  328.             die;
  329.         }
  330.     } catch (RepositoryException $e) {
  331.     }
  332. }
  333. if (!empty($_REQUEST["produrlname"]) && isset($products_id)) {
  334.     $prodtQuery "SELECT p.page_title, pd.name, p.meta_keyword, p.meta_description, p.categories_id, p.vendors_id, p.resprice, p.auctionend FROM products p LEFT JOIN products_description pd on p.id=pd.products_id WHERE p.id='" mysqli_real_escape_string($db$products_id) . "'";
  335.     $prodtResult mysqli_query($db$prodtQuery);
  336.     if (mysqli_num_rows($prodtResult) == 0) {
  337.         $prodtQuery "SELECT p.page_title, pd.name, p.meta_keyword, p.meta_description, p.categories_id, p.vendors_id, p.resprice, p.auctionend FROM products_archive p LEFT JOIN products_description pd on p.id=pd.products_id WHERE p.id='" mysqli_real_escape_string($db$products_id) . "'";
  338.         $prodtResult mysqli_query($db$prodtQuery);
  339.     }
  340.     if (mysqli_num_rows($prodtResult) > 0) {
  341.         $prodt mysqli_fetch_object($prodtResult);
  342.         if ($prodt->page_title !== '') {
  343.             $title $prodt->page_title;
  344.             $shortTitle $prodt->page_title;
  345.         } elseif (!empty($prodt->name)) {
  346.             $title $trans->get("ALIAS_TITLE_PREFIX_OBJECT") . " " $prodt->name;
  347.             $shortTitle $prodt->name;
  348.         }
  349.         if (!empty($prodt->meta_keyword)) {
  350.             $keywords $prodt->meta_keyword;
  351.         }
  352.         if (!empty($prodt->meta_description)) {
  353.             $description $trans->get("ALIAS_DESCRIPTION_PREFIX_OBJECT") . " " $prodt->meta_description;
  354.         } elseif (!empty($prodt->name)) {
  355.             $description $trans->get("ALIAS_DESCRIPTION_PREFIX_OBJECT") . " " $prodt->name;
  356.         }
  357.         $curBid null;
  358.         $bidSql "SELECT bid FROM bids WHERE products_id=" . (int) $products_id " ORDER BY bid DESC LIMIT 1";
  359.         $bidRes mysqli_query($db$bidSql);
  360.         if (mysqli_num_rows($bidRes)) {
  361.             $bid mysqli_fetch_object($bidRes);
  362.             $curBid $bid->bid;
  363.         }
  364.         $resPriceReached false;
  365.         if ((($curBid !== null && ($curBid >= $prodt->resprice && $prodt->resprice 0)) || ($curBid $prodt->resprice && $prodt->resprice == 0)) || $prodt->resprice == 0) {
  366.             $resPriceReached true;
  367.         }
  368.         $categoriesToImplode = array();
  369.         foreach ($categoriesObject->getPublicThreeForCategory($prodt->categories_id) as $categoryItem) {
  370.             $categoriesToImplode[] = $categoryItem->getName();
  371.         }
  372.         try {
  373.             $productHasEnded = (new DateTime()) > (new DateTime($prodt->auctionend));
  374.         } catch (Exception $e) {
  375.             $productHasEnded false;
  376.         }
  377.         $dataLayer['view'] = (int) $products_id;
  378.         $dataLayer['product'] = array(
  379.             'productsId' => (int) $products_id,
  380.             'categoriesId' => (int) $prodt->categories_id,
  381.             'categoryName' => implode('>'$categoriesToImplode),
  382.             'vendorsId' => (int) $prodt->vendors_id,
  383.             'name' => $prodt->name,
  384.             'resPriceReached' => $resPriceReached,
  385.             'zeroReserve' => === (int)$prodt->resprice,
  386.             'ended' => $productHasEnded,
  387.         );
  388.     }
  389. }
  390. $validRequestPage = [
  391.     "login",
  392.     "register",
  393.     "register_thanks",
  394.     "activate",
  395.     "forgot",
  396.     "editcustomer",
  397.     "trustpilot",
  398.     "faq",
  399.     "vendorRegistration",
  400.     "about",
  401.     "howtobuy",
  402.     "howtosell",
  403.     "allrealtors",
  404.     "contactrealtor",
  405.     "buyer",
  406.     "favorites",
  407.     "swish",
  408.     "exportdocuments",
  409.     "requestAdvance",
  410.     "requestAdvanceNo",
  411.     "vendor",
  412.     "ui-lib",
  413.     "404",
  414.     "english",
  415.     "kopinfo",
  416.     "savedSearch",
  417.     "saljinfo",
  418.     "app-download",
  419.     "text",
  420.     "form_thanks",
  421.     "auction",
  422.     "financing",
  423.     "finansiering",
  424.     "contact",
  425.     "dac7",
  426. ];
  427. if (isset($_REQUEST["page"]) && !in_array($_REQUEST["page"], $validRequestPage)) {
  428.     $_REQUEST['page'] = "404";
  429. }
  430. if (isset($_REQUEST['page']) && (string) $_REQUEST["page"] === "404") {
  431.     header("HTTP/1.1 404 Not Found");
  432.     $title $trans->get('error_page_not_found_title');
  433. }
  434. if (isset($_REQUEST['catid']) && (int) $_REQUEST['catid']) {
  435.     $categoryModel $categoriesObject->getCategory($_REQUEST['catid']);
  436.     if ($categoryModel->getHeadtitle() !== '') {
  437.         $title $shortTitle $categoryModel->getHeadtitle();
  438.     }
  439.     if ($categoryModel->getMetadescription() !== '') {
  440.         $description $categoryModel->getMetadescription();
  441.     }
  442. }
  443. if (DEV_MODE) {
  444.     $title basename(__DIR__) . ' ' $title;
  445. }
  446. global $includedJavaScript;
  447. $includedJavaScript = array();
  448. function includeJS($string$inline false)
  449. {
  450.     global $includedJavaScript;
  451.     $includedJavaScript[] = array(
  452.         'string' => $string,
  453.         'inline' => $inline
  454.     );
  455. }
  456. global $includedCSS;
  457. $includedCSS = array();
  458. function includeCSS($url$media "screen")
  459. {
  460.     global $includedCSS;
  461.     $includedCSS[] = array(
  462.         'url' => $url,
  463.         'media' => $media
  464.     );
  465. }
  466. $manifestAssets->add('bundle-checkBrowser');
  467. /*
  468.  * make sure that $currentpage also considers clienttype so we can
  469.  * differentiate register pages and what assets to include separately by clienttype
  470.  */
  471. $currentPage 'home';
  472. if (isset($_REQUEST['page'])) {
  473.     $currentPage $_REQUEST['page'];
  474.     if (isset($_REQUEST['clienttype'])) {
  475.         $currentPage .= '_' $_REQUEST['clienttype'];
  476.     }
  477. }
  478. $additionalBodyClass = [];
  479. // All css included before this is set as default.
  480. switch ($currentPage) {
  481.     case "contactrealtor":
  482.     case "howtosell":
  483.         includeCSS('/css/vendors/mapbox-gl@v1.10.1.css');
  484.         break;
  485.     case "requestAdvance":
  486.         $manifestAssets->add('bundle-common');
  487.         break;
  488.     case "vendor":
  489.         includeCSS('/css/jquery-ui.min.css');
  490.         includeCSS('/css/jquery.qtip.css');
  491.         includeCSS('/css/select2.min.css');
  492.         break;
  493.     case "annons":
  494.     case "404":
  495.     case "english":
  496.     case "kopinfo":
  497.     case "saljinfo":
  498.     case "text":
  499.     case "form_thanks":
  500.         $manifestAssets->add('bundle-common');
  501.         break;
  502.     case "auction":
  503.         // page_product || page_list
  504.         includeCSS('/css/page-product.css');
  505.         if (isset($products_id)) {
  506.             // page_product.phtml
  507.             includeCSS('/css/jquery-ui.min.css');
  508.             // Single-product
  509.             $manifestAssets
  510.                 ->add('shared')
  511.                 ->add('bundle-single-product');
  512.             $additionalBodyClass array_merge($additionalBodyClass, ['page''product']);
  513.         } else {
  514.             // page_list
  515.             $additionalBodyClass array_merge($additionalBodyClass, ['page''product''list']);
  516.         }
  517.         break;
  518.     case "financing":
  519.         // page_financing
  520.         includeCSS('/css/jquery-ui.min.css');
  521.         break;
  522.     case "home":
  523.         // home - page_list
  524.         $additionalBodyClass array_merge($additionalBodyClass, ['page''all''product''list']);
  525.         break;
  526.     case "vendorRegistration":
  527.         includeCSS('/css/jquery-ui.min.css');
  528.         $manifestAssets
  529.             ->add('bundle-common')
  530.             ->add('shared')
  531.             ->add('bundle-register-new-seller');
  532.         break;
  533.     case "favorites":
  534.         includeCSS('/css/page-product.css');
  535.         $additionalBodyClass array_merge($additionalBodyClass, ['auction''page''list']);
  536.         break;
  537.     case "savedSearch":
  538.         $manifestAssets->add('bundle-common')->add("shared")->add("bundle-saved-search");
  539.         break;
  540.     case "dac7":
  541.         includeCSS('/css/jquery-ui.min.css');
  542.         break;
  543.     default:
  544.         // prints "Unknown page.\n";
  545.         // Should not be handled as default for css.
  546.         break;
  547. }
  548. $products_id $products_id ?? null;
  549. /** @var Twig\Environment $twigEnvironment */
  550. $twigEnvironment $container->get('twig');
  551. ?>
  552. <!DOCTYPE html>
  553. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $parameters->get('app.lang'); ?>"
  554.     lang="<?php echo $parameters->get('app.lang'); ?>">
  555. <head>
  556.     <script type="text/javascript">
  557.         window.cachedCategories = <?php echo json_encode($cachedCategories->loadCachedCategories()); ?>;
  558.         window.params = <?php echo json_encode($jsParams); ?>;
  559.         dataLayer = [<?php echo json_encode($dataLayer); ?>];
  560.         savedSearchURL = '<?php echo $urlGenerator->generate('app.buyer.saved.savedSearch'); ?>';
  561.     </script>
  562.     <?php
  563.     if (array_key_exists("preview"$_REQUEST)) {
  564.         ?>
  565.         <meta name="robots" content="noindex">
  566.         <?php
  567.     }
  568.     includeJS('/assets/js/modernizr.js');
  569.     echo $twigEnvironment->render('public/head.html.twig'compact(
  570.         'title',
  571.         'keywords',
  572.         'description',
  573.         'ogImage',
  574.         'shortTitle',
  575.         'products_id',
  576.         'includedCSS',
  577.         'currentPage',
  578.         'manifestAssets',
  579.     ));
  580.     ?>
  581. </head>
  582. <?php
  583. $skipChat true;
  584. if (ZENDESKCHAT) {
  585.     $skipChat false;
  586.     if (!empty($_SESSION["users_id"])) {
  587.         $userObj getNodei($db"users"$_SESSION["users_id"]);
  588.         if ($userObj->auth_user != "") {
  589.             $skipChat true;
  590.         }
  591.     }
  592. }
  593. // Check if buyer has all necessary SESSIONS, if not log out the buyer.
  594. if (isset($_SESSION["register_id"]) && !isRegisterSignedIn()) {
  595.     unsetRegisterSessions();
  596.     header('Location: /');
  597. }
  598. if (
  599.     $parameters->get('app.bankid.enable') &&
  600.     isset($_SESSION['register_id']) &&
  601.     $_SESSION['bankIDActive'] === false &&
  602.     isset($_SESSION['register_clientType']) &&
  603.     !in_array($_SESSION['register_clientType'], ['UF''UP']) &&
  604.     !$_SESSION['exceptRequiredAuthentication']
  605. ) {
  606.     $additionalBodyClass[] = 'user-bankid-verification';
  607. }
  608. if ($pagetype) {
  609.     print "<body class=\"" htmlspecialchars($pagetype) . " " implode(' '$additionalBodyClass) . "\">\n";
  610. } elseif (isset($_REQUEST["page"])) {
  611.     /**
  612.      * if register pages, give class name of .register and .register_{type}
  613.      ** (seems to be register pages and register/thank-you pages)
  614.      * else only $_REQUEST['page'] as classname (pages without clienttype set)
  615.      */
  616.     print "<body class=\"
  617.         " . (isset($_REQUEST["clienttype"]) ? htmlspecialchars($_REQUEST["page"]) . "
  618.         " htmlspecialchars($_REQUEST["page"]) . "_" $_REQUEST["clienttype"] : htmlspecialchars($_REQUEST["page"]))
  619.         . (isset($_REQUEST['specialcat']) ? ' ' htmlspecialchars($_REQUEST['specialcat']) : '')
  620.         . (isset($categoriesUrl) ? ' ' $categoriesUrl '')
  621.         . (isset($_REQUEST['vendortab']) ? ' ' htmlspecialchars($_REQUEST['vendortab']) : '')
  622.         . ' ' implode(' '$additionalBodyClass) . "
  623.     \">\n";
  624. } else {
  625.     print "<body class=\"frontpage " implode(' '$additionalBodyClass) . "\">\n";
  626. }
  627. if (!DEV_MODE && !empty($parameters->get('gtm.id'))) {
  628.     ?>
  629.     <!-- Google Tag Manager (noscript) -->
  630.     <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo $parameters->get('gtm.id'); ?>" height="0"
  631.             width="0" style="display:none;visibility:hidden"></iframe></noscript>
  632.     <!-- End Google Tag Manager (noscript) -->
  633.     <?php
  634. } elseif (DEV_MODE && !empty($parameters->get('gtm.id.dev'))) {
  635.     $gitString '';
  636.     $branchName 'master';
  637.     if (is_file(PROJECT_ROOT '/.git/HEAD')) {
  638.         $gitString file_get_contents(PROJECT_ROOT '/.git/HEAD'FILE_USE_INCLUDE_PATH);
  639.         $branchName rtrim(preg_replace("/(.*?\/){2}/"''$gitString));
  640.     }
  641.     $branch_cookie $_COOKIE['devBranch'] ?? '';
  642.     ?>
  643.     <!-- Google Tag Manager (noscript) -->
  644.     <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo $parameters->get('gtm.id.dev'); ?>"
  645.             height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  646.     <!-- End Google Tag Manager (noscript) -->
  647.     <?php
  648.     $twig->display('dev/dev_menu.html.twig', [
  649.         "devMenu" => new Dev\DevMenuController(),
  650.         "branchCookie" => $branch_cookie,
  651.         "branchName" => $branchName,
  652.     ]);
  653. }
  654. ?>
  655. <script>
  656.     let isInitialized = false;
  657.     const kLocale = window.params.klocale;
  658.     const kLanguage = window.params.klanguage;
  659. </script>
  660. <?php
  661. $propSearchtext "";
  662. if (!empty($_REQUEST['searchtext'])) {
  663.     $propSearchtext $_REQUEST['searchtext'];
  664. }
  665. $propSearchtext urldecode($propSearchtext);
  666. $requestSetCountyFlag $_REQUEST['setcountyflag'] ?? null;
  667. $setCountyFlagData = [];
  668. if ($requestSetCountyFlag) {
  669.     $setCountyFlagData[] = $requestSetCountyFlag;
  670.     if (is_array($requestSetCountyFlag)) {
  671.         $setCountyFlagData $requestSetCountyFlag;
  672.     }
  673.     $setCountyFlagData array_filter($setCountyFlagData, fn($v) => (is_numeric($v) || "all" === $v));
  674. }
  675. $requestSetMunicipality $_REQUEST['setmunicipality'] ?? null;
  676. $setMunicipalityData = [];
  677. if ($requestSetMunicipality) {
  678.     $setMunicipalityData[] = $requestSetMunicipality;
  679.     if (is_array($requestSetMunicipality)) {
  680.         $setMunicipalityData $requestSetMunicipality;
  681.     }
  682.     $setMunicipalityData array_filter($setMunicipalityData, fn($v) => (is_numeric($v) || "all" === $v || "countyclose" === $v));
  683. }
  684. if ($propMultiUser):
  685.     $multiAccounts = [
  686.         [
  687.             'title' => $trans->get('text_label_app-index_company-accounts'),
  688.             'data' => $multiRegisterCollection->getCompanyTypes(),
  689.         ],
  690.         [
  691.             'title' => $trans->get('text_label_app-index_private-account'),
  692.             'data' => $multiRegisterCollection->getPrivateTypes(),
  693.         ]
  694.     ];
  695.     $lockedCss = !isset($_SESSION['register_id']) && !isset($_SESSION['users_id']) ? 'show lock' '';
  696.     ?>
  697.     <!--Modal account-switcher-->
  698.     <div class="account-switcher <?php echo $lockedCss?>" id="account-switcher">
  699.         <div class="account-switcher__container" id="modal-container">
  700.             <div class="account-switcher__close-modal" id="account-switcher-close">
  701.                 <i class="ri-close-fill"></i>
  702.             </div>
  703.             <div class="account-switcher__flex">
  704.                 <div class="account-switcher__inner">
  705.                     <div class="account-switcher__icon">
  706.                         <i class="ri-arrow-left-right-line"></i>
  707.                     </div>
  708.                     <div class="row">
  709.                         <div class="small-10 small-offset-1 medium-12 medium-offset-0">
  710.                             <div class="account-switcher__header">
  711.                                 <span
  712.                                     class="account-switcher__headline"><?php $trans->eGet('text_headline_app-index_account-switcher'); ?></span>
  713.                             </div>
  714.                         </div>
  715.                     </div>
  716.                     <div class="account-switcher__accounts">
  717.                         <div class="account-switcher__account-group">
  718.                             <div class="account-switcher__account-title">
  719.                                 <?php $trans->eGet('text_label_app-index_buyer-accounts'); ?>:
  720.                             </div>
  721.                             <?php
  722.                             /** @var RegisterCollection $multiAccount */
  723.                             foreach ($multiAccounts as $multiAccount):
  724.                                 if (!$multiAccount['data']->count()) {
  725.                                     continue;
  726.                                 }
  727.                                 ?>
  728.                                 <?php
  729.                                 /** @var \Klaravik\Model\Register $accountData */
  730.                                 foreach ($multiAccount['data'] as $accountData):
  731.                                     $clientTypeString $trans->get(
  732.                                         'text_label_app-index_client-type',
  733.                                         ['clientType' => $accountData->getClienttype()]
  734.                                     );
  735.                                     if ($accountData->getClienttype() === 'SF' && $accountData->isSoleProprietorship()) {
  736.                                         $clientTypeString $trans->get(
  737.                                             'text_label_app-index_client-type',
  738.                                             ['clientType' => 'EF']
  739.                                         );
  740.                                     }
  741.                                     $inactiveAccount '';
  742.                                     if (!$accountData->getActive()) {
  743.                                         $clientTypeString $trans->get('text_label_app-index_inactive-account');
  744.                                         $inactiveAccount 'inactive';
  745.                                     }
  746.                                     switch ($accountData->getClienttype()) {
  747.                                         case "SF":
  748.                                             $icon 'ri-home-smile-fill';
  749.                                             // Check if EF.
  750.                                             if ($accountData->isSoleProprietorship()) {
  751.                                                 $icon 'ri-user-smile-fill';
  752.                                             }
  753.                                             break;
  754.                                         case "SP":
  755.                                             $icon 'ri-user-fill';
  756.                                             break;
  757.                                     }
  758.                                     $activeAccount '';
  759.                                     $switchUserIcon 'ri-arrow-right-line';
  760.                                     $disableSwitch 'submitFunction(this);';
  761.                                     if ($accountData->getId() === (int) ($_SESSION['register_id'] ?? 0)) {
  762.                                         $activeAccount 'active';
  763.                                         $switchUserIcon 'ri-check-fill';
  764.                                         $disableSwitch 'return false';
  765.                                     }
  766.                                     ?>
  767.                                     <div class="">
  768.                                         <?php
  769.                                         echo <<<HTML
  770.                             <form class="account-switcher__form" action="{$urlGenerator->generate(
  771.                                                 'app.legacy.index',
  772.                                                 array_merge(
  773.                                                     ['doSwitchUser' => (int) $accountData->getId(), 'userType' => 'register'],
  774.                                                     $continueUrlParams
  775.                                                 ),
  776.                                                 UrlGeneratorInterface::ABSOLUTE_URL
  777.                                             )}" method="post">
  778.                             HTML;
  779.                                         ?>
  780.                                         <div class="account-switcher__account <?php echo $activeAccount;
  781.                                         echo $inactiveAccount ?>">
  782.                                             <span class="account-switcher__account-icon <?php echo $activeAccount?>">
  783.                                                 <i class="<?php echo $icon?>"></i>
  784.                                             </span>
  785.                                             <span class="account-switcher__user-and-type">
  786.                                                 <div class="account-switcher__user-name <?php echo $inactiveAccount?>">
  787.                                                     <?php echo $accountData->getRegisterName(); ?>
  788.                                                 </div>
  789.                                                 <div class="account-switcher__client-type <?php echo $inactiveAccount?>">
  790.                                                     <?php echo $clientTypeString?>
  791.                                                 </div>
  792.                                             </span>
  793.                                             <?php if ($accountData->getActive()) { ?>
  794.                                                 <span class="account-switcher__icon-switch <?php echo $activeAccount?>">
  795.                                                     <i class="<?php echo $switchUserIcon?>"></i>
  796.                                                 </span>
  797.                                                 <div class="account-switcher__icon-loader"
  798.                                                     data-src="/images/lottie-animations/loader.json"></div>
  799.                                             <?php } else {
  800.                                                 // TODO: Should be an ajax-request to the endpoint /api/buyer/{register_id}/activation/send
  801.                                                 echo '<span class="account-switcher__activation-link" id="send-activation-button" data-registerid="' $accountData->getId() . '">
  802.                                     <span class="mail-icon-text"><i class="ri-mail-send-line"></i>' $trans->get("text_label_app-index_account-switcher_send-verification-mail") . '</span>
  803.                                   </span>';
  804.                                             } ?>
  805.                                         </div>
  806.                                         </form>
  807.                                     </div>
  808.                                 <?php endforeach; ?>
  809.                             <?php endforeach; ?>
  810.                         </div>
  811.                         <?php if (!empty($multiUserCollection->toArray())) { ?>
  812.                             <div class="account-switcher__account-group">
  813.                                 <div class="account-switcher__account-title">
  814.                                     <?php $trans->eGet('text_label_app-index_vendor-accounts'?>:
  815.                                 </div>
  816.                                 <?php
  817.                                 foreach ($multiUserCollection as $userAccount):
  818.                                     // Todo:
  819.                                     // active
  820.                                     // Form action till switcher
  821.                                     $currentAccount '';
  822.                                     if ($userAccount->getId() === (int) ($_SESSION['users_id'] ?? 0)) {
  823.                                         $currentAccount '->';
  824.                                     }
  825.                                     ?>
  826.                                     <?php
  827.                                     $inactiveAccount '';
  828.                                     if (!$userAccount->getActive()) {
  829.                                         $clientTypeString $trans->get('text_label_app-index_inactive-account');
  830.                                         $inactiveAccount 'inactive';
  831.                                     }
  832.                                     $activeAccount '';
  833.                                     $icon 'ri-briefcase-5-fill';
  834.                                     $switchUserIcon 'ri-arrow-right-line';
  835.                                     $disableSwitch 'submitFunction(this);';
  836.                                     if ($userAccount->getId() === (int) ($_SESSION['users_id'] ?? 0)) {
  837.                                         $activeAccount 'active';
  838.                                         $switchUserIcon 'ri-check-fill';
  839.                                         $disableSwitch 'return false';
  840.                                     }
  841.                                     ?>
  842.                                     <div>
  843.                                         <?php
  844.                                         $postUrlForm $urlGenerator->generate(
  845.                                             'app.legacy.index',
  846.                                             array_merge(
  847.                                                 ['doSwitchUser' => (int) $userAccount->getId(), 'userType' => 'user'],
  848.                                                 $continueUrlParams
  849.                                             ),
  850.                                             UrlGeneratorInterface::ABSOLUTE_URL
  851.                                         );
  852.                                         ?>
  853.                                         <form class="account-switcher__form" action="<?php echo $postUrlForm?>" method="post">
  854.                                             <div class="account-switcher__account <?php echo $activeAccount;
  855.                                             echo $inactiveAccount ?>">
  856.                                                 <span class="account-switcher__account-icon <?php echo $activeAccount?>">
  857.                                                     <i class="<?php echo $icon?>"></i>
  858.                                                 </span>
  859.                                                 <span class="account-switcher__user-and-type">
  860.                                                     <div class="account-switcher__user-name <?php echo $inactiveAccount?>">
  861.                                                         <?php echo $userAccount->getName(); ?>
  862.                                                     </div>
  863.                                                     <div class="account-switcher__client-type <?php echo $inactiveAccount?>">
  864.                                                         <?php $trans->eGet('text_label_app-index_clienttype_vendor'); ?>
  865.                                                     </div>
  866.                                                 </span>
  867.                                                 <?php if ($userAccount->getActive()) { ?>
  868.                                                     <span class="account-switcher__icon-switch <?php echo $activeAccount?>">
  869.                                                         <i class="<?php echo $switchUserIcon?>"></i>
  870.                                                     </span>
  871.                                                     <div class="account-switcher__icon-loader"
  872.                                                         data-src="/images/lottie-animations/loader.json"></div>
  873.                                                 <?php ?>
  874.                                             </div>
  875.                                         </form>
  876.                                     </div>
  877.                                 <?php endforeach; ?>
  878.                             </div>
  879.                         <?php ?>
  880.                     </div>
  881.                 </div>
  882.             </div>
  883.             <a class="account-switcher__logout" id="account-switcher-button" href="<?php echo ($propUser === 'seller'
  884.                 $urlGenerator->generate('app.legacy.pages.vendor.logout')
  885.                 : $urlGenerator->generate('app.legacy.pages.buyer.logout')); ?>">
  886.                 <span>
  887.                     <span class="icon">
  888.                         <i class="ri-logout-circle-r-line"></i>
  889.                     </span>
  890.                     <?php $trans->eGet('text_label_app-index_log-out'); ?>
  891.                 </span>
  892.             </a>
  893.         </div>
  894.     </div>
  895. <?php endif; ?>
  896. <!-- End of account-switcher modal -->
  897. <div class="header">
  898.     <div class="topbar">
  899.         <div class="topbar__wrapper">
  900.             <div class="topbar__left-links">
  901.                 <!-- todo: i18n - maybe need to be another type of page -->
  902.                 <a class="left-link left-link__black contact-link" href="<?php echo $urlGenerator->generate(
  903.                     'app.legacy.pages.contact'
  904.                 ); ?>">
  905.                     <span></span>
  906.                     <?php $trans->eGet('text_label_app-index_header-contact-us'); ?>
  907.                 </a>
  908.                 <a class="left-link left-link__black faq-link"
  909.                     href="<?php echo $urlGenerator->generate('app.legacy.pages.faq'); ?>">
  910.                     <span></span><?php $trans->eGet('text_label_app-index_header-faq'); ?>
  911.                 </a>
  912.                 <span class="divider-bar"></span>
  913.                 <a class="left-link left-link__green auction-link"
  914.                     href="<?php echo $urlGenerator->generate('app.legacy.auction.listing'); ?>">
  915.                     <span></span><?php $trans->eGet('text_label_app-index_header-all-auctions'); ?>
  916.                 </a>
  917.                 <a class="left-link left-link__green no-reserve-link"
  918.                    href="<?php echo $urlGenerator->generate('app.legacy.auction.listing', ['reserve' => 'none']); ?>">
  919.                     <span></span><?php $trans->eGet('text_label_app-index_header-no-reserve-auctions'); ?>
  920.                 </a>
  921.             </div>
  922.             <div class="topbar__right-links">
  923.                 <!-- Not lopgged in -->
  924.                 <?php if (!$propLogged): ?>
  925.                     <a class="button--small button--rounded button--secondary register-link"
  926.                         href="<?php echo $urlGenerator->generate('app.legacy.pages.register'); ?>">
  927.                         <i class="ri-user-add-line"></i><?php $trans->eGet('text_label_app-index_header-create-account'); ?>
  928.                     </a>
  929.                     <a class="right-link right-link__primary login-link"
  930.                         href="<?php echo $urlGenerator->generate('app.legacy.pages.login'$continueUrlParams); ?>">
  931.                         <i class="ri-user-fill"></i><?php $trans->eGet('text_label_app-index_header-login'); ?>
  932.                     </a>
  933.                 </div>
  934.                 <!--Vendor, single buyer-->
  935.             <?php elseif (in_array($propUser, ['buyer''seller']) && !$propMultiUser): ?>
  936.                 <div class="topbar__userinfo">
  937.                     <ul class="topbar__userinfo-dropdown">
  938.                         <li>
  939.                             <a href="<?php echo ($propUser === 'seller'
  940.                                 $urlGenerator->generate('app.legacy.pages.vendor.logout')
  941.                                 : $urlGenerator->generate('app.legacy.pages.buyer.logout')); ?>">
  942.                                 <?php $trans->eGet('text_label_app-index_log-out'); ?>
  943.                             </a>
  944.                         </li>
  945.                     </ul>
  946.                     <div class="topbar__userinfo-trigger">
  947.                         <a href="<?php echo ($propUser === 'seller'
  948.                             $urlGenerator->generate('app.legacy.pages.vendor')
  949.                             : $urlGenerator->generate('app.legacy.pages.buyer')); ?>">
  950.                             <span class="user-name"> <?php echo $propUserName?></span>
  951.                             <span class="client-type"> <?php echo $propAlias?></span>
  952.                         </a>
  953.                     </div>
  954.                 </div>
  955.                 <!--Multi-->
  956.             <?php else: ?>
  957.                 <div class="topbar__userinfo-trigger multi">
  958.                     <a id="user-info">
  959.                         <span class="user-name"> <?php echo $propUserName?></span>
  960.                         <span class="client-type"><?php echo $propAlias?></span>
  961.                     </a>
  962.                 </div>
  963.                 <div class="topbar__account-switcher" id="account-switcher-opener">
  964.                     <i class="ri-arrow-left-right-line ri-1x"></i>
  965.                 </div>
  966.             <?php endif;
  967.                 // buyer
  968.                 $savedURL $urlGenerator->generate('app.legacy.pages.buyer.saved.favorites');
  969.                 if (isset($_COOKIE['savedURL'])) {
  970.                     $savedURL $_COOKIE['savedURL'];
  971.                 }
  972.                 if ($propLogged && $propUser === 'buyer'): ?>
  973.                 <span class="divider-bar" id="right-divider"></span>
  974.                 <a class="button--small button--rounded button--secondary favorites-link" href="<?php echo $savedURL ?>">
  975.                     <span></span><?php $trans->eGet('text_label_app-index_saved'); ?>
  976.                 </a>
  977.             <?php endif; ?>
  978.             <?php if ($propLogged): ?>
  979.                 <a class="right-link right-link__primary login-link" href="<?php echo ($propUser === 'seller'
  980.                     $urlGenerator->generate('app.legacy.pages.vendor')
  981.                     : $urlGenerator->generate('app.legacy.pages.buyer')); ?>">
  982.                     <i class="ri-user-fill"></i><?php $trans->eGet('text_label_app-index_my-account'); ?>
  983.                 </a>
  984.             </div>
  985.         <?php endif; ?>
  986.     </div>
  987. </div>
  988. <div class="middlebar">
  989.     <a class="main-logo" href="<?php echo $urlGenerator->generate('app.legacy.index'); ?>" aria-label="">
  990.         <svg id="klaravik-logo" xmlns="http://www.w3.org/2000/svg" width="376" height="59.714" viewBox="0 0 376 59.714">
  991.             <g transform="translate(0 -0.05)">
  992.                 <g id="Group_2348" data-name="Group 2348" transform="translate(242.111 1.482)">
  993.                     <path id="Path_872" data-name="Path 872"
  994.                         d="M490.519,59.885h15.332V2.6H490.519ZM486.138,2.6H470.525L459.181,29.277,447.443,2.6H431.1l26.957,57.9c.281.505.786.505,1.011,0Z"
  995.                         transform="translate(-431.1 -2.6)" fill="#fff" />
  996.                 </g>
  997.                 <g id="Group_2349" data-name="Group 2349" transform="translate(55.487 1.482)">
  998.                     <path id="Path_873" data-name="Path 873" d="M114.132,46.967V2.6H98.8V59.885h33.528l6.122-12.917Z"
  999.                         transform="translate(-98.8 -2.6)" fill="#fff" />
  1000.                 </g>
  1001.                 <g id="Group_2350" data-name="Group 2350" transform="translate(0 1.482)">
  1002.                     <path id="Path_874" data-name="Path 874" d="M50.265,52.5,40.1,64.575,51.388,81.76H69.472Z"
  1003.                         transform="translate(-17.579 -24.475)" fill="#fff" />
  1004.                     <path id="Path_875" data-name="Path 875"
  1005.                         d="M36.673,19.5,49.647,2.6H33.023L15.332,26.356V2.6H0V59.885H15.332V44.946C16.961,43.036,36.673,19.5,36.673,19.5Z"
  1006.                         transform="translate(0 -2.6)" fill="#fff" />
  1007.                 </g>
  1008.                 <g id="Group_2351" data-name="Group 2351" transform="translate(324.163 1.482)">
  1009.                     <path id="Path_876" data-name="Path 876" d="M627.365,52.5,617.2,64.575,628.488,81.76h18.084Z"
  1010.                         transform="translate(-594.735 -24.475)" fill="#fff" />
  1011.                     <path id="Path_877" data-name="Path 877"
  1012.                         d="M613.817,19.5,626.791,2.6H610.223L592.532,26.356V2.6H577.2V59.885h15.332V44.946C594.1,43.036,613.817,19.5,613.817,19.5Z"
  1013.                         transform="translate(-577.2 -2.6)" fill="#fff" />
  1014.                 </g>
  1015.                 <path id="Path_878" data-name="Path 878"
  1016.                     d="M319.628,25.065c0-12.692-8.705-22.465-24.093-22.465h-2.359V15.573h1.573c6.908,0,9.435,3.987,9.435,9.547s-2.527,9.435-9.435,9.435h-5.616V15.573h0V2.6H273.8V59.885h15.332V46.743h5.729l7.975,13.142H319.4L309.182,43.6C316.033,39.891,319.628,33.32,319.628,25.065Z"
  1017.                     transform="translate(-120.03 -1.118)" fill="#fff" />
  1018.                 <path id="Path_879" data-name="Path 879"
  1019.                     d="M195.423.471c-.281-.562-.73-.562-1.011,0L166.5,58.767h15l12.749-29.653,5.9,13.31h-7.189l-4.886,11.457H205.2l2.19,4.886h15.838Z"
  1020.                     transform="translate(-72.991 0)" fill="#fff" />
  1021.                 <path id="Path_880" data-name="Path 880"
  1022.                     d="M389.323.471c-.281-.562-.73-.562-1.011,0L360.4,58.767h15l12.749-29.653,5.9,13.31h-7.189l-4.886,11.457H399.1l2.19,4.886h15.838Z"
  1023.                     transform="translate(-157.995 0)" fill="#fff" />
  1024.             </g>
  1025.         </svg>
  1026.         <svg id="klaravik-icon-rgb" xmlns="http://www.w3.org/2000/svg" width="27.176" height="30"
  1027.             viewBox="0 0 27.176 30">
  1028.             <path id="Path_56433" data-name="Path 56433" d="M118.466,140.76l-5.309,6.338,5.9,8.991h9.485Z"
  1029.                 transform="translate(-101.362 -126.089)" fill="#008540" />
  1030.             <path id="Path_56434" data-name="Path 56434"
  1031.                 d="M19.193,8.866,25.985,0H17.294L8.029,12.441V0H0V30H8.029V22.191C8.868,21.176,19.193,8.866,19.193,8.866Z"
  1032.                 fill="#008540" />
  1033.         </svg>
  1034.     </a>
  1035.     <div id="category-links" class="category-links">
  1036.     </div>
  1037. </div>
  1038. <div class="bottombar">
  1039.     <div class="bottombar__wrapper">
  1040.         <form id="searchform" action="<?php echo $urlGenerator->generate('app.legacy.auction.listing'); ?>" method="get"
  1041.             class="searchform validate-form">
  1042.             <div class="form-field-3">
  1043.                 <div class="form-field-3__input-wrapper">
  1044.                     <input class="form-field-3__input-field validate-field" type="text" name="searchtext"
  1045.                         value="<?php echo htmlentities($propSearchtextENT_QUOTES ENT_HTML401'utf-8'?>"
  1046.                         placeholder="<?php $trans->eGet('text_label_app-index_top-search-placeholder'); ?>"
  1047.                         id="topsearch" />
  1048.                     <span class="form-clear-field"></span>
  1049.                 </div>
  1050.                 <div class="form-field-3__clear">
  1051.                     <button type="submit" value="" name="dosearch" class="form-field-3__button"
  1052.                         aria-label="<?php $trans->eGet('info_label_app-index_menu-search-aria-label'); ?>">
  1053.                         <img src="/images/icon-search-white.svg" height="19" width="19" class="subscription-arrow"
  1054.                             alt="<?php $trans->eGet('text_label_app-index_magnifying-glass'); ?>">
  1055.                     </button>
  1056.                 </div>
  1057.             </div>
  1058.         </form>
  1059.         <div class="bottombar__links">
  1060.             <a class="link link__green closed-link"
  1061.                 href="<?php echo $urlGenerator->generate('app.legacy.auction.listing.closed'); ?>">
  1062.                 <span></span><?php $trans->eGet('text_label_app-index_header-closed-auctions'); ?>
  1063.             </a>
  1064.             <a href="<?php echo $urlGenerator->generate('app.legacy.pages.howtosell'); ?>" id="salesButton"
  1065.                 class="salesButton button--medium button--rounded button--outlined">
  1066.                 <span><?php $trans->eGet('text_label_app-index_klaravik-sales'); ?></span>
  1067.             </a>
  1068.         </div>
  1069.     </div>
  1070. </div>
  1071. </div>
  1072. <div class="row hamburger-position-bar">
  1073.     <div class="columns small-8 mobile-logo">
  1074.         <a href="<?php echo $urlGenerator->generate('app.legacy.index'); ?>" id="logo">
  1075.             <svg xmlns="http://www.w3.org/2000/svg" width="232" height="36.844" viewBox="0 0 232 36.844">
  1076.                 <g id="Logo" transform="translate(0 -0.05)">
  1077.                     <g id="Group_2348" data-name="Group 2348" transform="translate(149.388 0.934)">
  1078.                         <path id="Path_872" data-name="Path 872"
  1079.                             d="M467.763,37.946h9.46V2.6h-9.46ZM465.06,2.6h-9.633l-7,16.46L441.184,2.6H431.1l16.633,35.727c.173.312.485.312.624,0Z"
  1080.                             transform="translate(-431.1 -2.6)" fill="#008540" />
  1081.                     </g>
  1082.                     <g id="Group_2349" data-name="Group 2349" transform="translate(34.237 0.934)">
  1083.                         <path id="Path_873" data-name="Path 873" d="M108.26,29.976V2.6H98.8V37.946h20.688l3.777-7.97Z"
  1084.                             transform="translate(-98.8 -2.6)" fill="#008540" />
  1085.                     </g>
  1086.                     <g id="Group_2350" data-name="Group 2350" transform="translate(0 0.934)">
  1087.                         <path id="Path_874" data-name="Path 874" d="M46.372,52.5,40.1,59.95l6.965,10.6H58.223Z"
  1088.                             transform="translate(-26.204 -35.208)" fill="#008540" />
  1089.                         <path id="Path_875" data-name="Path 875"
  1090.                             d="M22.628,13.03l8-10.43H20.376L9.46,17.258V2.6H0V37.946H9.46V28.728C10.465,27.55,22.628,13.03,22.628,13.03Z"
  1091.                             transform="translate(0 -2.6)" fill="#008540" />
  1092.                     </g>
  1093.                     <g id="Group_2351" data-name="Group 2351" transform="translate(200.015 0.934)">
  1094.                         <path id="Path_876" data-name="Path 876" d="M623.472,52.5,617.2,59.95l6.965,10.6h11.158Z"
  1095.                             transform="translate(-603.339 -35.208)" fill="#008540" />
  1096.                         <path id="Path_877" data-name="Path 877"
  1097.                             d="M599.793,13.03l8-10.43H597.576L586.66,17.258V2.6H577.2V37.946h9.46V28.728C587.63,27.55,599.793,13.03,599.793,13.03Z"
  1098.                             transform="translate(-577.2 -2.6)" fill="#008540" />
  1099.                     </g>
  1100.                     <path id="Path_878" data-name="Path 878"
  1101.                         d="M302.077,16.461c0-7.832-5.371-13.861-14.866-13.861h-1.455v8h.97c4.262,0,5.822,2.46,5.822,5.891s-1.559,5.822-5.822,5.822H283.26V10.6h0v-8H273.8V37.946h9.46V29.837h3.535l4.921,8.109h10.223L295.631,27.9C299.859,25.609,302.077,21.555,302.077,16.461Z"
  1102.                         transform="translate(-178.921 -1.666)" fill="#008540" />
  1103.                     <path id="Path_879" data-name="Path 879"
  1104.                         d="M184.346.31c-.173-.347-.45-.347-.624,0L166.5,36.279h9.252l7.866-18.3,3.639,8.213h-4.436l-3.015,7.069h10.569l1.351,3.015H201.5Z"
  1105.                         transform="translate(-108.803)" fill="#008540" />
  1106.                     <path id="Path_880" data-name="Path 880"
  1107.                         d="M378.246.31c-.173-.347-.451-.347-.624,0L360.4,36.279h9.252l7.866-18.3,3.639,8.213h-4.436l-3.015,7.069h10.569l1.351,3.015H395.4Z"
  1108.                         transform="translate(-235.512)" fill="#008540" />
  1109.                 </g>
  1110.             </svg>
  1111.         </a>
  1112.     </div>
  1113.     <div class="columns small-4 mobile-hamburger">
  1114.         <a href="#" class="hamburger-position-bar__icon" id="hamburger-position-bar__icon" aria-label="<?php echo $trans->get('text_label_app-mobile-menu-alt');?>">
  1115.             <div style="height:22px; width: 22px;" id="lottie-hamburger-menu" class="lottie-hamburger-menu"
  1116.                 data-src="/images/lottie-animations/hamburger-menu.json"></div>
  1117.         </a>
  1118.     </div>
  1119. </div>
  1120. <?php if ($parameters->get('app.instance') === 'dk' && date("Y-m-d") < "2024-03-18"): ?>
  1121.     <div id="topbar-fi">
  1122.         <p class="topbar-fi__text">
  1123.             Klaravik Finland er live! Nordens største onlineauktion for maskiner er netop blevet endnu større. Tag et kig pÃ¥
  1124.             udvalget og afgiv bud pÃ¥ klaravik.fi.
  1125.         </p>
  1126.         <a href="https://www.klaravik.fi/" target="_blank"
  1127.             class="topbar-fi__readmore button--small button--outlined button--outlined--highlight">Til klaravik.fi</a>
  1128.         <p href="#" id="topbar-fi__close" class="topbar-fi__icon"><i class="ri-close-line"></i></p>
  1129.     </div>
  1130. <?php endif; ?>
  1131. <!-- Mobile multi user, extra header bar  -->
  1132. <?php if ($propMultiUser): ?>
  1133.     <div class="multi-user-bar">
  1134.         <div class="multi-user-bar__flex">
  1135.             <div class="multi-user-bar__user-info" id="user-info-mobile">
  1136.                 <span class="users"><?php echo $propUserName?></span>
  1137.                 <span class="client-types"><?php
  1138.                 echo $trans->get(
  1139.                     'text_label_app-index_client-type',
  1140.                     ['clientType' => $_SESSION['register_clientType'] ?? '']
  1141.                 );
  1142.                 ?></span>
  1143.             </div>
  1144.             <div class="multi-user-bar__icons">
  1145.                 <span class="switch-account-icon" id="switch-account-mobile"><i class="ri-arrow-left-right-line"></i></span>
  1146.                 <span class="divider-mobile"></span>
  1147.                 <a class="my-likes" href="<?php echo $urlGenerator->generate('app.legacy.pages.buyer.saved.favorites'); ?>">
  1148.                     <span class="likes-icon">
  1149.                         <svg width="14" height="13" viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg">
  1150.                             <path
  1151.                                 d="M3.71741 0C2.75846 0 1.79672 0.394662 1.07777 1.17698C-0.36013 2.7416 -0.358383 5.22383 1.07777 6.78916C1.07777 6.78916 6.85697 13 6.9995 13C7.14203 13 11.0718 8.80698 12.9216 6.79477C14.3595 5.23014 14.3595 2.74686 12.9216 1.18258C11.4837 -0.382043 9.08578 -0.382043 7.64788 1.18258L7.00264 1.88358L6.35216 1.17733C5.63286 0.395012 4.67636 0 3.71741 0Z"
  1152.                                 fill="#222222" />
  1153.                         </svg>
  1154.                     </span>
  1155.                 </a>
  1156.                 <a class="my-account" href="<?php echo $urlGenerator->generate('app.legacy.pages.buyer'); ?>">
  1157.                     <span class="my-account-icon"><i class="ri-user-fill"></i></span>
  1158.                 </a>
  1159.             </div>
  1160.         </div>
  1161.     </div>
  1162. <?php endif;
  1163. $bankidBanner false;
  1164. // show banner on all non bankid verified users
  1165. // do not show this banner on buyer page in the info tab
  1166. if ($parameters->get('app.bankid.enable')) {
  1167.     if (
  1168.         (
  1169.             isset($_SESSION['register_id']) &&
  1170.             $_SESSION['bankIDActive'] === false &&
  1171.             isset($_SESSION['register_clientType']) &&
  1172.             !in_array($_SESSION['register_clientType'], ['UF''UP']) &&
  1173.             !$_SESSION['exceptRequiredAuthentication']
  1174.         ) &&
  1175.         (
  1176.             (isset($_REQUEST['page']) && $_REQUEST['page'] !== 'buyer')
  1177.             || (isset($_REQUEST['buyertab']) && $_REQUEST['buyertab'] !== 'info')
  1178.             || !isset($_REQUEST['page'])
  1179.         )
  1180.     ) {
  1181.         $bankidBanner true;
  1182.         ?>
  1183.         <a class="topbar-bankID" href="#">
  1184.             <span class="topbar-bankID__logo"><img src="/images/bankid_register.svg" alt="BankID"></span>
  1185.             <span class="topbar-bankID__text">Verifiera dig med BankID för att kunna lägga bud</span>
  1186.             <span class="topbar-bankID__icon"><i class="ri-arrow-right-line"></i></span>
  1187.         </a>
  1188.         <?php
  1189.         renderBankIdModal($trans);
  1190.         renderVerifyOverlay();
  1191.     } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] === 'vendor') {
  1192.         renderVerifyOverlay();
  1193.     }
  1194.     //bankid banner/modal endif
  1195. ?>
  1196. <div class="topbar_full <?php if ($propMultiUser)
  1197.     echo 'extra-margin' ?> <?php if ($bankidBanner)
  1198.     echo "extra-margin--bankid-banner"?>">
  1199.     <?php
  1200.     $pageListPath 'page_list.phtml';
  1201.     if ($parameters->get('redis.search.active')) {
  1202.         $pageListPath 'page_list_redis.php';
  1203.     }
  1204.     if (isset($_REQUEST["page"])) {
  1205.         $cfSiteKey $parameters->get('cf_turnstile_site');
  1206.         if ($_REQUEST["page"] == "login") {
  1207.             include("page_login.phtml");
  1208.         } elseif ($_REQUEST["page"] == "register") {
  1209.             if (isset($_REQUEST["clienttype"])) {
  1210.                 $manifestAssets->add('bundle-pages-register');
  1211.                 include("page_register.phtml");
  1212.             } else {
  1213.                 $manifestAssets->add('bundle-common');
  1214.                 include("page_register_choose_clienttype.php");
  1215.             }
  1216.         } elseif ($_REQUEST["page"] == "register_thanks") {
  1217.             $manifestAssets->add('bundle-common');
  1218.             include("page_register_thanks.phtml");
  1219.         } elseif ($_REQUEST["page"] == "activate") {
  1220.             include("page_activate.phtml");
  1221.         } elseif ($_REQUEST["page"] == "forgot") {
  1222.             include("page_forgot.phtml");
  1223.         } elseif ($_REQUEST["page"] == "editcustomer") {
  1224.             include("page_editcustomer.phtml");
  1225.         } elseif ($_REQUEST["page"] == "trustpilot") {
  1226.             include("page_trustpilot.php");
  1227.             $manifestAssets->add('bundle-trustpilot-showcase');
  1228.         } elseif ($_REQUEST["page"] == "faq") {
  1229.             include("page_faq.phtml");
  1230.         } elseif ($_REQUEST['page'] === 'vendorRegistration') {
  1231.             include("page_vendor_registration.phtml");
  1232.         } elseif ($_REQUEST["page"] === "about") {
  1233.             include("page_about_" $parameters->get("app.instance") . ".phtml");
  1234.         } elseif ($_REQUEST["page"] === "howtobuy") {
  1235.             include("page_howtobuy.phtml");
  1236.         } elseif ($_REQUEST["page"] === "howtosell") {
  1237.             include("page_howtosell_" $parameters->get("app.instance") . ".phtml");
  1238.         } elseif ($_REQUEST["page"] === "allrealtors") {
  1239.             include("page_allrealtors.phtml");
  1240.         } elseif ($_REQUEST["page"] === "contactrealtor") {
  1241.             include("page_realtor.phtml");
  1242.         } elseif ($_REQUEST["page"] === "buyer") {
  1243.             include("page_buyer.phtml");
  1244.         } elseif ($_REQUEST['page'] === 'favorites') {
  1245.             $manifestAssets->add('bundle-pages-list');
  1246.             echo $this->forward('\Klaravik\Buyer\Controller\FavoritesController::index')->getContent();
  1247.         } elseif ($_REQUEST["page"] == "swish") {
  1248.             include("page_swish.php");
  1249.         } elseif ($_REQUEST['page'] == 'exportdocuments') {
  1250.             include('page_exportdocumentupload.phtml');
  1251.         } elseif ($_REQUEST["page"] == "requestAdvance") {
  1252.             include("page_requestadvancepay.phtml");
  1253.         } elseif ($_REQUEST["page"] == "requestAdvanceNo") {
  1254.             $manifestAssets->add('bundle-common');
  1255.             include("page_requestadvancepayno.phtml");
  1256.         } elseif ($_REQUEST["page"] == "vendor") {
  1257.             include("page_vendor.phtml");
  1258.         } elseif ($_REQUEST["page"] == "ui-lib") {
  1259.             include("includes/ui-test.php");
  1260.         } elseif ($_REQUEST["page"] == "404") {
  1261.             texter($trans$db$manifestAssets"statictext"404$language$cfSiteKey);
  1262.         } elseif ($_REQUEST["page"] == "english") {
  1263.             $manifestAssets->add('bundle-common');
  1264.             texter($trans$db$manifestAssets"statictext"1066$language$cfSiteKey);
  1265.         } elseif ($_REQUEST["page"] == "kopinfo") {
  1266.             texter($trans$db$manifestAssets"statictext"301$language$cfSiteKey);
  1267.         } elseif ($_REQUEST["page"] == "savedSearch") {
  1268.             echo $this->forward('\Klaravik\Buyer\SavedSearch\Controller\SavedSearchController::build')->getContent();
  1269.         } elseif ($_REQUEST["page"] == "saljinfo") {
  1270.             texter($trans$db$manifestAssets"statictext"302$language$cfSiteKey);
  1271.         } elseif ($_REQUEST["page"] === "app-download") {
  1272.             include("page_app_download.php");
  1273.         } elseif ($_REQUEST["page"] == "text") {
  1274.             $manifestAssets->add('bundle-common');
  1275.             if (isset($pid) && is_numeric($pid)) {
  1276.                 $pageQuery "SELECT pagetype, url FROM pages WHERE id=" . (int) ($pid);
  1277.                 $pageResult mysqli_query($db$pageQuery);
  1278.                 if (mysqli_num_rows($pageResult) > 0) {
  1279.                     $page mysqli_fetch_object($pageResult);
  1280.                     if ($pid == TERMSPAGE) {
  1281.                         include __DIR__ "/page_terms.php";
  1282.                         texter($trans$db$manifestAssets"text"$pid$language$cfSiteKey);
  1283.                     } elseif ($page->url == 'cookies') {
  1284.                         texter($trans$db$manifestAssets"text"$pid$language$cfSiteKey);
  1285.                         echo '<div class="row">
  1286.                             <div class="column xlarge-6 xlarge-offset-3 large-8 large-offset-2">
  1287.                             <a onclick="document.getElementById(\'cookiesDeclaration\').classList.toggle(\'cookies-visible\'), this.classList.toggle(\'cookies-active\')" class="cookie-declaration-btn">
  1288.                             ' $trans->get('text_label_app-index_cookies-consent') . '
  1289.                              <svg id="icn-arrow-down-s" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#00682f">
  1290.                                <path id="Path_56238" data-name="Path 56238" d="M0,0H24V24H0Z" fill="none"/>
  1291.                                <path id="Path_56239" data-name="Path 56239" d="M12,13.172l4.95-4.95,1.414,1.414L12,16,5.636,9.636,7.05,8.222Z"/>
  1292.                              </svg>
  1293.                              <svg id="icn-arrow-up-s" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#00682f">
  1294.                               <path data-name="Path 56236" d="M0,0H24V24H0Z" fill="none"/>
  1295.                               <path data-name="Path 56237" d="M12,10.828l-4.95,4.95L5.636,14.364,12,8l6.364,6.364L16.95,15.778Z"/>
  1296.                             </svg>
  1297.                              </a>
  1298.                             <div id="cookiesDeclaration">
  1299.                             <h2>' $trans->get('text_label_app-index_cookies-declaration') . '</h2>';
  1300.                         echo '<script id="CookieDeclaration" data-culture="SE" src="https://consent.cookiebot.com/05ff59ba-3559-4216-af40-9b6b5a930282/cd.js" type="text/javascript" async></script>';
  1301.                         echo '</div></div></div>';
  1302.                     } elseif ($page->url == 'corona-information') {
  1303.                         $manifestAssets->add('bundle-foundation-reInit');
  1304.                         texter($trans$db$manifestAssets"text"$pid$language$cfSiteKey);
  1305.                         echo '<div class="covid-content" data-equalizer data-equalizer-mq="large-up">
  1306.                             <div class="covid-content__info" data-equalizer-watch>
  1307.                                 <div class="covid-content__list">
  1308.                                     ' $trans->get('text_label_app-index_covid-content-list') . '
  1309.                                 </div>
  1310.                             </div>
  1311.                             <div class="covid-content__img">
  1312.                                <img
  1313.                                   class="covid-content__image"
  1314.                                   data-equalizer-watch src="/images/emil_bil_dator-large.jpg"
  1315.                                   alt="' $trans->get('info_altimg_app-index_img-kam') . '"
  1316.                                >
  1317.                             </div>
  1318.                         </div>';
  1319.                     } else {
  1320.                         renderHeroPagePart($db$pid);
  1321.                         $manifestAssets->add('bundle-hero-video-image');
  1322.                         texter($trans$db$manifestAssets"text"$pid$language$cfSiteKey);
  1323.                     }
  1324.                 } else {
  1325.                     header("HTTP/1.1 404 Not Found");
  1326.                     texter($trans$db$manifestAssets"statictext"404$language$cfSiteKey);
  1327.                 }
  1328.             } else {
  1329.                 header("HTTP/1.1 404 Not Found");
  1330.                 texter($trans$db$manifestAssets"statictext"404$language$cfSiteKey);
  1331.             }
  1332.         } elseif ($_REQUEST["page"] == "form_thanks") {
  1333.             texter($trans$db$manifestAssets"statictext"4$language$cfSiteKey);
  1334.         } elseif ($_REQUEST["page"] == "auction") {
  1335.             if (isset($products_id)) {
  1336.                 include("page_product.phtml");
  1337.             } else {
  1338.                 include($pageListPath);
  1339.             }
  1340.         } elseif ($_REQUEST["page"] == "financing") {
  1341.             if (isset($_REQUEST['notavailable'])) {
  1342.                 include("page_financing_notavailable.phtml");
  1343.             } elseif (isset($_REQUEST['financingdone'])) {
  1344.                 include("page_financing_done.phtml");
  1345.             } else {
  1346.                 include("page_financing.phtml");
  1347.             }
  1348.         } elseif ($_REQUEST["page"] == "finansiering") {
  1349.             $manifestAssets->add('bundle-common');
  1350.             include("page_financing_info.phtml");
  1351.         } elseif ($_REQUEST['page'] === 'contact') {
  1352.             $manifestAssets->add('bundle-common');
  1353.             $manifestAssets->add('bundle-pages-contact-us');
  1354.             texter($trans$db$manifestAssets"statictext"250$language$cfSiteKey);
  1355.         } elseif ($_REQUEST["page"] === "dac7") {
  1356.             $vendor = new Klaravik\Model\Vendor();
  1357.             $vendorRepo = (new \Klaravik\Repository\VendorRepo());
  1358.             if (!empty($_REQUEST['token']) && !empty($_REQUEST['vendorId'])) {
  1359.                 $token mb_substr($_REQUEST['token'], 040);
  1360.                 if (sha1($_REQUEST['vendorId']) === $token) {
  1361.                     $vendor $vendorRepo->getVendor($_REQUEST['vendorId']);
  1362.                 } else {
  1363.                     throw new Exception('Bad token');
  1364.                 }
  1365.             }
  1366.             $vendorsFlagsRepo = (new \Klaravik\Repository\VendorsFlagsRepo());
  1367.             $formSubmitted 0;
  1368.             if (!empty($_REQUEST['vendorId'])) {
  1369.                 try {
  1370.                     $dacUpdated $vendorsFlagsRepo->getVendorsById(
  1371.                         $_REQUEST['vendorId']
  1372.                     )->getDacUpdated();
  1373.                 } catch (RepositoryException $e) {
  1374.                     //Do something
  1375.                 }
  1376.             }
  1377.             if (!empty($dacUpdated)) {
  1378.                 $formSubmitted 1;
  1379.             }
  1380.             $countryRepo = (new \Klaravik\Repository\CountryRepo());
  1381.             $countries $countryRepo->getAll();
  1382.             // If token is available we need
  1383.             if (!empty($_REQUEST['idFromForm']) && $formSubmitted === 0) {
  1384.                 $vendorId = (int) $_REQUEST['idFromForm'];
  1385.                 //TODO handle formdata and save in db
  1386.                 if (!empty($_POST['permanent-establishment'])) {
  1387.                     $pEs count($_POST['permanent-establishment']);
  1388.                     for ($i 0$i $pEs$i++) {
  1389.                         $countryId $countryRepo->getIdByIso2($_POST['permanent-establishment'][$i]);
  1390.                         $db->query("INSERT INTO permanentEstablishment_ref (vendors_id, countries_id) VALUES (" $vendorId "," $countryId ")");
  1391.                     }
  1392.                 }
  1393.                 $fHs count($_POST['fiscal-home']);
  1394.                 for ($i 0$i $fHs$i++) {
  1395.                     $countryId $countryRepo->getIdByIso2($_POST['fiscal-home'][$i]);
  1396.                     $tin $_POST['tin'][$i];
  1397.                     $tin2 $_POST['tin2'][$i] ?? '';
  1398.                     $stmt $db->prepare("
  1399.                           INSERT INTO
  1400.                               fiscalHome_ref
  1401.                                   (vendors_id, countries_id, tin, tin2)
  1402.                           VALUES
  1403.                               (?,?,?,?)");
  1404.                     $stmt->bind_param('iiss'$vendorId$countryId$tin$tin2);
  1405.                     $stmt->execute();
  1406.                 }
  1407.                 if (!empty($_POST['personal_name'])) {
  1408.                     $name u($_POST['personal_name'])->split(' '2);
  1409.                     $firstName $name[0]->toString();
  1410.                     if (!empty($name[1])) {
  1411.                         $lastName $name[1]->toString();
  1412.                     } else {
  1413.                         $lastName '';
  1414.                     }
  1415.                     $countryId $countryRepo->getIdByIso2($_POST['personal_country']);
  1416.                     $address $_POST['personal_address'] ?? '';
  1417.                     $zipcode $_POST['personal_zipcode'] ?? '';
  1418.                     $city $_POST['personal_city'] ?? '';
  1419.                     $cprNumber $_POST['personal_cpr'] ?? '';
  1420.                     $stmt $db->prepare("
  1421.                           INSERT INTO
  1422.                               personal_information
  1423.                                   (vendors_id, firstName, lastName, address, zipcode, city, country, cprNumber)
  1424.                           VALUES
  1425.                               (?,?,?,?,?,?,?,?)
  1426.                           ");
  1427.                     $stmt->bind_param('isssssis'$vendorId$firstName$lastName$address$zipcode$city$countryId$cprNumber);
  1428.                     $stmt->execute();
  1429.                 }
  1430.                 $vendorsFlags $vendor->getVendorsFlags();
  1431.                 $vendorsFlags->setDacUpdated(1);
  1432.                 $vendorsFlagsRepo->save($vendorsFlags);
  1433.                 $formSubmitted 1;
  1434.                 if ($vendor->getStopProductStart() === 1) {
  1435.                     if ($vendor->getStopProductReason() === ' - DAC7') {
  1436.                         $vendor->setStopProductStart(0);
  1437.                         $vendor->setStopProductReason('');
  1438.                     } elseif (str_contains($vendor->getStopProductReason(), ' - DAC7')) {
  1439.                         $reason str_ireplace(' - DAC7'''$vendor->getStopProductReason());
  1440.                         $vendor->setStopProductReason($reason);
  1441.                     }
  1442.                     try {
  1443.                         $vendorRepo->saveForDac7($vendor$parameters->get('app.instance'));
  1444.                     } catch (RepositoryException $e) {
  1445.                         //doStuff();
  1446.                     }
  1447.                 }
  1448.             }
  1449.             $pageRepository = new \Klaravik\Repository\PageRepository();
  1450.             /** @var ?\Klaravik\Model\Page $pageDAC7 */
  1451.             $pageDAC7 null;
  1452.             try {
  1453.                 $pageDAC7 $pageRepository->getByPageKey('DAC7');
  1454.             } catch (RepositoryException $e) {}
  1455.             // Redirect to DAC7 page if new DAC7 page is online and no vendor selected or the form is sent.
  1456.             $pageDAC7Url $pageDAC7 sprintf('/%s.html'$pageDAC7->getUrl()) : '';
  1457.             if ($pageDAC7 && !$vendor->getId()) {
  1458.                 header(sprintf('Location: %s'$pageDAC7Url));
  1459.                 die;
  1460.             }
  1461.             $dac7Params = [
  1462.                 'vendor' => $vendor,
  1463.                 'language' => $parameters->get('app.lang'),
  1464.                 'primaryAddress' => $vendor->getAddresses()->getPrimary()->getFirst(),
  1465.                 'signeeContact' => $vendor->getContacts()->getSignee()->getFirst(),
  1466.                 'countries' => $countries,
  1467.                 'formSubmitted' => $formSubmitted,
  1468.                 'pageDAC7Active' => $pageDAC7,
  1469.                 'pageDAC7Url' => $pageDAC7Url,
  1470.             ];
  1471.             $twigEnvironment->display('public/dac7/dac7.html.twig'$dac7Params);
  1472.             $manifestAssets->add('bundle-pages-dac7');
  1473.         } else {
  1474.             print "Unknown page.\n";
  1475.         }
  1476.     } else {
  1477.         // Default framsidan!
  1478.         include($pageListPath);
  1479.     }
  1480.     ?>
  1481.     <!-- end .topbar_full -->
  1482. </div>
  1483. <div id="k-app-ad-banner">
  1484.     <div class="k-ad-container">
  1485.         <div id="k-ad-heading">
  1486.             <?php $trans->eGet('text_app-index_app-ad_description'); ?>
  1487.         </div>
  1488.         <div class="k-ad-links">
  1489.             <a class="k-ad-links__link k-ad-links__appstore" href=<?php $trans->eGet('text_app-index_app-ad_app-store_url'); ?>>
  1490.                 <img src="/images/logotypes/logo_appstore.png" alt="<?php $trans->eGet('text_app-index_app-ad_app-store_alt'); ?>">
  1491.             </a>
  1492.             <a class="k-ad-links__link k-ad-links__playstore" href=<?php $trans->eGet('text_app-index_app-ad_playstore_url'); ?>>
  1493.                 <img src="/images/logotypes/logo_google_play.svg" alt="<?php $trans->eGet('text_app-index_app-alt'); ?>">
  1494.             </a>
  1495.         </div>
  1496.         <div id="k-ad-picture" class="<?= $parameters->get('app.instance') === 'dk' 'app-dk' '' ?>">
  1497.         </div>
  1498.     </div>
  1499. </div>
  1500. <div id="footer_full">
  1501.     <div class="row">
  1502.         <div class="small-12 columns show-for-small-only">
  1503.             <h5 class="subscribe-title"><?php $trans->eGet('text_headline_app-index_newsletter-caption'); ?></h5>
  1504.             <!-- Begin MOBILE Signup Form -->
  1505.             <form id="subscribe-mobile-form" action="" method="post">
  1506.                 <div class="subscription-input">
  1507.                     <div class="input-animation">
  1508.                         <span class="input-animation-text">
  1509.                             <?php $trans->eGet('text_label_app-index_newsletter-registration'); ?>
  1510.                         </span>
  1511.                     </div>
  1512.                     <div class="button-inside">
  1513.                         <input type="email" value="" name="EMAIL" required class="search-box" id="mobile-email"
  1514.                             placeholder="<?php $trans->eGet('text_label_app-index_newsletter-email-placeholder'); ?>">
  1515.                         <button class="subscribe-erase" style="display: none;" aria-label="<?php $trans->eGet('text_label_app-index_newsletter-email-placeholder'); ?>"><img
  1516.                                 src="/images/footer-subscribe-cross.svg" alt=""></button>
  1517.                     </div>
  1518.                     <div class="button-clear">
  1519.                         <button type="submit" value="" name="subscribe" id="subscribe-mobile" class="subscribe-button">
  1520.                             <img src="/images/arrow-right-white.svg" class="subscription-arrow"
  1521.                                 alt="<?php $trans->eGet('info_altimg_app-index_white-arrow-right'); ?>">
  1522.                             <img src="/images/checkmark-white.svg" class="subscription-checkmark" style="display: none;"
  1523.                                 alt="<?php $trans->eGet('info_altimg_app-index_white-checkbox'); ?>">
  1524.                         </button>
  1525.                     </div>
  1526.                 </div>
  1527.                 <div style="clear: both"></div>
  1528.                 <div id="subscribe-mobile-error"></div>
  1529.             </form>
  1530.             <!--End MOBILE Signup form -->
  1531.         </div>
  1532.         <div class="large-3 medium-4 small-12 columns hide-for-small" style="float: left;">
  1533.             <a href="/"><img src="/images/klaravik-logo-tba.png" alt="Klaravik logo" class="footer-logo"></a>
  1534.         </div>
  1535.     </div>
  1536.     <div class="row">
  1537.         <div class="large-3 medium-6 small-12 columns footer-contact hide-for-small">
  1538.             <h5 class="subscribe-title"><?php $trans->eGet('text_headline_app-index_newsletter-caption'); ?></h5>
  1539.             <!-- Begin DESKTOP Signup Form -->
  1540.             <form id="subscribe-desktop-form" action="" method="post">
  1541.                 <div class="subscription-input">
  1542.                     <div class="input-animation">
  1543.                         <span class="input-animation-text">
  1544.                             <?php $trans->eGet('text_label_app-index_newsletter-registration'); ?>
  1545.                         </span>
  1546.                     </div>
  1547.                     <div class="button-inside">
  1548.                         <input type="email" value="" name="EMAIL" required class="search-box" id="desktop-email"
  1549.                             placeholder="<?php $trans->eGet('text_label_app-index_newsletter-email-placeholder'); ?>">
  1550.                         <button class="subscribe-erase" style="display: none;"  aria-label="<?php $trans->eGet('text_label_app-index_newsletter-email-placeholder'); ?>"><img
  1551.                                 src="/images/footer-subscribe-cross.svg" alt=""></button>
  1552.                     </div>
  1553.                     <div class="button-clear">
  1554.                         <button type="submit" value="" name="subscribe" id="subscribe-desktop" class="subscribe-button">
  1555.                             <img src="/images/arrow-right-white.svg" class="subscription-arrow"
  1556.                                 alt="<?php $trans->eGet('info_altimg_app-index_white-arrow-right'); ?>">
  1557.                             <img src="/images/checkmark-white.svg" class="subscription-checkmark" style="display: none;"
  1558.                                 alt="<?php $trans->eGet('info_altimg_app-index_white-checkbox'); ?>">
  1559.                         </button>
  1560.                     </div>
  1561.                 </div>
  1562.                 <div style="clear: both"></div>
  1563.                 <div id="subscribe-desktop-error"></div>
  1564.             </form>
  1565.             <!--End DESKTOP Signup form -->
  1566.             <div class="footer-info">
  1567.                 <?php
  1568.                 generateFooter($trans);
  1569.                 ?>
  1570.             </div>
  1571.         </div>
  1572.         <div class="large-3 medium-6 small-12 columns small-text-left footer-column-padding">
  1573.             <!-- TODO: alias method -->
  1574.             <h6><?php print $trans->get("ALIAS_FOOTER_HEADER_LEFT"); ?></h6>
  1575.             <hr>
  1576.             <?php
  1577.             generateBottomMenu($db$urlGenerator1LANGUAGE_ID$pid);
  1578.             ?>
  1579.         </div>
  1580.         <div class="large-3 medium-6 small-12 columns small-text-left footer-column-padding">
  1581.             <!-- TODO: alias method -->
  1582.             <h6><?php print $trans->get("ALIAS_FOOTER_HEADER_CENTER"); ?></h6>
  1583.             <hr>
  1584.             <?php
  1585.             generateBottomMenu($db$urlGenerator2LANGUAGE_ID$pid);
  1586.             ?>
  1587.         </div>
  1588.         <div class="large-3 medium-6 small-12 columns small-text-left footer-column-padding">
  1589.             <!-- TODO: alias method -->
  1590.             <h6><?php print $trans->get("ALIAS_FOOTER_HEADER_RIGHT"); ?></h6>
  1591.             <hr>
  1592.             <?php
  1593.             generateBottomMenu($db$urlGenerator3LANGUAGE_ID$pid);
  1594.             ?>
  1595.         </div>
  1596.     </div>
  1597.     <div class="row">
  1598.         <div class="large-12 medium-12 columns hide-for-small">
  1599.             <div class="small-text-right flag-columns">
  1600.                 <a class="footer-flag" href="https://www.klaravik.fi" target="_blank" rel="noreferrer">
  1601.                     <img src="/images/footer-fi-flag.svg"
  1602.                         alt="<?php $trans->eGet('info_altimg_app-index_flag-finland'); ?>" align="middle"
  1603.                         class="footer-img-flag" />
  1604.                     <span><?php $trans->eGet('text_label_app-index_flag-finland'); ?></span>
  1605.                 </a>
  1606.                 <a class="footer-flag" href="https://www.klaravik.dk" target="_blank" rel="noreferrer">
  1607.                     <img src="/images/footer-dk-flag.svg"
  1608.                         alt="<?php $trans->eGet('info_altimg_app-index_flag-denmark'); ?>" align="middle"
  1609.                         class="footer-img-flag" />
  1610.                     <span><?php $trans->eGet('text_label_app-index_flag-denmark'); ?></span>
  1611.                 </a>
  1612.                 <a class="footer-flag" href="https://www.klaravik.se/" target="_blank" rel="noreferrer">
  1613.                     <img src="/images/footer-sv-flag.svg"
  1614.                         alt="<?php $trans->eGet('info_altimg_app-index_flag-sweden'); ?>" align="middle"
  1615.                         class="footer-img-flag" />
  1616.                     <span><?php $trans->eGet('text_label_app-index_flag-sweden'); ?></span>
  1617.                 </a>
  1618.             </div>
  1619.         </div>
  1620.         <div class="small-12 show-for-small-only">
  1621.             <div class="large-3 medium-12 small-12 columns">
  1622.                 <a href="/"><img src="/images/klaravik-logo-tba.png" alt="Klaravik logo" class="footer-logo"></a>
  1623.                 <!-- TODO: alias method -->
  1624.                 <h3><?php print $trans->get("ALIAS_FOOTER_HEADER_CONTACT"); ?></h3>
  1625.                 <div class="footer-info">
  1626.                     <!-- TODO: Ta bort "All rights reserved" text frÃ¥n databasen -->
  1627.                     <?php
  1628.                     generateFooter($trans);
  1629.                     ?>
  1630.                 </div>
  1631.             </div>
  1632.             <div class="small-12 columns show-for-small-only">
  1633.                 <div class="row">
  1634.                     <a class="small-3 small-centered columns flag-columns" href="https://www.klaravik.se/"
  1635.                         target="_blank" rel="noreferrer">
  1636.                         <img src="/images/footer-sv-flag.svg"
  1637.                             alt="<?php $trans->eGet('info_altimg_app-index_flag-sweden'); ?>" align="middle"
  1638.                             class="footer-img-flag" />
  1639.                         <span><?php $trans->eGet('text_label_app-index_flag-sweden'); ?></span>
  1640.                     </a>
  1641.                     <a class="small-3 small-centered columns flag-columns" href="https://www.klaravik.dk/"
  1642.                         target="_blank" rel="noreferrer">
  1643.                         <img src="/images/footer-dk-flag.svg"
  1644.                             alt="<?php $trans->eGet('info_altimg_app-index_flag-denmark'); ?>" align="middle"
  1645.                             class="footer-img-flag" />
  1646.                         <span><?php $trans->eGet('text_label_app-index_flag-denmark'); ?></span>
  1647.                     </a>
  1648.                     <a class="small-3 small-centered columns flag-columns" href="https://www.klaravik.fi"
  1649.                         target="_blank" rel="noreferrer">
  1650.                         <img src="/images/footer-fi-flag.svg"
  1651.                             alt="<?php $trans->eGet('info_altimg_app-index_flag-finland'); ?>" align="middle"
  1652.                             class="footer-img-flag" />
  1653.                         <span><?php $trans->eGet('text_label_app-index_flag-finland'); ?></span>
  1654.                     </a>
  1655.                 </div>
  1656.             </div>
  1657.         </div>
  1658.     </div>
  1659.     <div id="bottom-footer">
  1660.         <div class="row">
  1661.             <div class="small-12 columns bottom-footer-center">
  1662.                 <div class="bottom-footer-center_content">
  1663.                     <span class="copyright-row">
  1664.                         <img class="copyright-sign" src="/images/icons/icn-copyright-line.svg" alt="<?php $trans->eGet('text_label_app-index_copyright-alt'); ?>"/>
  1665.                         <span>
  1666.                             <?php $trans->eGet('text_label_app-index_copyright-caption'); ?>
  1667.                         </span>
  1668.                         <span>|</span>
  1669.                         <span>
  1670.                             <a href="/material.html" target="_blank">
  1671.                                 <?php $trans->eGet('link_button_app-index_copyright-text'); ?>
  1672.                             </a>
  1673.                         </span>
  1674.                     </span>
  1675.                     <div class="follow-links">
  1676.                         <div class="social-media">
  1677.                             <span class="follow-us">
  1678.                                 <?php $trans->eGet('text_label_app-index_social-media-caption'); ?>
  1679.                             </span>
  1680.                             <a href="<?php print $parameters->get('social.media.youtube.link'?>" target="_blank"
  1681.                                 rel="noreferrer"><img class="youtube-logo" src="/images/logotypes/icn-youtube.svg"
  1682.                                     alt="youtube logo"></a>
  1683.                             <a href="<?php print $parameters->get('social.media.facebook.link'?>" target="_blank"
  1684.                                 rel="noreferrer"><img class="fb-logo" src="/images/logotypes/icn-facebook.svg"
  1685.                                     alt="facebook logo"></a>
  1686.                             <?php if ($parameters->get('social.media.tiktok.active')) { ?>
  1687.                                 <a href="<?php print $parameters->get('social.media.tiktok.link'?>" target="_blank"
  1688.                                     rel="noreferrer"><img class="tiktok-logo" src="/images/logotypes/icn-tiktok.svg"
  1689.                                         alt="tiktok logo"></a>
  1690.                             <?php ?>
  1691.                             <?php if ($parameters->get('social.media.instagram.active')) { ?>
  1692.                                 <a href="<?php print $parameters->get('social.media.instagram.link'?>" target="_blank"
  1693.                                     rel="noreferrer"><img class="ig-logo" src="/images/logotypes/icn-instagram.svg"
  1694.                                         alt="instagram logo"></a>
  1695.                             <?php ?>
  1696.                         </div>
  1697.                     </div>
  1698.                 </div>
  1699.             </div>
  1700.         </div><!-- end .row -->
  1701.     </div><!-- end #bottom-footer -->
  1702. </div>
  1703. <!-- end #footer_full --></div>
  1704. </div><!-- end starting div that wraps all content -->
  1705. <!-- The mobile menu -->
  1706. <nav id="mobile-menu" class="mobile-menu">
  1707.     <form id="mobile-menu-search-form" class="mobile-search-form validate-form"
  1708.         action="<?php echo $urlGenerator->generate('app.legacy.auction.listing'); ?>" method="get">
  1709.         <div class="form-field-3">
  1710.             <div class="form-field-3__input-wrapper">
  1711.                 <input class="form-field-3__input-field validate-field" type="text" id="menusearch"
  1712.                     class="mobile-menu__search-input"
  1713.                     placeholder="<?php $trans->eGet('info_label_app-index_menu-search-placeholder'); ?>"
  1714.                     name="searchtext" value="<?php if (isset($_REQUEST['searchtext']) && $_REQUEST['searchtext'] !== '')
  1715.                         print htmlentities($_REQUEST['searchtext'], ENT_QUOTES ENT_HTML401'utf-8'); ?>"
  1716.                     title="sokord" />
  1717.                 <span class="form-clear-field"></span>
  1718.             </div>
  1719.             <div class="form-field-3__clear">
  1720.                 <button type="submit" value="" name="dosearch" class="form-field-3__button"
  1721.                     aria-label="<?php $trans->eGet('info_label_app-index_menu-search-aria-label'); ?>">
  1722.                     <img src="/images/icon-search-white.svg" height="19px" width="19x" class="subscription-arrow"
  1723.                         alt="<?php $trans->eGet('text_label_app-index_magnifying-glass'); ?>">
  1724.                 </button>
  1725.             </div>
  1726.         </div>
  1727.         <?php
  1728.         if ($requestSetCountyFlag && !in_array('all'$setCountyFlagData)) {
  1729.             foreach ($setCountyFlagData as $setCountyFlagDataItem) {
  1730.                 printf(
  1731.                     '<input type="hidden" name="setcountyflag[]" value="%s">',
  1732.                     $setCountyFlagDataItem
  1733.                 );
  1734.             }
  1735.         }
  1736.         if ($requestSetMunicipality && !in_array('all'$setMunicipalityData)) {
  1737.             foreach ($setMunicipalityData as $setMunicipalityDataItem) {
  1738.                 printf(
  1739.                     '<input type="hidden" name="setmunicipality[]" value="%s">',
  1740.                     $setMunicipalityDataItem
  1741.                 );
  1742.             }
  1743.         }
  1744.         ?>
  1745.     </form><!-- end Textfield-3 -->
  1746.     <div class="mobile-menu__toggle-categories-column" id="toggle-categories">
  1747.         <div class="mobile-menu__toggle-categories-link">
  1748.             <?php
  1749.             // TODO: alias method
  1750.             print $trans->get("ALIAS_MAIN_BUTTON");
  1751.             ?>
  1752.         </div>
  1753.         <div class="mobile-menu__toggle-category-icon">
  1754.             <img src="/images/icon-expand-categories.svg" alt="" class="menu-expand-categories">
  1755.             <img src="/images/icon-retract-categories.svg" alt="" class="menu-retract-categories">
  1756.         </div>
  1757.     </div>
  1758.     <div class="mobile-menu__expanding-section mobile-hide">
  1759.         <?php
  1760.         $pageListPartials = new \Klaravik\includes\PageListPartials($urlGenerator$trans);
  1761.         $urlParams = [];
  1762.         $pageListPartials->geoLocationUrlParams($urlParams);
  1763.         $pageListPartials->filterUrlParams($urlParams);
  1764.         echo '<div class="mobile-menu__category-link-row mobile-menu__top-level-row">';
  1765.         echo '    <a
  1766.                   href="' $urlGenerator->generate('app.legacy.auction.listing'$urlParams) . '"
  1767.                   class="mobile-menu__category-link mobile-menu__all-link"
  1768.                 >
  1769.                     <span>' $trans->get('text_label_app-index_header-all-auctions') . '</span>
  1770.                 </a>';
  1771.         echo '</div>';
  1772.         $catCount count($cachedCategories->loadCachedCategories());
  1773.         $i 0;
  1774.         foreach ($cachedCategories->loadCachedCategories() as $headCategory) {
  1775.             if (++$i === $catCount) {
  1776.                 echo '<div class="mobile-menu__category-link-row mobile-menu__top-level-row mobile-menu__last-row-item" >';
  1777.             } else {
  1778.                 echo '<div class="mobile-menu__category-link-row mobile-menu__top-level-row" >';
  1779.             }
  1780.             echo '<span class="mobile-menu__category-link expand-subcat" data-catId="' $headCategory->id '">
  1781.                       <img class="mobile-menu__category-link-icon" src="/images/icons/icn-category-' $headCategory->icon '.svg">' $headCategory->name '</span>';
  1782.             if (count($headCategory->children)) {
  1783.                 $urlParams['caturlname'] = $headCategory->url;
  1784.                 echo '<div class="mobile-menu__toggle-category-icon">
  1785.                               <img src="/images/icon-expand-dd.svg" alt="" class="menu-expand-categories">
  1786.                               <img src="/images/icon-retract-dd.svg" alt="" class="menu-retract-categories">
  1787.                           </div>';
  1788.                 echo '</div>';
  1789.                 echo '<div class="mobile-menu__expanding-section subcat-expandable subcat-expandable-' $headCategory->id '">';
  1790.                 echo '<div class="mobile-menu__category-link-row">';
  1791.                 echo '    <a
  1792.                             href="' $urlGenerator->generate('app.legacy.auction.listing.category'$urlParams) . '"
  1793.                             class="mobile-menu__category-link mobile-menu__all-link"
  1794.                           >
  1795.                               <span class="mobile-menu__green-border">
  1796.                                   ' $trans->get(
  1797.                             'link_button_app-index_auction-listing-category',
  1798.                             ['cat_name' => $headCategory->name]
  1799.                         ) . ' (' $headCategory->numberOfProducts ')
  1800.                               </span>
  1801.                           </a>';
  1802.                 echo '</div>';
  1803.                 foreach ($headCategory->children as $child) {
  1804.                     if ($child->showOnlyInParent) {
  1805.                         continue;
  1806.                     }
  1807.                     $urlParams['caturlname'] = $child->url;
  1808.                     echo '<div class="mobile-menu__category-link-row">';
  1809.                     echo '    <a href="' $urlGenerator->generate('app.legacy.auction.listing.category'$urlParams) . '" class="mobile-menu__category-link">' $child->name ' (' $child->numberOfProducts ')</a>';
  1810.                     echo '</div>';
  1811.                 }
  1812.             }
  1813.             echo '</div>';
  1814.         }
  1815.         ?>
  1816.     </div>
  1817.     <div class="mobile-menu__row">
  1818.         <?php
  1819.         // TODO: alias method
  1820.         echo '<a href="' $urlGenerator->generate('app.legacy.auction.listing', ['reserve' => 'none']) . '" class="mobile-menu__auction-list-link mobile-menu__no-reserve-link"><span></span>' $trans->get('text_label_app-index_header-no-reserve-auctions-full') . '</a>';
  1821.         ?>
  1822.     </div>
  1823.     <div class="mobile-menu__row">
  1824.         <?php
  1825.         // TODO: alias method
  1826.         echo '<a href="' $urlGenerator->generate('app.legacy.auction.listing.closed') . '" class="mobile-menu__auction-list-link mobile-menu__closed-auctions-link"><span></span>' $trans->get('text_label_app-index_header-closed-auctions') . '</a>';
  1827.         ?>
  1828.     </div>
  1829.     <div class="mobile-menu__row">
  1830.         <?php
  1831.         // TODO: alias method
  1832.         echo '<a href="' $urlGenerator->generate('app.legacy.pages.howtosell') . '" class="mobile-menu__how-to-sell-link">' $trans->get('ALIAS_TOP_BUTTON_SALE') . '</a>';
  1833.         ?>
  1834.     </div>
  1835.     <div class="mobile-menu__row">
  1836.         <?php
  1837.         echo '<a
  1838.                     href="' $urlGenerator->generate('app.legacy.pages.contact') . '"
  1839.                     class="mobile-menu__link mobile-menu__contact-link"
  1840.                   >
  1841.                        <span></span>' $trans->get('text_label_app-index_header-contact-us') . '
  1842.                   </a>';
  1843.         ?>
  1844.     </div>
  1845.     <div class="mobile-menu__row">
  1846.         <?php
  1847.         echo '<a
  1848.                     href="' $urlGenerator->generate('app.legacy.pages.faq') . '"
  1849.                     class="mobile-menu__link mobile-menu__faq-link"
  1850.                   >
  1851.                       <span></span>' $trans->get('link_button_app-index_pages-faq') . '
  1852.                   </a>';
  1853.         ?>
  1854.     </div>
  1855.     <div class="mobile-menu__row">
  1856.         <?php
  1857.         echo '<a
  1858.                     href="' $urlGenerator->generate('app.legacy.pages.about') . '"
  1859.                     class="mobile-menu__link mobile-menu__about-link"
  1860.                   >
  1861.                       <span></span>' $trans->get('link_button_app-index_pages-about') . '
  1862.                   </a>';
  1863.         ?>
  1864.     </div>
  1865.     <?php
  1866.     if (isset($_SESSION["users_id"])) {
  1867.         print "<div class='mobile-menu__bottom-buttons'>\n";
  1868.         // TODO: alias method
  1869.         print "  <a href=\"" $urlGenerator->generate('app.legacy.pages.vendor') . "\" class=\"button--large button--primary mobile-menu__bottom-button mobile-menu__login-icon\"><span></span>" $trans->get("ALIAS_VENDOR_MYPAGE") . "</a>";
  1870.         print "  <a
  1871.                href=\"" $urlGenerator->generate('app.legacy.pages.vendor.subpage', ['vendortab' => 'products']) . "\"
  1872.                class=\"button--large button--outlined mobile-menu__bottom-button mobile-menu__my-objects\"
  1873.              >
  1874.                  " $trans->get('link_button_app-index_pages-vendor') . "
  1875.              </a>";
  1876.         print "</div>";
  1877.         print "<div class=\"mobile-menu__footer-row\">";
  1878.         print "<hr class=\"mobile-menu__footer-top-hr\" />";
  1879.         print "    <div class=\"mobile-menu__footer-wrapper\">";
  1880.         print "        <div class=\"mobile-menu__footer-userinfo\">";
  1881.         // TODO: alias method
  1882.         print "            <span class=\"mobile-menu__footer-text\">" $trans->get("ALIAS_LOGGEDIN_AS_SELLER") . "</span>";
  1883.         print "            <span class=\"mobile-menu__footer-text-username\">" $propUserName "</span>";
  1884.         print "        </div>";
  1885.         print "        <div class=\"mobile-menu__footer-logout\">";
  1886.         // TODO: alias method
  1887.         print "            <a href=\"" $urlGenerator->generate('app.legacy.pages.vendor.logout') . "\" class=\"mobile-menu__logout-button\"><span></span>" $trans->get("ALIAS_LOGOUT_BUTTON") . "</a>";
  1888.         print "        </div>";
  1889.         print "</div>";
  1890.         print "</div>";
  1891.     } elseif (isset($_SESSION["register_id"])) {
  1892.         print "<div class='mobile-menu__bottom-buttons'>\n";
  1893.         // TODO: alias method
  1894.         print "  <a href=\"" $urlGenerator->generate('app.legacy.pages.buyer') . "\" class=\"button--large button--primary mobile-menu__bottom-button mobile-menu__login-icon\"><span></span>" $trans->get("ALIAS_BUYER_MYPAGE") . "</a>";
  1895.         print "  <a
  1896.                 href=\"" $savedURL "\"
  1897.                 class=\"button--large button--outlined mobile-menu__bottom-button mobile-menu__link--favorites \"
  1898.              >
  1899.                  <span></span>" $trans->get('text_label_app-index_saved') . "
  1900.              </a>\n";
  1901.         print "</div>";
  1902.         print "<div class=\"mobile-menu__footer-row\">";
  1903.         print "    <hr class=\"mobile-menu__footer-top-hr\" />";
  1904.         print "    <div class=\"mobile-menu__footer-wrapper\">";
  1905.         print "        <div class=\"mobile-menu__footer-userinfo\">";
  1906.         // TODO: alias method
  1907.         print "            <span class=\"mobile-menu__footer-text\">" $trans->get("ALIAS_LOGGEDIN_AS_BUYER") . "</span>";
  1908.         print "            <span class=\"mobile-menu__footer-text-username\">" $propUserName "</span>";
  1909.         print "        </div>";
  1910.         print "        <div class=\"mobile-menu__footer-logout\">";
  1911.         // TODO: alias method
  1912.         print "            <a href=\"" $urlGenerator->generate('app.legacy.pages.buyer.logout'$continueUrlParams) . "\" class=\"mobile-menu__logout-button\"><span></span>" $trans->get("ALIAS_LOGOUT_BUTTON") . "</a>";
  1913.         print "        </div>";
  1914.         print "    </div>";
  1915.         print "</div>";
  1916.     } else {
  1917.         print "<div class='mobile-menu__bottom-buttons'>\n";
  1918.         // TODO: alias method
  1919.         print "  <a href=\"" $urlGenerator->generate('app.legacy.pages.login'$continueUrlParams) . "\" .  class=\"button--large button--primary mobile-menu__bottom-button mobile-menu__login-icon\"><span></span>" $trans->get("ALIAS_TOP_BUTTON_LOGIN") . "</a>";
  1920.         print "  <a href=\"" $urlGenerator->generate('app.legacy.pages.register') . "\" class=\"button--large button--outlined mobile-menu__bottom-button mobile-menu__register-icon\"><span></span>" $trans->get("ALIAS_REGISTER_BUTTON_SAVE") . "</a>\n";
  1921.         print "</div>";
  1922.         print " <hr class=\"mobile-menu__hr-initial\">";
  1923.     }
  1924.     ?>
  1925. </nav>
  1926. <!-- end mobile menu -->
  1927. <?php
  1928. if (isset($_SESSION["register_clientType"])): ?>
  1929.     <div class="hidden" id="globalClient" data-client-type="<?= $_SESSION['register_clientType']; ?>"
  1930.         data-client-id="<?= $_SESSION['register_id']; ?>"></div>
  1931. <?php endif;
  1932. // Prints JS-scripts that is set as to be included.
  1933. foreach ($includedJavaScript as $item) {
  1934.     if ($item['inline']) {
  1935.         echo "<script type=\"text/javascript\">\n";
  1936.         echo $item['inline'] . "\n";
  1937.         echo "</script>\n";
  1938.     } else {
  1939.         echo "<script type=\"text/javascript\" src=\"" getFileVersion($item['string']) . "\"></script>\n";
  1940.     }
  1941. }
  1942. $manifestAssets->renderJs();
  1943. if ($skipChat === false) {
  1944.     $zendeskKey "7ee8070a-5a9b-49d3-aa86-027cca4cba0e";
  1945.     if ('dk' === $parameters->get('app.instance')) {
  1946.         $zendeskKey "45813887-bdb1-48d7-ac0c-b68245c6cbc4";
  1947.     }
  1948.     ?>
  1949.     <!-- Start of klaravik Zendesk Widget script -->
  1950.     <script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=<?php echo $zendeskKey?>"> </script>
  1951.     <script type="text/JavaScript">
  1952.                             window.zESettings = {
  1953.                                 webWidget: {
  1954.                                   zIndex: 800,
  1955.                                   color: {
  1956.                                     theme: '#008540',
  1957.                                     launcher: '#FFFFFF', // This will also update the badge
  1958.                                     launcherText: '#ED7600',
  1959.                                     header: '#008540',
  1960.                                   }
  1961.                                 }
  1962.                             };
  1963.                         </script>
  1964.     <!-- End of klaravik Zendesk Widget script -->
  1965.     <?php
  1966. }
  1967. ?>
  1968. </body>
  1969. </html>
  1970. <?php
  1971. $time_end microtime(true);
  1972. $time $time_end $time_start;
  1973. echo "<!-- {$time} -->";