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