Пример #1
0
$STAT_RIGHT = $APPLICATION->GetGroupRight("statistic");
if ($STAT_RIGHT == "D") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$sTableID = "tbl_event_dynamic_list";
$oSort = new CAdminSorting($sTableID, "DATE_STAT", "desc");
$lAdmin = new CAdminList($sTableID, $oSort);
if ($set_default == "Y") {
    $find_date1_DAYS_TO_BACK = 90;
}
$FilterArr = array("find_event_id", "find_date1", "find_date2");
$lAdmin->InitFilter($FilterArr);
AdminListCheckDate($lAdmin, array("find_date1" => $find_date1, "find_date2" => $find_date2));
$arFilter = array("DATE1" => $find_date1, "DATE2" => $find_date2);
$cData = new CStatEventType();
$rsData = $cData->GetDynamicList($find_event_id, $by, $order, $arMaxMin, $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("STAT_EVENT_DYN_PAGES")));
$arHeaders = array(array("id" => "DATE_STAT", "content" => GetMessage("STAT_DATE"), "sort" => "s_date", "default" => true), array("id" => "COUNTER", "content" => GetMessage("STAT_COUNTER") . $group_by, "align" => "right", "default" => true));
$lAdmin->AddHeaders($arHeaders);
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arRes);
    if ($f_COUNTER > 0) {
        $href = htmlspecialcharsbx("event_list.php?lang=" . LANGUAGE_ID . "&find_event_id=" . urlencode($find_event_id) . "&find_event_id_exact_match=Y&find_date1=" . urlencode($f_DATE_STAT) . "&find_date2=" . urlencode($f_DATE_STAT) . "&set_filter=Y");
        $strHTML = "<a href=\"" . $href . "\">" . $f_COUNTER . "</a>";
    } else {
        $strHTML = "&nbsp;";
    }
    $row->AddViewField("COUNTER", $strHTML);
}
Пример #2
0
 public static function DynamicDays($EVENT_ID, $date1 = "", $date2 = "")
 {
     $arFilter = array("DATE1" => $date1, "DATE2" => $date2);
     $z = CStatEventType::GetDynamicList($EVENT_ID, $by, $order, $arMaxMin, $arFilter);
     $d = 0;
     while ($zr = $z->Fetch()) {
         if (intval($zr["COUNTER"]) > 0) {
             $d++;
         }
     }
     return $d;
 }