@ini_set("memory_limit", "20M");
}
if ($ShowAll == 0) {
    $Report->RsNeeded = true;
}
if ($ShowAll == 1) {
    $Report->NoRef = true;
}
if ($ShowAll == 2) {
    $Report->OnlyNoRef = true;
}
if ($OnlyNatural) {
    $Report->JoinArr[] = "LEFT JOIN " . PFX . "_tracker_" . $CpId . "_stat_click S_CLICK ON S_CLICK.LOG_ID = S_LOG.COOKIE_LOG";
    $Report->WhereArr[] = "(S_CLICK.ID < 1 OR S_CLICK.ID IS NULL)";
}
$Report->Calculate();
if (ValidVar($Report->StatArr)) {
    if (!$GroupBy) {
        $Report->Tmp[0] = $Report->StatArr;
        $Report->StatArr = $Report->Tmp;
    }
    if (!$GroupBy && !$WhereArr) {
        $Report->StatArr[0]['Name'] = $Lang['Total'];
        $GroupBy = "General";
    }
    // Experimenting with sorting by actions conversion
    if ($OrderBy == "ACTCONV" || $OrderBy == "SALECONV" || $OrderBy == "ACTIONCNT" || $OrderBy == "ACTIONUNI" || $OrderBy == "SALECNT" || $OrderBy == "SALEUNI" || $OrderBy == "INCOME") {
        usort($Report->StatArr, "SortRows");
        if (count($Report->StatArr) > $Limit) {
            array_splice($Report->StatArr, $Limit);
        }
Ejemplo n.º 2
0
 if ($nsUser->Columns->SALES) {
     $NaturalReport->ShowSales = true;
 }
 $NaturalReport->ViewDate = $Today;
 $NaturalReport->CpId = $CurrentCompany->ID;
 if ($SitesCnt == 0) {
     $NaturalReport->SiteId = -1;
 }
 $NaturalReport->SelectArr[] = "TS.ID";
 $NaturalReport->SelectArr[] = "TS.HOST AS NAME";
 $NaturalReport->JoinArr[] = "INNER JOIN " . PFX . "_tracker_site TS ON TS.ID=S_LOG.SITE_ID";
 $NaturalReport->GroupArr[] = "TS.ID";
 $NaturalReport->GrpFld = "ID";
 $NaturalReport->GrpName = "NAME";
 $NaturalReport->OrderArr[] = "TS.HOST ASC";
 $NaturalReport->Calculate();
 if ($nsUser->Columns->CLICKS) {
     $PaidReport = new Paid_v2();
     $PaidReport->ShowVisitors = true;
     $PaidReport->CpId = $CurrentCompany->ID;
     if ($SitesCnt == 0) {
         $PaidReport->SiteId = -1;
     }
     $PaidReport->ViewDate = $Today;
     $PaidReport->SelectArr[] = "TS.ID";
     $PaidReport->SelectArr[] = "TS.HOST AS NAME";
     $PaidReport->JoinArr[] = "INNER JOIN " . PFX . "_tracker_site TS ON TS.ID=S_LOG.SITE_ID";
     $PaidReport->GroupArr[] = "TS.ID";
     $PaidReport->GrpFld = "ID";
     $PaidReport->GrpName = "NAME";
     $PaidReport->OrderArr[] = "TS.HOST ASC";