} $site = $_GET['site'] ?: $userOptions['site']; if (!($siteName = $sites[$site])) { list($site, $siteName) = each($sites); } // ATTRIBUTES if (!($attributeTypes = AttributeManager::getTypes())) { die('No attributes!'); } unset($attributeTypes['conversion_site']); $attributeName = $_GET['split']; // different split in $userOptions from summary page! if (!($attributeType = $attributeTypes[$attributeName])) { list($attributeName, $attributeType) = each($attributeTypes); } $attributeGroupTypes = AttributeGroupManager::getTypes(); // FILTER $filter = array('from' => $from->toString(), 'to' => $to->toString(), 'site' => $site); CUserOptions::SetOption('conversion', 'filter', array_merge($userOptions, $filter)); $filter['rate'] = $rateName; $filter['split'] = $attributeName; $filter['lang'] = LANGUAGE_ID; // CONTEXT $context = new ReportContext(); $context->setAttribute('conversion_site', $site); $filterInfo = array(); foreach ($attributeTypes as $name => $type) { if (($value = $_GET[$name]) !== null && $name != $attributeName) { $context->setAttribute($name, $value); if ($value) { $filterInfo[$type['NAME'] ?: $name] = ($gv = $type['GET_VALUES']) && ($vs = $gv(array($value))) && isset($vs[$value]['NAME']) ? $vs[$value]['NAME'] : htmlspecialcharsbx($value);
$sites[$row['LID']] = $row['NAME']; } $site = $_GET['site'] ?: $userOptions['site']; if (!($siteName = $sites[$site])) { list($site, $siteName) = each($sites); } // SPLITS $groupedAttributeTypes = \Bitrix\Conversion\AttributeManager::getGroupedTypes(); // $splitGroups unset($groupedAttributeTypes[null]); $attributeGroupName = $_GET['split'] ?: $userOptions['split']; // $splitGroupKey if (!($attributeTypes = $groupedAttributeTypes[$attributeGroupName])) { list($attributeGroupName, $attributeTypes) = each($groupedAttributeTypes); } $attributeGroupTypes = \Bitrix\Conversion\AttributeGroupManager::getTypes(); $splits = array(); foreach ($attributeTypes as $name => $type) { $splits[$name] = array('NAME' => $name, 'TITLE' => $type['NAME'] ?: $name, 'SPLIT_BY' => $type['SPLIT_BY'], 'BG_COLOR' => $type['BG_COLOR'] ?: '#4b9ec1'); } $splits += array('other' => array('TITLE' => Loc::getMessage('CONVERSION_SPLIT_OTHER'), 'BG_COLOR' => '#96c023'), 'total' => array('TITLE' => Loc::getMessage('CONVERSION_SPLIT_TOTAL'), 'BG_COLOR' => '#33ade1')); // RATES if ($rateTypes = RateManager::getTypes(array('ACTIVE' => true))) { $topRateName = $_GET['rate'] ?: $userOptions['rate']; if ($topRateType = $rateTypes[$topRateName]) { $rateTypes = array($topRateName => $topRateType) + $rateTypes; } else { list($topRateName, $topRateType) = each($rateTypes); } $scale = $topRateType['SCALE']; } else {