$arSelect = array("ID", "USER_ID", "DATE_FROM", "DATE_TO", "MARK", "FORUM_TOPIC_ID"); //$arSelect = Array(); $dbres = CTimeManReportFull::GetList(array("ID" => "desc"), $arFilterReport, $arSelect); $res["USERS"][$arRes['ID']]["FULL_REPORT_INFO"]["GOOD"] = 0; $res["USERS"][$arRes['ID']]["FULL_REPORT_INFO"]["MARKED"] = 0; while ($report = $dbres->Fetch()) { if ($report["MARK"] != "X") { $res["USERS"][$arRes['ID']]["FULL_REPORT_INFO"]["MARKED"]++; } if ($report["MARK"] == "G") { $res["USERS"][$arRes['ID']]["FULL_REPORT_INFO"]["GOOD"]++; } $res["USERS"][$arRes['ID']]["FULL_REPORT_INFO"]["COUNT"]++; $report["DATE_TO"] = MakeTimeStamp($report["DATE_TO"], $datefomat); $report["DATE_FROM"] = MakeTimeStamp($report["DATE_FROM"], $datefomat); $report["FOR_JS"] = CTimeManReportFull::__getReportJSDraw(array("PERIOD_DATE_FROM" => $_POST["ts"], "REPORT_DATE_FROM" => $report['DATE_FROM'], "REPORT_DATE_TO" => $report['DATE_TO'])); $report["COMMENTS_COUNT"] = 0; if ($report['FORUM_TOPIC_ID'] && CModule::IncludeModule("forum")) { $count = CForumMessage::GetList(array("ID" => "ASC"), array("TOPIC_ID" => $report['FORUM_TOPIC_ID']), true); $report["COMMENTS_COUNT"] = $count; } $res["USERS"][$arRes['ID']]["FULL_REPORT"][] = $report; } if ($arRes['ID'] == $USER->GetID() && !CTimeMan::IsAdmin()) { $res["USERS"][$arRes['ID']]["CAN_EDIT_TIME"] = "N"; } else { $res["USERS"][$arRes['ID']]["CAN_EDIT_TIME"] = "Y"; } $tm_user = new CUserReportFull($arRes["ID"]); $res["USERS"][$arRes['ID']]["SETTINGS"] = $tm_user->GetSettings(true); }