<?php

if (!defined('ACCOUNT_AREA')) {
  include(PATH . 'control/system/headers/403.php');
  exit;
}

include(LANG_FLDR . 'footer.php');
include(LANG_FLDR . 'home.php');
include(LANG_FLDR . 'products.php');

$loadJS[] = 'sort-table';
$sysTitle = $msw_footer[7] . ': ' . mswCD($SETTINGS->website);

include(PATH . 'control/system/modules/_header.php');

$PGS = new pages(array(
  'count' => $HTML->products(array(
    'id' => $loggedInUser['id'],
    'limit' => $limit,
    'count' => 'yes'
  )),
  'text' => $msw_pages,
  'page' => $page,
  'admin' => 'no',
  'flag' => '',
  'limit' => DEF_PER_PAGE,
  's' => $SETTINGS
));

$templateParams = [
  'TEXT' => $msw_products,
  'FTEXT' => $msw_footer,
  'HTEXT' => $msw_home,
  'PRODUCTS' => $HTML->products([
    'id' => $loggedInUser['id'],
    'limit' => $limit,
    'lang' => [$msw_common, $msw_common2, $msw_products]
  ]),
  'PAGES' => $PGS->display(),
  'CODE' => $ACC->affcode($loggedInUser)
];

// Global..
include(PATH . 'control/system/global.php');

$latte->render('acc-products.tpl', $templateParams);

include(PATH . 'control/system/modules/_footer.php');

?>
