/jf/web/reports/PRTY_Reportssmry.php
PHP | 1720 lines | 1250 code | 225 blank | 245 comment | 333 complexity | 5066ee8197c1c32592e22d7692cef0a9 MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- if (session_id() == "") session_start(); // Initialize Session data
- ob_start();
- ?>
- <?php include_once "phprptinc/ewrcfg5.php"; ?>
- <?php include_once "phprptinc/ewmysql.php"; ?>
- <?php include_once "phprptinc/ewrfn5.php"; ?>
- <?php include_once "phprptinc/ewrusrfn.php"; ?>
- <?php
-
- // Global variable for table object
- $PRTY_Reports = NULL;
-
- //
- // Table class for PRTY Reports
- //
- class crPRTY_Reports {
- var $TableVar = 'PRTY_Reports';
- var $TableName = 'PRTY Reports';
- var $TableType = 'REPORT';
- var $ShowCurrentFilter = EWRPT_SHOW_CURRENT_FILTER;
- var $FilterPanelOption = EWRPT_FILTER_PANEL_OPTION;
- var $CurrentOrder; // Current order
- var $CurrentOrderType; // Current order type
-
- // Table caption
- function TableCaption() {
- global $ReportLanguage;
- return $ReportLanguage->TablePhrase($this->TableVar, "TblCaption");
- }
-
- // Session Group Per Page
- function getGroupPerPage() {
- return @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_grpperpage"];
- }
-
- function setGroupPerPage($v) {
- @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_grpperpage"] = $v;
- }
-
- // Session Start Group
- function getStartGroup() {
- return @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_start"];
- }
-
- function setStartGroup($v) {
- @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_start"] = $v;
- }
-
- // Session Order By
- function getOrderBy() {
- return @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_orderby"];
- }
-
- function setOrderBy($v) {
- @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_orderby"] = $v;
- }
-
- // var $SelectLimit = TRUE;
- var $id;
- var $full_name;
- var $dob;
- var $priority;
- var $department_name;
- var $fields = array();
- var $Export; // Export
- var $ExportAll = TRUE;
- var $UseTokenInUrl = EWRPT_USE_TOKEN_IN_URL;
- var $RowType; // Row type
- var $RowTotalType; // Row total type
- var $RowTotalSubType; // Row total subtype
- var $RowGroupLevel; // Row group level
- var $RowAttrs = array(); // Row attributes
-
- // Reset CSS styles for table object
- function ResetCSS() {
- $this->RowAttrs["style"] = "";
- $this->RowAttrs["class"] = "";
- foreach ($this->fields as $fld) {
- $fld->ResetCSS();
- }
- }
-
- //
- // Table class constructor
- //
- function crPRTY_Reports() {
- global $ReportLanguage;
-
- // id
- $this->id = new crField('PRTY_Reports', 'PRTY Reports', 'x_id', 'id', '`id`', 19, EWRPT_DATATYPE_NUMBER, -1);
- $this->id->FldDefaultErrMsg = $ReportLanguage->Phrase("IncorrectInteger");
- $this->fields['id'] =& $this->id;
- $this->id->DateFilter = "";
- $this->id->SqlSelect = "";
- $this->id->SqlOrderBy = "";
-
- // full_name
- $this->full_name = new crField('PRTY_Reports', 'PRTY Reports', 'x_full_name', 'full_name', '`full_name`', 200, EWRPT_DATATYPE_STRING, -1);
- $this->fields['full_name'] =& $this->full_name;
- $this->full_name->DateFilter = "";
- $this->full_name->SqlSelect = "";
- $this->full_name->SqlOrderBy = "";
-
- // dob
- $this->dob = new crField('PRTY_Reports', 'PRTY Reports', 'x_dob', 'dob', '`dob`', 133, EWRPT_DATATYPE_DATE, 7);
- $this->dob->FldDefaultErrMsg = str_replace("%s", "/", $ReportLanguage->Phrase("IncorrectDateDMY"));
- $this->fields['dob'] =& $this->dob;
- $this->dob->DateFilter = "";
- $this->dob->SqlSelect = "";
- $this->dob->SqlOrderBy = "";
-
- // priority
- $this->priority = new crField('PRTY_Reports', 'PRTY Reports', 'x_priority', 'priority', '`priority`', 202, EWRPT_DATATYPE_STRING, -1);
- $this->priority->GroupingFieldId = 1;
- $this->fields['priority'] =& $this->priority;
- $this->priority->DateFilter = "";
- $this->priority->SqlSelect = "SELECT DISTINCT `priority` FROM " . $this->SqlFrom();
- $this->priority->SqlOrderBy = "`priority`";
- $this->priority->FldGroupByType = "";
- $this->priority->FldGroupInt = "0";
- $this->priority->FldGroupSql = "";
-
- // department_name
- $this->department_name = new crField('PRTY_Reports', 'PRTY Reports', 'x_department_name', 'department_name', '`department_name`', 200, EWRPT_DATATYPE_STRING, -1);
- $this->department_name->GroupingFieldId = 2;
- $this->fields['department_name'] =& $this->department_name;
- $this->department_name->DateFilter = "";
- $this->department_name->SqlSelect = "SELECT DISTINCT `department_name` FROM " . $this->SqlFrom();
- $this->department_name->SqlOrderBy = "`department_name`";
- $this->department_name->FldGroupByType = "";
- $this->department_name->FldGroupInt = "0";
- $this->department_name->FldGroupSql = "";
- }
-
- // Multiple column sort
- function UpdateSort(&$ofld, $ctrl) {
- if ($this->CurrentOrder == $ofld->FldName) {
- $sLastSort = $ofld->getSort();
- if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") {
- $sThisSort = $this->CurrentOrderType;
- } else {
- $sThisSort = ($sLastSort == "ASC") ? "DESC" : "ASC";
- }
- $ofld->setSort($sThisSort);
- } else {
- if ($ofld->GroupingFieldId == 0 && !$ctrl) $ofld->setSort("");
- }
- }
-
- // Get Sort SQL
- function SortSql() {
- $sDtlSortSql = "";
- $argrps = array();
- foreach ($this->fields as $fld) {
- if ($fld->getSort() <> "") {
- if ($fld->GroupingFieldId > 0) {
- if ($fld->FldGroupSql <> "")
- $argrps[$fld->GroupingFieldId] = str_replace("%s", $fld->FldExpression, $fld->FldGroupSql) . " " . $fld->getSort();
- else
- $argrps[$fld->GroupingFieldId] = $fld->FldExpression . " " . $fld->getSort();
- } else {
- if ($sDtlSortSql <> "") $sDtlSortSql .= ", ";
- $sDtlSortSql .= $fld->FldExpression . " " . $fld->getSort();
- }
- }
- }
- $sSortSql = "";
- foreach ($argrps as $grp) {
- if ($sSortSql <> "") $sSortSql .= ", ";
- $sSortSql .= $grp;
- }
- if ($sDtlSortSql <> "") {
- if ($sSortSql <> "") $sSortSql .= ",";
- $sSortSql .= $sDtlSortSql;
- }
- return $sSortSql;
- }
-
- // Table level SQL
- function SqlFrom() { // From
- return "`vw__priority_reports`";
- }
-
- function SqlSelect() { // Select
- return "SELECT * FROM " . $this->SqlFrom();
- }
-
- function SqlWhere() { // Where
- return "";
- }
-
- function SqlGroupBy() { // Group By
- return "";
- }
-
- function SqlHaving() { // Having
- return "";
- }
-
- function SqlOrderBy() { // Order By
- return "`priority` ASC, `department_name` ASC";
- }
-
- // Table Level Group SQL
- function SqlFirstGroupField() {
- return "`priority`";
- }
-
- function SqlSelectGroup() {
- return "SELECT DISTINCT " . $this->SqlFirstGroupField() . " FROM " . $this->SqlFrom();
- }
-
- function SqlOrderByGroup() {
- return "`priority` ASC";
- }
-
- function SqlSelectAgg() {
- return "SELECT * FROM " . $this->SqlFrom();
- }
-
- function SqlAggPfx() {
- return "";
- }
-
- function SqlAggSfx() {
- return "";
- }
-
- function SqlSelectCount() {
- return "SELECT COUNT(*) FROM " . $this->SqlFrom();
- }
-
- // Sort URL
- function SortUrl(&$fld) {
- if ($this->Export <> "" ||
- in_array($fld->FldType, array(128, 204, 205))) { // Unsortable data type
- return "";
- } elseif ($fld->Sortable) {
- $sUrlParm = "order=" . urlencode($fld->FldName) . "&ordertype=" . $fld->ReverseSort();
- return ewrpt_CurrentPage() . "?" . $sUrlParm;
- } else {
- return "";
- }
- }
-
- // Row attributes
- function RowAttributes() {
- $sAtt = "";
- foreach ($this->RowAttrs as $k => $v) {
- if (trim($v) <> "")
- $sAtt .= " " . $k . "=\"" . trim($v) . "\"";
- }
- return $sAtt;
- }
-
- // Field object by fldvar
- function &fields($fldvar) {
- return $this->fields[$fldvar];
- }
-
- // Table level events
- // Row Rendering event
- function Row_Rendering() {
-
- // Enter your code here
- }
-
- // Cell Rendered event
- function Cell_Rendered(&$Field, $CurrentValue, &$ViewValue, &$ViewAttrs, &$CellAttrs, &$HrefValue) {
-
- //$ViewValue = "xxx";
- //$ViewAttrs["style"] = "xxx";
-
- }
-
- // Row Rendered event
- function Row_Rendered() {
-
- // To view properties of field class, use:
- //var_dump($this-><FieldName>);
-
- }
-
- // Load Filters event
- function Filters_Load() {
-
- // Enter your code here
- // Example: Register/Unregister Custom Extended Filter
- //ewrpt_RegisterFilter($this-><Field>, 'StartsWithA', 'Starts With A', 'GetStartsWithAFilter');
- //ewrpt_UnregisterFilter($this-><Field>, 'StartsWithA');
-
- }
-
- // Page Filter Validated event
- function Page_FilterValidated() {
-
- // Example:
- //global $MyTable;
- //$MyTable->MyField1->SearchValue = "your search criteria"; // Search value
-
- }
-
- // Chart Rendering event
- function Chart_Rendering(&$chart) {
-
- // var_dump($chart);
- }
-
- // Chart Rendered event
- function Chart_Rendered($chart, &$chartxml) {
-
- // Example:
- //$doc = $chart->XmlDoc; // Get the DOMDocument object
- // Enter your code to manipulate the DOMDocument object here
- //$chartxml = $doc->saveXML(); // Output the XML
-
- }
-
- // Email Sending event
- function Email_Sending(&$Email, &$Args) {
-
- //var_dump($Email); var_dump($Args); exit();
- return TRUE;
- }
- }
- ?>
- <?php ewrpt_Header(FALSE) ?>
- <?php
-
- // Create page object
- $PRTY_Reports_summary = new crPRTY_Reports_summary();
- $Page =& $PRTY_Reports_summary;
-
- // Page init
- $PRTY_Reports_summary->Page_Init();
-
- // Page main
- $PRTY_Reports_summary->Page_Main();
- ?>
- <?php include_once "phprptinc/header.php"; ?>
- <?php if ($PRTY_Reports->Export == "" || $PRTY_Reports->Export == "print" || $PRTY_Reports->Export == "email") { ?>
- <script type="text/javascript">
-
- // Create page object
- var PRTY_Reports_summary = new ewrpt_Page("PRTY_Reports_summary");
-
- // page properties
- PRTY_Reports_summary.PageID = "summary"; // page ID
- PRTY_Reports_summary.FormID = "fPRTY_Reportssummaryfilter"; // form ID
- var EWRPT_PAGE_ID = PRTY_Reports_summary.PageID;
-
- // extend page with Chart_Rendering function
- PRTY_Reports_summary.Chart_Rendering =
- function(chart, chartid) { // DO NOT CHANGE THIS LINE!
-
- //alert(chartid);
- }
-
- // extend page with Chart_Rendered function
- PRTY_Reports_summary.Chart_Rendered =
- function(chart, chartid) { // DO NOT CHANGE THIS LINE!
-
- //alert(chartid);
- }
- </script>
- <?php } ?>
- <?php if ($PRTY_Reports->Export == "") { ?>
- <script language="JavaScript" type="text/javascript">
- <!--
-
- // Write your client script here, no need to add script tags.
- //-->
-
- </script>
- <?php } ?>
- <?php if ($PRTY_Reports->Export == "" || $PRTY_Reports->Export == "print" || $PRTY_Reports->Export == "email") { ?>
- <script src="<?php echo EWRPT_FUSIONCHARTS_FREE_JSCLASS_FILE; ?>" type="text/javascript"></script>
- <?php } ?>
- <?php if ($PRTY_Reports->Export == "") { ?>
- <div id="ewrpt_PopupFilter"><div class="bd"></div></div>
- <script src="phprptjs/ewrptpop.js" type="text/javascript"></script>
- <script type="text/javascript">
-
- // popup fields
- <?php $jsdata = ewrpt_GetJsData($PRTY_Reports->priority, $PRTY_Reports->priority->FldType); ?>
- ewrpt_CreatePopup("PRTY_Reports_priority", [<?php echo $jsdata ?>]);
- <?php $jsdata = ewrpt_GetJsData($PRTY_Reports->department_name, $PRTY_Reports->department_name->FldType); ?>
- ewrpt_CreatePopup("PRTY_Reports_department_name", [<?php echo $jsdata ?>]);
- </script>
- <?php } ?>
- <?php if ($PRTY_Reports->Export == "" || $PRTY_Reports->Export == "print" || $PRTY_Reports->Export == "email") { ?>
- <!-- Table Container (Begin) -->
- <table id="ewContainer" cellspacing="0" cellpadding="0" border="0">
- <!-- Top Container (Begin) -->
- <tr><td colspan="3"><div id="ewTop" class="phpreportmaker">
- <!-- top slot -->
- <a name="top"></a>
- <?php } ?>
- <p class="phpreportmaker ewTitle"><?php echo $PRTY_Reports->TableCaption() ?>
- <?php $PRTY_Reports_summary->ExportOptions->Render("body"); ?></p>
- <?php $PRTY_Reports_summary->ShowPageHeader(); ?>
- <?php $PRTY_Reports_summary->ShowMessage(); ?>
- <br><br>
- <?php if ($PRTY_Reports->Export == "" || $PRTY_Reports->Export == "print" || $PRTY_Reports->Export == "email") { ?>
- </div></td></tr>
- <!-- Top Container (End) -->
- <tr>
- <!-- Left Container (Begin) -->
- <td style="vertical-align: top;"><div id="ewLeft" class="phpreportmaker">
- <!-- Left slot -->
- </div></td>
- <!-- Left Container (End) -->
- <!-- Center Container - Report (Begin) -->
- <td style="vertical-align: top;" class="ewPadding"><div id="ewCenter" class="phpreportmaker">
- <!-- center slot -->
- <?php } ?>
- <!-- summary report starts -->
- <div id="report_summary">
- <?php if ($PRTY_Reports->ShowCurrentFilter) { ?>
- <div id="ewrptFilterList">
- <?php $PRTY_Reports_summary->ShowFilterList() ?>
- </div>
- <br>
- <?php } ?>
- <table class="ewGrid" cellspacing="0"><tr>
- <td class="ewGridContent">
- <?php if ($PRTY_Reports->Export == "") { ?>
- <div class="ewGridUpperPanel">
- <form action="<?php echo ewrpt_CurrentPage() ?>" name="ewpagerform" id="ewpagerform" class="ewForm">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td style="white-space: nowrap;">
- <?php if (!isset($Pager)) $Pager = new crPrevNextPager($PRTY_Reports_summary->StartGrp, $PRTY_Reports_summary->DisplayGrps, $PRTY_Reports_summary->TotalGrps) ?>
- <?php if ($Pager->RecordCount > 0) { ?>
- <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Page") ?> </span></td>
- <!--first page button-->
- <?php if ($Pager->FirstButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->FirstButton->Start ?>"><img src="phprptimages/first.gif" alt="<?php echo $ReportLanguage->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/firstdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <!--previous page button-->
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->PrevButton->Start ?>"><img src="phprptimages/prev.gif" alt="<?php echo $ReportLanguage->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/prevdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <!--current page number-->
- <td><input type="text" name="pageno" id="pageno" value="<?php echo $Pager->CurrentPage ?>" size="4"></td>
- <!--next page button-->
- <?php if ($Pager->NextButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->NextButton->Start ?>"><img src="phprptimages/next.gif" alt="<?php echo $ReportLanguage->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/nextdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <!--last page button-->
- <?php if ($Pager->LastButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->LastButton->Start ?>"><img src="phprptimages/last.gif" alt="<?php echo $ReportLanguage->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/lastdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <td><span class="phpreportmaker"> <?php echo $ReportLanguage->Phrase("of") ?> <?php echo $Pager->PageCount ?></span></td>
- </tr></table>
- </td>
- <td> </td>
- <td>
- <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Record") ?> <?php echo $Pager->FromIndex ?> <?php echo $ReportLanguage->Phrase("To") ?> <?php echo $Pager->ToIndex ?> <?php echo $ReportLanguage->Phrase("Of") ?> <?php echo $Pager->RecordCount ?></span>
- <?php } else { ?>
- <?php if ($PRTY_Reports_summary->Filter == "0=101") { ?>
- <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("EnterSearchCriteria") ?></span>
- <?php } else { ?>
- <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("NoRecord") ?></span>
- <?php } ?>
- <?php } ?>
- </td>
- <?php if ($PRTY_Reports_summary->TotalGrps > 0) { ?>
- <td style="white-space: nowrap;"> </td>
- <td align="right" style="vertical-align: top; white-space: nowrap;"><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("GroupsPerPage"); ?>
- <select name="<?php echo EWRPT_TABLE_GROUP_PER_PAGE; ?>" onchange="this.form.submit();">
- <option value="1"<?php if ($PRTY_Reports_summary->DisplayGrps == 1) echo " selected=\"selected\"" ?>>1</option>
- <option value="2"<?php if ($PRTY_Reports_summary->DisplayGrps == 2) echo " selected=\"selected\"" ?>>2</option>
- <option value="3"<?php if ($PRTY_Reports_summary->DisplayGrps == 3) echo " selected=\"selected\"" ?>>3</option>
- <option value="4"<?php if ($PRTY_Reports_summary->DisplayGrps == 4) echo " selected=\"selected\"" ?>>4</option>
- <option value="5"<?php if ($PRTY_Reports_summary->DisplayGrps == 5) echo " selected=\"selected\"" ?>>5</option>
- <option value="10"<?php if ($PRTY_Reports_summary->DisplayGrps == 10) echo " selected=\"selected\"" ?>>10</option>
- <option value="20"<?php if ($PRTY_Reports_summary->DisplayGrps == 20) echo " selected=\"selected\"" ?>>20</option>
- <option value="50"<?php if ($PRTY_Reports_summary->DisplayGrps == 50) echo " selected=\"selected\"" ?>>50</option>
- <option value="ALL"<?php if ($PRTY_Reports->getGroupPerPage() == -1) echo " selected=\"selected\"" ?>><?php echo $ReportLanguage->Phrase("AllRecords") ?></option>
- </select>
- </span></td>
- <?php } ?>
- </tr>
- </table>
- </form>
- </div>
- <?php } ?>
- <!-- Report Grid (Begin) -->
- <div class="ewGridMiddlePanel">
- <table class="<?php echo $PRTY_Reports_summary->ReportTableClass ?>" cellspacing="0">
- <?php
-
- // Set the last group to display if not export all
- if ($PRTY_Reports->ExportAll && $PRTY_Reports->Export <> "") {
- $PRTY_Reports_summary->StopGrp = $PRTY_Reports_summary->TotalGrps;
- } else {
- $PRTY_Reports_summary->StopGrp = $PRTY_Reports_summary->StartGrp + $PRTY_Reports_summary->DisplayGrps - 1;
- }
-
- // Stop group <= total number of groups
- if (intval($PRTY_Reports_summary->StopGrp) > intval($PRTY_Reports_summary->TotalGrps))
- $PRTY_Reports_summary->StopGrp = $PRTY_Reports_summary->TotalGrps;
- $PRTY_Reports_summary->RecCount = 0;
-
- // Get first row
- if ($PRTY_Reports_summary->TotalGrps > 0) {
- $PRTY_Reports_summary->GetGrpRow(1);
- $PRTY_Reports_summary->GrpCount = 1;
- }
- while (($rsgrp && !$rsgrp->EOF && $PRTY_Reports_summary->GrpCount <= $PRTY_Reports_summary->DisplayGrps) || $PRTY_Reports_summary->ShowFirstHeader) {
-
- // Show header
- if ($PRTY_Reports_summary->ShowFirstHeader) {
- ?>
- <thead>
- <tr>
- <td class="ewTableHeader">
- <?php if ($PRTY_Reports->Export <> "") { ?>
- <?php echo $PRTY_Reports->priority->FldCaption() ?>
- <?php } else { ?>
- <table cellspacing="0" class="ewTableHeaderBtn"><tr>
- <?php if ($PRTY_Reports->SortUrl($PRTY_Reports->priority) == "") { ?>
- <td style="vertical-align: bottom;"><?php echo $PRTY_Reports->priority->FldCaption() ?></td>
- <?php } else { ?>
- <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $PRTY_Reports->SortUrl($PRTY_Reports->priority) ?>',2);"><?php echo $PRTY_Reports->priority->FldCaption() ?></td><td style="width: 10px;">
- <?php if ($PRTY_Reports->priority->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($PRTY_Reports->priority->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
- <?php } ?>
- <td style="width: 20px;" align="right"><a href="#" onclick="ewrpt_ShowPopup(this.name, 'PRTY_Reports_priority', false, '<?php echo $PRTY_Reports->priority->RangeFrom; ?>', '<?php echo $PRTY_Reports->priority->RangeTo; ?>');return false;" name="x_priority<?php echo $PRTY_Reports_summary->Cnt[0][0]; ?>" id="x_priority<?php echo $PRTY_Reports_summary->Cnt[0][0]; ?>"><img src="phprptimages/popup.gif" width="15" height="14" border="0" alt="<?php echo $ReportLanguage->Phrase("Filter") ?>"></a></td>
- </tr></table>
- <?php } ?>
- </td>
- <td class="ewTableHeader">
- <?php if ($PRTY_Reports->Export <> "") { ?>
- <?php echo $PRTY_Reports->department_name->FldCaption() ?>
- <?php } else { ?>
- <table cellspacing="0" class="ewTableHeaderBtn"><tr>
- <?php if ($PRTY_Reports->SortUrl($PRTY_Reports->department_name) == "") { ?>
- <td style="vertical-align: bottom;"><?php echo $PRTY_Reports->department_name->FldCaption() ?></td>
- <?php } else { ?>
- <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $PRTY_Reports->SortUrl($PRTY_Reports->department_name) ?>',2);"><?php echo $PRTY_Reports->department_name->FldCaption() ?></td><td style="width: 10px;">
- <?php if ($PRTY_Reports->department_name->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($PRTY_Reports->department_name->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
- <?php } ?>
- <td style="width: 20px;" align="right"><a href="#" onclick="ewrpt_ShowPopup(this.name, 'PRTY_Reports_department_name', false, '<?php echo $PRTY_Reports->department_name->RangeFrom; ?>', '<?php echo $PRTY_Reports->department_name->RangeTo; ?>');return false;" name="x_department_name<?php echo $PRTY_Reports_summary->Cnt[0][0]; ?>" id="x_department_name<?php echo $PRTY_Reports_summary->Cnt[0][0]; ?>"><img src="phprptimages/popup.gif" width="15" height="14" border="0" alt="<?php echo $ReportLanguage->Phrase("Filter") ?>"></a></td>
- </tr></table>
- <?php } ?>
- </td>
- <td class="ewTableHeader">
- <?php if ($PRTY_Reports->Export <> "") { ?>
- <?php echo $PRTY_Reports->full_name->FldCaption() ?>
- <?php } else { ?>
- <table cellspacing="0" class="ewTableHeaderBtn"><tr>
- <?php if ($PRTY_Reports->SortUrl($PRTY_Reports->full_name) == "") { ?>
- <td style="vertical-align: bottom;"><?php echo $PRTY_Reports->full_name->FldCaption() ?></td>
- <?php } else { ?>
- <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $PRTY_Reports->SortUrl($PRTY_Reports->full_name) ?>',2);"><?php echo $PRTY_Reports->full_name->FldCaption() ?></td><td style="width: 10px;">
- <?php if ($PRTY_Reports->full_name->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($PRTY_Reports->full_name->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
- <?php } ?>
- </tr></table>
- <?php } ?>
- </td>
- <td class="ewTableHeader">
- <?php if ($PRTY_Reports->Export <> "") { ?>
- <?php echo $PRTY_Reports->dob->FldCaption() ?>
- <?php } else { ?>
- <table cellspacing="0" class="ewTableHeaderBtn"><tr>
- <?php if ($PRTY_Reports->SortUrl($PRTY_Reports->dob) == "") { ?>
- <td style="vertical-align: bottom;"><?php echo $PRTY_Reports->dob->FldCaption() ?></td>
- <?php } else { ?>
- <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $PRTY_Reports->SortUrl($PRTY_Reports->dob) ?>',2);"><?php echo $PRTY_Reports->dob->FldCaption() ?></td><td style="width: 10px;">
- <?php if ($PRTY_Reports->dob->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($PRTY_Reports->dob->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
- <?php } ?>
- </tr></table>
- <?php } ?>
- </td>
- </tr>
- </thead>
- <tbody>
- <?php
- $PRTY_Reports_summary->ShowFirstHeader = FALSE;
- }
-
- // Build detail SQL
- $sWhere = ewrpt_DetailFilterSQL($PRTY_Reports->priority, $PRTY_Reports->SqlFirstGroupField(), $PRTY_Reports->priority->GroupValue());
- if ($PRTY_Reports_summary->Filter != "")
- $sWhere = "($PRTY_Reports_summary->Filter) AND ($sWhere)";
- $sSql = ewrpt_BuildReportSql($PRTY_Reports->SqlSelect(), $PRTY_Reports->SqlWhere(), $PRTY_Reports->SqlGroupBy(), $PRTY_Reports->SqlHaving(), $PRTY_Reports->SqlOrderBy(), $sWhere, $PRTY_Reports_summary->Sort);
- $rs = $conn->Execute($sSql);
- $rsdtlcnt = ($rs) ? $rs->RecordCount() : 0;
- if ($rsdtlcnt > 0)
- $PRTY_Reports_summary->GetRow(1);
- while ($rs && !$rs->EOF) { // Loop detail records
- $PRTY_Reports_summary->RecCount++;
-
- // Render detail row
- $PRTY_Reports->ResetCSS();
- $PRTY_Reports->RowType = EWRPT_ROWTYPE_DETAIL;
- $PRTY_Reports_summary->RenderRow();
- ?>
- <tr<?php echo $PRTY_Reports->RowAttributes(); ?>>
- <td<?php echo $PRTY_Reports->priority->CellAttributes(); ?>>
- <span<?php echo $PRTY_Reports->priority->ViewAttributes(); ?>><?php echo $PRTY_Reports->priority->GroupViewValue; ?></span></td>
- <td<?php echo $PRTY_Reports->department_name->CellAttributes(); ?>>
- <span<?php echo $PRTY_Reports->department_name->ViewAttributes(); ?>><?php echo $PRTY_Reports->department_name->GroupViewValue; ?></span></td>
- <td<?php echo $PRTY_Reports->full_name->CellAttributes() ?>>
- <span<?php echo $PRTY_Reports->full_name->ViewAttributes(); ?>><?php echo $PRTY_Reports->full_name->ListViewValue(); ?></span></td>
- <td<?php echo $PRTY_Reports->dob->CellAttributes() ?>>
- <span<?php echo $PRTY_Reports->dob->ViewAttributes(); ?>><?php echo $PRTY_Reports->dob->ListViewValue(); ?></span></td>
- </tr>
- <?php
-
- // Accumulate page summary
- $PRTY_Reports_summary->AccumulateSummary();
-
- // Get next record
- $PRTY_Reports_summary->GetRow(2);
-
- // Show Footers
- ?>
- <?php
- } // End detail records loop
- ?>
- <?php
- ?>
- <?php
- $PRTY_Reports->ResetCSS();
- $PRTY_Reports->RowType = EWRPT_ROWTYPE_TOTAL;
- $PRTY_Reports->RowTotalType = EWRPT_ROWTOTAL_GROUP;
- $PRTY_Reports->RowTotalSubType = EWRPT_ROWTOTAL_FOOTER;
- $PRTY_Reports->RowGroupLevel = 1;
- $PRTY_Reports_summary->RenderRow();
- ?>
- <tr<?php echo $PRTY_Reports->RowAttributes(); ?>>
- <td colspan="4"<?php echo $PRTY_Reports->priority->CellAttributes() ?>><?php echo $ReportLanguage->Phrase("RptSumHead") ?> <?php echo $PRTY_Reports->priority->FldCaption() ?>: <?php echo $PRTY_Reports->priority->GroupViewValue; ?> (<?php echo ewrpt_FormatNumber($PRTY_Reports_summary->Cnt[1][0],0,-2,-2,-2); ?><?php echo $ReportLanguage->Phrase("RptDtlRec") ?>)</td></tr>
- <?php
-
- // Reset level 1 summary
- $PRTY_Reports_summary->ResetLevelSummary(1);
- ?>
- <?php
-
- // Next group
- $PRTY_Reports_summary->GetGrpRow(2);
- $PRTY_Reports_summary->GrpCount++;
- } // End while
- ?>
- </tbody>
- <tfoot>
- <?php
- if ($PRTY_Reports_summary->TotalGrps > 0) {
- $PRTY_Reports->ResetCSS();
- $PRTY_Reports->RowType = EWRPT_ROWTYPE_TOTAL;
- $PRTY_Reports->RowTotalType = EWRPT_ROWTOTAL_GRAND;
- $PRTY_Reports->RowTotalSubType = EWRPT_ROWTOTAL_FOOTER;
- $PRTY_Reports->RowAttrs["class"] = "ewRptGrandSummary";
- $PRTY_Reports_summary->RenderRow();
- ?>
- <!-- tr><td colspan="4"><span class="phpreportmaker"> <br></span></td></tr -->
- <tr<?php echo $PRTY_Reports->RowAttributes(); ?>><td colspan="4"><?php echo $ReportLanguage->Phrase("RptGrandTotal") ?> (<?php echo ewrpt_FormatNumber($PRTY_Reports_summary->TotCount,0,-2,-2,-2); ?><?php echo $ReportLanguage->Phrase("RptDtlRec") ?>)</td></tr>
- <?php } ?>
- </tfoot>
- </table>
- </div>
- <?php if ($PRTY_Reports_summary->TotalGrps > 0) { ?>
- <?php if ($PRTY_Reports->Export == "") { ?>
- <div class="ewGridLowerPanel">
- <form action="<?php echo ewrpt_CurrentPage() ?>" name="ewpagerform" id="ewpagerform" class="ewForm">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td style="white-space: nowrap;">
- <?php if (!isset($Pager)) $Pager = new crPrevNextPager($PRTY_Reports_summary->StartGrp, $PRTY_Reports_summary->DisplayGrps, $PRTY_Reports_summary->TotalGrps) ?>
- <?php if ($Pager->RecordCount > 0) { ?>
- <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Page") ?> </span></td>
- <!--first page button-->
- <?php if ($Pager->FirstButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->FirstButton->Start ?>"><img src="phprptimages/first.gif" alt="<?php echo $ReportLanguage->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/firstdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <!--previous page button-->
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->PrevButton->Start ?>"><img src="phprptimages/prev.gif" alt="<?php echo $ReportLanguage->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/prevdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <!--current page number-->
- <td><input type="text" name="pageno" id="pageno" value="<?php echo $Pager->CurrentPage ?>" size="4"></td>
- <!--next page button-->
- <?php if ($Pager->NextButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->NextButton->Start ?>"><img src="phprptimages/next.gif" alt="<?php echo $ReportLanguage->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/nextdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <!--last page button-->
- <?php if ($Pager->LastButton->Enabled) { ?>
- <td><a href="<?php echo ewrpt_CurrentPage() ?>?start=<?php echo $Pager->LastButton->Start ?>"><img src="phprptimages/last.gif" alt="<?php echo $ReportLanguage->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>
- <?php } else { ?>
- <td><img src="phprptimages/lastdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
- <?php } ?>
- <td><span class="phpreportmaker"> <?php echo $ReportLanguage->Phrase("of") ?> <?php echo $Pager->PageCount ?></span></td>
- </tr></table>
- </td>
- <td> </td>
- <td>
- <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Record") ?> <?php echo $Pager->FromIndex ?> <?php echo $ReportLanguage->Phrase("To") ?> <?php echo $Pager->ToIndex ?> <?php echo $ReportLanguage->Phrase("Of") ?> <?php echo $Pager->RecordCount ?></span>
- <?php } else { ?>
- <?php if ($PRTY_Reports_summary->Filter == "0=101") { ?>
- <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("EnterSearchCriteria") ?></span>
- <?php } else { ?>
- <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("NoRecord") ?></span>
- <?php } ?>
- <?php } ?>
- </td>
- <?php if ($PRTY_Reports_summary->TotalGrps > 0) { ?>
- <td style="white-space: nowrap;"> </td>
- <td align="right" style="vertical-align: top; white-space: nowrap;"><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("GroupsPerPage"); ?>
- <select name="<?php echo EWRPT_TABLE_GROUP_PER_PAGE; ?>" onchange="this.form.submit();">
- <option value="1"<?php if ($PRTY_Reports_summary->DisplayGrps == 1) echo " selected=\"selected\"" ?>>1</option>
- <option value="2"<?php if ($PRTY_Reports_summary->DisplayGrps == 2) echo " selected=\"selected\"" ?>>2</option>
- <option value="3"<?php if ($PRTY_Reports_summary->DisplayGrps == 3) echo " selected=\"selected\"" ?>>3</option>
- <option value="4"<?php if ($PRTY_Reports_summary->DisplayGrps == 4) echo " selected=\"selected\"" ?>>4</option>
- <option value="5"<?php if ($PRTY_Reports_summary->DisplayGrps == 5) echo " selected=\"selected\"" ?>>5</option>
- <option value="10"<?php if ($PRTY_Reports_summary->DisplayGrps == 10) echo " selected=\"selected\"" ?>>10</option>
- <option value="20"<?php if ($PRTY_Reports_summary->DisplayGrps == 20) echo " selected=\"selected\"" ?>>20</option>
- <option value="50"<?php if ($PRTY_Reports_summary->DisplayGrps == 50) echo " selected=\"selected\"" ?>>50</option>
- <option value="ALL"<?php if ($PRTY_Reports->getGroupPerPage() == -1) echo " selected=\"selected\"" ?>><?php echo $ReportLanguage->Phrase("AllRecords") ?></option>
- </select>
- </span></td>
- <?php } ?>
- </tr>
- </table>
- </form>
- </div>
- <?php } ?>
- <?php } ?>
- </td></tr></table>
- </div>
- <!-- Summary Report Ends -->
- <?php if ($PRTY_Reports->Export == "" || $PRTY_Reports->Export == "print" || $PRTY_Reports->Export == "email") { ?>
- </div><br></td>
- <!-- Center Container - Report (End) -->
- <!-- Right Container (Begin) -->
- <td style="vertical-align: top;"><div id="ewRight" class="phpreportmaker">
- <!-- Right slot -->
- </div></td>
- <!-- Right Container (End) -->
- </tr>
- <!-- Bottom Container (Begin) -->
- <tr><td colspan="3"><div id="ewBottom" class="phpreportmaker">
- <!-- Bottom slot -->
- </div><br></td></tr>
- <!-- Bottom Container (End) -->
- </table>
- <!-- Table Container (End) -->
- <?php } ?>
- <?php $PRTY_Reports_summary->ShowPageFooter(); ?>
- <?php if (EWRPT_DEBUG_ENABLED) echo ewrpt_DebugMsg(); ?>
- <?php
-
- // Close recordsets
- if ($rsgrp) $rsgrp->Close();
- if ($rs) $rs->Close();
- ?>
- <?php if ($PRTY_Reports->Export == "") { ?>
- <script language="JavaScript" type="text/javascript">
- <!--
-
- // Write your table-specific startup script here
- // document.write("page loaded");
- //-->
-
- </script>
- <?php } ?>
- <?php include_once "phprptinc/footer.php"; ?>
- <?php
- $PRTY_Reports_summary->Page_Terminate();
- ?>
- <?php
-
- //
- // Page class
- //
- class crPRTY_Reports_summary {
-
- // Page ID
- var $PageID = 'summary';
-
- // Table name
- var $TableName = 'PRTY Reports';
-
- // Page object name
- var $PageObjName = 'PRTY_Reports_summary';
-
- // Page name
- function PageName() {
- return ewrpt_CurrentPage();
- }
-
- // Page URL
- function PageUrl() {
- $PageUrl = ewrpt_CurrentPage() . "?";
- global $PRTY_Reports;
- if ($PRTY_Reports->UseTokenInUrl) $PageUrl .= "t=" . $PRTY_Reports->TableVar . "&"; // Add page token
- return $PageUrl;
- }
-
- // Export URLs
- var $ExportPrintUrl;
- var $ExportExcelUrl;
- var $ExportWordUrl;
- var $ExportPdfUrl;
- var $ReportTableClass;
-
- // Message
- function getMessage() {
- return @$_SESSION[EWRPT_SESSION_MESSAGE];
- }
-
- function setMessage($v) {
- if (@$_SESSION[EWRPT_SESSION_MESSAGE] <> "") { // Append
- $_SESSION[EWRPT_SESSION_MESSAGE] .= "<br>" . $v;
- } else {
- $_SESSION[EWRPT_SESSION_MESSAGE] = $v;
- }
- }
-
- // Show message
- function ShowMessage() {
- $sMessage = $this->getMessage();
- $this->Message_Showing($sMessage);
- if ($sMessage <> "") { // Message in Session, display
- echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
- $_SESSION[EWRPT_SESSION_MESSAGE] = ""; // Clear message in Session
- }
- }
- var $PageHeader;
- var $PageFooter;
-
- // Show Page Header
- function ShowPageHeader() {
- $sHeader = $this->PageHeader;
- $this->Page_DataRendering($sHeader);
- if ($sHeader <> "") { // Header exists, display
- echo "<p><span class=\"phpreportmaker\">" . $sHeader . "</span></p>";
- }
- }
-
- // Show Page Footer
- function ShowPageFooter() {
- $sFooter = $this->PageFooter;
- $this->Page_DataRendered($sFooter);
- if ($sFooter <> "") { // Fotoer exists, display
- echo "<p><span class=\"phpreportmaker\">" . $sFooter . "</span></p>";
- }
- }
-
- // Validate page request
- function IsPageRequest() {
- global $PRTY_Reports;
- if ($PRTY_Reports->UseTokenInUrl) {
- if (ewrpt_IsHttpPost())
- return ($PRTY_Reports->TableVar == @$_POST("t"));
- if (@$_GET["t"] <> "")
- return ($PRTY_Reports->TableVar == @$_GET["t"]);
- } else {
- return TRUE;
- }
- }
-
- //
- // Page class constructor
- //
- function crPRTY_Reports_summary() {
- global $conn, $ReportLanguage;
-
- // Language object
- $ReportLanguage = new crLanguage();
-
- // Table object (PRTY_Reports)
- $GLOBALS["PRTY_Reports"] = new crPRTY_Reports();
- $GLOBALS["Table"] =& $GLOBALS["PRTY_Reports"];
-
- // Initialize URLs
- $this->ExportPrintUrl = $this->PageUrl() . "export=print";
- $this->ExportExcelUrl = $this->PageUrl() . "export=excel";
- $this->ExportWordUrl = $this->PageUrl() . "export=word";
- $this->ExportPdfUrl = $this->PageUrl() . "export=pdf";
-
- // Page ID
- if (!defined("EWRPT_PAGE_ID"))
- define("EWRPT_PAGE_ID", 'summary', TRUE);
-
- // Table name (for backward compatibility)
- if (!defined("EWRPT_TABLE_NAME"))
- define("EWRPT_TABLE_NAME", 'PRTY Reports', TRUE);
-
- // Start timer
- $GLOBALS["gsTimer"] = new crTimer();
-
- // Open connection
- $conn = ewrpt_Connect();
-
- // Export options
- $this->ExportOptions = new crListOptions();
- $this->ExportOptions->Tag = "span";
- $this->ExportOptions->Separator = " ";
- }
-
- //
- // Page_Init
- //
- function Page_Init() {
- global $gsExport, $gsExportFile, $ReportLanguage, $Security;
- global $PRTY_Reports;
-
- // Get export parameters
- if (@$_GET["export"] <> "") {
- $PRTY_Reports->Export = $_GET["export"];
- }
- $gsExport = $PRTY_Reports->Export; // Get export parameter, used in header
- $gsExportFile = $PRTY_Reports->TableVar; // Get export file, used in header
- if ($PRTY_Reports->Export == "excel") {
- header('Content-Type: application/vnd.ms-excel;charset=utf-8');
- header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
- }
- if ($PRTY_Reports->Export == "word") {
- header('Content-Type: application/vnd.ms-word;charset=utf-8');
- header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
- }
-
- // Setup export options
- $this->SetupExportOptions();
-
- // Global Page Loading event (in userfn*.php)
- Page_Loading();
-
- // Page Load event
- $this->Page_Load();
- }
-
- // Set up export options
- function SetupExportOptions() {
- global $ReportLanguage, $PRTY_Reports;
-
- // Printer friendly
- $item =& $this->ExportOptions->Add("print");
- $item->Body = "<a href=\"" . $this->ExportPrintUrl . "\">" . $ReportLanguage->Phrase("PrinterFriendly") . "</a>";
- $item->Visible = TRUE;
-
- // Export to Excel
- $item =& $this->ExportOptions->Add("excel");
- $item->Body = "<a href=\"" . $this->ExportExcelUrl . "\">" . $ReportLanguage->Phrase("ExportToExcel") . "</a>";
- $item->Visible = TRUE;
-
- // Export to Word
- $item =& $this->ExportOptions->Add("word");
- $item->Body = "<a href=\"" . $this->ExportWordUrl . "\">" . $ReportLanguage->Phrase("ExportToWord") . "</a>";
- $item->Visible = TRUE;
-
- // Export to Pdf
- $item =& $this->ExportOptions->Add("pdf");
- $item->Body = "<a href=\"" . $this->ExportPdfUrl . "\">" . $ReportLanguage->Phrase("ExportToPDF") . "</a>";
- $item->Visible = FALSE;
-
- // Uncomment codes below to show export to Pdf link
- // $item->Visible = FALSE;
- // Export to Email
-
- $item =& $this->ExportOptions->Add("email");
- $item->Body = "<a name=\"emf_PRTY_Reports\" id=\"emf_PRTY_Reports\" href=\"javascript:void(0);\" onclick=\"ewrpt_EmailDialogShow({lnk:'emf_PRTY_Reports',hdr:ewLanguage.Phrase('ExportToEmail')});\">" . $ReportLanguage->Phrase("ExportToEmail") . "</a>";
- $item->Visible = FALSE;
-
- // Reset filter
- $item =& $this->ExportOptions->Add("resetfilter");
- $item->Body = "<a href=\"" . ewrpt_CurrentPage() . "?cmd=reset\">" . $ReportLanguage->Phrase("ResetAllFilter") . "</a>";
- $item->Visible = TRUE;
- $this->SetupExportOptionsExt();
-
- // Hide options for export
- if ($PRTY_Reports->Export <> "")
- $this->ExportOptions->HideAllOptions();
-
- // Set up table class
- if ($PRTY_Reports->Export == "word" || $PRTY_Reports->Export == "excel" || $PRTY_Reports->Export == "pdf")
- $this->ReportTableClass = "ewTable";
- else
- $this->ReportTableClass = "ewTable ewTableSeparate";
- }
-
- //
- // Page_Terminate
- //
- function Page_Terminate($url = "") {
- global $conn;
- global $ReportLanguage;
- global $PRTY_Reports;
-
- // Page Unload event
- $this->Page_Unload();
-
- // Global Page Unloaded event (in userfn*.php)
- Page_Unloaded();
-
- // Export to Email (use ob_file_contents for PHP)
- if ($PRTY_Reports->Export == "email") {
- $sContent = ob_get_contents();
- $this->ExportEmail($sContent);
- ob_end_clean();
-
- // Close connection
- $conn->Close();
- header("Location: " . ewrpt_CurrentPage());
- exit();
- }
-
- // Export to PDF (use ob_file_contents for PHP)
- if ($PRTY_Reports->Export == "pdf") {
- $sContent = ob_get_contents();
- $this->ExportPDF($sContent);
- ob_end_clean();
-
- // Close connection
- $conn->Close();
- }
-
- // Close connection
- $conn->Close();
-
- // Go to URL if specified
- if ($url <> "") {
- if (!EWRPT_DEBUG_ENABLED && ob_get_length())
- ob_end_clean();
- header("Location: " . $url);
- }
- exit();
- }
-
- // Initialize common variables
- var $ExportOptions; // Export options
-
- // Paging variables
- var $RecCount = 0; // Record count
- var $StartGrp = 0; // Start group
- var $StopGrp = 0; // Stop group
- var $TotalGrps = 0; // Total groups
- var $GrpCount = 0; // Group count
- var $DisplayGrps = 10; // Groups per page
- var $GrpRange = 10;
- var $Sort = "";
- var $Filter = "";
- var $UserIDFilter = "";
-
- // Clear field for ext filter
- var $ClearExtFilter = "";
- var $FilterApplied;
- var $ShowFirstHeader;
- var $Cnt, $Col, $Val, $Smry, $Mn, $Mx, $GrandSmry, $GrandMn, $GrandMx;
- var $TotCount;
-
- //
- // Page main
- //
- function Page_Main() {
- global $PRTY_Reports;
- global $rs;
- global $rsgrp;
- global $gsFormError;
-
- // Aggregate variables
- // 1st dimension = no of groups (level 0 used for grand total)
- // 2nd dimension = no of fields
-
- $nDtls = 3;
- $nGrps = 3;
- $this->Val =& ewrpt_InitArray($nDtls, 0);
- $this->Cnt =& ewrpt_Init2DArray($nGrps, $nDtls, 0);
- $this->Smry =& ewrpt_Init2DArray($nGrps, $nDtls, 0);
- $this->Mn =& ewrpt_Init2DArray($nGrps, $nDtls, NULL);
- $this->Mx =& ewrpt_Init2DArray($nGrps, $nDtls, NULL);
- $this->GrandSmry =& ewrpt_InitArray($nDtls, 0);
- $this->GrandMn =& ewrpt_InitArray($nDtls, NULL);
- $this->GrandMx =& ewrpt_InitArray($nDtls, NULL);
-
- // Set up if accumulation required
- $this->Col = array(FALSE, FALSE, FALSE);
-
- // Set up groups per page dynamically
- $this->SetUpDisplayGrps();
- $PRTY_Reports->priority->SelectionList = "";
- $PRTY_Reports->priority->DefaultSelectionList = "";
- $PRTY_Reports->priority->ValueList = "";
- $PRTY_Reports->department_name->SelectionList = "";
- $PRTY_Reports->department_name->DefaultSelectionList = "";
- $PRTY_Reports->department_name->ValueList = "";
-
- // Load default filter values
- $this->LoadDefaultFilters();
-
- // Load custom filters
- $PRTY_Reports->Filters_Load();
-
- // Set up popup filter
- $this->SetupPopup();
-
- // Extended filter
- $sExtendedFilter = "";
-
- // Build popup filter
- $sPopupFilter = $this->GetPopupFilter();
-
- //ewrpt_SetDebugMsg("popup filter: " . $sPopupFilter);
- if ($sPopupFilter <> "") {
- if ($this->Filter <> "")
- $this->Filter = "($this->Filter) AND ($sPopupFilter)";
- else
- $this->Filter = $sPopupFilter;
- }
-
- // Check if filter applied
- $this->FilterApplied = $this->CheckFilter();
- $this->ExportOptions->GetItem("resetfilter")->Visible = $this->FilterApplied;
-
- // Get sort
- $this->Sort = $this->GetSort();
-
- // Get total group count
- $sGrpSort = ewrpt_UpdateSortFields($PRTY_Reports->SqlOrderByGroup(), $this->Sort, 2); // Get grouping field only
- $sSql = ewrpt_BuildReportSql($PRTY_Reports->SqlSelectGroup(), $PRTY_Reports->SqlWhere(), $PRTY_Reports->SqlGroupBy(), $PRTY_Reports->SqlHaving(), $PRTY_Reports->SqlOrderByGroup(), $this->Filter, $sGrpSort);
- $this->TotalGrps = $this->GetGrpCnt($sSql);
- if ($this->DisplayGrps <= 0) // Display all groups
- $this->DisplayGrps = $this->TotalGrps;
- $this->StartGrp = 1;
-
- // Show header
- $this->ShowFirstHeader = ($this->TotalGrps > 0);
-
- //$this->ShowFirstHeader = TRUE; // Uncomment to always show header
- // Set up start position if not export all
-
- if ($PRTY_Reports->ExportAll && $PRTY_Reports->Export <> "")
- $this->DisplayGrps = $this->TotalGrps;
- else
- $this->SetUpStartGroup();
-
- // Hide all options if export
- if ($PRTY_Reports->Export <> "") {
- $this->ExportOptions->HideAllOptions();
- }
-
- // Get current page groups
- $rsgrp = $this->GetGrpRs($sSql, $this->StartGrp, $this->DisplayGrps);
-
- // Init detail recordset
- $rs = NULL;
- }
-
- // Check level break
- function ChkLvlBreak($lvl) {
- global $PRTY_Reports;
- switch ($lvl) {
- case 1:
- return (is_null($PRTY_Reports->priority->CurrentValue) && !is_null($PRTY_Reports->priority->OldValue)) ||
- (!is_null($PRTY_Reports->priority->CurrentValue) && is_null($PRTY_Reports->priority->OldValue)) ||
- ($PRTY_Reports->priority->GroupValue() <> $PRTY_Reports->priority->GroupOldValue());
- case 2:
- return (is_null($PRTY_Reports->department_name->CurrentValue) && !is_null($PRTY_Reports->department_name->OldValue)) ||
- (!is_null($PRTY_Reports->department_name->CurrentValue) && is_null($PRTY_Reports->department_name->OldValue)) ||
- ($PRTY_Reports->department_name->GroupValue() <> $PRTY_Reports->department_name->GroupOldValue()) || $this->ChkLvlBreak(1); // Recurse upper level
- }
- }
-
- // Accummulate summary
- function AccumulateSummary() {
- $cntx = count($this->Smry);
- for ($ix = 0; $ix < $cntx; $ix++) {
- $cnty = count($this->Smry[$ix]);
- for ($iy = 1; $iy < $cnty; $iy++) {
- $this->Cnt[$ix][$iy]++;
- if ($this->Col[$iy]) {
- $valwrk = $this->Val[$iy];
- if (is_null($valwrk) || !is_numeric($valwrk)) {
-
- // skip
- } else {
- $this->Smry[$ix][$iy] += $valwrk;
- if (is_null($this->Mn[$ix][$iy])) {
- $this->Mn[$ix][$iy] = $valwrk;
- $this->Mx[$ix][$iy] = $valwrk;
- } else {
- if ($this->Mn[$ix][$iy] > $valwrk) $this->Mn[$ix][$iy] = $valwrk;
- if ($this->Mx[$ix][$iy] < $valwrk) $this->Mx[$ix][$iy] = $valwrk;
- }
- }
- }
- }
- }
- $cntx = count($this->Smry);
- for ($ix = 1; $ix < $cntx; $ix++) {
- $this->Cnt[$ix][0]++;
- }
- }
-
- // Reset level summary
- function ResetLevelSummary($lvl) {
-
- // Clear summary values
- $cntx = count($this->Smry);
- for ($ix = $lvl; $ix < $cntx; $ix++) {
- $cnty = count($this->Smry[$ix]);
- for ($iy = 1; $iy < $cnty; $iy++) {
- $this->Cnt[$ix][$iy] = 0;
- if ($this->Col[$iy]) {
- $this->Smry[$ix][$iy] = 0;
- $this->Mn[$ix][$iy] = NULL;
- $this->Mx[$ix][$iy] = NULL;
- }
- }
- }
- $cntx = count($this->Smry);
- for ($ix = $lvl; $ix < $cntx; $ix++) {
- $this->Cnt[$ix][0] = 0;
- }
-
- // Reset record count
- $this->RecCount = 0;
- }
-
- // Accummulate grand summary
- function AccumulateGrandSummary() {
- $this->Cnt[0][0]++;
- $cntgs = count($this->GrandSmry);
- for ($iy = 1; $iy < $cntgs; $iy++) {
- if ($this->Col[$iy]) {
- $valwrk = $this->Val[$iy];
- if (is_null($valwrk) || !is_numeric($valwrk)) {
-
- // skip
- } else {
- $this->GrandSmry[$iy] += $valwrk;
- if (is_null($this->GrandMn[$iy])) {
- $this->GrandMn[$iy] = $valwrk;
- $this->GrandMx[$iy] = $valwrk;
- } else {
- if ($this->GrandMn[$iy] > $valwrk) $this->GrandMn[$iy] = $valwrk;
- if ($this->GrandMx[$iy] < $valwrk) $this->GrandMx[$iy] = $valwrk;
- }
- }
- }
- }
- }
-
- // Get group count
- function GetGrpCnt($sql) {
- global $conn;
- global $PRTY_Reports;
- $rsgrpcnt = $conn->Execute($sql);
- $grpcnt = ($rsgrpcnt) ? $rsgrpcnt->RecordCount() : 0;
- if ($rsgrpcnt) $rsgrpcnt->Close();
- return $grpcnt;
- }
-
- // Get group rs
- function GetGrpRs($sql, $start, $grps) {
- global $conn;
- global $PRTY_Reports;
- $wrksql = $sql;
- if ($start > 0 && $grps > -1)
- $wrksql .= " LIMIT " . ($start-1) . ", " . ($grps);
- $rswrk = $conn->Execute($wrksql);
- return $rswrk;
- }
-
- // Get group row values
- function GetGrpRow($opt) {
- global $rsgrp;
- global $PRTY_Reports;
- if (!$rsgrp)
- return;
- if ($opt == 1) { // Get first group
-
- //$rsgrp->MoveFirst(); // NOTE: no need to move position
- $PRTY_Reports->priority->setDbValue(""); // Init first value
- } else { // Get next group
- $rsgrp->MoveNext();
- }
- if (!$rsgrp->EOF)
- $PRTY_Reports->priority->setDbValue($rsgrp->fields[0]);
- if ($rsgrp->EOF) {
- $PRTY_Reports->priority->setDbValue("");
- }
- }
-
- // Get row values
- function GetRow($opt) {
- global $rs;
- global $PRTY_Reports;
- if (!$rs)
- return;
- if ($opt == 1) { // Get first row
-
- // $rs->MoveFirst(); // NOTE: no need to move position
- } else { // Get next row
- $rs->MoveNext();
- }
- if (!$rs->EOF) {
- $PRTY_Reports->id->setDbValue($rs->fields('id'));
- $PRTY_Reports->full_name->setDbValue($rs->fields('full_name'));
- $PRTY_Reports->dob->setDbValue($rs->fields('dob'));
- if ($opt <> 1) {
- if (is_array($PRTY_Reports->priority->GroupDbValues))
- $PRTY_Reports->priority->setDbValue(@$PRTY_Reports->priority->GroupDbValues[$rs->fields('priority')]);
- else
- $PRTY_Reports->priority->setDbValue(ewrpt_GroupValue($PRTY_Reports->priority, $rs->fields('priority')));
- }
- $PRTY_Reports->department_name->setDbValue($rs->fields('department_name'));
- $this->Val[1] = $PRTY_Reports->full_name->CurrentValue;
- $this->Val[2] = $PRTY_Reports->dob->CurrentValue;
- } else {
- $PRTY_Reports->id->setDbValue("");
- $PRTY_Reports->full_name->setDbValue("");
- $PRTY_Reports->dob->setDbValue("");
- $PRTY_Reports->priority->setDbValue("");
- $PRTY_Reports->department_name->setDbValue("");
- }
- }
-
- // Set up starting group
- function SetUpStartGroup() {
- global $PRTY_Reports;
-
- // Exit if no groups
- if ($this->DisplayGrps == 0)
- return;
-
- // Check for a 'start' parameter
- if (@$_GET[EWRPT_TABLE_START_GROUP] != "") {
- $this->StartGrp = $_GET[EWRPT_TABLE_START_GROUP];
- $PRTY_Reports->setStartGroup($this->StartGrp);
- } elseif (@$_GET["pageno"] != "") {
- $nPageNo = $_GET["pageno"];
- if (is_numeric($nPageNo)) {
- $this->StartGrp = ($nPageNo-1)*$this->DisplayGrps+1;
- if ($this->StartGrp <= 0) {
- $this->StartGrp = 1;
- } elseif ($this->StartGrp >= intval(($this->TotalGrps-1)/$this->DisplayGrps)*$this->DisplayGrps+1) {
- $this->StartGrp = intval(($this->TotalGrps-1)/$this->DisplayGrps)*$this->DisplayGrps+1;
- }
- $PRTY_Reports->setStartGroup($this->StartGrp);
- } else {
- $this->StartGrp = $PRTY_Reports->getStartGroup();
- }
- } else {
- $this->StartGrp = $PRTY_Reports->getStartGroup();
- }
-
- // Check if correct start group counter
- if (!is_numeric($this->StartGrp) || $this->StartGrp == "") { // Avoid invalid start group counter
- $this->StartGrp = 1; // Reset start group counter
- $PRTY_Reports->setStartGroup($this->StartGrp);
- } elseif (intval($this->StartGrp) > intval($this->TotalGrps)) { // Avoid starting group > total groups
- $this->StartGrp = intval(($this->TotalGrps-1)/$this->DisplayGrps) * $this->DisplayGrps + 1; // Point to last page first group
- $PRTY_Reports->setStartGroup($this->StartGrp);
- } elseif (($this->StartGrp-1) % $this->DisplayGrps <> 0) {
- $this->StartGrp = intval(($this->StartGrp-1)/$this->DisplayGrps) * $this->DisplayGrps + 1; // Point to page boundary
- $PRTY_Reports->setStartGroup($this->StartGrp);
- }
- }
-
- // Set up popup
- function SetupPopup() {
- global $conn, $ReportLanguage;
- global $PRTY_Reports;
-
- // Initialize popup
- // Build distinct values for priority
-
- ewrpt_SetupDistinctValues($PRTY_Reports->priority->ValueList, "TB", "TB", FALSE);
- ewrpt_SetupDistinctValues($PRTY_Reports->priority->ValueList, "GDTBLS", "GDTBLS", FALSE);
- ewrpt_SetupDistinctValues($PRTY_Reports->priority->ValueList, "GDCCCM", "GDCCCM", FALSE);
-
- // Build distinct values for department_name
- $bNullValue = FALSE;
- $bEmptyValue = FALSE;
- $sSql = ewrpt_BuildReportSql($PRTY_Reports->department_name->SqlSelect, $PRTY_Reports->SqlWhere(), $PRTY_Reports->SqlGroupBy(), $PRTY_Reports->SqlHaving(), $PRTY_Reports->department_name->SqlOrderBy, $this->Filter, "");
- $rswrk = $conn->Execute($sSql);
- while ($rswrk && !$rswrk->EOF) {
- $PRTY_Reports->department_name->setDbValue($rswrk->fields[0]);
- if (is_null($PRTY_Reports->department_name->CurrentValue)) {
- $bNullValue = TRUE;
- } elseif ($PRTY_Reports->department_name->CurrentValue == "") {
- $bEmptyValue = TRUE;
- } else {
- $PRTY_Reports->department_name->GroupViewValue = ewrpt_DisplayGroupValue($PRTY_Reports->department_name,$PRTY_Reports->department_name->GroupValue());
- ewrpt_SetupDistinctValues($PRTY_Reports->department_name->ValueList, $PRTY_Reports->department_name->GroupValue(), $PRTY_Reports->department_name->GroupViewValue, FALSE);
- }
- $rswrk->MoveNext();
- }
- if ($rswrk)
- $rswrk->Close();
- if ($bEmptyValue)
- ewrpt_SetupDistinctValues($PRTY_Reports->department_name->ValueList, EWRPT_EMPTY_VALUE, $ReportLanguage->Phrase("EmptyLabel"), FALSE);
- if ($bNullValue)
- ewrpt_SetupDistinctValues($PRTY_Reports->department_name->ValueList, EWRPT_NULL_VALUE, $ReportLanguage->Phrase("NullLabel"), FALSE);
-
- // Process post back form
- if (ewrpt_IsHttpPost()) {
- $sName = @$_POST["popup"]; // Get popup form name
- if ($sName <> "") {
- $cntValues = (is_array(@$_POST["sel_$sName"])) ? count($_POST["sel_$sName"]) : 0;
- if ($cntValues > 0) {
- $arValues = ewrpt_StripSlashes($_POST["sel_$sName"]);
- if (trim($arValues[0]) == "") // Select all
- $arValues = EWRPT_INIT_VALUE;
- $_SESSION["sel_$sName"] = $arValues;
- $_SESSION["rf_$sName"] = ewrpt_StripSlashes(@$_POST["rf_$sName"]);
- $_SESSION["rt_$sName"] = ewrpt_StripSlashes(@$_POST["rt_$sName"]);
- $this->ResetPager();
- }
- }
-
- // Get 'reset' command
- } elseif (@$_GET["cmd"] <> "") {
- $sCmd = $_GET["cmd"];
- if (strtolower($sCmd) == "reset") {
- $this->ClearSessionSelection('priority');
- $this->ClearSessionSelection('department_name');
- $this->ResetPager();
- }
- }
-
- // Load selection criteria to array
- // Get Di?n chÃnh sách selected values
-
- if (is_array(@$_SESSION["sel_PRTY_Reports_priority"])) {
- $this->LoadSelectionFromSession('priority');
- } elseif (@$_SESSION["sel_PRTY_Reports_priority"] == EWRPT_INIT_VALUE) { // Select all
- $PRTY_Reports->priority->SelectionList = "";
- }
-
- // Get ??n v? selected values
- if (is_array(@$_SESSION["sel_PRTY_Reports_department_name"])) {
- $this->LoadSelectionFromSession('department_name');
- } elseif (@$_SESSION["sel_PRTY_Reports_department_name"] == EWRPT_INIT_VALUE) { // Select all
- $PRTY_Reports->department_name->SelectionList = "";
- }
- }
-
- // Reset pager
- function ResetPager() {
-
- // Reset start position (reset command)
- global $PRTY_Reports;
- $this->StartGrp = 1;
- $PRTY_Reports->setStartGroup($this->StartGrp);
- }
-
- // Set up number of groups displayed per page
- function SetUpDisplayGrps() {
- global $PRTY_Reports;
- $sWrk = @$_GET[EWRPT_TABLE_GROUP_PER_PAGE];
- if ($sWrk <> "") {
- if (is_numeric($sWrk)) {
- $this->DisplayGrps = intval($sWrk);
- } else {
- if (strtoupper($sWrk) == "ALL") { // display all groups
- $this->DisplayGrps = -1;
- } else {
- $this->DisplayGrps = 10; // Non-numeric, load default
- }
- }
- $PRTY_Reports->setGroupPerPage($this->DisplayGrps); // Save to session
-
- // Reset start position (reset command)
- $this->StartGrp = 1;
- $PRTY_Reports->setStartGroup($this->StartGrp);
- } else {
- if ($PRTY_Reports->getGroupPerPage() <> "") {
- $this->DisplayGrps = $PRTY_Reports->getGroupPerPage(); // Restore from session
- } else {
- $this->DisplayGrps = 10; // Load default
- }
- }
- }
-
- function RenderRow() {
- global $conn, $rs, $Security;
- global $PRTY_Reports;
- if ($PRTY_Reports->RowTotalType == EWRPT_ROWTOTAL_GRAND) { // Grand total
-
- // Get total count from sql directly
- $sSql = ewrpt_BuildReportSql($PRTY_Reports->SqlSelectCount(), $PRTY_Reports->SqlWhere(), $PRTY_Reports->SqlGroupBy(), $PRTY_Reports->SqlHaving(), "", $this->Filter, "");
- $rstot = $conn->Execute($sSql);
- if ($rstot) {
- $this->TotCount = ($rstot->RecordCount()>1) ? $rstot->RecordCount() : $rstot->fields[0];
- $rstot->Close();
- } else {
- $this->TotCount = 0;
- }
- }
-
- // Call Row_Rendering event
- $PRTY_Reports->Row_Rendering();
-
- //
- // Render view codes
- //
-
- if ($PRTY_Reports->RowType == EWRPT_ROWTYPE_TOTAL) { // Summary row
-
- // priority
- $PRTY_Reports->priority->GroupViewValue = $PRTY_Reports->priority->GroupOldValue();
- $PRTY_Reports->priority->CellAttrs["class"] = ($PRTY_Reports->RowGroupLevel == 1) ? "ewRptGrpSummary1" : "ewRptGrpField1";
- $PRTY_Reports->priority->GroupViewValue = ewrpt_DisplayGroupValue($PRTY_Reports->priority, $PRTY_Reports->priority->GroupViewValue);
- $PRTY_Reports->priority->GroupSummaryOldValue = $PRTY_Reports->priority->GroupSummaryValue;
- $PRTY_Reports->priority->GroupSummaryValue = $PRTY_Reports->priority->GroupViewValue;
- $PRTY_Reports->priority->GroupSummaryViewValue = ($PRTY_Reports->priority->GroupSummaryOldValue <> $PRTY_Reports->priority->GroupSummaryValue) ? $PRTY_Reports->priority->GroupSummaryValue : " ";
-
- // department_name
- $PRTY_Reports->department_name->GroupViewValue = $PRTY_Reports->department_name->GroupOldValue();
- $PRTY_Reports->department_name->CellAttrs["class"] = ($PRTY_Reports->RowGroupLevel == 2) ? "ewRptGrpSummary2" : "ewRptGrpField2";
- $PRTY_Reports->department_name->GroupViewValue = ewrpt_DisplayGroupValue($PRTY_Reports->department_name, $PRTY_Reports->department_name->GroupViewValue);
- $PRTY_Reports->department_name->GroupSummaryOldValue = $PRTY_Reports->department_name->GroupSummaryValue;
- $PRTY_Reports->department_name->GroupSummaryValue = $PRTY_Reports->department_name->GroupViewValue;
- $PRTY_Reports->department_name->GroupSummaryViewValue = ($PRTY_Reports->department_name->GroupSummaryOldValue <> $PRTY_Reports->department_name->GroupSummaryValue) ? $PRTY_Reports->department_name->GroupSummaryValue : " ";
-
- // priority
- $PRTY_Reports->priority->HrefValue = "";
-
- // department_name
- $PRTY_Reports->department_name->HrefValue = "";
- } else {
-
- // priority
- $PRTY_Reports->priority->GroupViewValue = $PRTY_Reports->priority->GroupValue();
- $PRTY_Reports->priority->CellAttrs["class"] = "ewRptGrpField1";
- $PRTY_Reports->priority->GroupViewValue = ewrpt_DisplayGroupValue($PRTY_Reports->priority, $PRTY_Reports->priority->GroupViewValue);
- if ($PRTY_Reports->priority->GroupValue() == $PRTY_Reports->priority->GroupOldValue() && !$this->ChkLvlBreak(1))
- $PRTY_Reports->priority->GroupViewValue = " ";
-
- // department_name
- $PRTY_Reports->department_name->GroupViewValue = $PRTY_Reports->department_name->GroupValue();
- $PRTY_Reports->department_name->CellAttrs["class"] = "ewRptGrpField2";
- $PRTY_Reports->department_name->GroupViewValue = ewrpt_DisplayGroupValue($PRTY_Reports->department_name, $PRTY_Reports->department_name->GroupViewValue);
- if ($PRTY_Reports->department_name->GroupValue() == $PRTY_Reports->department_name->GroupOldValue() && !$this->ChkLvlBreak(2))
- $PRTY_Reports->department_name->GroupViewValue = " ";
-
- // full_name
- $PRTY_Reports->full_name->ViewValue = $PRTY_Reports->full_name->CurrentValue;
- $PRTY_Reports->full_name->CellAttrs["class"] = ($this->RecCount % 2 <> 1) ? "ewTableAltRow" : "ewTableRow";
-
- // dob
- $PRTY_Reports->dob->ViewValue = $PRTY_Reports->dob->CurrentValue;
- $PRTY_Reports->dob->ViewValue = ewrpt_FormatDateTime($PRTY_Reports->dob->ViewValue, 7);
- $PRTY_Reports->dob->CellAttrs["class"] = ($this->RecCount % 2 <> 1) ? "ewTableAltRow" : "ewTableRow";
-
- // priority
- $PRTY_Reports->priority->HrefValue = "";
-
- // department_name
- $PRTY_Reports->department_name->HrefValue = "";
-
- // full_name
- $PRTY_Reports->full_name->HrefValue = "";
-
- // dob
- $PRTY_Reports->dob->HrefValue = "";
- }
-
- // Call Cell_Rendered event
- if ($PRTY_Reports->RowType == EWRPT_ROWTYPE_TOTAL) { // Summary row
-
- // priority
- $CurrentValue = $PRTY_Reports->priority->GroupViewValue;
- $ViewValue =& $PRTY_Reports->priority->GroupViewValue;
- $ViewAttrs =& $PRTY_Reports->priority->ViewAttrs;
- $CellAttrs =& $PRTY_Reports->priority->CellAttrs;
- $HrefValue =& $PRTY_Reports->priority->HrefValue;
- $PRTY_Reports->Cell_Rendered($PRTY_Reports->priority, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue);
-
- // department_name
- $CurrentValue = $PRTY_Reports->department_name->GroupViewValue;
- $ViewValue =& $PRTY_Reports->department_name->GroupViewValue;
- $ViewAttrs =& $PRTY_Reports->department_name->ViewAttrs;
- $CellAttrs =& $PRTY_Reports->department_name->CellAttrs;
- $HrefValue =& $PRTY_Reports->department_name->HrefValue;
- $PRTY_Reports->Cell_Rendered($PRTY_Reports->department_name, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue);
- } else {
-
- // priority
- $CurrentValue = $PRTY_Reports->priority->GroupValue();
- $ViewValue =& $PRTY_Reports->priority->GroupViewValue;
- $ViewAttrs =& $PRTY_Reports->priority->ViewAttrs;
- $CellAttrs =& $PRTY_Reports->priority->CellAttrs;
- $HrefValue =& $PRTY_Reports->priority->HrefValue;
- $PRTY_Reports->Cell_Rendered($PRTY_Reports->priority, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue);
-
- // department_name
- $CurrentValue = $PRTY_Reports->department_name->GroupValue();
- $ViewValue =& $PRTY_Reports->department_name->GroupViewValue;
- $ViewAttrs =& $PRTY_Reports->department_name->ViewAttrs;
- $CellAttrs =& $PRTY_Reports->department_name->CellAttrs;
- $HrefValue =& $PRTY_Reports->department_name->HrefValue;
- $PRTY_Reports->Cell_Rendered($PRTY_Reports->department_name, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue);
-
- // full_name
- $CurrentValue = $PRTY_Reports->full_name->CurrentValue;
- $ViewValue =& $PRTY_Reports->full_name->ViewValue;
- $ViewAttrs =& $PRTY_Reports->full_name->ViewAttrs;
- $CellAttrs =& $PRTY_Reports->full_name->CellAttrs;
- $HrefValue =& $PRTY_Reports->full_name->HrefValue;
- $PRTY_Reports->Cell_Rendered($PRTY_Reports->full_name, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue);
-
- // dob
- $CurrentValue = $PRTY_Reports->dob->CurrentValue;
- $ViewValue =& $PRTY_Reports->dob->ViewValue;
- $ViewAttrs =& $PRTY_Reports->dob->ViewAttrs;
- $CellAttrs =& $PRTY_Reports->dob->CellAttrs;
- $HrefValue =& $PRTY_Reports->dob->HrefValue;
- $PRTY_Reports->Cell_Rendered($PRTY_Reports->dob, $CurrentValue, $ViewValue, $ViewAttrs, $CellAttrs, $HrefValue);
- }
-
- // Call Row_Rendered event
- $PRTY_Reports->Row_Rendered();
- }
-
- function SetupExportOptionsExt() {
- global $ReportLanguage, $PRTY_Reports;
- }
-
- // Clear selection stored in session
- function ClearSessionSelection($parm) {
- $_SESSION["sel_PRTY_Reports_$parm"] = "";
- $_SESSION["rf_PRTY_Reports_$parm"] = "";
- $_SESSION["rt_PRTY_Reports_$parm"] = "";
- }
-
- // Load selection from session
- function LoadSelectionFromSession($parm) {
- global $PRTY_Reports;
- $fld =& $PRTY_Reports->fields($parm);
- $fld->SelectionList = @$_SESSION["sel_PRTY_Reports_$parm"];
- $fld->RangeFrom = @$_SESSION["rf_PRTY_Reports_$parm"];
- $fld->RangeTo = @$_SESSION["rt_PRTY_Reports_$parm"];
- }
-
- // Load default value for filters
- function LoadDefaultFilters() {
- global $PRTY_Reports;
-
- /**
- * Set up default values for non Text filters
- */
-
- /**
- * Set up default values for extended filters
- * function SetDefaultExtFilter(&$fld, $so1, $sv1, $sc, $so2, $sv2)
- * Parameters:
- * $fld - Field object
- * $so1 - Default search operator 1
- * $sv1 - Default ext filter value 1
- * $sc - Default search condition (if operator 2 is enabled)
- * $so2 - Default search operator 2 (if operator 2 is enabled)
- * $sv2 - Default ext filter value 2 (if operator 2 is enabled)
- */
-
- /**
- * Set up default values for popup filters
- */
-
- // Field priority
- // $PRTY_Reports->priority->DefaultSelectionList = array("val1", "val2");
-
- $PRTY_Reports->priority->DefaultSelectionList = "";
- $PRTY_Reports->priority->SelectionList = $PRTY_Reports->priority->DefaultSelectionList;
-
- // Field department_name
- // $PRTY_Reports->department_name->DefaultSelectionList = array("val1", "val2");
-
- $PRTY_Reports->department_name->DefaultSelectionList = "";
- $PRTY_Reports->department_name->SelectionList = $PRTY_Reports->department_name->DefaultSelectionList;
- }
-
- // Check if filter applied
- function CheckFilter() {
- global $PRTY_Reports;
-
- // Check priority popup filter
- if (!ewrpt_MatchedArray($PRTY_Reports->priority->DefaultSelectionList, $PRTY_Reports->priority->SelectionList))
- return TRUE;
-
- // Check department_name popup filter
- if (!ewrpt_MatchedArray($PRTY_Reports->department_name->DefaultSelectionList, $PRTY_Reports->department_name->SelectionList))
- return TRUE;
- return FALSE;
- }
-
- // Show list of filters
- function ShowFilterList() {
- global $PRTY_Reports;
- global $ReportLanguage;
-
- // Initialize
- $sFilterList = "";
-
- // Field priority
- $sExtWrk = "";
- $sWrk = "";
- if (is_array($PRTY_Reports->priority->SelectionList))
- $sWrk = ewrpt_JoinArray($PRTY_Reports->priority->SelectionList, ", ", EWRPT_DATATYPE_STRING);
- if ($sExtWrk <> "" || $sWrk <> "")
-