<?php
$time_start = microtime(true);
ob_start();
$dataLayer = array();
/**
* @var mysqli $db
* @var Trans $trans
* @var UrlGeneratorInterface $urlGenerator
* @var ContainerInterface $container
* @var ManifestAssets $manifestAssets
* @var \Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface $parameters
*/
require_once __DIR__ . "/require.phtml";
require_once __DIR__ . "/includes/monthNames.inc";
require_once __DIR__ . "/includes/approvedAgreement.php";
require_once __DIR__ . '/includes/Categories.php';
require_once __DIR__ . '/includes/JsonHelper.php';
require_once __DIR__ . '/includes/renderHeroPagePart.php';
require_once __DIR__ . '/includes/registerLoginFunctions.php';
require_once __DIR__ . '/includes/bankID/bankID-overlay.php';
use Klaravik\Assets\ManifestAssets;
use Klaravik\Buyer\Repository\FavoritesRepo;
use Klaravik\Category\Cache\ActiveCategoryCache;
use Klaravik\Common\Collections\RegisterCollection;
use Klaravik\Common\Collections\UserCollection;
use Klaravik\Exception\RepositoryException;
use Klaravik\includes\Categories;
use Klaravik\Repository\RegisterRepository;
use Klaravik\Repository\UserRepo;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Klaravik\Translate\Trans;
use Twig\TwigFunction;
use function Symfony\Component\String\u;
// Initiate categories object.
$categoriesObject = new Categories($trans, $urlGenerator);
$cachedCategories = new ActiveCategoryCache();
$parameters = $container->get('parameter_bag');
$language = LANGUAGE_ID;
$url = "";
$siteConfigQuery = "SELECT * FROM siteconfig WHERE language=" . $language;
$siteConfigResult = mysqli_query($db, $siteConfigQuery);
$shortTitle = "";
if (mysqli_num_rows($siteConfigResult) > 0) {
$siteConfig = mysqli_fetch_object($siteConfigResult);
$title = $siteConfig->title;
$shortTitle = $siteConfig->title;
$keywords = $siteConfig->metakeywords;
$description = $siteConfig->metadescription;
} else {
include __DIR__ . '/page_db_down.php';
exit();
}
if (isset($_REQUEST["vote"]) && is_numeric($_REQUEST["vote"])) {
$pollQuery = "SELECT sida FROM answers WHERE id=" . $_REQUEST["vote"];
$pollResult = mysqli_query($db, $pollQuery);
if (mysqli_num_rows($pollResult) > 0) {
$poll = mysqli_fetch_object($pollResult);
if (!empty($_COOKIE["rostat"])) {
$value = $_COOKIE["rostat"] . "|" . $poll->sida;
} else {
$value = $poll->sida;
}
setcookie("rostat", $value, 0, "/");
}
}
include("includes/loginHandler.php");
require_once(__DIR__ . "/requestHandlers.phtml");
$dataLayer['userInfo'] = array(
'id' => (array_key_exists("register_id", $_SESSION) ? $_SESSION['register_id'] : ''),
'idEmarsys' => (array_key_exists("register_id", $_SESSION) ? 'B' . $_SESSION['register_id'] : 'NOTLOGGEDIN'),
'userType' => (array_key_exists("register_clientType", $_SESSION) ? $_SESSION['register_clientType'] : ''),
'country' => (array_key_exists("register_country", $_SESSION) ? $_SESSION['register_country'] : ''),
);
if (array_key_exists('is_admin', $_SESSION)) {
$dataLayer['isAdmin'] = true;
}
if (array_key_exists('registerInfo', $_SESSION)) {
$dataLayer['userEvent'] = 'createAccount';
$dataLayer['userRegisterInfo'] = array(
'id' => $_SESSION['registerInfo']['id'],
'userType' => $_SESSION['registerInfo']['clientType'],
'country' => $_SESSION['registerInfo']['country'],
);
unset($_SESSION['registerInfo']);
}
$pid = null;
// klaravik.se/<products_id> -> /auktion/produkt/<urlname>
if (isset($_REQUEST['shorturl'])) {
$productId = (int) $_REQUEST['shorturl'];
$queryShortUrl = mysqli_query($db, "SELECT `urlname` FROM `products_description` WHERE `products_id` = " . $productId . " LIMIT 1");
if (mysqli_num_rows($queryShortUrl) > 0) {
$gotoShortUrl = mysqli_fetch_object($queryShortUrl);
$urlParams = ['produrlname' => $gotoShortUrl->urlname];
if (isset($_REQUEST['s'])) {
// From SMS
$urlParams = array_merge(
$urlParams,
['utm_source' => 'sms', 'utm_medium' => 'autosms', 'utm_campaign' => 'smsalert30']
);
}
$url = $urlGenerator->generate('app.legacy.auction.object', $urlParams);
header('Location: ' . $url);
exit();
}
// If products_id not found, show 404.
$_REQUEST['page'] = '404';
}
if (!empty($_REQUEST["produrlname"])) {
$query = "SELECT products_id FROM products_description WHERE urlname='" . $db->escape_string($_REQUEST["produrlname"]) . "' AND language_id=" . $language;
$result = mysqli_query($db, $query);
if (mysqli_num_rows($result) > 0) {
$obj = mysqli_fetch_object($result);
$products_id = $obj->products_id;
if ($parameters->get('app.instance') === 'se' && $products_id === 224486) {
header("Location:/", true, 301);
exit();
}
$dataLayer['pageType'] = 'product';
} else {
$_REQUEST['page'] = '404';
}
}
if (!empty($_REQUEST['caturlname'])) {
$categoriesUrl = $_REQUEST['caturlname'];
$categoryModel = $categoriesObject->getCategoryByUrl($categoriesUrl);
if (!is_null($categoryModel->getId())) {
$_REQUEST['catid'] = $categoryModel->getId();
if ($categoryModel->getCtLevel() > 0) {
$urlArray = explode('/', $categoryModel->getUrl());
if (count($urlArray)) {
$parent = $categoriesObject->getCategoryByUrl($urlArray[0]);
$_REQUEST['catid'] = $parent->getId();
$_REQUEST['subcatid'] = $categoryModel->getId();
}
}
$dataLayer['pageType'] = 'category';
$dataLayer['categoryName'] = $categoryModel->getName();
} else {
// Redirect with 301 to new URL if old URL found.
// If a matching url is found in the categoriesUrlHistory.
$categoriesUrlHistoryResult = mysqli_query($db,sprintf(
"SELECT categories_id FROM categoriesUrlHistory WHERE url='%s'",
$db->escape_string($categoriesUrl)
)
);
if ($categoriesUrlHistoryResult && mysqli_num_rows($categoriesUrlHistoryResult)) {
$categoryModel = $categoriesObject->getCategory(
mysqli_fetch_object($categoriesUrlHistoryResult)->categories_id
);
if (!is_null($categoryModel->getId())) {
header('HTTP/1.1 301 Moved Permanently');
header(sprintf('Location: %s', $categoryModel->getCompleteUrl()));
die;
}
}
$explodedCategoriesUrl = explode('/', $categoriesUrl);
$categoriesUrlEnd = end($explodedCategoriesUrl);
$categoryModel = $categoriesObject->getCategoryByOldUrlName($categoriesUrlEnd);
if (!is_null($categoryModel->getId())) {
$routeName = 'app.legacy.auction.listing.category';
if (!empty($_REQUEST['specialcat']) && 'closed' === $_REQUEST['specialcat']) {
$routeName = 'app.legacy.auction.listing.closed.category';
}
$redirectUrl = $urlGenerator->generate($routeName, ['caturlname' => $categoryModel->getUrl()]);
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $redirectUrl);
die;
}
header('Location: /');
exit();
}
}
if (
(isset($_REQUEST['specialcat']) && $_REQUEST['specialcat'] === 'all')
|| (isset($_REQUEST['cat']) && $_REQUEST['cat'] === 'all')
) {
$_REQUEST['catid'] = 0;
}
if (!empty($_REQUEST["urlname"])) {
$query = "SELECT id, pagetype FROM pages WHERE url='" . $db->escape_string($_REQUEST["urlname"]) . "' AND language=" . $language;
$result = mysqli_query($db, $query);
if (mysqli_num_rows($result) > 0) {
$obj = mysqli_fetch_object($result);
$pid = $obj->id;
$dataLayer['pageType'] = $obj->pagetype;
}
} elseif (!empty($_REQUEST["page"])) {
$cres = $db->query("SELECT id, pagetype FROM pages WHERE pagetype='" . $db->escape_string($_REQUEST['page']) . "' AND language=" . $language);
if (mysqli_num_rows($cres)) {
$crow = mysqli_fetch_object($cres);
$pid = $crow->id;
$dataLayer['pageType'] = $crow->pagetype;
} elseif (!isset($dataLayer['pageType'])) {
$pageName = $_REQUEST['page'];
switch ($pageName) {
case "auction":
if (isset($_REQUEST['specialcat'])) {
$pageName = "category_" . $_REQUEST['specialcat'];
}
break;
case "login":
if (isset($_REQUEST['logintab'])) {
$pageName .= "_" . $_REQUEST['logintab'];
}
break;
case "buyer":
if (isset($_REQUEST['buyertab'])) {
$pageName .= "_" . $_REQUEST['buyertab'];
}
break;
case "vendor":
if (isset($_REQUEST['vendortab'])) {
$pageName .= "_" . $_REQUEST['vendortab'];
if ($_REQUEST['vendortab'] === 'reports' || $_REQUEST['vendortab'] === 'overview' || $_REQUEST['vendortab'] === 'info') {
$manifestAssets->add('bundle-ui-Tooltip/kTooltip');
}
} else {
$manifestAssets->add('bundle-ui-Tooltip/kTooltip');
}
break;
case "register":
case "register_thanks":
if (isset($_REQUEST['clienttype'])) {
$pageName .= "_" . $_REQUEST['clienttype'];
}
break;
default:
break;
}
$dataLayer['pageType'] = $pageName;
}
} else {
$cres = mysqli_query($db,"SELECT id, pagetype FROM pages WHERE pagetype='frontpage' AND language=" . $language);
if (mysqli_num_rows($cres)) {
$crow = mysqli_fetch_object($cres);
$pid = $crow->id;
$dataLayer['pageType'] = "frontpage";
}
}
// The variable $page is used in various places with wildy different
// data. Somtimes it is a string of the pagetype, other times it is
// an object with page data. Unfortunately I don't know why that is,
// so I don't dare change it. I'll just add another variable to the
// fray. It is used to add a unique class to the body element in
// order to be able to style pages with unique layouts, e.g. the
// about page.
$pagetype = call_user_func(static function($pid) use ($db) {
if (!is_numeric($pid)) {
return null;
}
$res = mysqli_query($db, "SELECT pagetype FROM pages WHERE id = " . (int)$pid);
return mysqli_fetch_object($res)->pagetype;
}, $pid);
$continueUrlParams = [];
if ((isset($_REQUEST['page'])) && ($_REQUEST['page'] == 'auction')) {
$continueUrlParams['continue'] = $_SERVER['REQUEST_URI'];
}
$jsParams = [];
foreach($parameters->all() as $key => $value) {
$stringKey = u($key);
if (!$stringKey->startsWith('js.param.')) {
continue;
}
$jsKey = strtolower($stringKey->trimStart('js.param.'));
$jsParams[$jsKey] = $value;
}
if (isset($_SESSION['dataLayer']) && count($_SESSION['dataLayer'])) {
$dataLayer = array_merge($dataLayer, $_SESSION['dataLayer']);
unset($_SESSION['dataLayer']);
}
/**
* @var \Symfony\Component\HttpFoundation\Request $request
*/
if (isset($_REQUEST['page'], $products_id) && $_REQUEST["page"] === "auction") {
$ogImage = getFirstProductImageUrl($db, $products_id);
} else {
$ogImage = $request->getSchemeAndHttpHost() .'/images/klaravik-share-icon-200x200.png';
}
/** @var \Klaravik\Page\PropUserData $propUserData */
$propUserData = $container->get(\Klaravik\Page\PropUserData::class);
$propUserName = $propUserData->getUserName();
$propLogged = $propUserData->isLogged();
$propUser = $propUserData->getUserType();
$propAlias = $propUserData->getAlias();
$propMultiUser = $propUserData->isMultiUser();
$multiRegisterCollection = $propUserData->getMultiRegisterCollection();
$multiUserCollection = $propUserData->getMultiUserCollection();
if (isset($pid) && is_numeric($pid)) {
try {
$pageObject = (new \Klaravik\Repository\PageRepository())->getById($pid);
if(!empty($pageObject->getTitle())) {
$title = $pageObject->getTitle();
$shortTitle = $pageObject->getTitle();
}
if(!empty($pageObject->getMetaKeyword())) {
$keywords = $pageObject->getMetaKeyword();
}
if(!empty($pageObject->getMetaDescription())) {
$description = $pageObject->getMetaDescription();
}
// Kontrollera om det finns någon enkät på sidan
$textEnkatQuery = "SELECT enkat_id FROM text WHERE sida=".(int)$pid." AND enkat_id > 0";
$textEnkatResult = mysqli_query($db, $textEnkatQuery);
if (mysqli_num_rows($textEnkatResult)) {
$textEnkat = mysqli_fetch_object($textEnkatResult);
$enkatQuery = "SELECT id, overskrift FROM enkat WHERE id=".(int)$textEnkat->enkat_id;
$enkatResult = mysqli_query($db, $enkatQuery);
if (mysqli_num_rows($enkatResult)) {
$enkat = mysqli_fetch_object($enkatResult);
if(!array_key_exists('formEditor', $dataLayer)) {
$dataLayer['formEditor'] = array(
'id' => $enkat->id,
'name' => $enkat->overskrift,
'submitted' => false
);
}
}
}
if ($pageObject->getWordpressPageId() > 0) {
/** @var \Klaravik\Page\MarketWpClient $marketWordPressClient */
$marketWordPressClient = $container->get(\Klaravik\Page\MarketWpClient::class);
echo $marketWordPressClient->getPageHTML($pageObject, $propUserData, $jsParams, $dataLayer, compact(
'title',
'keywords',
'description',
'ogImage',
'shortTitle',
));
die;
}
} catch (RepositoryException $e) {}
}
if(!empty($_REQUEST["produrlname"]) && isset($products_id)) {
$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)."'";
$prodtResult = mysqli_query($db, $prodtQuery);
if(mysqli_num_rows($prodtResult) == 0) {
$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)."'";
$prodtResult = mysqli_query($db, $prodtQuery);
}
if(mysqli_num_rows($prodtResult) > 0) {
$prodt = mysqli_fetch_object($prodtResult);
if ($prodt->page_title !== '') {
$title = $prodt->page_title;
$shortTitle = $prodt->page_title;
} elseif (!empty($prodt->name)) {
$title = $trans->get("ALIAS_TITLE_PREFIX_OBJECT")." ".$prodt->name;
$shortTitle = $prodt->name;
}
if(!empty($prodt->meta_keyword)) {
$keywords = $prodt->meta_keyword;
}
if(!empty($prodt->meta_description)) {
$description = $trans->get("ALIAS_DESCRIPTION_PREFIX_OBJECT")." ".$prodt->meta_description;
} elseif (!empty($prodt->name)) {
$description = $trans->get("ALIAS_DESCRIPTION_PREFIX_OBJECT")." ".$prodt->name;
}
$curBid = null;
$bidSql = "SELECT bid FROM bids WHERE products_id=".(int)$products_id." ORDER BY bid DESC LIMIT 1";
$bidRes = mysqli_query($db, $bidSql);
if (mysqli_num_rows($bidRes)) {
$bid = mysqli_fetch_object($bidRes);
$curBid = $bid->bid;
}
$resPriceReached = false;
if((($curBid !== null && ($curBid >= $prodt->resprice && $prodt->resprice > 0)) || ($curBid > $prodt->resprice && $prodt->resprice == 0)) || $prodt->resprice == 0) {
$resPriceReached = true;
}
$categoriesToImplode = array();
foreach ($categoriesObject->getPublicThreeForCategory($prodt->categories_id) as $categoryItem) {
$categoriesToImplode[] = $categoryItem->getName();
}
try {
$productHasEnded = (new DateTime()) > (new DateTime($prodt->auctionend));
} catch (Exception $e) {
$productHasEnded = false;
}
$dataLayer['view'] = (int)$products_id;
$dataLayer['product'] = array(
'productsId' => (int)$products_id,
'categoriesId' => (int)$prodt->categories_id,
'categoryName' => implode('>', $categoriesToImplode),
'vendorsId' => (int)$prodt->vendors_id,
'name' => $prodt->name,
'resPriceReached' => $resPriceReached,
'ended' => $productHasEnded,
);
}
}
if(isset($_REQUEST['page']) && (string)$_REQUEST["page"] === "404") {
header("HTTP/1.1 404 Not Found");
$title = $trans->get('error_page_not_found_title');
}
if (isset($_REQUEST['catid']) && (int)$_REQUEST['catid']) {
$categoryModel = $categoriesObject->getCategory($_REQUEST['catid']);
if ($categoryModel->getHeadtitle() !== '') {
$title = $shortTitle = $categoryModel->getHeadtitle();
}
if ($categoryModel->getMetadescription() !== '') {
$description = $categoryModel->getMetadescription();
}
}
if(DEV_MODE) {
$title = basename(__DIR__). ' ' . $title;
}
global $includedJavaScript;
$includedJavaScript = array();
function includeJS($string, $inline = false) {
global $includedJavaScript;
$includedJavaScript[] = array(
'string' => $string,
'inline' => $inline
);
}
global $includedCSS;
$includedCSS = array();
function includeCSS($url, $media = "screen") {
global $includedCSS;
$includedCSS[] = array(
'url' => $url,
'media' => $media
);
}
$manifestAssets->add('bundle-checkBrowser');
/*
* make sure that $currentpage also considers clienttype so we can
* differentiate register pages and what assets to include separately by clienttype
*/
$currentPage = 'home';
if (isset($_REQUEST['page'])) {
$currentPage = $_REQUEST['page'];
if (isset($_REQUEST['clienttype'])) {
$currentPage .= '_' . $_REQUEST['clienttype'];
}
}
$additionalBodyClass = [];
// All css included before this is set as default.
switch ($currentPage) {
case "contactrealtor":
case "howtosell":
includeCSS('/css/vendors/mapbox-gl@v1.10.1.css');
break;
case "requestAdvance":
$manifestAssets->add('bundle-common');
break;
case "vendor":
includeCSS('/css/jquery-ui.min.css');
includeCSS('/css/jquery.qtip.css');
includeCSS('/css/select2.min.css');
break;
case "annons":
case "404":
case "english":
case "kopinfo":
case "saljinfo":
case "text":
case "form_thanks":
$manifestAssets->add('bundle-common');
break;
case "auction":
// page_product || page_list
includeCSS('/css/page-product.css');
if(isset($products_id)) {
// page_product.phtml
includeCSS('/css/jquery-ui.min.css');
// Single-product
$manifestAssets
->add('shared')
->add('bundle-single-product');
$additionalBodyClass = array_merge($additionalBodyClass, ['page', 'product']);
} else {
// page_list
$additionalBodyClass = array_merge($additionalBodyClass, ['page', 'product', 'list']);
}
break;
case "financing":
// page_financing
includeCSS('/css/jquery-ui.min.css');
break;
case "home":
// home - page_list
$additionalBodyClass = array_merge($additionalBodyClass, ['page', 'all', 'product', 'list']);
break;
case "vendorRegistration":
includeCSS('/css/jquery-ui.min.css');
$manifestAssets
->add('bundle-common')
->add('shared')
->add('bundle-register-new-seller');
break;
case "favorites":
includeCSS('/css/page-product.css');
$additionalBodyClass = array_merge($additionalBodyClass, ['auction', 'page', 'list']);
break;
case "savedSearch":
$manifestAssets->add('bundle-common')->add("shared")->add("bundle-saved-search");
break;
case "dac7":
includeCSS('/css/jquery-ui.min.css');
break;
default:
// prints "Unknown page.\n";
// Should not be handled as default for css.
break;
}
$products_id = $products_id ?? null;
/** @var Twig\Environment $twigEnvironment */
$twigEnvironment = $container->get('twig');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $parameters->get('app.lang'); ?>" lang="<?php echo $parameters->get('app.lang'); ?>">
<head>
<script type="text/javascript">
window.cachedCategories = <?php echo json_encode($cachedCategories->loadCachedCategories()); ?>;
window.params = <?php echo json_encode($jsParams); ?>;
dataLayer = [<?php echo json_encode($dataLayer); ?>];
savedSearchURL = '<?php echo $urlGenerator->generate('app.buyer.saved.savedSearch'); ?>';
</script>
<?php
if (array_key_exists("preview", $_REQUEST)) {
?>
<meta name="robots" content="noindex">
<?php
}
includeJS('/assets/js/modernizr.js');
echo $twigEnvironment->render('public/head.html.twig', compact(
'title',
'keywords',
'description',
'ogImage',
'shortTitle',
'products_id',
'includedCSS',
'currentPage',
'manifestAssets',
));
?>
</head>
<?php
$skipChat = true;
if (ZENDESKCHAT) {
$skipChat = false;
if (!empty($_SESSION["users_id"])) {
$userObj = getNodei($db, "users", $_SESSION["users_id"]);
if ($userObj->auth_user != "") {
$skipChat = true;
}
}
}
// Check if buyer has all necessary SESSIONS, if not log out the buyer.
if (isset($_SESSION["register_id"]) && !isRegisterSignedIn()) {
unsetRegisterSessions();
header('Location: /');
}
if(
$parameters->get('app.bankid.enable') &&
isset($_SESSION['register_id']) &&
$_SESSION['bankIDActive'] === false &&
isset($_SESSION['register_clientType']) &&
!in_array($_SESSION['register_clientType'], ['UF', 'UP']) &&
!$_SESSION['exceptRequiredAuthentication']
) {
$additionalBodyClass[] = 'user-bankid-verification';
}
if ($pagetype) {
print "<body class=\"".htmlspecialchars($pagetype)." ".implode(' ', $additionalBodyClass)."\">\n";
} elseif (isset($_REQUEST["page"])) {
/**
* if register pages, give class name of .register and .register_{type}
** (seems to be register pages and register/thank-you pages)
* else only $_REQUEST['page'] as classname (pages without clienttype set)
*/
print "<body class=\"
". (isset($_REQUEST["clienttype"]) ? $_REQUEST["page"] . "
" . $_REQUEST["page"] . "_" .$_REQUEST["clienttype"] : $_REQUEST["page"])
. (isset($_REQUEST['specialcat']) ? ' '.htmlspecialchars($_REQUEST['specialcat']) : '')
. (isset($categoriesUrl) ? ' '.$categoriesUrl : '')
. (isset($_REQUEST['vendortab']) ? ' '.htmlspecialchars($_REQUEST['vendortab']) : '')
. ' ' . implode(' ', $additionalBodyClass) . "
\">\n";
} else {
print "<body class=\"frontpage ".implode(' ', $additionalBodyClass)."\">\n";
}
if (!DEV_MODE && !empty($parameters->get('gtm.id'))) {
?>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo $parameters->get('gtm.id');?>"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<?php
} elseif (DEV_MODE && !empty($parameters->get('gtm.id.dev'))) {
$gitString = '';
$branchName = 'master';
if (is_file(PROJECT_ROOT . '/.git/HEAD')) {
$gitString = file_get_contents(PROJECT_ROOT . '/.git/HEAD', FILE_USE_INCLUDE_PATH);
$branchName = rtrim(preg_replace("/(.*?\/){2}/", '', $gitString));
}
$branch_cookie = $_COOKIE['devBranch'] ?? '';
?>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo $parameters->get('gtm.id.dev'); ?>"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<?php
$twig->display('dev/dev_menu.html.twig', [
"devMenu" => new Dev\DevMenuController(),
"branchCookie" => $branch_cookie,
"branchName" => $branchName,
]);
}
?>
<script>
let isInitialized = false;
const kLocale = window.params.klocale;
const kLanguage = window.params.klanguage;
</script>
<?php
$propSearchtext = "";
if (!empty($_REQUEST['searchtext'])) {
$propSearchtext = $_REQUEST['searchtext'];
}
$propSearchtext = urldecode($propSearchtext);
$propSearchCounty = "";
$requestSetCountyFlag = $_REQUEST['setcountyflag'] ?? null;
$setCountyFlagData = [];
if ($requestSetCountyFlag) {
$setCountyFlagData[] = $requestSetCountyFlag;
if (is_array($requestSetCountyFlag)) {
$setCountyFlagData = $requestSetCountyFlag;
}
}
$requestSetMunicipality = $_REQUEST['setmunicipality'] ?? null;
$setMunicipalityData = [];
if ($requestSetMunicipality) {
$setMunicipalityData[] = $requestSetMunicipality;
if (is_array($requestSetMunicipality)) {
$setMunicipalityData = $requestSetMunicipality;
}
}
if ($requestSetCountyFlag && !in_array('all', $setCountyFlagData)) $propSearchCounty = $setCountyFlagData;
$propSearchMunicipality = "";
if ($requestSetMunicipality && !in_array('all', $setMunicipalityData)) $propSearchMunicipality = $setMunicipalityData;
if ($propMultiUser):
$multiAccounts = [
[
'title' => $trans->get('text_label_app-index_company-accounts'),
'data' => $multiRegisterCollection->getCompanyTypes(),
],
[
'title' => $trans->get('text_label_app-index_private-account'),
'data' => $multiRegisterCollection->getPrivateTypes(),
]
];
$lockedCss = !isset($_SESSION['register_id']) && !isset($_SESSION['users_id']) ? 'show lock' : '';
?>
<!--Modal account-switcher-->
<div class="account-switcher <?php echo $lockedCss; ?>" id="account-switcher">
<div class="account-switcher__container" id="modal-container">
<div class="account-switcher__close-modal" id="account-switcher-close">
<i class="ri-close-fill"></i>
</div>
<div class="account-switcher__flex">
<div class="account-switcher__inner">
<div class="account-switcher__icon">
<i class="ri-arrow-left-right-line"></i>
</div>
<div class="row">
<div class="small-10 small-offset-1 medium-12 medium-offset-0">
<div class="account-switcher__header">
<span class="account-switcher__headline"><?php $trans->eGet('text_headline_app-index_account-switcher'); ?></span>
</div>
</div>
</div>
<div class="account-switcher__accounts">
<div class="account-switcher__account-group">
<div class="account-switcher__account-title"><?php $trans->eGet('text_label_app-index_buyer-accounts'); ?>:</div>
<?php
/** @var RegisterCollection $multiAccount */
foreach ($multiAccounts as $multiAccount):
if (!$multiAccount['data']->count()) {
continue;
}
?>
<?php
/** @var \Klaravik\Model\Register $accountData */
foreach ($multiAccount['data'] as $accountData):
$clientTypeString = $trans->get(
'text_label_app-index_client-type',
['clientType' => $accountData->getClienttype()]
);
if ($accountData->getClienttype() === 'SF' && $accountData->isSoleProprietorship()) {
$clientTypeString = $trans->get(
'text_label_app-index_client-type',
['clientType' => 'EF']
);
}
$inactiveAccount = '';
if (!$accountData->getActive()) {
$clientTypeString = $trans->get('text_label_app-index_inactive-account');
$inactiveAccount = 'inactive';
}
switch ($accountData->getClienttype()) {
case "SF":
$icon = 'ri-home-smile-fill';
// Check if EF.
if ($accountData->isSoleProprietorship()) {
$icon = 'ri-user-smile-fill';
}
break;
case "SP":
$icon = 'ri-user-fill';
break;
}
$activeAccount = '';
$switchUserIcon = 'ri-arrow-right-line';
$disableSwitch = 'submitFunction(this);';
if ($accountData->getId() === (int)($_SESSION['register_id'] ?? 0)) {
$activeAccount = 'active';
$switchUserIcon = 'ri-check-fill';
$disableSwitch = 'return false';
}
?>
<div class="">
<?php
echo <<<HTML
<form class="account-switcher__form" action="{$urlGenerator->generate(
'app.legacy.index',
array_merge(
['doSwitchUser' => (int)$accountData->getId(), 'userType' => 'register'],
$continueUrlParams
),
UrlGeneratorInterface::ABSOLUTE_URL
)}" method="post">
HTML;
?>
<div class="account-switcher__account <?php echo $activeAccount; echo $inactiveAccount ?>">
<span class="account-switcher__account-icon <?php echo $activeAccount; ?>">
<i class="<?php echo $icon; ?>"></i>
</span>
<span class="account-switcher__user-and-type">
<div class="account-switcher__user-name <?php echo $inactiveAccount; ?>">
<?php echo $accountData->getRegisterName(); ?>
</div>
<div class="account-switcher__client-type <?php echo $inactiveAccount; ?>">
<?php echo $clientTypeString; ?>
</div>
</span>
<?php if ($accountData->getActive()) { ?>
<span class="account-switcher__icon-switch <?php echo $activeAccount; ?>">
<i class="<?php echo $switchUserIcon; ?>"></i>
</span>
<div class="account-switcher__icon-loader" data-src="/images/lottie-animations/loader.json"></div>
<?php } else {
// TODO: Should be an ajax-request to the endpoint /api/buyer/{register_id}/activation/send
echo '<span class="account-switcher__activation-link" id="send-activation-button" data-registerid="'. $accountData->getId() .'">
<span class="mail-icon-text"><i class="ri-mail-send-line"></i>'.$trans->get("text_label_app-index_account-switcher_send-verification-mail").'</span>
</span>';
} ?>
</div>
</form>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
<?php if (!empty($multiUserCollection->toArray())) { ?>
<div class="account-switcher__account-group">
<div class="account-switcher__account-title"><?php $trans->eGet('text_label_app-index_vendor-accounts') ?>:</div>
<?php
foreach ($multiUserCollection as $userAccount) :
// Todo:
// active
// Form action till switcher
$currentAccount = '';
if ($userAccount->getId() === (int)($_SESSION['users_id'] ?? 0)) {
$currentAccount = '->';
}
?>
<?php
$inactiveAccount = '';
if (!$userAccount->getActive()) {
$clientTypeString = $trans->get('text_label_app-index_inactive-account');
$inactiveAccount = 'inactive';
}
$activeAccount = '';
$icon = 'ri-briefcase-5-fill';
$switchUserIcon = 'ri-arrow-right-line';
$disableSwitch = 'submitFunction(this);';
if ($userAccount->getId() === (int)($_SESSION['users_id'] ?? 0)) {
$activeAccount = 'active';
$switchUserIcon = 'ri-check-fill';
$disableSwitch = 'return false';
}
?>
<div>
<?php
$postUrlForm = $urlGenerator->generate(
'app.legacy.index',
array_merge(
['doSwitchUser' => (int)$userAccount->getId(), 'userType' => 'user'],
$continueUrlParams
),
UrlGeneratorInterface::ABSOLUTE_URL
);
?>
<form class="account-switcher__form" action="<?php echo $postUrlForm; ?>" method="post">
<div class="account-switcher__account <?php echo $activeAccount; echo $inactiveAccount ?>">
<span class="account-switcher__account-icon <?php echo $activeAccount; ?>">
<i class="<?php echo $icon; ?>"></i>
</span>
<span class="account-switcher__user-and-type">
<div class="account-switcher__user-name <?php echo $inactiveAccount; ?>">
<?php echo $userAccount->getName(); ?>
</div>
<div class="account-switcher__client-type <?php echo $inactiveAccount; ?>">
<?php $trans->eGet('text_label_app-index_clienttype_vendor'); ?>
</div>
</span>
<?php if ($userAccount->getActive()) { ?>
<span class="account-switcher__icon-switch <?php echo $activeAccount; ?>">
<i class="<?php echo $switchUserIcon; ?>"></i>
</span>
<div class="account-switcher__icon-loader" data-src="/images/lottie-animations/loader.json"></div>
<?php } ?>
</div>
</form>
</div>
<?php endforeach; ?>
</div>
<?php } ?>
</div>
</div>
</div>
<a class="account-switcher__logout" id="account-switcher-button"
href="<?php echo ($propUser === 'seller'
? $urlGenerator->generate('app.legacy.pages.vendor.logout')
: $urlGenerator->generate('app.legacy.pages.buyer.logout')); ?>">
<span>
<span class="icon">
<i class="ri-logout-circle-r-line"></i>
</span>
<?php $trans->eGet('text_label_app-index_log-out'); ?>
</span>
</a>
</div>
</div>
<?php endif; ?>
<!-- End of account-switcher modal -->
<div class="header">
<div class="topbar">
<div class="topbar__wrapper">
<div class="topbar__left-links">
<!-- todo: i18n - maybe need to be another type of page -->
<a
class="left-link left-link__black contact-link"
href="<?php echo $urlGenerator->generate(
'app.legacy.pages.contact'); ?>"
>
<span></span>
<?php $trans->eGet('text_label_app-index_header-contact-us'); ?>
</a>
<a
class="left-link left-link__black faq-link"
href="<?php echo $urlGenerator->generate('app.legacy.pages.faq'); ?>"
>
<span></span><?php $trans->eGet('text_label_app-index_header-faq'); ?>
</a>
<span class="divider-bar"></span>
<a
class="left-link left-link__green auction-link"
href="<?php echo $urlGenerator->generate('app.legacy.auction.listing'); ?>"
>
<span></span><?php $trans->eGet('text_label_app-index_header-all-auctions'); ?>
</a>
<?php
if ('se' === $parameters->get('app.instance')):
?>
<a
class="left-link left-link__green bankruptcy-link"
href="<?php echo $urlGenerator->generate('app.legacy.auction.listing.bankruptcy'); ?>"
>
<span></span><?php $trans->eGet('text_label_app-index_header-bankruptcy-auctions'); ?>
</a>
<?php
endif;
?>
</div>
<div class="topbar__right-links">
<!-- Not lopgged in -->
<?php if(!$propLogged): ?>
<a
class="button--small button--rounded button--secondary register-link"
href="<?php echo $urlGenerator->generate('app.legacy.pages.register'); ?>"
>
<i class="ri-user-add-line"></i><?php $trans->eGet('text_label_app-index_header-create-account'); ?>
</a>
<a
class="right-link right-link__primary login-link"
href="<?php echo $urlGenerator->generate('app.legacy.pages.login', $continueUrlParams); ?>"
>
<i class="ri-user-fill"></i><?php $trans->eGet('text_label_app-index_header-login'); ?>
</a>
</div>
<!--Vendor, single buyer-->
<?php elseif( in_array($propUser, ['buyer', 'seller']) && !$propMultiUser): ?>
<div class="topbar__userinfo">
<ul class="topbar__userinfo-dropdown">
<li>
<a
href="<?php echo ($propUser === 'seller'
? $urlGenerator->generate('app.legacy.pages.vendor.logout')
: $urlGenerator->generate('app.legacy.pages.buyer.logout')); ?>">
<?php $trans->eGet('text_label_app-index_log-out'); ?>
</a>
</li>
</ul>
<div class="topbar__userinfo-trigger">
<a href="<?php echo ($propUser === 'seller'
? $urlGenerator->generate('app.legacy.pages.vendor')
: $urlGenerator->generate('app.legacy.pages.buyer')); ?>">
<span class="user-name"> <?php echo $propUserName; ?></span>
<span class="client-type"> <?php echo $propAlias; ?></span>
</a>
</div>
</div>
<!--Multi-->
<?php else: ?>
<div class="topbar__userinfo-trigger multi">
<a id="user-info">
<span class="user-name"> <?php echo $propUserName; ?></span>
<span class="client-type"><?php echo $propAlias; ?></span>
</a>
</div>
<div class="topbar__account-switcher" id="account-switcher-opener">
<i class="ri-arrow-left-right-line ri-1x"></i>
</div>
<?php endif;
// buyer
$savedURL = $urlGenerator->generate('app.legacy.pages.buyer.saved.favorites');
if (isset($_COOKIE['savedURL'])) {
$savedURL = $_COOKIE['savedURL'];
}
if ($propLogged && $propUser === 'buyer'): ?>
<span class="divider-bar" id="right-divider"></span>
<a
class="button--small button--rounded button--secondary favorites-link"
href="<?php echo $savedURL ?>"
>
<span></span><?php $trans->eGet('text_label_app-index_saved'); ?>
</a>
<?php endif; ?>
<?php if ($propLogged): ?>
<a class="right-link right-link__primary login-link"
href="<?php echo ( $propUser === 'seller'
? $urlGenerator->generate('app.legacy.pages.vendor')
: $urlGenerator->generate('app.legacy.pages.buyer')); ?>">
<i class="ri-user-fill"></i><?php $trans->eGet('text_label_app-index_my-account'); ?>
</a>
</div>
<?php endif; ?>
</div>
</div>
<div class="middlebar">
<a class="main-logo" href="<?php echo $urlGenerator->generate('app.legacy.index'); ?>">
<svg id="klaravik-logo" xmlns="http://www.w3.org/2000/svg" width="376" height="59.714" viewBox="0 0 376 59.714">
<g transform="translate(0 -0.05)">
<g id="Group_2348" data-name="Group 2348" transform="translate(242.111 1.482)">
<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"/>
</g>
<g id="Group_2349" data-name="Group 2349" transform="translate(55.487 1.482)">
<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"/>
</g>
<g id="Group_2350" data-name="Group 2350" transform="translate(0 1.482)">
<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"/>
<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"/>
</g>
<g id="Group_2351" data-name="Group 2351" transform="translate(324.163 1.482)">
<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"/>
<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"/>
</g>
<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"/>
<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"/>
<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"/>
</g>
</svg>
<svg id="klaravik-icon-rgb" xmlns="http://www.w3.org/2000/svg" width="27.176" height="30" viewBox="0 0 27.176 30">
<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"/>
<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"/>
</svg>
</a>
<div id="category-links" class="category-links">
</div>
</div>
<div class="bottombar">
<div class="bottombar__wrapper">
<form id="searchform" action="<?php echo $urlGenerator->generate('app.legacy.auction.listing'); ?>" method="get" class="searchform validate-form">
<div class="form-field-3">
<div class="form-field-3__input-wrapper">
<input
class="form-field-3__input-field validate-field"
type="text"
name="searchtext"
value="<?php echo $propSearchtext?>"
placeholder="<?php $trans->eGet('text_label_app-index_top-search-placeholder'); ?>"
id="topsearch"
/>
<span class="form-clear-field"></span>
</div>
<div class="form-field-3__clear">
<button
type="submit"
value=""
name="dosearch"
class="form-field-3__button"
aria-label="<?php $trans->eGet('info_label_app-index_menu-search-aria-label'); ?>"
>
<img
src="/images/icon-search-white.svg"
height="19"
width="19"
class="subscription-arrow"
alt="<?php $trans->eGet('text_label_app-index_magnifying-glass'); ?>"
>
</button>
</div>
</div>
</form>
<div class="bottombar__links">
<a
class="link link__green closed-link"
href="<?php echo $urlGenerator->generate('app.legacy.auction.listing.closed'); ?>"
>
<span></span><?php $trans->eGet('text_label_app-index_header-closed-auctions'); ?>
</a>
<a
href="<?php echo $urlGenerator->generate('app.legacy.pages.howtosell'); ?>"
id="salesButton"
class="salesButton button--medium button--rounded button--outlined"
>
<span><?php $trans->eGet('text_label_app-index_klaravik-sales'); ?></span>
</a>
</div>
</div>
</div>
</div>
<div class="row hamburger-position-bar">
<div class="columns small-8 mobile-logo">
<a href="<?php echo $urlGenerator->generate('app.legacy.index'); ?>" id="logo">
<svg xmlns="http://www.w3.org/2000/svg" width="232" height="36.844" viewBox="0 0 232 36.844">
<g id="Logo" transform="translate(0 -0.05)">
<g id="Group_2348" data-name="Group 2348" transform="translate(149.388 0.934)">
<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"/>
</g>
<g id="Group_2349" data-name="Group 2349" transform="translate(34.237 0.934)">
<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"/>
</g>
<g id="Group_2350" data-name="Group 2350" transform="translate(0 0.934)">
<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"/>
<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"/>
</g>
<g id="Group_2351" data-name="Group 2351" transform="translate(200.015 0.934)">
<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"/>
<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"/>
</g>
<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"/>
<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"/>
<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"/>
</g>
</svg>
</a>
</div>
<div class="columns small-4 mobile-hamburger">
<a href="#" class="hamburger-position-bar__icon" id="hamburger-position-bar__icon">
<div style="height:22px; width: 22px;" id="lottie-hamburger-menu" class="lottie-hamburger-menu" data-src="/images/lottie-animations/hamburger-menu.json"></div>
</a>
</div>
</div>
<?php if($parameters->get('app.instance') === 'dk' && date("Y-m-d") < "2024-03-18"): ?>
<div id="topbar-fi">
<p class="topbar-fi__text">
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.
</p>
<a href="https://www.klaravik.fi/" target="_blank" class="topbar-fi__readmore button--small button--outlined button--outlined--highlight">Til klaravik.fi</a>
<p href="#" id="topbar-fi__close" class="topbar-fi__icon"><i class="ri-close-line"></i></p>
</div>
<?php endif; ?>
<!-- Mobile multi user, extra header bar -->
<?php if ($propMultiUser): ?>
<div class="multi-user-bar">
<div class="multi-user-bar__flex">
<div class="multi-user-bar__user-info" id="user-info-mobile">
<span class="users"><?php echo $propUserName; ?></span>
<span class="client-types"><?php
echo $trans->get(
'text_label_app-index_client-type',
['clientType' => $_SESSION['register_clientType'] ?? '']
);
?></span>
</div>
<div class="multi-user-bar__icons">
<span class="switch-account-icon" id="switch-account-mobile"><i class="ri-arrow-left-right-line"></i></span>
<span class="divider-mobile"></span>
<a class="my-likes" href="<?php echo $urlGenerator->generate('app.legacy.pages.buyer.saved.favorites');?>">
<span class="likes-icon">
<svg width="14" height="13" viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<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"/>
</svg>
</span>
</a>
<a class="my-account" href="<?php echo $urlGenerator->generate('app.legacy.pages.buyer');?>">
<span class="my-account-icon"><i class="ri-user-fill"></i></span>
</a>
</div>
</div>
</div>
<?php endif;
$bankidBanner = false;
// show banner on all non bankid verified users
// do not show this banner on buyer page in the info tab
if ($parameters->get('app.bankid.enable')) {
if(
(
isset($_SESSION['register_id']) &&
$_SESSION['bankIDActive'] === false &&
isset($_SESSION['register_clientType']) &&
!in_array($_SESSION['register_clientType'], ['UF', 'UP']) &&
!$_SESSION['exceptRequiredAuthentication']
) &&
(
(isset($_REQUEST['page']) && $_REQUEST['page'] !== 'buyer')
|| (isset($_REQUEST['buyertab']) && $_REQUEST['buyertab'] !== 'info')
|| !isset($_REQUEST['page'])
)
) {
$bankidBanner = true;
?>
<a class="topbar-bankID" href="#">
<span class="topbar-bankID__logo"><img src="/images/bankid_register.svg" alt="BankID"></span>
<span class="topbar-bankID__text">Verifiera dig med BankID för att kunna lägga bud</span>
<span class="topbar-bankID__icon"><i class="ri-arrow-right-line"></i></span>
</a>
<?php
renderBankIdModal($trans);
renderVerifyOverlay();
} elseif (isset($_REQUEST['page']) && $_REQUEST['page'] === 'vendor') {
renderVerifyOverlay();
}
//bankid banner/modal endif
} ?>
<?php if (!empty($_SESSION["users_id"])): ?>
<?php
$dacToken = $_SESSION["users_id"];
if (!empty($_REQUEST['filterVendors_id']) && $_REQUEST['filterVendors_id'] != 0) {
$dacToken .= "_".(int)$_REQUEST['filterVendors_id'];
} else if (!empty($_SESSION['filterVendors_id'])) {
$dacToken .= "_".(int)$_SESSION['filterVendors_id'];
}
?>
<div id="topbar-dac7" data-id="<?php echo $dacToken; ?>">
<p class="topbar-dac7__text"><?php $trans->eGet('dac7-title'); ?></p>
<a href="/dac7" class="topbar-dac7__readmore button--small button--outlined button--outlined--highlight"><?php $trans->eGet('dac7-read-more'); ?></a>
<p href="#" id="topbar-dac7__close" class="topbar-dac7__icon"><i class="ri-close-line"></i></p>
</div>
<?php endif; ?>
<div class="topbar_full <?php if($propMultiUser) echo 'extra-margin'?> <?php if($bankidBanner) echo "extra-margin--bankid-banner"; ?>">
<?php
$pageListPath = 'page_list.phtml';
if ($parameters->get('redis.search.active')) {
$pageListPath = 'page_list_redis.php';
}
if(isset($_REQUEST["page"])) {
$cfSiteKey = $parameters->get('cf_turnstile_site');
if($_REQUEST["page"] == "login") {
include("page_login.phtml");
} elseif($_REQUEST["page"] == "register") {
if (isset($_REQUEST["clienttype"])) {
$manifestAssets->add('bundle-pages-register');
include("page_register.phtml");
} else {
$manifestAssets->add('bundle-common');
include("page_register_choose_clienttype.php");
}
} elseif($_REQUEST["page"] == "register_thanks") {
$manifestAssets->add('bundle-common');
include("page_register_thanks.phtml");
} elseif($_REQUEST["page"] == "activate") {
include("page_activate.phtml");
} elseif($_REQUEST["page"] == "forgot") {
include("page_forgot.phtml");
} elseif($_REQUEST["page"] == "editcustomer") {
include("page_editcustomer.phtml");
} elseif ($_REQUEST["page"] == "trustpilot") {
include("page_trustpilot.php");
$manifestAssets->add('bundle-trustpilot-showcase');
} elseif($_REQUEST["page"] == "faq") {
include("page_faq.phtml");
} elseif($_REQUEST['page'] === 'vendorRegistration') {
include("page_vendor_registration.phtml");
} elseif($_REQUEST["page"] === "about") {
include("page_about_" . $parameters->get("app.instance") . ".phtml");
} elseif($_REQUEST["page"] === "howtobuy") {
include("page_howtobuy.phtml");
} elseif($_REQUEST["page"] === "howtosell") {
include("page_howtosell_".$parameters->get("app.instance").".phtml");
} elseif($_REQUEST["page"] === "allrealtors") {
include("page_allrealtors.phtml");
} elseif($_REQUEST["page"] === "contactrealtor") {
include("page_realtor.phtml");
} elseif($_REQUEST["page"] === "buyer") {
include("page_buyer.phtml");
} elseif($_REQUEST['page'] === 'favorites') {
$manifestAssets->add('bundle-pages-list');
echo $this->forward('\Klaravik\Buyer\Controller\FavoritesController::index')->getContent();
} elseif($_REQUEST["page"] == "swish") {
include("page_swish.php");
} elseif ($_REQUEST['page'] == 'exportdocuments') {
include('page_exportdocumentupload.phtml');
} elseif($_REQUEST["page"] == "requestAdvance") {
include("page_requestadvancepay.phtml");
} elseif($_REQUEST["page"] == "requestAdvanceNo") {
$manifestAssets->add('bundle-common');
include("page_requestadvancepayno.phtml");
} elseif($_REQUEST["page"] == "vendor") {
include("page_vendor.phtml");
} elseif($_REQUEST["page"] == "ui-lib") {
include("includes/ui-test.php");
} elseif($_REQUEST["page"] == "404") {
texter($trans, $db, $manifestAssets, "statictext", 404, $language, $cfSiteKey);
} elseif($_REQUEST["page"] == "english") {
$manifestAssets->add('bundle-common');
texter($trans, $db, $manifestAssets, "statictext", 1066, $language, $cfSiteKey);
} elseif($_REQUEST["page"] == "kopinfo") {
texter($trans, $db, $manifestAssets, "statictext", 301, $language, $cfSiteKey);
} elseif($_REQUEST["page"] == "savedSearch") {
echo $this->forward('\Klaravik\Buyer\SavedSearch\Controller\SavedSearchController::build')->getContent();
} elseif($_REQUEST["page"] == "saljinfo") {
texter($trans, $db, $manifestAssets, "statictext", 302, $language, $cfSiteKey);
} elseif($_REQUEST["page"] === "app-download") {
include("page_app_download.php");
} elseif($_REQUEST["page"] == "text") {
$manifestAssets->add('bundle-common');
if(isset($pid) && is_numeric($pid)) {
$pageQuery = "SELECT pagetype, url FROM pages WHERE id=". (int)($pid);
$pageResult = mysqli_query($db, $pageQuery);
if(mysqli_num_rows($pageResult) > 0) {
$page = mysqli_fetch_object($pageResult);
if ($pid == TERMSPAGE) {
include __DIR__ . "/page_terms.php";
texter($trans, $db, $manifestAssets, "text", $pid, $language, $cfSiteKey);
} elseif ($page->url == 'cookies') {
texter($trans, $db, $manifestAssets, "text", $pid, $language, $cfSiteKey);
echo '<div class="row">
<div class="column xlarge-6 xlarge-offset-3 large-8 large-offset-2">
<a onclick="document.getElementById(\'cookiesDeclaration\').classList.toggle(\'cookies-visible\'), this.classList.toggle(\'cookies-active\')" class="cookie-declaration-btn">
'. $trans->get('text_label_app-index_cookies-consent') .'
<svg id="icn-arrow-down-s" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#00682f">
<path id="Path_56238" data-name="Path 56238" d="M0,0H24V24H0Z" fill="none"/>
<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"/>
</svg>
<svg id="icn-arrow-up-s" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#00682f">
<path data-name="Path 56236" d="M0,0H24V24H0Z" fill="none"/>
<path data-name="Path 56237" d="M12,10.828l-4.95,4.95L5.636,14.364,12,8l6.364,6.364L16.95,15.778Z"/>
</svg>
</a>
<div id="cookiesDeclaration">
<h2>'. $trans->get('text_label_app-index_cookies-declaration') .'</h2>';
echo '<script id="CookieDeclaration" data-culture="SE" src="https://consent.cookiebot.com/05ff59ba-3559-4216-af40-9b6b5a930282/cd.js" type="text/javascript" async></script>';
echo '</div></div></div>';
} elseif ($page->url == 'corona-information') {
$manifestAssets->add('bundle-foundation-reInit');
texter($trans, $db, $manifestAssets, "text", $pid, $language, $cfSiteKey);
echo '<div class="covid-content" data-equalizer data-equalizer-mq="large-up">
<div class="covid-content__info" data-equalizer-watch>
<div class="covid-content__list">
'. $trans->get('text_label_app-index_covid-content-list') .'
</div>
</div>
<div class="covid-content__img">
<img
class="covid-content__image"
data-equalizer-watch src="/images/emil_bil_dator-large.jpg"
alt="'. $trans->get('info_altimg_app-index_img-kam') .'"
>
</div>
</div>';
}
else {
renderHeroPagePart($db, $pid);
$manifestAssets->add('bundle-hero-video-image');
texter($trans, $db, $manifestAssets, "text", $pid, $language, $cfSiteKey);
}
} else {
header("HTTP/1.1 404 Not Found");
texter($trans, $db, $manifestAssets, "statictext", 404, $language, $cfSiteKey);
}
} else {
header("HTTP/1.1 404 Not Found");
texter($trans, $db, $manifestAssets, "statictext", 404, $language, $cfSiteKey);
}
} elseif($_REQUEST["page"] == "form_thanks") {
texter($trans, $db, $manifestAssets, "statictext", 4, $language, $cfSiteKey);
} elseif($_REQUEST["page"] == "auction") {
if(isset($products_id)) {
include("page_product.phtml");
} else {
include($pageListPath);
}
} elseif($_REQUEST["page"] == "financing") {
if (isset($_REQUEST['notavailable'])) {
include("page_financing_notavailable.phtml");
} elseif (isset($_REQUEST['financingdone'])) {
include("page_financing_done.phtml");
} else {
include("page_financing.phtml");
}
} elseif($_REQUEST["page"] == "finansiering") {
$manifestAssets->add('bundle-common');
include("page_financing_info.phtml");
} elseif ($_REQUEST['page'] === 'contact') {
$manifestAssets->add('bundle-common');
$manifestAssets->add('bundle-pages-contact-us');
texter($trans, $db, $manifestAssets, "statictext", 250, $language, $cfSiteKey);
} elseif($_REQUEST["page"] === "dac7") {
$vendor = new Klaravik\Model\Vendor();
$vendorRepo = (new \Klaravik\Repository\VendorRepo());
if (!empty($_REQUEST['token']) && !empty($_REQUEST['vendorId'])) {
$token = mb_substr($_REQUEST['token'],0, 40);
if (sha1($_REQUEST['vendorId']) === $token) {
$vendor = $vendorRepo->getVendor($_REQUEST['vendorId']);
} else {
throw new Exception('Bad token');
}
}
$vendorsFlagsRepo = (new \Klaravik\Repository\VendorsFlagsRepo());
$formSubmitted = 0;
if(!empty($_REQUEST['vendorId'])) {
try {
$dacUpdated = $vendorsFlagsRepo->getVendorsById(
$_REQUEST['vendorId']
)->getDacUpdated();
} catch (RepositoryException $e) {
//Do something
}
}
if (!empty($dacUpdated)) {
$formSubmitted = 1;
}
$countryRepo = (new \Klaravik\Repository\CountryRepo());
$countries = $countryRepo->getAll();
// If token is available we need
if (!empty($_REQUEST['idFromForm']) && $formSubmitted === 0) {
$vendorId = (int) $_REQUEST['idFromForm'];
//TODO handle formdata and save in db
if (!empty($_POST['permanent-establishment'])) {
$pEs = count($_POST['permanent-establishment']);
for ($i = 0; $i<$pEs; $i++) {
$countryId = $countryRepo->getIdByIso2($_POST['permanent-establishment'][$i]);
$db->query("INSERT INTO permanentEstablishment_ref (vendors_id, countries_id) VALUES (" . $vendorId . "," . $countryId .")");
}
}
$fHs = count($_POST['fiscal-home']);
for ($i = 0;$i<$fHs; $i++) {
$countryId = $countryRepo->getIdByIso2($_POST['fiscal-home'][$i]);
$tin = $_POST['tin'][$i];
$tin2 = $_POST['tin2'][$i] ?? '';
$stmt = $db->prepare("
INSERT INTO
fiscalHome_ref
(vendors_id, countries_id, tin, tin2)
VALUES
(?,?,?,?)");
$stmt->bind_param('iiss', $vendorId, $countryId, $tin, $tin2);
$stmt->execute();
}
if (!empty($_POST['personal_name'])) {
$name = u($_POST['personal_name'])->split(' ', 2);
$firstName = $name[0]->toString();
if (!empty($name[1])) {
$lastName = $name[1]->toString();
} else {
$lastName = '';
}
$countryId = $countryRepo->getIdByIso2($_POST['personal_country']);
$address = $_POST['personal_address'] ?? '';
$zipcode = $_POST['personal_zipcode'] ?? '';
$city = $_POST['personal_city'] ?? '';
$cprNumber = $_POST['personal_cpr'] ?? '';
$stmt = $db->prepare("
INSERT INTO
personal_information
(vendors_id, firstName, lastName, address, zipcode, city, country, cprNumber)
VALUES
(?,?,?,?,?,?,?,?)
");
$stmt->bind_param('isssssis', $vendorId,$firstName, $lastName, $address, $zipcode, $city, $countryId, $cprNumber);
$stmt->execute();
}
$vendorsFlags = $vendor->getVendorsFlags();
$vendorsFlags->setDacUpdated(1);
$vendorsFlagsRepo->save($vendorsFlags);
$formSubmitted = 1;
if ($vendor->getStopProductStart() === 1) {
if ($vendor->getStopProductReason() === ' - DAC7') {
$vendor->setStopProductStart(0);
$vendor->setStopProductReason('');
} elseif (str_contains($vendor->getStopProductReason(), ' - DAC7')) {
$reason = str_ireplace(' - DAC7', '', $vendor->getStopProductReason());
$vendor->setStopProductReason($reason);
}
try {
$vendorRepo->saveForDac7($vendor, $parameters->get('app.instance'));
} catch (RepositoryException $e) {
//doStuff();
}
}
}
$dac7Params = [
'vendor' => $vendor,
'language' => $parameters->get('app.lang'),
'primaryAddress' => $vendor->getAddresses()->getPrimary()->getFirst(),
'signeeContact' => $vendor->getContacts()->getSignee()->getFirst(),
'countries' => $countries,
'formSubmitted' => $formSubmitted,
];
$twigEnvironment->display('public/dac7/dac7.html.twig', $dac7Params);
$manifestAssets->add('bundle-pages-dac7');
} else {
print "Unknown page.\n";
}
} else {
// Default framsidan!
include($pageListPath);
}
?>
<!-- end .topbar_full --></div>
<?php if($parameters->get('app.instance') === 'se'): ?>
<div id="k-app-ad-banner">
<div class="k-ad-container">
<div id="k-ad-heading">
Enklare <span>budgivning</br>med Klaraviks</span> app
</div>
<div class="k-ad-links">
<a class="k-ad-links__link k-ad-links__appstore"
href="https://apps.apple.com/se/app/klaravik-maskiner-fordon/id6474321257?utm_source=klaravik&utm_medium=link&utm_campaign=download_app&utm_content=ios">
<img src="/images/logotypes/logo_appstore.png" alt="">
</a>
<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">
<img src="/images/logotypes/logo_google_play.svg" alt="">
</a>
</div>
<div id="k-ad-picture">
</div>
</div>
</div>
<?php endif; ?>
<div id="footer_full">
<div class="row">
<div class="small-12 columns show-for-small-only">
<h5 class="subscribe-title"><?php $trans->eGet('text_headline_app-index_newsletter-caption'); ?></h5>
<!-- Begin MOBILE Signup Form -->
<form id="subscribe-mobile-form" action="" method="post">
<div class="subscription-input">
<div class="input-animation">
<span class="input-animation-text">
<?php $trans->eGet('text_label_app-index_newsletter-registration'); ?>
</span>
</div>
<div class="button-inside">
<input
type="email"
value=""
name="EMAIL"
required
class="search-box"
id="mobile-email"
placeholder="<?php $trans->eGet('text_label_app-index_newsletter-email-placeholder'); ?>"
>
<button class="subscribe-erase" style="display: none;"><img src="/images/footer-subscribe-cross.svg" alt=""></button>
</div>
<div class="button-clear">
<button type="submit" value="" name="subscribe" id="subscribe-mobile" class="subscribe-button">
<img
src="/images/arrow-right-white.svg"
class="subscription-arrow"
alt="<?php $trans->eGet('info_altimg_app-index_white-arrow-right'); ?>"
>
<img
src="/images/checkmark-white.svg"
class="subscription-checkmark"
style="display: none;"
alt="<?php $trans->eGet('info_altimg_app-index_white-checkbox'); ?>"
>
</button>
</div>
</div>
<div style="clear: both"></div>
<div id="subscribe-mobile-error"></div>
</form>
<!--End MOBILE Signup form -->
</div>
<div class="large-3 medium-4 small-12 columns hide-for-small" style="float: left;">
<a href="/"><img src="/images/klaravik-logo.svg" alt="Klaravik logo" class="footer-logo"></a>
</div>
</div>
<div class="row">
<div class="large-3 medium-6 small-12 columns footer-contact hide-for-small">
<h5 class="subscribe-title"><?php $trans->eGet('text_headline_app-index_newsletter-caption'); ?></h5>
<!-- Begin DESKTOP Signup Form -->
<form id="subscribe-desktop-form" action="" method="post">
<div class="subscription-input">
<div class="input-animation">
<span class="input-animation-text">
<?php $trans->eGet('text_label_app-index_newsletter-registration'); ?>
</span>
</div>
<div class="button-inside">
<input
type="email"
value=""
name="EMAIL"
required
class="search-box"
id="desktop-email"
placeholder="<?php $trans->eGet('text_label_app-index_newsletter-email-placeholder'); ?>"
>
<button class="subscribe-erase" style="display: none;"><img src="/images/footer-subscribe-cross.svg" alt=""></button>
</div>
<div class="button-clear">
<button type="submit" value="" name="subscribe" id="subscribe-desktop" class="subscribe-button">
<img
src="/images/arrow-right-white.svg"
class="subscription-arrow"
alt="<?php $trans->eGet('info_altimg_app-index_white-arrow-right'); ?>"
>
<img
src="/images/checkmark-white.svg"
class="subscription-checkmark"
style="display: none;"
alt="<?php $trans->eGet('info_altimg_app-index_white-checkbox'); ?>"
>
</button>
</div>
</div>
<div style="clear: both"></div>
<div id="subscribe-desktop-error"></div>
</form>
<!--End DESKTOP Signup form -->
<div class="footer-info">
<?php
generateFooter($trans);
?>
</div>
</div>
<div class="large-3 medium-6 small-12 columns small-text-left footer-column-padding">
<!-- TODO: alias method -->
<h6><?php print $trans->get("ALIAS_FOOTER_HEADER_LEFT"); ?></h6>
<hr>
<?php
generateBottomMenu($db, $urlGenerator, 1, LANGUAGE_ID, $pid);
?>
</div>
<div class="large-3 medium-6 small-12 columns small-text-left footer-column-padding">
<!-- TODO: alias method -->
<h6><?php print $trans->get("ALIAS_FOOTER_HEADER_CENTER"); ?></h6>
<hr>
<?php
generateBottomMenu($db, $urlGenerator, 2, LANGUAGE_ID, $pid);
?>
</div>
<div class="large-3 medium-6 small-12 columns small-text-left footer-column-padding">
<!-- TODO: alias method -->
<h6><?php print $trans->get("ALIAS_FOOTER_HEADER_RIGHT"); ?></h6>
<hr>
<?php
generateBottomMenu($db, $urlGenerator, 3, LANGUAGE_ID, $pid);
?>
</div>
</div>
<div class="row">
<div class="large-12 medium-12 columns hide-for-small">
<div class="small-text-right flag-columns">
<a class="footer-flag" href="https://www.klaravik.fi" target="_blank" rel="noreferrer">
<img
src="/images/footer-fi-flag.svg"
alt="<?php $trans->eGet('info_altimg_app-index_flag-finland'); ?>"
align="middle"
class="footer-img-flag"
/>
<span><?php $trans->eGet('text_label_app-index_flag-finland'); ?></span>
</a>
<a class="footer-flag" href="https://www.klaravik.dk" target="_blank" rel="noreferrer">
<img
src="/images/footer-dk-flag.svg"
alt="<?php $trans->eGet('info_altimg_app-index_flag-denmark'); ?>"
align="middle"
class="footer-img-flag"
/>
<span><?php $trans->eGet('text_label_app-index_flag-denmark'); ?></span>
</a>
<a class="footer-flag" href="https://www.klaravik.se/" target="_blank" rel="noreferrer">
<img
src="/images/footer-sv-flag.svg"
alt="<?php $trans->eGet('info_altimg_app-index_flag-sweden'); ?>"
align="middle"
class="footer-img-flag"
/>
<span><?php $trans->eGet('text_label_app-index_flag-sweden'); ?></span>
</a>
</div>
</div>
<div class="small-12 show-for-small-only">
<div class="large-3 medium-12 small-12 columns">
<a href="/"><img src="/images/klaravik-logo.svg" alt="Klaravik logo" class="footer-logo"></a>
<!-- TODO: alias method -->
<h3><?php print $trans->get("ALIAS_FOOTER_HEADER_CONTACT"); ?></h3>
<div class="footer-info">
<!-- TODO: Ta bort "All rights reserved" text från databasen -->
<?php
generateFooter($trans);
?>
</div>
</div>
<div class="small-12 columns show-for-small-only">
<div class="row">
<a
class="small-3 small-centered columns flag-columns"
href="https://www.klaravik.se/"
target="_blank"
rel="noreferrer"
>
<img
src="/images/footer-sv-flag.svg"
alt="<?php $trans->eGet('info_altimg_app-index_flag-sweden'); ?>"
align="middle"
class="footer-img-flag"
/>
<span><?php $trans->eGet('text_label_app-index_flag-sweden'); ?></span>
</a>
<a
class="small-3 small-centered columns flag-columns"
href="https://www.klaravik.dk/"
target="_blank"
rel="noreferrer"
>
<img
src="/images/footer-dk-flag.svg"
alt="<?php $trans->eGet('info_altimg_app-index_flag-denmark'); ?>"
align="middle"
class="footer-img-flag"
/>
<span><?php $trans->eGet('text_label_app-index_flag-denmark'); ?></span>
</a>
<a
class="small-3 small-centered columns flag-columns"
href="https://www.klaravik.fi"
target="_blank"
rel="noreferrer"
>
<img
src="/images/footer-fi-flag.svg"
alt="<?php $trans->eGet('info_altimg_app-index_flag-finland'); ?>"
align="middle"
class="footer-img-flag"
/>
<span><?php $trans->eGet('text_label_app-index_flag-finland'); ?></span>
</a>
</div>
</div>
</div>
</div>
<div id="bottom-footer">
<div class="row">
<div class="small-12 columns bottom-footer-center">
<div class="bottom-footer-center_content">
<span class="copyright-row">
<img class="copyright-sign" src="/images/icons/icn-copyright-line.svg"/>
<span>
<?php $trans->eGet('text_label_app-index_copyright-caption'); ?>
</span>
<span>|</span>
<span>
<a
href="/material.html"
target="_blank"
title="<?php $trans->eGet('link_button_app-index_copyright-text'); ?>"
>
<?php $trans->eGet('link_button_app-index_copyright-text'); ?>
</a>
</span>
</span>
<div class="follow-links">
<div class="social-media">
<span class="follow-us">
<?php $trans->eGet('text_label_app-index_social-media-caption'); ?>
</span>
<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>
<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>
<?php if ($parameters->get('social.media.tiktok.active')) { ?>
<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>
<?php } ?>
<?php if ($parameters->get('social.media.instagram.active')) { ?>
<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>
<?php } ?>
</div>
</div>
</div>
</div>
</div><!-- end .row -->
</div><!-- end #bottom-footer -->
</div>
<!-- end #footer_full --></div>
</div><!-- end starting div that wraps all content -->
<!-- The mobile menu -->
<nav id="mobile-menu" class="mobile-menu">
<form id="mobile-menu-search-form" class="mobile-search-form validate-form" action="<?php echo $urlGenerator->generate('app.legacy.auction.listing'); ?>" method="get">
<div class="form-field-3">
<div class="form-field-3__input-wrapper">
<input
class="form-field-3__input-field validate-field"
type="text"
id="menusearch"
class="mobile-menu__search-input"
placeholder="<?php $trans->eGet('info_label_app-index_menu-search-placeholder'); ?>"
name="searchtext"
value="<?php if(isset($_REQUEST['searchtext']) && $_REQUEST['searchtext'] !== '') print htmlentities($_REQUEST['searchtext'], ENT_QUOTES | ENT_HTML401, 'utf-8'); ?>"
title="sokord"
/>
<span class="form-clear-field"></span>
</div>
<div class="form-field-3__clear">
<button
type="submit"
value=""
name="dosearch"
class="form-field-3__button"
aria-label="<?php $trans->eGet('info_label_app-index_menu-search-aria-label'); ?>"
>
<img
src="/images/icon-search-white.svg"
height="19px"
width="19x"
class="subscription-arrow"
alt="<?php $trans->eGet('text_label_app-index_magnifying-glass'); ?>"
>
</button>
</div>
</div>
<?php
if ($requestSetCountyFlag && !in_array('all', $setCountyFlagData)) {
foreach ($setCountyFlagData as $setCountyFlagDataItem) {
printf(
'<input type="hidden" name="setcountyflag[]" value="%s">', $setCountyFlagDataItem
);
}
}
if ($requestSetMunicipality && !in_array('all', $setMunicipalityData)) {
foreach ($setMunicipalityData as $setMunicipalityDataItem) {
printf(
'<input type="hidden" name="setmunicipality[]" value="%s">', $setMunicipalityDataItem
);
}
}
?>
</form><!-- end Textfield-3 -->
<div class="mobile-menu__toggle-categories-column" id="toggle-categories">
<div class="mobile-menu__toggle-categories-link">
<?php
// TODO: alias method
print $trans->get("ALIAS_MAIN_BUTTON");
?>
</div>
<div class="mobile-menu__toggle-category-icon">
<img src="/images/icon-expand-categories.svg" alt="" class="menu-expand-categories">
<img src="/images/icon-retract-categories.svg" alt="" class="menu-retract-categories">
</div>
</div>
<div class="mobile-menu__expanding-section mobile-hide">
<?php
$pageListPartials = new \Klaravik\includes\PageListPartials($urlGenerator, $trans);
$urlParams = [];
$pageListPartials->geoLocationUrlParams($urlParams);
echo '<div class="mobile-menu__category-link-row mobile-menu__top-level-row">';
echo ' <a
href="'.$urlGenerator->generate('app.legacy.auction.listing', $urlParams).'"
class="mobile-menu__category-link mobile-menu__all-link"
>
<span>'. $trans->get('text_label_app-index_header-all-auctions') .'</span>
</a>';
echo '</div>';
$catCount = count($cachedCategories->loadCachedCategories());
$i = 0;
foreach ($cachedCategories->loadCachedCategories() as $headCategory) {
if (++$i === $catCount) {
echo '<div class="mobile-menu__category-link-row mobile-menu__top-level-row mobile-menu__last-row-item" >';
} else {
echo '<div class="mobile-menu__category-link-row mobile-menu__top-level-row" >';
}
echo '<span class="mobile-menu__category-link expand-subcat" data-catId="'. $headCategory->id .'">
<img class="mobile-menu__category-link-icon" src="/images/icons/icn-category-'. $headCategory->icon .'.svg">'. $headCategory->name .'</span>';
if (count($headCategory->children)) {
$urlParams['caturlname'] = $headCategory->url;
echo '<div class="mobile-menu__toggle-category-icon">
<img src="/images/icon-expand-dd.svg" alt="" class="menu-expand-categories">
<img src="/images/icon-retract-dd.svg" alt="" class="menu-retract-categories">
</div>';
echo '</div>';
echo '<div class="mobile-menu__expanding-section subcat-expandable subcat-expandable-'. $headCategory->id .'">';
echo '<div class="mobile-menu__category-link-row">';
echo ' <a
href="'.$urlGenerator->generate('app.legacy.auction.listing.category', $urlParams).'"
class="mobile-menu__category-link mobile-menu__all-link"
>
<span class="mobile-menu__green-border">
'. $trans->get(
'link_button_app-index_auction-listing-category',
['cat_name' => $headCategory->name]
) .' (' . $headCategory->numberOfProducts . ')
</span>
</a>';
echo '</div>';
foreach ($headCategory->children as $child) {
if ($child->showOnlyInParent) { continue; }
$urlParams['caturlname'] = $child->url;
echo '<div class="mobile-menu__category-link-row">';
echo ' <a href="'.$urlGenerator->generate('app.legacy.auction.listing.category', $urlParams).'" class="mobile-menu__category-link">' . $child->name . ' (' . $child->numberOfProducts . ')</a>';
echo '</div>';
}
}
echo '</div>';
}
?>
</div>
<div class="mobile-menu__row">
<?php
// TODO: alias method
echo '<a href="'.$urlGenerator->generate('app.legacy.auction.listing.closed').'" class="mobile-menu__auction-list-link">'.$trans->get('ALIAS_CLOSED_AUCTIONS').'</a>';
?>
</div>
<?php
if ('se' === $parameters->get('app.instance')):
echo '<div class="mobile-menu__row">
<a
href="'.$urlGenerator->generate('app.legacy.auction.listing.bankruptcy').'"
class="mobile-menu__auction-list-link"
>
'. $trans->get('text_label_app-index_header-bankruptcy-auctions') .'
</a>
</div>';
endif
?>
<div class="mobile-menu__row">
<?php
// TODO: alias method
echo '<a href="'.$urlGenerator->generate('app.legacy.pages.howtosell').'" class="mobile-menu__how-to-sell-link">'.$trans->get('ALIAS_TOP_BUTTON_SALE').'</a>';
?>
</div>
<div class="mobile-menu__row">
<?php
echo '<a
href="'.$urlGenerator->generate('app.legacy.pages.contact').'"
class="mobile-menu__link mobile-menu__contact-link"
>
<span></span>'. $trans->get('text_label_app-index_header-contact-us') .'
</a>';
?>
</div>
<div class="mobile-menu__row">
<?php
echo '<a
href="'.$urlGenerator->generate('app.legacy.pages.faq').'"
class="mobile-menu__link mobile-menu__faq-link"
>
<span></span>'. $trans->get('link_button_app-index_pages-faq') .'
</a>';
?>
</div>
<div class="mobile-menu__row">
<?php
echo '<a
href="'.$urlGenerator->generate('app.legacy.pages.about').'"
class="mobile-menu__link mobile-menu__about-link"
>
<span></span>'. $trans->get('link_button_app-index_pages-about') .'
</a>';
?>
</div>
<?php
if (isset($_SESSION["users_id"])) {
print "<div class='mobile-menu__bottom-buttons'>\n";
// TODO: alias method
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>";
print " <a
href=\"".$urlGenerator->generate('app.legacy.pages.vendor.subpage', ['vendortab' => 'products'])."\"
class=\"button--large button--outlined mobile-menu__bottom-button mobile-menu__my-objects\"
>
". $trans->get('link_button_app-index_pages-vendor') ."
</a>";
print "</div>";
print "<div class=\"mobile-menu__footer-row\">";
print "<hr class=\"mobile-menu__footer-top-hr\" />";
print " <div class=\"mobile-menu__footer-wrapper\">";
print " <div class=\"mobile-menu__footer-userinfo\">";
// TODO: alias method
print " <span class=\"mobile-menu__footer-text\">".$trans->get("ALIAS_LOGGEDIN_AS_SELLER")."</span>";
print " <span class=\"mobile-menu__footer-text-username\">". $propUserName ."</span>";
print " </div>";
print " <div class=\"mobile-menu__footer-logout\">";
// TODO: alias method
print " <a href=\"".$urlGenerator->generate('app.legacy.pages.vendor.logout')."\" class=\"mobile-menu__logout-button\"><span></span>".$trans->get("ALIAS_LOGOUT_BUTTON")."</a>";
print " </div>";
print "</div>";
print "</div>";
} elseif (isset($_SESSION["register_id"])) {
print "<div class='mobile-menu__bottom-buttons'>\n";
// TODO: alias method
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>";
print " <a
href=\"". $savedURL ."\"
class=\"button--large button--outlined mobile-menu__bottom-button mobile-menu__link--favorites \"
>
<span></span>". $trans->get('text_label_app-index_saved') ."
</a>\n";
print "</div>";
print "<div class=\"mobile-menu__footer-row\">";
print " <hr class=\"mobile-menu__footer-top-hr\" />";
print " <div class=\"mobile-menu__footer-wrapper\">";
print " <div class=\"mobile-menu__footer-userinfo\">";
// TODO: alias method
print " <span class=\"mobile-menu__footer-text\">".$trans->get("ALIAS_LOGGEDIN_AS_BUYER")."</span>";
print " <span class=\"mobile-menu__footer-text-username\">". $propUserName ."</span>";
print " </div>";
print " <div class=\"mobile-menu__footer-logout\">";
// TODO: alias method
print " <a href=\"".$urlGenerator->generate('app.legacy.pages.buyer.logout', $continueUrlParams)."\" class=\"mobile-menu__logout-button\"><span></span>".$trans->get("ALIAS_LOGOUT_BUTTON")."</a>";
print " </div>";
print " </div>";
print "</div>";
} else {
print "<div class='mobile-menu__bottom-buttons'>\n";
// TODO: alias method
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>";
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";
print "</div>";
print " <hr class=\"mobile-menu__hr-initial\">";
}
?>
</nav>
<!-- end mobile menu -->
<?php
if (isset($_SESSION["register_clientType"])): ?>
<div class="hidden" id="globalClient" data-client-type="<?= $_SESSION['register_clientType']; ?>" data-client-id="<?= $_SESSION['register_id']; ?>"></div>
<?php endif;
// Prints JS-scripts that is set as to be included.
foreach ($includedJavaScript as $item) {
if ($item['inline']) {
echo "<script type=\"text/javascript\">\n";
echo $item['inline']."\n";
echo "</script>\n";
} else {
echo "<script type=\"text/javascript\" src=\"".getFileVersion($item['string'])."\"></script>\n";
}
}
$manifestAssets->renderJs();
if ($skipChat === false) {
$zendeskKey = "7ee8070a-5a9b-49d3-aa86-027cca4cba0e";
if ('dk' === $parameters->get('app.instance')) {
$zendeskKey = "45813887-bdb1-48d7-ac0c-b68245c6cbc4";
}
?>
<!-- Start of klaravik Zendesk Widget script -->
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=<?php echo $zendeskKey; ?>"> </script>
<script type="text/JavaScript">
window.zESettings = {
webWidget: {
zIndex: 800,
color: {
theme: '#008540',
launcher: '#FFFFFF', // This will also update the badge
launcherText: '#ED7600',
header: '#008540',
}
}
};
</script>
<!-- End of klaravik Zendesk Widget script -->
<?php
}
?>
</body>
</html>
<?php
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "<!-- {$time} -->";