Заранее благодарю!
PHP:
| Код |
|---|
<table class="table table-bordered table-actions">
<thead>
<tr>
<th>Статья расходов</th>
<th>Контрагент</th>
<th>Дата проведения</th>
<th>Цена</th>
</tr>
</thead>
<tbody>
<? if ($_GET) { ?>
<?
$cost = 0 ;
$res = CIBlockElement::GetList(
Array("PROPERTY_STAT_VALUE" => "ASC"),
$filter,
false,
false,
array('ID','PROPERTY_STAT','PROPERTY_USER_ID','DETAIL_TEXT','PROPERTY_DATA','PROPERTY_SUMMA','PROPERTY_OPERATION')
);
echo "<pre>";
print_r($res);
while($ob = $res->GetNextElement())
{
$arFields = $ob->GetFields();
?>
<tr>
<td><?
$rest = CIBlockElement::GetByID($arFields["PROPERTY_STAT_VALUE"]);
if($ar_rest = $rest->GetNext())
echo $ar_rest['NAME'];
?></td>
<td><?=$arFields['DETAIL_TEXT']?></td>
<td><?=date("d.m.Y",$arFields['PROPERTY_DATA_VALUE'])?></td>
<td><span class="mob_hide2">Цена </span><?=$arFields['PROPERTY_OPERATION_VALUE']?><?=$arFields['PROPERTY_SUMMA_VALUE']?></td>
</tr>
<tr class="line">
<th colspan="5"></th>
</tr>
<? if ( $arFields['PROPERTY_OPERATION_VALUE'] == '+' ) {
$cost = $cost + $arFields['PROPERTY_SUMMA_VALUE'];
} else {
$cost = $cost - $arFields['PROPERTY_SUMMA_VALUE'];
}
?>
<? } ?>
<? } ?>
</tbody>
<tfoot>
<tr>
<td colspan="4" align="right"><label>Итог:</label></td>
<td><?=number_format($cost, 2, '.', ' ')?></td>
</tr>
</tfoot>
</table> |
Переменная $res:
| Код |
|---|
CIBlockResult Object ( [arIBlockMultProps] => Array ( ) [arIBlockConvProps] => Array ( ) [arIBlockAllProps] => Array ( ) [arIBlockNumProps] => Array ( ) [arIBlockLongProps] => Array ( ) [nInitialSize] => [table_id] => [strDetailUrl] => [strSectionUrl] => [strListUrl] => [arSectionContext] => [bIBlockSection] => [nameTemplate] => [_LAST_IBLOCK_ID] => [_FILTER_IBLOCK_ID] => Array ( [19] => 1 ) [result] => mysqli_result Object ( [current_field] => 0 [field_count] => 13 [lengths] => [num_rows] => 12 [type] => 0 ) [arResult] => [arReplacedAliases] => [arResultAdd] => [bNavStart] => [bShowAll] => [NavNum] => [NavPageCount] => [NavPageNomer] => [NavPageSize] => [NavShowAll] => [NavRecordCount] => [bFirstPrintNav] => 1 [PAGEN] => [SIZEN] => [SESS_SIZEN] => [SESS_ALL] => [SESS_PAGEN] => [add_anchor] => [bPostNavigation] => [bFromArray] => [bFromLimited] => [sSessInitAdd] => [nPageWindow] => 5 [nSelectedCount] => [arGetNextCache] => [bDescPageNumbering] => [arUserFields] => [usedUserFields] => [SqlTraceIndex] => [DB] => CDatabase Object ( [db_Conn] => mysqli Object ( [affected_rows] => 12 [client_info] => mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $ [client_version] => 50011 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [error_list] => Array ( ) [field_count] => 13 [host_info] => localhost via TCP/IP [info] => [insert_id] => 0 [server_info] => 5.5.53-log [server_version] => 50553 [stat] => Uptime: 573 Threads: 1 Questions: 808 Slow queries: 0 Opens: 55 Flush tables: 1 Open tables: 48 Queries per second avg: 1.410 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 15 [warning_count] => 0 ) [version] => [escL] => ` [escR] => ` [alias_length] => 256 [DBName] => Name [DBHost] => localhost [DBLogin] => Login [DBPassword] => Password [bConnected] => 1 [debug] => [DebugToFile] => [ShowSqlStat] => [db_Error] => [db_ErrorSQL] => [result] => [type] => MYSQL [column_cache] => Array ( ) [bModuleConnection] => [bNodeConnection] => [node_id] => [obSlave] => [cntQuery] => 0 [timeQuery] => 0 [arQueryDebug] => Array ( ) [sqlTracker] => ) [NavRecordCountChangeDisable] => [is_filtered] => [nStartPage] => 0 [nEndPage] => 0 [resultObject] => ) |

