Server IP : 85.193.89.191 / Your IP : 3.137.198.239 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/bitrix/www/bitrix/components/bitrix/report.view/templates/.default/ |
Upload File : |
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); /** @var CBitrixComponentTemplate $this */ $this->IncludeLangFile('template.php'); $isStExport = (is_array($arResult['STEXPORT_OPTIONS']) && !empty($arResult['STEXPORT_OPTIONS'])); $isStExportFirstPage = false; $isStExportLastPage = false; if ($isStExport) { $isStExportFirstPage = (isset($arResult['STEXPORT_OPTIONS']['STEXPORT_IS_FIRST_PAGE']) && $arResult['STEXPORT_OPTIONS']['STEXPORT_IS_FIRST_PAGE'] === 'Y'); $isStExportLastPage = (isset($arResult['STEXPORT_OPTIONS']['STEXPORT_IS_LAST_PAGE']) && $arResult['STEXPORT_OPTIONS']['STEXPORT_IS_LAST_PAGE'] === 'Y'); } $redSignMap = array(); $rowNum = 0; foreach ($arResult['data'] as &$row) { $colNum = 0; foreach($arResult['viewColumns'] as $col) { if (isset($arResult['customChartData'][$rowNum][$col['resultName']]['multiple'])) { $customValueInfo = &$arResult['customChartData'][$rowNum][$col['resultName']]; if ($customValueInfo['multiple'] === true) { $dataValue = 0; foreach ($customValueInfo as $cvKey => $cvInfo) { if ($cvKey !== 'multiple' && isset($cvInfo['type']) && ($cvInfo['type'] === 'float' || $cvInfo['type'] === 'integer')) { if ($cvInfo['value'] < 0) { $redSignMap[$rowNum][$colNum] = true; break; } } } unset($cvKey, $cvInfo); } else { $cvInfo = &$customValueInfo[0]; if (isset($cvInfo['type']) && ($cvInfo['type'] === 'float' || $cvInfo['type'] === 'integer')) { if ($cvInfo['value'] < 0) $redSignMap[$rowNum][$colNum] = true; } unset($cvInfo); } unset($customValueInfo); } if (is_array($row[$col['resultName']])) { $row[$col['resultName']] = join(' / ', $row[$col['resultName']]); } $colNum++; } $rowNum++; } unset($row); if (!$isStExport || $isStExportFirstPage) { ?> <meta http-equiv="Content-type" content="text/html;charset=<? echo LANG_CHARSET ?>"/> <style type="text/css"> .report-red-neg-val { color: red; } </style> <table border="1"> <thead> <tr> <? foreach ($arResult['viewColumns'] as $colId => $col): ?> <th><?= htmlspecialcharsbx($col['humanTitle']) ?></th> <? endforeach; ?> </tr> </thead> <tbody><? } // (!$isStExport || $isStExportFirstPage) $rowNum = 0; foreach ($arResult['data'] as $row) { ?> <tr> <? $colNum = 0; ?> <? foreach ($arResult['viewColumns'] as $col): ?> <?php $td_class = ''; if($arResult['settings']['red_neg_vals'] === true) { $finalValue = $row[$col['resultName']]; if(isset($redSignMap[$rowNum][$colNum]) || (is_numeric($finalValue) && $finalValue < 0)) { $td_class = ' class="report-red-neg-val"'; } } ?> <td<?= $td_class ?>><?= $row[$col['resultName']] ?></td> <? $colNum++; ?> <? endforeach; ?> </tr> <? $rowNum++; } if (!$isStExport || $isStExportLastPage) { ?> </tbody> </table><? } // !$isStExport || $isStExportLastPage unset($redSignMap);