Exemplo n.º 1
0
 // <editor-fold defaultstate="collapsed" desc="POST action">
 if ($_REQUEST['cancel']) {
     LocalRedirect($arParams['PATH_TO_REPORT_LIST']);
 }
 $siteList = CBaseSaleReportHelper::getSiteList();
 if (isset($_REQUEST['F_SALE_SITE'])) {
     $siteId = substr($_REQUEST['F_SALE_SITE'], 0, 2);
     if (array_key_exists($siteId, $siteList)) {
         $siteCookieId = CBaseSaleReportHelper::getSiteCookieId();
         setcookie($siteCookieId, $siteId, time() + 365 * 24 * 3600);
     }
     $arParams['F_SALE_SITE'] = $siteId;
     CBaseSaleReportHelper::setDefaultSiteId($siteId);
     unset($siteId);
 } else {
     $siteCookieId = CBaseSaleReportHelper::getSiteCookieId();
     if (isset($_COOKIE[$siteCookieId])) {
         $siteId = substr($_COOKIE[$siteCookieId], 0, 2);
         if (array_key_exists($siteId, $siteList)) {
             $arParams['F_SALE_SITE'] = $siteId;
         }
         CBaseSaleReportHelper::setDefaultSiteId($siteId);
         unset($siteId);
     }
 }
 $arParams['USER_NAME_FORMAT'] = CSite::getNameFormat(null, CBaseSaleReportHelper::getDefaultSiteId());
 // Product custom "quantity" filter
 if (isset($_REQUEST['F_SALE_PRODUCT'])) {
     if (in_array($_REQUEST['F_SALE_PRODUCT'], array('all', 'avail', 'not_avail'))) {
         $arParams['F_SALE_PRODUCT'] = $_REQUEST['F_SALE_PRODUCT'];
     }