function RenderRow()
 {
     global $conn, $Security, $ReportLanguage;
     // Set up summary values
     $colcnt = $this->ColCount + 1;
     $this->SummaryCellAttrs =& ewr_InitArray($colcnt, NULL);
     $this->SummaryViewAttrs =& ewr_InitArray($colcnt, NULL);
     $this->SummaryLinkAttrs =& ewr_InitArray($colcnt, NULL);
     $this->SummaryCurrentValue =& ewr_InitArray($colcnt, NULL);
     $this->SummaryViewValue =& ewr_InitArray($colcnt, NULL);
     $rowsmry = 0;
     $rowcnt = 0;
     if ($this->RowTotalType == EWR_ROWTOTAL_GRAND) {
         // Grand total
         // Aggregate SQL
         $sSql = ewr_BuildReportSql(str_replace("<DistinctColumnFields>", $this->DistinctColumnFields, $this->getSqlSelectAgg()), $this->getSqlWhere(), $this->getSqlGroupByAgg(), "", "", $this->Filter, "");
         $rsagg = $conn->Execute($sSql);
         if ($rsagg && !$rsagg->EOF) {
             $rsagg->MoveFirst();
         }
     }
     for ($i = 1; $i <= $this->ColCount; $i++) {
         if ($this->Col[$i]->Visible) {
             if ($this->RowType == EWR_ROWTYPE_DETAIL) {
                 // Detail row
                 $thisval = $this->Val[$i];
             } elseif ($this->RowTotalType == EWR_ROWTOTAL_GROUP) {
                 // Group total
                 $thisval = $this->Smry[$i][$this->RowGroupLevel];
             } elseif ($this->RowTotalType == EWR_ROWTOTAL_PAGE) {
                 // Page total
                 $thisval = $this->Smry[$i][0];
             } elseif ($this->RowTotalType == EWR_ROWTOTAL_GRAND) {
                 // Grand total
                 $thisval = $rsagg && !$rsagg->EOF ? $rsagg->fields[$i + 1 - 1] : 0;
             }
             $this->SummaryCurrentValue[$i - 1] = $thisval;
             $rowsmry = ewr_SummaryValue($rowsmry, $thisval, $this->getSummaryType());
         }
     }
     if ($this->RowTotalType == EWR_ROWTOTAL_GRAND) {
         // Grand total
         if ($rsagg) {
             $rsagg->Close();
         }
     }
     $this->SummaryCurrentValue[$this->ColCount] = $rowsmry;
     // Call Row_Rendering event
     $this->Row_Rendering();
     //
     //  Render view codes
     //
     if ($this->RowType == EWR_ROWTYPE_TOTAL) {
         // Summary row
         // University
         $this->University->GroupViewValue = $this->University->GroupOldValue();
         $this->University->CellAttrs["class"] = $this->RowGroupLevel == 1 ? "ewRptGrpSummary1" : "ewRptGrpField1";
         // Set up summary values
         $scvcnt = count($this->SummaryCurrentValue);
         for ($i = 0; $i < $scvcnt; $i++) {
             $this->SummaryViewValue[$i] = $this->SummaryCurrentValue[$i];
             $this->SummaryViewAttrs[$i]["style"] = "";
             $this->SummaryCellAttrs[$i]["style"] = "";
             $this->SummaryCellAttrs[$i]["class"] = $this->RowTotalType == EWR_ROWTOTAL_GROUP ? "ewRptGrpSummary" . $this->RowGroupLevel : "";
         }
         // University
         $this->University->HrefValue = "";
     } else {
         // University
         $this->University->GroupViewValue = $this->University->GroupValue();
         $this->University->CellAttrs["class"] = "ewRptGrpField1";
         if ($this->University->GroupValue() == $this->University->GroupOldValue() && !$this->ChkLvlBreak(1)) {
             $this->University->GroupViewValue = "&nbsp;";
         }
         // Set up summary values
         $scvcnt = count($this->SummaryCurrentValue);
         for ($i = 0; $i < $scvcnt; $i++) {
             $this->SummaryViewValue[$i] = $this->SummaryCurrentValue[$i];
             $this->SummaryViewAttrs[$i]["style"] = "";
             $this->SummaryCellAttrs[$i]["style"] = "";
             $this->SummaryCellAttrs[$i]["class"] = $this->RecCount % 2 != 1 ? "ewTableAltRow" : "ewTableRow";
         }
         // University
         $this->University->HrefValue = "";
     }
     // Call Cell_Rendered event
     if ($this->RowType == EWR_ROWTYPE_TOTAL) {
         // Summary row
         // University
         $this->CurrentIndex = 0;
         // Current index
         $CurrentValue = $this->University->GroupOldValue();
         $ViewValue =& $this->University->GroupViewValue;
         $ViewAttrs =& $this->University->ViewAttrs;
         $CellAttrs =& $this->University->CellAttrs;
         $HrefValue =& $this->University->HrefValue;
         $LinkAttrs =& $this->University->LinkAttrs;
         $this->Cell_Rendered($this->University, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         for ($i = 0; $i < $scvcnt; $i++) {
             $this->CurrentIndex = $i;
             $CurrentValue = $this->SummaryCurrentValue[$i];
             $ViewValue =& $this->SummaryViewValue[$i];
             $ViewAttrs =& $this->SummaryViewAttrs[$i];
             $CellAttrs =& $this->SummaryCellAttrs[$i];
             $HrefValue = "";
             $LinkAttrs =& $this->SummaryLinkAttrs[$i];
             $this->Cell_Rendered($this->COUNT28candidate_candStatusID29, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         }
     } else {
         // University
         $this->CurrentIndex = 0;
         // Group index
         $CurrentValue = $this->University->GroupValue();
         $ViewValue =& $this->University->GroupViewValue;
         $ViewAttrs =& $this->University->ViewAttrs;
         $CellAttrs =& $this->University->CellAttrs;
         $HrefValue =& $this->University->HrefValue;
         $LinkAttrs =& $this->University->LinkAttrs;
         $this->Cell_Rendered($this->University, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         for ($i = 0; $i < $scvcnt; $i++) {
             $this->CurrentIndex = $i;
             $CurrentValue = $this->SummaryCurrentValue[$i];
             $ViewValue =& $this->SummaryViewValue[$i];
             $ViewAttrs =& $this->SummaryViewAttrs[$i];
             $CellAttrs =& $this->SummaryCellAttrs[$i];
             $HrefValue = "";
             $LinkAttrs =& $this->SummaryLinkAttrs[$i];
             $this->Cell_Rendered($this->COUNT28candidate_candStatusID29, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         }
     }
     // Call Row_Rendered event
     $this->Row_Rendered();
     $this->SetupFieldCount();
 }
 function RenderRow()
 {
     global $conn, $rs, $Security, $ReportLanguage;
     if ($this->RowTotalType == EWR_ROWTOTAL_GRAND && !$this->GrandSummarySetup) {
         // Grand total
         $bGotCount = FALSE;
         $bGotSummary = FALSE;
         // Get total count from sql directly
         $sSql = ewr_BuildReportSql($this->getSqlSelectCount(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), "", $this->Filter, "");
         $rstot = $conn->Execute($sSql);
         if ($rstot) {
             $this->TotCount = $rstot->RecordCount() > 1 ? $rstot->RecordCount() : $rstot->fields[0];
             $rstot->Close();
             $bGotCount = TRUE;
         } else {
             $this->TotCount = 0;
         }
         // Get total from sql directly
         $sSql = ewr_BuildReportSql($this->getSqlSelectAgg(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), "", $this->Filter, "");
         $sSql = $this->getSqlAggPfx() . $sSql . $this->getSqlAggSfx();
         $rsagg = $conn->Execute($sSql);
         if ($rsagg) {
             $this->GrandCnt[1] = $this->TotCount;
             $this->GrandSmry[1] = $rsagg->fields("sum_job_offered_candidates");
             $this->GrandCnt[2] = $this->TotCount;
             $rsagg->Close();
             $bGotSummary = TRUE;
         }
         // Accumulate grand summary from detail records
         if (!$bGotCount || !$bGotSummary) {
             $sSql = ewr_BuildReportSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), "", $this->Filter, "");
             $rs = $conn->Execute($sSql);
             if ($rs) {
                 $this->GetRow(1);
                 while (!$rs->EOF) {
                     $this->AccumulateGrandSummary();
                     $this->GetRow(2);
                 }
                 $rs->Close();
             }
         }
         $this->GrandSummarySetup = TRUE;
         // No need to set up again
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     //
     // Render view codes
     //
     if ($this->RowType == EWR_ROWTYPE_TOTAL) {
         // Summary row
         // Job_Name
         $this->Job_Name->GroupViewValue = $this->Job_Name->GroupOldValue();
         $this->Job_Name->CellAttrs["class"] = $this->RowGroupLevel == 1 ? "ewRptGrpSummary1" : "ewRptGrpField1";
         $this->Job_Name->GroupViewValue = ewr_DisplayGroupValue($this->Job_Name, $this->Job_Name->GroupViewValue);
         $this->Job_Name->GroupSummaryOldValue = $this->Job_Name->GroupSummaryValue;
         $this->Job_Name->GroupSummaryValue = $this->Job_Name->GroupViewValue;
         $this->Job_Name->GroupSummaryViewValue = $this->Job_Name->GroupSummaryOldValue != $this->Job_Name->GroupSummaryValue ? $this->Job_Name->GroupSummaryValue : "&nbsp;";
         // Job_Offered_Candidates
         $this->Job_Offered_Candidates->SumViewValue = $this->Job_Offered_Candidates->SumValue;
         $this->Job_Offered_Candidates->CellAttrs["class"] = $this->RowTotalType == EWR_ROWTOTAL_PAGE || $this->RowTotalType == EWR_ROWTOTAL_GRAND ? "ewRptGrpAggregate" : "ewRptGrpSummary" . $this->RowGroupLevel;
         // Job_Name
         $this->Job_Name->HrefValue = "";
         // Job_Offered_Candidates
         $this->Job_Offered_Candidates->HrefValue = "";
         // dateCreated
         $this->dateCreated->HrefValue = "";
     } else {
         // Job_Name
         $this->Job_Name->GroupViewValue = $this->Job_Name->GroupValue();
         $this->Job_Name->CellAttrs["class"] = "ewRptGrpField1";
         $this->Job_Name->GroupViewValue = ewr_DisplayGroupValue($this->Job_Name, $this->Job_Name->GroupViewValue);
         if ($this->Job_Name->GroupValue() == $this->Job_Name->GroupOldValue() && !$this->ChkLvlBreak(1)) {
             $this->Job_Name->GroupViewValue = "&nbsp;";
         }
         // Job_Offered_Candidates
         $this->Job_Offered_Candidates->ViewValue = $this->Job_Offered_Candidates->CurrentValue;
         $this->Job_Offered_Candidates->CellAttrs["class"] = $this->RecCount % 2 != 1 ? "ewTableAltRow" : "ewTableRow";
         // dateCreated
         $this->dateCreated->ViewValue = $this->dateCreated->CurrentValue;
         $this->dateCreated->ViewValue = ewr_FormatDateTime($this->dateCreated->ViewValue, 5);
         $this->dateCreated->CellAttrs["class"] = $this->RecCount % 2 != 1 ? "ewTableAltRow" : "ewTableRow";
         $this->dateCreated->CellAttrs["style"] = "white-space: nowrap;";
         // Job_Name
         $this->Job_Name->HrefValue = "";
         // Job_Offered_Candidates
         $this->Job_Offered_Candidates->HrefValue = "";
         // dateCreated
         $this->dateCreated->HrefValue = "";
     }
     // Call Cell_Rendered event
     if ($this->RowType == EWR_ROWTYPE_TOTAL) {
         // Summary row
         // Job_Name
         $CurrentValue = $this->Job_Name->GroupViewValue;
         $ViewValue =& $this->Job_Name->GroupViewValue;
         $ViewAttrs =& $this->Job_Name->ViewAttrs;
         $CellAttrs =& $this->Job_Name->CellAttrs;
         $HrefValue =& $this->Job_Name->HrefValue;
         $LinkAttrs =& $this->Job_Name->LinkAttrs;
         $this->Cell_Rendered($this->Job_Name, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         // Job_Offered_Candidates
         $CurrentValue = $this->Job_Offered_Candidates->SumValue;
         $ViewValue =& $this->Job_Offered_Candidates->SumViewValue;
         $ViewAttrs =& $this->Job_Offered_Candidates->ViewAttrs;
         $CellAttrs =& $this->Job_Offered_Candidates->CellAttrs;
         $HrefValue =& $this->Job_Offered_Candidates->HrefValue;
         $LinkAttrs =& $this->Job_Offered_Candidates->LinkAttrs;
         $this->Cell_Rendered($this->Job_Offered_Candidates, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
     } else {
         // Job_Name
         $CurrentValue = $this->Job_Name->GroupValue();
         $ViewValue =& $this->Job_Name->GroupViewValue;
         $ViewAttrs =& $this->Job_Name->ViewAttrs;
         $CellAttrs =& $this->Job_Name->CellAttrs;
         $HrefValue =& $this->Job_Name->HrefValue;
         $LinkAttrs =& $this->Job_Name->LinkAttrs;
         $this->Cell_Rendered($this->Job_Name, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         // Job_Offered_Candidates
         $CurrentValue = $this->Job_Offered_Candidates->CurrentValue;
         $ViewValue =& $this->Job_Offered_Candidates->ViewValue;
         $ViewAttrs =& $this->Job_Offered_Candidates->ViewAttrs;
         $CellAttrs =& $this->Job_Offered_Candidates->CellAttrs;
         $HrefValue =& $this->Job_Offered_Candidates->HrefValue;
         $LinkAttrs =& $this->Job_Offered_Candidates->LinkAttrs;
         $this->Cell_Rendered($this->Job_Offered_Candidates, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         // dateCreated
         $CurrentValue = $this->dateCreated->CurrentValue;
         $ViewValue =& $this->dateCreated->ViewValue;
         $ViewAttrs =& $this->dateCreated->ViewAttrs;
         $CellAttrs =& $this->dateCreated->CellAttrs;
         $HrefValue =& $this->dateCreated->HrefValue;
         $LinkAttrs =& $this->dateCreated->LinkAttrs;
         $this->Cell_Rendered($this->dateCreated, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
     }
     // Call Row_Rendered event
     $this->Row_Rendered();
     $this->SetupFieldCount();
 }
Example #3
0
 function LoadColumnValues($filter = "")
 {
     global $conn;
     global $ReportLanguage;
     // Build SQL
     $sSql = ewr_BuildReportSql($this->getSqlDistinctSelect(), $this->getSqlDistinctWhere(), "", "", $this->getSqlDistinctOrderBy(), $filter, "");
     // Load recordset
     $rscol = $conn->Execute($sSql);
     // Get distinct column count
     $this->ColCount = $rscol ? $rscol->RecordCount() : 0;
     /* Uncomment to show phrase
     		if ($this->ColCount == 0) {
     			if ($rscol) $rscol->Close();
     			echo "<p>" . $ReportLanguage->Phrase("NoDistinctColVals") . $sSql . "</p>";
     			exit();
     		}
     */
     $this->Col =& ewr_Init2DArray($this->ColCount + 1, 2, NULL);
     $colcnt = 0;
     while (!$rscol->EOF) {
         if (is_null($rscol->fields[0])) {
             $wrkValue = EWR_NULL_VALUE;
             $wrkCaption = $ReportLanguage->Phrase("NullLabel");
         } elseif ($rscol->fields[0] == "") {
             $wrkValue = EWR_EMPTY_VALUE;
             $wrkCaption = $ReportLanguage->Phrase("EmptyLabel");
         } else {
             $wrkValue = $rscol->fields[0];
             $wrkCaption = $rscol->fields[0];
         }
         $colcnt++;
         $this->Col[$colcnt] = new crCrosstabColumn($wrkValue, $wrkCaption, TRUE);
         $rscol->MoveNext();
     }
     $rscol->Close();
     // Update crosstab sql
     $sSqlFlds = "";
     for ($colcnt = 1; $colcnt <= $this->ColCount; $colcnt++) {
         $sFld = ewr_CrossTabField($this->getSummaryType(), $this->getSummaryField(), $this->getColumnField(), $this->getColumnDateType(), $this->Col[$colcnt]->Value, "", "C" . $colcnt);
         if ($sSqlFlds != "") {
             $sSqlFlds .= ", ";
         }
         $sSqlFlds .= $sFld;
     }
     $this->DistinctColumnFields = $sSqlFlds;
 }
Example #4
0
 function RenderRow()
 {
     global $conn, $rs, $Security, $ReportLanguage;
     if ($this->RowTotalType == EWR_ROWTOTAL_GRAND && !$this->GrandSummarySetup) {
         // Grand total
         $bGotCount = FALSE;
         $bGotSummary = FALSE;
         // Get total count from sql directly
         $sSql = ewr_BuildReportSql($this->getSqlSelectCount(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), "", $this->Filter, "");
         $rstot = $conn->Execute($sSql);
         if ($rstot) {
             $this->TotCount = $rstot->RecordCount() > 1 ? $rstot->RecordCount() : $rstot->fields[0];
             $rstot->Close();
             $bGotCount = TRUE;
         } else {
             $this->TotCount = 0;
         }
         $bGotSummary = TRUE;
         // Accumulate grand summary from detail records
         if (!$bGotCount || !$bGotSummary) {
             $sSql = ewr_BuildReportSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(), $this->getSqlHaving(), "", $this->Filter, "");
             $rs = $conn->Execute($sSql);
             if ($rs) {
                 $this->GetRow(1);
                 while (!$rs->EOF) {
                     $this->AccumulateGrandSummary();
                     $this->GetRow(2);
                 }
                 $rs->Close();
             }
         }
         $this->GrandSummarySetup = TRUE;
         // No need to set up again
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     //
     // Render view codes
     //
     if ($this->RowType == EWR_ROWTYPE_TOTAL) {
         // Summary row
         // Count(messages.message)
         $this->Count28messages_message29->HrefValue = "";
         // timeta
         $this->timeta->HrefValue = "";
     } else {
         // Count(messages.message)
         $this->Count28messages_message29->ViewValue = $this->Count28messages_message29->CurrentValue;
         $this->Count28messages_message29->CellAttrs["class"] = $this->RecCount % 2 != 1 ? "ewTableAltRow" : "ewTableRow";
         // timeta
         $this->timeta->ViewValue = $this->timeta->CurrentValue;
         $this->timeta->ViewValue = ewr_FormatDateTime($this->timeta->ViewValue, 7);
         $this->timeta->CellAttrs["class"] = $this->RecCount % 2 != 1 ? "ewTableAltRow" : "ewTableRow";
         // Count(messages.message)
         $this->Count28messages_message29->HrefValue = "";
         // timeta
         $this->timeta->HrefValue = "";
     }
     // Call Cell_Rendered event
     if ($this->RowType == EWR_ROWTYPE_TOTAL) {
         // Summary row
     } else {
         // Count(messages.message)
         $CurrentValue = $this->Count28messages_message29->CurrentValue;
         $ViewValue =& $this->Count28messages_message29->ViewValue;
         $ViewAttrs =& $this->Count28messages_message29->ViewAttrs;
         $CellAttrs =& $this->Count28messages_message29->CellAttrs;
         $HrefValue =& $this->Count28messages_message29->HrefValue;
         $LinkAttrs =& $this->Count28messages_message29->LinkAttrs;
         $this->Cell_Rendered($this->Count28messages_message29, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
         // timeta
         $CurrentValue = $this->timeta->CurrentValue;
         $ViewValue =& $this->timeta->ViewValue;
         $ViewAttrs =& $this->timeta->ViewAttrs;
         $CellAttrs =& $this->timeta->CellAttrs;
         $HrefValue =& $this->timeta->HrefValue;
         $LinkAttrs =& $this->timeta->LinkAttrs;
         $this->Cell_Rendered($this->timeta, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue, $LinkAttrs);
     }
     // Call Row_Rendered event
     $this->Row_Rendered();
     $this->SetupFieldCount();
 }
Example #5
0
function ewr_LoadSelectionFromFilter(&$fld, $filter, &$sel, $af = "")
{
    $sel = "";
    if ($af != "") {
        // Set up advanced filter first
        $ar = is_array($af) ? $af : array($af);
        $cnt = count($ar);
        for ($i = 0; $i < $cnt; $i++) {
            if (substr($ar[$i], 0, 2) == "@@") {
                if (!is_array($sel)) {
                    $sel = array();
                }
                $sel[] = $ar[$i];
            }
        }
    }
    if ($filter != "") {
        $sSql = ewr_BuildReportSql($fld->SqlSelect, "", "", "", $fld->SqlOrderBy, $filter, "");
        ewr_LoadArrayFromSql($sSql, $sel);
    }
}