PageRenderTime 59ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 1ms

/jf/web/reports/Emp_Reports_by_Yearsmry.php

http://tinkerportal.googlecode.com/
PHP | 1610 lines | 1210 code | 196 blank | 204 comment | 341 complexity | 2c63ad4939a22b6f14aa60c71ad26797 MD5 | raw file
Possible License(s): LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. if (session_id() == "") session_start(); // Initialize Session data
  3. ob_start();
  4. ?>
  5. <?php include_once "phprptinc/ewrcfg5.php"; ?>
  6. <?php include_once "phprptinc/ewmysql.php"; ?>
  7. <?php include_once "phprptinc/ewrfn5.php"; ?>
  8. <?php include_once "phprptinc/ewrusrfn.php"; ?>
  9. <?php
  10. // Global variable for table object
  11. $Emp_Reports_by_Year = NULL;
  12. //
  13. // Table class for Emp Reports by Year
  14. //
  15. class crEmp_Reports_by_Year {
  16. var $TableVar = 'Emp_Reports_by_Year';
  17. var $TableName = 'Emp Reports by Year';
  18. var $TableType = 'REPORT';
  19. var $ShowCurrentFilter = EWRPT_SHOW_CURRENT_FILTER;
  20. var $FilterPanelOption = EWRPT_FILTER_PANEL_OPTION;
  21. var $CurrentOrder; // Current order
  22. var $CurrentOrderType; // Current order type
  23. // Table caption
  24. function TableCaption() {
  25. global $ReportLanguage;
  26. return $ReportLanguage->TablePhrase($this->TableVar, "TblCaption");
  27. }
  28. // Session Group Per Page
  29. function getGroupPerPage() {
  30. return @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_grpperpage"];
  31. }
  32. function setGroupPerPage($v) {
  33. @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_grpperpage"] = $v;
  34. }
  35. // Session Start Group
  36. function getStartGroup() {
  37. return @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_start"];
  38. }
  39. function setStartGroup($v) {
  40. @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_start"] = $v;
  41. }
  42. // Session Order By
  43. function getOrderBy() {
  44. return @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_orderby"];
  45. }
  46. function setOrderBy($v) {
  47. @$_SESSION[EWRPT_PROJECT_VAR . "_" . $this->TableVar . "_orderby"] = $v;
  48. }
  49. // var $SelectLimit = TRUE;
  50. var $full_name;
  51. var $dob;
  52. var $joined_company_date;
  53. var $department_name;
  54. var $year;
  55. var $id;
  56. var $fields = array();
  57. var $Export; // Export
  58. var $ExportAll = TRUE;
  59. var $UseTokenInUrl = EWRPT_USE_TOKEN_IN_URL;
  60. var $RowType; // Row type
  61. var $RowTotalType; // Row total type
  62. var $RowTotalSubType; // Row total subtype
  63. var $RowGroupLevel; // Row group level
  64. var $RowAttrs = array(); // Row attributes
  65. // Reset CSS styles for table object
  66. function ResetCSS() {
  67. $this->RowAttrs["style"] = "";
  68. $this->RowAttrs["class"] = "";
  69. foreach ($this->fields as $fld) {
  70. $fld->ResetCSS();
  71. }
  72. }
  73. //
  74. // Table class constructor
  75. //
  76. function crEmp_Reports_by_Year() {
  77. global $ReportLanguage;
  78. // full_name
  79. $this->full_name = new crField('Emp_Reports_by_Year', 'Emp Reports by Year', 'x_full_name', 'full_name', '`full_name`', 200, EWRPT_DATATYPE_STRING, -1);
  80. $this->fields['full_name'] =& $this->full_name;
  81. $this->full_name->DateFilter = "";
  82. $this->full_name->SqlSelect = "";
  83. $this->full_name->SqlOrderBy = "";
  84. // dob
  85. $this->dob = new crField('Emp_Reports_by_Year', 'Emp Reports by Year', 'x_dob', 'dob', '`dob`', 133, EWRPT_DATATYPE_DATE, 7);
  86. $this->dob->FldDefaultErrMsg = str_replace("%s", "/", $ReportLanguage->Phrase("IncorrectDateDMY"));
  87. $this->fields['dob'] =& $this->dob;
  88. $this->dob->DateFilter = "";
  89. $this->dob->SqlSelect = "";
  90. $this->dob->SqlOrderBy = "";
  91. // joined_company_date
  92. $this->joined_company_date = new crField('Emp_Reports_by_Year', 'Emp Reports by Year', 'x_joined_company_date', 'joined_company_date', '`joined_company_date`', 133, EWRPT_DATATYPE_DATE, 7);
  93. $this->joined_company_date->FldDefaultErrMsg = str_replace("%s", "/", $ReportLanguage->Phrase("IncorrectDateDMY"));
  94. $this->fields['joined_company_date'] =& $this->joined_company_date;
  95. $this->joined_company_date->DateFilter = "";
  96. $this->joined_company_date->SqlSelect = "";
  97. $this->joined_company_date->SqlOrderBy = "";
  98. // department_name
  99. $this->department_name = new crField('Emp_Reports_by_Year', 'Emp Reports by Year', 'x_department_name', 'department_name', '`department_name`', 200, EWRPT_DATATYPE_STRING, -1);
  100. $this->department_name->GroupingFieldId = 1;
  101. $this->fields['department_name'] =& $this->department_name;
  102. $this->department_name->DateFilter = "";
  103. $this->department_name->SqlSelect = "SELECT DISTINCT `department_name` FROM " . $this->SqlFrom();
  104. $this->department_name->SqlOrderBy = "`department_name`";
  105. $this->department_name->FldGroupByType = "";
  106. $this->department_name->FldGroupInt = "0";
  107. $this->department_name->FldGroupSql = "";
  108. // year
  109. $this->year = new crField('Emp_Reports_by_Year', 'Emp Reports by Year', 'x_year', 'year', '`year`', 131, EWRPT_DATATYPE_NUMBER, -1);
  110. $this->year->GroupingFieldId = 2;
  111. $this->year->FldDefaultErrMsg = $ReportLanguage->Phrase("IncorrectFloat");
  112. $this->fields['year'] =& $this->year;
  113. $this->year->DateFilter = "";
  114. $this->year->SqlSelect = "SELECT DISTINCT `year` FROM " . $this->SqlFrom();
  115. $this->year->SqlOrderBy = "`year`";
  116. $this->year->FldGroupByType = "";
  117. $this->year->FldGroupInt = "0";
  118. $this->year->FldGroupSql = "";
  119. // id
  120. $this->id = new crField('Emp_Reports_by_Year', 'Emp Reports by Year', 'x_id', 'id', '`id`', 19, EWRPT_DATATYPE_NUMBER, -1);
  121. $this->id->FldDefaultErrMsg = $ReportLanguage->Phrase("IncorrectInteger");
  122. $this->fields['id'] =& $this->id;
  123. $this->id->DateFilter = "";
  124. $this->id->SqlSelect = "";
  125. $this->id->SqlOrderBy = "";
  126. }
  127. // Multiple column sort
  128. function UpdateSort(&$ofld, $ctrl) {
  129. if ($this->CurrentOrder == $ofld->FldName) {
  130. $sLastSort = $ofld->getSort();
  131. if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") {
  132. $sThisSort = $this->CurrentOrderType;
  133. } else {
  134. $sThisSort = ($sLastSort == "ASC") ? "DESC" : "ASC";
  135. }
  136. $ofld->setSort($sThisSort);
  137. } else {
  138. if ($ofld->GroupingFieldId == 0 && !$ctrl) $ofld->setSort("");
  139. }
  140. }
  141. // Get Sort SQL
  142. function SortSql() {
  143. $sDtlSortSql = "";
  144. $argrps = array();
  145. foreach ($this->fields as $fld) {
  146. if ($fld->getSort() <> "") {
  147. if ($fld->GroupingFieldId > 0) {
  148. if ($fld->FldGroupSql <> "")
  149. $argrps[$fld->GroupingFieldId] = str_replace("%s", $fld->FldExpression, $fld->FldGroupSql) . " " . $fld->getSort();
  150. else
  151. $argrps[$fld->GroupingFieldId] = $fld->FldExpression . " " . $fld->getSort();
  152. } else {
  153. if ($sDtlSortSql <> "") $sDtlSortSql .= ", ";
  154. $sDtlSortSql .= $fld->FldExpression . " " . $fld->getSort();
  155. }
  156. }
  157. }
  158. $sSortSql = "";
  159. foreach ($argrps as $grp) {
  160. if ($sSortSql <> "") $sSortSql .= ", ";
  161. $sSortSql .= $grp;
  162. }
  163. if ($sDtlSortSql <> "") {
  164. if ($sSortSql <> "") $sSortSql .= ",";
  165. $sSortSql .= $sDtlSortSql;
  166. }
  167. return $sSortSql;
  168. }
  169. // Table level SQL
  170. function SqlFrom() { // From
  171. return "`vw__employee_reports_by_year`";
  172. }
  173. function SqlSelect() { // Select
  174. return "SELECT * FROM " . $this->SqlFrom();
  175. }
  176. function SqlWhere() { // Where
  177. return "";
  178. }
  179. function SqlGroupBy() { // Group By
  180. return "";
  181. }
  182. function SqlHaving() { // Having
  183. return "";
  184. }
  185. function SqlOrderBy() { // Order By
  186. return "`department_name` ASC, `year` DESC";
  187. }
  188. // Table Level Group SQL
  189. function SqlFirstGroupField() {
  190. return "`department_name`";
  191. }
  192. function SqlSelectGroup() {
  193. return "SELECT DISTINCT " . $this->SqlFirstGroupField() . " FROM " . $this->SqlFrom();
  194. }
  195. function SqlOrderByGroup() {
  196. return "`department_name` ASC";
  197. }
  198. function SqlSelectAgg() {
  199. return "SELECT * FROM " . $this->SqlFrom();
  200. }
  201. function SqlAggPfx() {
  202. return "";
  203. }
  204. function SqlAggSfx() {
  205. return "";
  206. }
  207. function SqlSelectCount() {
  208. return "SELECT COUNT(*) FROM " . $this->SqlFrom();
  209. }
  210. // Sort URL
  211. function SortUrl(&$fld) {
  212. if ($this->Export <> "" ||
  213. in_array($fld->FldType, array(128, 204, 205))) { // Unsortable data type
  214. return "";
  215. } elseif ($fld->Sortable) {
  216. $sUrlParm = "order=" . urlencode($fld->FldName) . "&ordertype=" . $fld->ReverseSort();
  217. return ewrpt_CurrentPage() . "?" . $sUrlParm;
  218. } else {
  219. return "";
  220. }
  221. }
  222. // Row attributes
  223. function RowAttributes() {
  224. $sAtt = "";
  225. foreach ($this->RowAttrs as $k => $v) {
  226. if (trim($v) <> "")
  227. $sAtt .= " " . $k . "=\"" . trim($v) . "\"";
  228. }
  229. return $sAtt;
  230. }
  231. // Field object by fldvar
  232. function &fields($fldvar) {
  233. return $this->fields[$fldvar];
  234. }
  235. // Table level events
  236. // Row Rendering event
  237. function Row_Rendering() {
  238. // Enter your code here
  239. }
  240. // Cell Rendered event
  241. function Cell_Rendered(&$Field, $CurrentValue, &$ViewValue, &$ViewAttrs, &$CellAttrs, &$HrefValue) {
  242. //$ViewValue = "xxx";
  243. //$ViewAttrs["style"] = "xxx";
  244. }
  245. // Row Rendered event
  246. function Row_Rendered() {
  247. // To view properties of field class, use:
  248. //var_dump($this-><FieldName>);
  249. }
  250. // Load Filters event
  251. function Filters_Load() {
  252. // Enter your code here
  253. // Example: Register/Unregister Custom Extended Filter
  254. //ewrpt_RegisterFilter($this-><Field>, 'StartsWithA', 'Starts With A', 'GetStartsWithAFilter');
  255. //ewrpt_UnregisterFilter($this-><Field>, 'StartsWithA');
  256. }
  257. // Page Filter Validated event
  258. function Page_FilterValidated() {
  259. // Example:
  260. //global $MyTable;
  261. //$MyTable->MyField1->SearchValue = "your search criteria"; // Search value
  262. }
  263. // Chart Rendering event
  264. function Chart_Rendering(&$chart) {
  265. // var_dump($chart);
  266. }
  267. // Chart Rendered event
  268. function Chart_Rendered($chart, &$chartxml) {
  269. // Example:
  270. //$doc = $chart->XmlDoc; // Get the DOMDocument object
  271. // Enter your code to manipulate the DOMDocument object here
  272. //$chartxml = $doc->saveXML(); // Output the XML
  273. }
  274. // Email Sending event
  275. function Email_Sending(&$Email, &$Args) {
  276. //var_dump($Email); var_dump($Args); exit();
  277. return TRUE;
  278. }
  279. }
  280. ?>
  281. <?php ewrpt_Header(FALSE) ?>
  282. <?php
  283. // Create page object
  284. $Emp_Reports_by_Year_summary = new crEmp_Reports_by_Year_summary();
  285. $Page =& $Emp_Reports_by_Year_summary;
  286. // Page init
  287. $Emp_Reports_by_Year_summary->Page_Init();
  288. // Page main
  289. $Emp_Reports_by_Year_summary->Page_Main();
  290. ?>
  291. <?php include_once "phprptinc/header.php"; ?>
  292. <?php if ($Emp_Reports_by_Year->Export == "" || $Emp_Reports_by_Year->Export == "print" || $Emp_Reports_by_Year->Export == "email") { ?>
  293. <script type="text/javascript">
  294. // Create page object
  295. var Emp_Reports_by_Year_summary = new ewrpt_Page("Emp_Reports_by_Year_summary");
  296. // page properties
  297. Emp_Reports_by_Year_summary.PageID = "summary"; // page ID
  298. Emp_Reports_by_Year_summary.FormID = "fEmp_Reports_by_Yearsummaryfilter"; // form ID
  299. var EWRPT_PAGE_ID = Emp_Reports_by_Year_summary.PageID;
  300. // extend page with Chart_Rendering function
  301. Emp_Reports_by_Year_summary.Chart_Rendering =
  302. function(chart, chartid) { // DO NOT CHANGE THIS LINE!
  303. //alert(chartid);
  304. }
  305. // extend page with Chart_Rendered function
  306. Emp_Reports_by_Year_summary.Chart_Rendered =
  307. function(chart, chartid) { // DO NOT CHANGE THIS LINE!
  308. //alert(chartid);
  309. }
  310. </script>
  311. <?php } ?>
  312. <?php if ($Emp_Reports_by_Year->Export == "") { ?>
  313. <script language="JavaScript" type="text/javascript">
  314. <!--
  315. // Write your client script here, no need to add script tags.
  316. //-->
  317. </script>
  318. <?php } ?>
  319. <?php if ($Emp_Reports_by_Year->Export == "" || $Emp_Reports_by_Year->Export == "print" || $Emp_Reports_by_Year->Export == "email") { ?>
  320. <script src="<?php echo EWRPT_FUSIONCHARTS_FREE_JSCLASS_FILE; ?>" type="text/javascript"></script>
  321. <?php } ?>
  322. <?php if ($Emp_Reports_by_Year->Export == "") { ?>
  323. <div id="ewrpt_PopupFilter"><div class="bd"></div></div>
  324. <script src="phprptjs/ewrptpop.js" type="text/javascript"></script>
  325. <script type="text/javascript">
  326. // popup fields
  327. <?php $jsdata = ewrpt_GetJsData($Emp_Reports_by_Year->department_name, $Emp_Reports_by_Year->department_name->FldType); ?>
  328. ewrpt_CreatePopup("Emp_Reports_by_Year_department_name", [<?php echo $jsdata ?>]);
  329. <?php $jsdata = ewrpt_GetJsData($Emp_Reports_by_Year->year, $Emp_Reports_by_Year->year->FldType); ?>
  330. ewrpt_CreatePopup("Emp_Reports_by_Year_year", [<?php echo $jsdata ?>]);
  331. </script>
  332. <?php } ?>
  333. <?php if ($Emp_Reports_by_Year->Export == "" || $Emp_Reports_by_Year->Export == "print" || $Emp_Reports_by_Year->Export == "email") { ?>
  334. <!-- Table Container (Begin) -->
  335. <table id="ewContainer" cellspacing="0" cellpadding="0" border="0">
  336. <!-- Top Container (Begin) -->
  337. <tr><td colspan="3"><div id="ewTop" class="phpreportmaker">
  338. <!-- top slot -->
  339. <a name="top"></a>
  340. <?php } ?>
  341. <p class="phpreportmaker ewTitle"><?php echo $Emp_Reports_by_Year->TableCaption() ?>
  342. &nbsp;&nbsp;<?php $Emp_Reports_by_Year_summary->ExportOptions->Render("body"); ?></p>
  343. <?php $Emp_Reports_by_Year_summary->ShowPageHeader(); ?>
  344. <?php $Emp_Reports_by_Year_summary->ShowMessage(); ?>
  345. <br><br>
  346. <?php if ($Emp_Reports_by_Year->Export == "" || $Emp_Reports_by_Year->Export == "print" || $Emp_Reports_by_Year->Export == "email") { ?>
  347. </div></td></tr>
  348. <!-- Top Container (End) -->
  349. <tr>
  350. <!-- Left Container (Begin) -->
  351. <td style="vertical-align: top;"><div id="ewLeft" class="phpreportmaker">
  352. <!-- Left slot -->
  353. </div></td>
  354. <!-- Left Container (End) -->
  355. <!-- Center Container - Report (Begin) -->
  356. <td style="vertical-align: top;" class="ewPadding"><div id="ewCenter" class="phpreportmaker">
  357. <!-- center slot -->
  358. <?php } ?>
  359. <!-- summary report starts -->
  360. <div id="report_summary">
  361. <?php if ($Emp_Reports_by_Year->ShowCurrentFilter) { ?>
  362. <div id="ewrptFilterList">
  363. <?php $Emp_Reports_by_Year_summary->ShowFilterList() ?>
  364. </div>
  365. <br>
  366. <?php } ?>
  367. <table class="ewGrid" cellspacing="0"><tr>
  368. <td class="ewGridContent">
  369. <?php if ($Emp_Reports_by_Year->Export == "") { ?>
  370. <div class="ewGridUpperPanel">
  371. <form action="<?php echo ewrpt_CurrentPage() ?>" name="ewpagerform" id="ewpagerform" class="ewForm">
  372. <table border="0" cellspacing="0" cellpadding="0">
  373. <tr>
  374. <td style="white-space: nowrap;">
  375. <?php if (!isset($Pager)) $Pager = new crPrevNextPager($Emp_Reports_by_Year_summary->StartGrp, $Emp_Reports_by_Year_summary->DisplayGrps, $Emp_Reports_by_Year_summary->TotalGrps) ?>
  376. <?php if ($Pager->RecordCount > 0) { ?>
  377. <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Page") ?>&nbsp;</span></td>
  378. <!--first page button-->
  379. <?php if ($Pager->FirstButton->Enabled) { ?>
  380. <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>
  381. <?php } else { ?>
  382. <td><img src="phprptimages/firstdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
  383. <?php } ?>
  384. <!--previous page button-->
  385. <?php if ($Pager->PrevButton->Enabled) { ?>
  386. <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>
  387. <?php } else { ?>
  388. <td><img src="phprptimages/prevdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
  389. <?php } ?>
  390. <!--current page number-->
  391. <td><input type="text" name="pageno" id="pageno" value="<?php echo $Pager->CurrentPage ?>" size="4"></td>
  392. <!--next page button-->
  393. <?php if ($Pager->NextButton->Enabled) { ?>
  394. <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>
  395. <?php } else { ?>
  396. <td><img src="phprptimages/nextdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
  397. <?php } ?>
  398. <!--last page button-->
  399. <?php if ($Pager->LastButton->Enabled) { ?>
  400. <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>
  401. <?php } else { ?>
  402. <td><img src="phprptimages/lastdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
  403. <?php } ?>
  404. <td><span class="phpreportmaker">&nbsp;<?php echo $ReportLanguage->Phrase("of") ?> <?php echo $Pager->PageCount ?></span></td>
  405. </tr></table>
  406. </td>
  407. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  408. <td>
  409. <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>
  410. <?php } else { ?>
  411. <?php if ($Emp_Reports_by_Year_summary->Filter == "0=101") { ?>
  412. <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("EnterSearchCriteria") ?></span>
  413. <?php } else { ?>
  414. <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("NoRecord") ?></span>
  415. <?php } ?>
  416. <?php } ?>
  417. </td>
  418. <?php if ($Emp_Reports_by_Year_summary->TotalGrps > 0) { ?>
  419. <td style="white-space: nowrap;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
  420. <td align="right" style="vertical-align: top; white-space: nowrap;"><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("GroupsPerPage"); ?>&nbsp;
  421. <select name="<?php echo EWRPT_TABLE_GROUP_PER_PAGE; ?>" onchange="this.form.submit();">
  422. <option value="1"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 1) echo " selected=\"selected\"" ?>>1</option>
  423. <option value="2"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 2) echo " selected=\"selected\"" ?>>2</option>
  424. <option value="3"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 3) echo " selected=\"selected\"" ?>>3</option>
  425. <option value="4"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 4) echo " selected=\"selected\"" ?>>4</option>
  426. <option value="5"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 5) echo " selected=\"selected\"" ?>>5</option>
  427. <option value="10"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 10) echo " selected=\"selected\"" ?>>10</option>
  428. <option value="20"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 20) echo " selected=\"selected\"" ?>>20</option>
  429. <option value="50"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 50) echo " selected=\"selected\"" ?>>50</option>
  430. <option value="ALL"<?php if ($Emp_Reports_by_Year->getGroupPerPage() == -1) echo " selected=\"selected\"" ?>><?php echo $ReportLanguage->Phrase("AllRecords") ?></option>
  431. </select>
  432. </span></td>
  433. <?php } ?>
  434. </tr>
  435. </table>
  436. </form>
  437. </div>
  438. <?php } ?>
  439. <!-- Report Grid (Begin) -->
  440. <div class="ewGridMiddlePanel">
  441. <table class="<?php echo $Emp_Reports_by_Year_summary->ReportTableClass ?>" cellspacing="0">
  442. <?php
  443. // Set the last group to display if not export all
  444. if ($Emp_Reports_by_Year->ExportAll && $Emp_Reports_by_Year->Export <> "") {
  445. $Emp_Reports_by_Year_summary->StopGrp = $Emp_Reports_by_Year_summary->TotalGrps;
  446. } else {
  447. $Emp_Reports_by_Year_summary->StopGrp = $Emp_Reports_by_Year_summary->StartGrp + $Emp_Reports_by_Year_summary->DisplayGrps - 1;
  448. }
  449. // Stop group <= total number of groups
  450. if (intval($Emp_Reports_by_Year_summary->StopGrp) > intval($Emp_Reports_by_Year_summary->TotalGrps))
  451. $Emp_Reports_by_Year_summary->StopGrp = $Emp_Reports_by_Year_summary->TotalGrps;
  452. $Emp_Reports_by_Year_summary->RecCount = 0;
  453. // Get first row
  454. if ($Emp_Reports_by_Year_summary->TotalGrps > 0) {
  455. $Emp_Reports_by_Year_summary->GetGrpRow(1);
  456. $Emp_Reports_by_Year_summary->GrpCount = 1;
  457. }
  458. while (($rsgrp && !$rsgrp->EOF && $Emp_Reports_by_Year_summary->GrpCount <= $Emp_Reports_by_Year_summary->DisplayGrps) || $Emp_Reports_by_Year_summary->ShowFirstHeader) {
  459. // Show header
  460. if ($Emp_Reports_by_Year_summary->ShowFirstHeader) {
  461. ?>
  462. <thead>
  463. <tr>
  464. <td class="ewTableHeader">
  465. <?php if ($Emp_Reports_by_Year->Export <> "") { ?>
  466. <?php echo $Emp_Reports_by_Year->department_name->FldCaption() ?>
  467. <?php } else { ?>
  468. <table cellspacing="0" class="ewTableHeaderBtn"><tr>
  469. <?php if ($Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->department_name) == "") { ?>
  470. <td style="vertical-align: bottom;"><?php echo $Emp_Reports_by_Year->department_name->FldCaption() ?></td>
  471. <?php } else { ?>
  472. <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->department_name) ?>',2);"><?php echo $Emp_Reports_by_Year->department_name->FldCaption() ?></td><td style="width: 10px;">
  473. <?php if ($Emp_Reports_by_Year->department_name->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($Emp_Reports_by_Year->department_name->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
  474. <?php } ?>
  475. <td style="width: 20px;" align="right"><a href="#" onclick="ewrpt_ShowPopup(this.name, 'Emp_Reports_by_Year_department_name', false, '<?php echo $Emp_Reports_by_Year->department_name->RangeFrom; ?>', '<?php echo $Emp_Reports_by_Year->department_name->RangeTo; ?>');return false;" name="x_department_name<?php echo $Emp_Reports_by_Year_summary->Cnt[0][0]; ?>" id="x_department_name<?php echo $Emp_Reports_by_Year_summary->Cnt[0][0]; ?>"><img src="phprptimages/popup.gif" width="15" height="14" border="0" alt="<?php echo $ReportLanguage->Phrase("Filter") ?>"></a></td>
  476. </tr></table>
  477. <?php } ?>
  478. </td>
  479. <td class="ewTableHeader">
  480. <?php if ($Emp_Reports_by_Year->Export <> "") { ?>
  481. <?php echo $Emp_Reports_by_Year->year->FldCaption() ?>
  482. <?php } else { ?>
  483. <table cellspacing="0" class="ewTableHeaderBtn"><tr>
  484. <?php if ($Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->year) == "") { ?>
  485. <td style="vertical-align: bottom;"><?php echo $Emp_Reports_by_Year->year->FldCaption() ?></td>
  486. <?php } else { ?>
  487. <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->year) ?>',2);"><?php echo $Emp_Reports_by_Year->year->FldCaption() ?></td><td style="width: 10px;">
  488. <?php if ($Emp_Reports_by_Year->year->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($Emp_Reports_by_Year->year->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
  489. <?php } ?>
  490. <td style="width: 20px;" align="right"><a href="#" onclick="ewrpt_ShowPopup(this.name, 'Emp_Reports_by_Year_year', false, '<?php echo $Emp_Reports_by_Year->year->RangeFrom; ?>', '<?php echo $Emp_Reports_by_Year->year->RangeTo; ?>');return false;" name="x_year<?php echo $Emp_Reports_by_Year_summary->Cnt[0][0]; ?>" id="x_year<?php echo $Emp_Reports_by_Year_summary->Cnt[0][0]; ?>"><img src="phprptimages/popup.gif" width="15" height="14" border="0" alt="<?php echo $ReportLanguage->Phrase("Filter") ?>"></a></td>
  491. </tr></table>
  492. <?php } ?>
  493. </td>
  494. <td class="ewTableHeader">
  495. <?php if ($Emp_Reports_by_Year->Export <> "") { ?>
  496. <?php echo $Emp_Reports_by_Year->full_name->FldCaption() ?>
  497. <?php } else { ?>
  498. <table cellspacing="0" class="ewTableHeaderBtn"><tr>
  499. <?php if ($Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->full_name) == "") { ?>
  500. <td style="vertical-align: bottom;"><?php echo $Emp_Reports_by_Year->full_name->FldCaption() ?></td>
  501. <?php } else { ?>
  502. <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->full_name) ?>',2);"><?php echo $Emp_Reports_by_Year->full_name->FldCaption() ?></td><td style="width: 10px;">
  503. <?php if ($Emp_Reports_by_Year->full_name->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($Emp_Reports_by_Year->full_name->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
  504. <?php } ?>
  505. </tr></table>
  506. <?php } ?>
  507. </td>
  508. <td class="ewTableHeader">
  509. <?php if ($Emp_Reports_by_Year->Export <> "") { ?>
  510. <?php echo $Emp_Reports_by_Year->dob->FldCaption() ?>
  511. <?php } else { ?>
  512. <table cellspacing="0" class="ewTableHeaderBtn"><tr>
  513. <?php if ($Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->dob) == "") { ?>
  514. <td style="vertical-align: bottom;"><?php echo $Emp_Reports_by_Year->dob->FldCaption() ?></td>
  515. <?php } else { ?>
  516. <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->dob) ?>',2);"><?php echo $Emp_Reports_by_Year->dob->FldCaption() ?></td><td style="width: 10px;">
  517. <?php if ($Emp_Reports_by_Year->dob->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($Emp_Reports_by_Year->dob->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
  518. <?php } ?>
  519. </tr></table>
  520. <?php } ?>
  521. </td>
  522. <td class="ewTableHeader">
  523. <?php if ($Emp_Reports_by_Year->Export <> "") { ?>
  524. <?php echo $Emp_Reports_by_Year->joined_company_date->FldCaption() ?>
  525. <?php } else { ?>
  526. <table cellspacing="0" class="ewTableHeaderBtn"><tr>
  527. <?php if ($Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->joined_company_date) == "") { ?>
  528. <td style="vertical-align: bottom;"><?php echo $Emp_Reports_by_Year->joined_company_date->FldCaption() ?></td>
  529. <?php } else { ?>
  530. <td class="ewPointer" onmousedown="ewrpt_Sort(event,'<?php echo $Emp_Reports_by_Year->SortUrl($Emp_Reports_by_Year->joined_company_date) ?>',2);"><?php echo $Emp_Reports_by_Year->joined_company_date->FldCaption() ?></td><td style="width: 10px;">
  531. <?php if ($Emp_Reports_by_Year->joined_company_date->getSort() == "ASC") { ?><img src="phprptimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($Emp_Reports_by_Year->joined_company_date->getSort() == "DESC") { ?><img src="phprptimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td>
  532. <?php } ?>
  533. </tr></table>
  534. <?php } ?>
  535. </td>
  536. </tr>
  537. </thead>
  538. <tbody>
  539. <?php
  540. $Emp_Reports_by_Year_summary->ShowFirstHeader = FALSE;
  541. }
  542. // Build detail SQL
  543. $sWhere = ewrpt_DetailFilterSQL($Emp_Reports_by_Year->department_name, $Emp_Reports_by_Year->SqlFirstGroupField(), $Emp_Reports_by_Year->department_name->GroupValue());
  544. if ($Emp_Reports_by_Year_summary->Filter != "")
  545. $sWhere = "($Emp_Reports_by_Year_summary->Filter) AND ($sWhere)";
  546. $sSql = ewrpt_BuildReportSql($Emp_Reports_by_Year->SqlSelect(), $Emp_Reports_by_Year->SqlWhere(), $Emp_Reports_by_Year->SqlGroupBy(), $Emp_Reports_by_Year->SqlHaving(), $Emp_Reports_by_Year->SqlOrderBy(), $sWhere, $Emp_Reports_by_Year_summary->Sort);
  547. $rs = $conn->Execute($sSql);
  548. $rsdtlcnt = ($rs) ? $rs->RecordCount() : 0;
  549. if ($rsdtlcnt > 0)
  550. $Emp_Reports_by_Year_summary->GetRow(1);
  551. while ($rs && !$rs->EOF) { // Loop detail records
  552. $Emp_Reports_by_Year_summary->RecCount++;
  553. // Render detail row
  554. $Emp_Reports_by_Year->ResetCSS();
  555. $Emp_Reports_by_Year->RowType = EWRPT_ROWTYPE_DETAIL;
  556. $Emp_Reports_by_Year_summary->RenderRow();
  557. ?>
  558. <tr<?php echo $Emp_Reports_by_Year->RowAttributes(); ?>>
  559. <td<?php echo $Emp_Reports_by_Year->department_name->CellAttributes(); ?>>
  560. <span<?php echo $Emp_Reports_by_Year->department_name->ViewAttributes(); ?>><?php echo $Emp_Reports_by_Year->department_name->GroupViewValue; ?></span></td>
  561. <td<?php echo $Emp_Reports_by_Year->year->CellAttributes(); ?>>
  562. <span<?php echo $Emp_Reports_by_Year->year->ViewAttributes(); ?>><?php echo $Emp_Reports_by_Year->year->GroupViewValue; ?></span></td>
  563. <td<?php echo $Emp_Reports_by_Year->full_name->CellAttributes() ?>>
  564. <span<?php echo $Emp_Reports_by_Year->full_name->ViewAttributes(); ?>><?php echo $Emp_Reports_by_Year->full_name->ListViewValue(); ?></span></td>
  565. <td<?php echo $Emp_Reports_by_Year->dob->CellAttributes() ?>>
  566. <span<?php echo $Emp_Reports_by_Year->dob->ViewAttributes(); ?>><?php echo $Emp_Reports_by_Year->dob->ListViewValue(); ?></span></td>
  567. <td<?php echo $Emp_Reports_by_Year->joined_company_date->CellAttributes() ?>>
  568. <span<?php echo $Emp_Reports_by_Year->joined_company_date->ViewAttributes(); ?>><?php echo $Emp_Reports_by_Year->joined_company_date->ListViewValue(); ?></span></td>
  569. </tr>
  570. <?php
  571. // Accumulate page summary
  572. $Emp_Reports_by_Year_summary->AccumulateSummary();
  573. // Get next record
  574. $Emp_Reports_by_Year_summary->GetRow(2);
  575. // Show Footers
  576. ?>
  577. <?php
  578. } // End detail records loop
  579. ?>
  580. <?php
  581. ?>
  582. <?php
  583. $Emp_Reports_by_Year->ResetCSS();
  584. $Emp_Reports_by_Year->RowType = EWRPT_ROWTYPE_TOTAL;
  585. $Emp_Reports_by_Year->RowTotalType = EWRPT_ROWTOTAL_GROUP;
  586. $Emp_Reports_by_Year->RowTotalSubType = EWRPT_ROWTOTAL_FOOTER;
  587. $Emp_Reports_by_Year->RowGroupLevel = 1;
  588. $Emp_Reports_by_Year_summary->RenderRow();
  589. ?>
  590. <tr<?php echo $Emp_Reports_by_Year->RowAttributes(); ?>>
  591. <td colspan="5"<?php echo $Emp_Reports_by_Year->department_name->CellAttributes() ?>><?php echo $ReportLanguage->Phrase("RptSumHead") ?> <?php echo $Emp_Reports_by_Year->department_name->FldCaption() ?>: <?php echo $Emp_Reports_by_Year->department_name->GroupViewValue; ?> (<?php echo ewrpt_FormatNumber($Emp_Reports_by_Year_summary->Cnt[1][0],0,-2,-2,-2); ?><?php echo $ReportLanguage->Phrase("RptDtlRec") ?>)</td></tr>
  592. <?php
  593. // Reset level 1 summary
  594. $Emp_Reports_by_Year_summary->ResetLevelSummary(1);
  595. ?>
  596. <?php
  597. // Next group
  598. $Emp_Reports_by_Year_summary->GetGrpRow(2);
  599. $Emp_Reports_by_Year_summary->GrpCount++;
  600. } // End while
  601. ?>
  602. </tbody>
  603. <tfoot>
  604. <?php
  605. if ($Emp_Reports_by_Year_summary->TotalGrps > 0) {
  606. $Emp_Reports_by_Year->ResetCSS();
  607. $Emp_Reports_by_Year->RowType = EWRPT_ROWTYPE_TOTAL;
  608. $Emp_Reports_by_Year->RowTotalType = EWRPT_ROWTOTAL_GRAND;
  609. $Emp_Reports_by_Year->RowTotalSubType = EWRPT_ROWTOTAL_FOOTER;
  610. $Emp_Reports_by_Year->RowAttrs["class"] = "ewRptGrandSummary";
  611. $Emp_Reports_by_Year_summary->RenderRow();
  612. ?>
  613. <!-- tr><td colspan="5"><span class="phpreportmaker">&nbsp;<br></span></td></tr -->
  614. <tr<?php echo $Emp_Reports_by_Year->RowAttributes(); ?>><td colspan="5"><?php echo $ReportLanguage->Phrase("RptGrandTotal") ?> (<?php echo ewrpt_FormatNumber($Emp_Reports_by_Year_summary->TotCount,0,-2,-2,-2); ?><?php echo $ReportLanguage->Phrase("RptDtlRec") ?>)</td></tr>
  615. <?php } ?>
  616. </tfoot>
  617. </table>
  618. </div>
  619. <?php if ($Emp_Reports_by_Year_summary->TotalGrps > 0) { ?>
  620. <?php if ($Emp_Reports_by_Year->Export == "") { ?>
  621. <div class="ewGridLowerPanel">
  622. <form action="<?php echo ewrpt_CurrentPage() ?>" name="ewpagerform" id="ewpagerform" class="ewForm">
  623. <table border="0" cellspacing="0" cellpadding="0">
  624. <tr>
  625. <td style="white-space: nowrap;">
  626. <?php if (!isset($Pager)) $Pager = new crPrevNextPager($Emp_Reports_by_Year_summary->StartGrp, $Emp_Reports_by_Year_summary->DisplayGrps, $Emp_Reports_by_Year_summary->TotalGrps) ?>
  627. <?php if ($Pager->RecordCount > 0) { ?>
  628. <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("Page") ?>&nbsp;</span></td>
  629. <!--first page button-->
  630. <?php if ($Pager->FirstButton->Enabled) { ?>
  631. <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>
  632. <?php } else { ?>
  633. <td><img src="phprptimages/firstdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
  634. <?php } ?>
  635. <!--previous page button-->
  636. <?php if ($Pager->PrevButton->Enabled) { ?>
  637. <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>
  638. <?php } else { ?>
  639. <td><img src="phprptimages/prevdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
  640. <?php } ?>
  641. <!--current page number-->
  642. <td><input type="text" name="pageno" id="pageno" value="<?php echo $Pager->CurrentPage ?>" size="4"></td>
  643. <!--next page button-->
  644. <?php if ($Pager->NextButton->Enabled) { ?>
  645. <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>
  646. <?php } else { ?>
  647. <td><img src="phprptimages/nextdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
  648. <?php } ?>
  649. <!--last page button-->
  650. <?php if ($Pager->LastButton->Enabled) { ?>
  651. <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>
  652. <?php } else { ?>
  653. <td><img src="phprptimages/lastdisab.gif" alt="<?php echo $ReportLanguage->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
  654. <?php } ?>
  655. <td><span class="phpreportmaker">&nbsp;<?php echo $ReportLanguage->Phrase("of") ?> <?php echo $Pager->PageCount ?></span></td>
  656. </tr></table>
  657. </td>
  658. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  659. <td>
  660. <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>
  661. <?php } else { ?>
  662. <?php if ($Emp_Reports_by_Year_summary->Filter == "0=101") { ?>
  663. <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("EnterSearchCriteria") ?></span>
  664. <?php } else { ?>
  665. <span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("NoRecord") ?></span>
  666. <?php } ?>
  667. <?php } ?>
  668. </td>
  669. <?php if ($Emp_Reports_by_Year_summary->TotalGrps > 0) { ?>
  670. <td style="white-space: nowrap;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
  671. <td align="right" style="vertical-align: top; white-space: nowrap;"><span class="phpreportmaker"><?php echo $ReportLanguage->Phrase("GroupsPerPage"); ?>&nbsp;
  672. <select name="<?php echo EWRPT_TABLE_GROUP_PER_PAGE; ?>" onchange="this.form.submit();">
  673. <option value="1"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 1) echo " selected=\"selected\"" ?>>1</option>
  674. <option value="2"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 2) echo " selected=\"selected\"" ?>>2</option>
  675. <option value="3"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 3) echo " selected=\"selected\"" ?>>3</option>
  676. <option value="4"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 4) echo " selected=\"selected\"" ?>>4</option>
  677. <option value="5"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 5) echo " selected=\"selected\"" ?>>5</option>
  678. <option value="10"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 10) echo " selected=\"selected\"" ?>>10</option>
  679. <option value="20"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 20) echo " selected=\"selected\"" ?>>20</option>
  680. <option value="50"<?php if ($Emp_Reports_by_Year_summary->DisplayGrps == 50) echo " selected=\"selected\"" ?>>50</option>
  681. <option value="ALL"<?php if ($Emp_Reports_by_Year->getGroupPerPage() == -1) echo " selected=\"selected\"" ?>><?php echo $ReportLanguage->Phrase("AllRecords") ?></option>
  682. </select>
  683. </span></td>
  684. <?php } ?>
  685. </tr>
  686. </table>
  687. </form>
  688. </div>
  689. <?php } ?>
  690. <?php } ?>
  691. </td></tr></table>
  692. </div>
  693. <!-- Summary Report Ends -->
  694. <?php if ($Emp_Reports_by_Year->Export == "" || $Emp_Reports_by_Year->Export == "print" || $Emp_Reports_by_Year->Export == "email") { ?>
  695. </div><br></td>
  696. <!-- Center Container - Report (End) -->
  697. <!-- Right Container (Begin) -->
  698. <td style="vertical-align: top;"><div id="ewRight" class="phpreportmaker">
  699. <!-- Right slot -->
  700. </div></td>
  701. <!-- Right Container (End) -->
  702. </tr>
  703. <!-- Bottom Container (Begin) -->
  704. <tr><td colspan="3"><div id="ewBottom" class="phpreportmaker">
  705. <!-- Bottom slot -->
  706. </div><br></td></tr>
  707. <!-- Bottom Container (End) -->
  708. </table>
  709. <!-- Table Container (End) -->
  710. <?php } ?>
  711. <?php $Emp_Reports_by_Year_summary->ShowPageFooter(); ?>
  712. <?php if (EWRPT_DEBUG_ENABLED) echo ewrpt_DebugMsg(); ?>
  713. <?php
  714. // Close recordsets
  715. if ($rsgrp) $rsgrp->Close();
  716. if ($rs) $rs->Close();
  717. ?>
  718. <?php if ($Emp_Reports_by_Year->Export == "") { ?>
  719. <script language="JavaScript" type="text/javascript">
  720. <!--
  721. // Write your table-specific startup script here
  722. // document.write("page loaded");
  723. //-->
  724. </script>
  725. <?php } ?>
  726. <?php include_once "phprptinc/footer.php"; ?>
  727. <?php
  728. $Emp_Reports_by_Year_summary->Page_Terminate();
  729. ?>
  730. <?php
  731. //
  732. // Page class
  733. //
  734. class crEmp_Reports_by_Year_summary {
  735. // Page ID
  736. var $PageID = 'summary';
  737. // Table name
  738. var $TableName = 'Emp Reports by Year';
  739. // Page object name
  740. var $PageObjName = 'Emp_Reports_by_Year_summary';
  741. // Page name
  742. function PageName() {
  743. return ewrpt_CurrentPage();
  744. }
  745. // Page URL
  746. function PageUrl() {
  747. $PageUrl = ewrpt_CurrentPage() . "?";
  748. global $Emp_Reports_by_Year;
  749. if ($Emp_Reports_by_Year->UseTokenInUrl) $PageUrl .= "t=" . $Emp_Reports_by_Year->TableVar . "&"; // Add page token
  750. return $PageUrl;
  751. }
  752. // Export URLs
  753. var $ExportPrintUrl;
  754. var $ExportExcelUrl;
  755. var $ExportWordUrl;
  756. var $ExportPdfUrl;
  757. var $ReportTableClass;
  758. // Message
  759. function getMessage() {
  760. return @$_SESSION[EWRPT_SESSION_MESSAGE];
  761. }
  762. function setMessage($v) {
  763. if (@$_SESSION[EWRPT_SESSION_MESSAGE] <> "") { // Append
  764. $_SESSION[EWRPT_SESSION_MESSAGE] .= "<br>" . $v;
  765. } else {
  766. $_SESSION[EWRPT_SESSION_MESSAGE] = $v;
  767. }
  768. }
  769. // Show message
  770. function ShowMessage() {
  771. $sMessage = $this->getMessage();
  772. $this->Message_Showing($sMessage);
  773. if ($sMessage <> "") { // Message in Session, display
  774. echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
  775. $_SESSION[EWRPT_SESSION_MESSAGE] = ""; // Clear message in Session
  776. }
  777. }
  778. var $PageHeader;
  779. var $PageFooter;
  780. // Show Page Header
  781. function ShowPageHeader() {
  782. $sHeader = $this->PageHeader;
  783. $this->Page_DataRendering($sHeader);
  784. if ($sHeader <> "") { // Header exists, display
  785. echo "<p><span class=\"phpreportmaker\">" . $sHeader . "</span></p>";
  786. }
  787. }
  788. // Show Page Footer
  789. function ShowPageFooter() {
  790. $sFooter = $this->PageFooter;
  791. $this->Page_DataRendered($sFooter);
  792. if ($sFooter <> "") { // Fotoer exists, display
  793. echo "<p><span class=\"phpreportmaker\">" . $sFooter . "</span></p>";
  794. }
  795. }
  796. // Validate page request
  797. function IsPageRequest() {
  798. global $Emp_Reports_by_Year;
  799. if ($Emp_Reports_by_Year->UseTokenInUrl) {
  800. if (ewrpt_IsHttpPost())
  801. return ($Emp_Reports_by_Year->TableVar == @$_POST("t"));
  802. if (@$_GET["t"] <> "")
  803. return ($Emp_Reports_by_Year->TableVar == @$_GET["t"]);
  804. } else {
  805. return TRUE;
  806. }
  807. }
  808. //
  809. // Page class constructor
  810. //
  811. function crEmp_Reports_by_Year_summary() {
  812. global $conn, $ReportLanguage;
  813. // Language object
  814. $ReportLanguage = new crLanguage();
  815. // Table object (Emp_Reports_by_Year)
  816. $GLOBALS["Emp_Reports_by_Year"] = new crEmp_Reports_by_Year();
  817. $GLOBALS["Table"] =& $GLOBALS["Emp_Reports_by_Year"];
  818. // Initialize URLs
  819. $this->ExportPrintUrl = $this->PageUrl() . "export=print";
  820. $this->ExportExcelUrl = $this->PageUrl() . "export=excel";
  821. $this->ExportWordUrl = $this->PageUrl() . "export=word";
  822. $this->ExportPdfUrl = $this->PageUrl() . "export=pdf";
  823. // Page ID
  824. if (!defined("EWRPT_PAGE_ID"))
  825. define("EWRPT_PAGE_ID", 'summary', TRUE);
  826. // Table name (for backward compatibility)
  827. if (!defined("EWRPT_TABLE_NAME"))
  828. define("EWRPT_TABLE_NAME", 'Emp Reports by Year', TRUE);
  829. // Start timer
  830. $GLOBALS["gsTimer"] = new crTimer();
  831. // Open connection
  832. $conn = ewrpt_Connect();
  833. // Export options
  834. $this->ExportOptions = new crListOptions();
  835. $this->ExportOptions->Tag = "span";
  836. $this->ExportOptions->Separator = "&nbsp;&nbsp;";
  837. }
  838. //
  839. // Page_Init
  840. //
  841. function Page_Init() {
  842. global $gsExport, $gsExportFile, $ReportLanguage, $Security;
  843. global $Emp_Reports_by_Year;
  844. // Get export parameters
  845. if (@$_GET["export"] <> "") {
  846. $Emp_Reports_by_Year->Export = $_GET["export"];
  847. }
  848. $gsExport = $Emp_Reports_by_Year->Export; // Get export parameter, used in header
  849. $gsExportFile = $Emp_Reports_by_Year->TableVar; // Get export file, used in header
  850. if ($Emp_Reports_by_Year->Export == "excel") {
  851. header('Content-Type: application/vnd.ms-excel;charset=utf-8');
  852. header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
  853. }
  854. if ($Emp_Reports_by_Year->Export == "word") {
  855. header('Content-Type: application/vnd.ms-word;charset=utf-8');
  856. header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
  857. }
  858. // Setup export options
  859. $this->SetupExportOptions();
  860. // Global Page Loading event (in userfn*.php)
  861. Page_Loading();
  862. // Page Load event
  863. $this->Page_Load();
  864. }
  865. // Set up export options
  866. function SetupExportOptions() {
  867. global $ReportLanguage, $Emp_Reports_by_Year;
  868. // Printer friendly
  869. $item =& $this->ExportOptions->Add("print");
  870. $item->Body = "<a href=\"" . $this->ExportPrintUrl . "\">" . $ReportLanguage->Phrase("PrinterFriendly") . "</a>";
  871. $item->Visible = TRUE;
  872. // Export to Excel
  873. $item =& $this->ExportOptions->Add("excel");
  874. $item->Body = "<a href=\"" . $this->ExportExcelUrl . "\">" . $ReportLanguage->Phrase("ExportToExcel") . "</a>";
  875. $item->Visible = TRUE;
  876. // Export to Word
  877. $item =& $this->ExportOptions->Add("word");
  878. $item->Body = "<a href=\"" . $this->ExportWordUrl . "\">" . $ReportLanguage->Phrase("ExportToWord") . "</a>";
  879. $item->Visible = TRUE;
  880. // Export to Pdf
  881. $item =& $this->ExportOptions->Add("pdf");
  882. $item->Body = "<a href=\"" . $this->ExportPdfUrl . "\">" . $ReportLanguage->Phrase("ExportToPDF") . "</a>";
  883. $item->Visible = FALSE;
  884. // Uncomment codes below to show export to Pdf link
  885. // $item->Visible = FALSE;
  886. // Export to Email
  887. $item =& $this->ExportOptions->Add("email");
  888. $item->Body = "<a name=\"emf_Emp_Reports_by_Year\" id=\"emf_Emp_Reports_by_Year\" href=\"javascript:void(0);\" onclick=\"ewrpt_EmailDialogShow({lnk:'emf_Emp_Reports_by_Year',hdr:ewLanguage.Phrase('ExportToEmail')});\">" . $ReportLanguage->Phrase("ExportToEmail") . "</a>";
  889. $item->Visible = FALSE;
  890. // Reset filter
  891. $item =& $this->ExportOptions->Add("resetfilter");
  892. $item->Body = "<a href=\"" . ewrpt_CurrentPage() . "?cmd=reset\">" . $ReportLanguage->Phrase("ResetAllFilter") . "</a>";
  893. $item->Visible = TRUE;
  894. $this->SetupExportOptionsExt();
  895. // Hide options for export
  896. if ($Emp_Reports_by_Year->Export <> "")
  897. $this->ExportOptions->HideAllOptions();
  898. // Set up table class
  899. if ($Emp_Reports_by_Year->Export == "word" || $Emp_Reports_by_Year->Export == "excel" || $Emp_Reports_by_Year->Export == "pdf")
  900. $this->ReportTableClass = "ewTable";
  901. else
  902. $this->ReportTableClass = "ewTable ewTableSeparate";
  903. }
  904. //
  905. // Page_Terminate
  906. //
  907. function Page_Terminate($url = "") {
  908. global $conn;
  909. global $ReportLanguage;
  910. global $Emp_Reports_by_Year;
  911. // Page Unload event
  912. $this->Page_Unload();
  913. // Global Page Unloaded event (in userfn*.php)
  914. Page_Unloaded();
  915. // Export to Email (use ob_file_contents for PHP)
  916. if ($Emp_Reports_by_Year->Export == "email") {
  917. $sContent = ob_get_contents();
  918. $this->ExportEmail($sContent);
  919. ob_end_clean();
  920. // Close connection
  921. $conn->Close();
  922. header("Location: " . ewrpt_CurrentPage());
  923. exit();
  924. }
  925. // Export to PDF (use ob_file_contents for PHP)
  926. if ($Emp_Reports_by_Year->Export == "pdf") {
  927. $sContent = ob_get_contents();
  928. $this->ExportPDF($sContent);
  929. ob_end_clean();
  930. // Close connection
  931. $conn->Close();
  932. }
  933. // Close connection
  934. $conn->Close();
  935. // Go to URL if specified
  936. if ($url <> "") {
  937. if (!EWRPT_DEBUG_ENABLED && ob_get_length())
  938. ob_end_clean();
  939. header("Location: " . $url);
  940. }
  941. exit();
  942. }
  943. // Initialize common variables
  944. var $ExportOptions; // Export options
  945. // Paging variables
  946. var $RecCount = 0; // Record count
  947. var $StartGrp = 0; // Start group
  948. var $StopGrp = 0; // Stop group
  949. var $TotalGrps = 0; // Total groups
  950. var $GrpCount = 0; // Group count
  951. var $DisplayGrps = 10; // Groups per page
  952. var $GrpRange = 10;
  953. var $Sort = "";
  954. var $Filter = "";
  955. var $UserIDFilter = "";
  956. // Clear field for ext filter
  957. var $ClearExtFilter = "";
  958. var $FilterApplied;
  959. var $ShowFirstHeader;
  960. var $Cnt, $Col, $Val, $Smry, $Mn, $Mx, $GrandSmry, $GrandMn, $GrandMx;
  961. var $TotCount;
  962. //
  963. // Page main
  964. //
  965. function Page_Main() {
  966. global $Emp_Reports_by_Year;
  967. global $rs;
  968. global $rsgrp;
  969. global $gsFormError;
  970. // Aggregate variables
  971. // 1st dimension = no of groups (level 0 used for grand total)
  972. // 2nd dimension = no of fields
  973. $nDtls = 4;
  974. $nGrps = 3;
  975. $this->Val =& ewrpt_InitArray($nDtls, 0);
  976. $this->Cnt =& ewrpt_Init2DArray($nGrps, $nDtls, 0);
  977. $this->Smry =& ewrpt_Init2DArray($nGrps, $nDtls, 0);
  978. $this->Mn =& ewrpt_Init2DArray($nGrps, $nDtls, NULL);
  979. $this->Mx =& ewrpt_Init2DArray($nGrps, $nDtls, NULL);
  980. $this->GrandSmry =& ewrpt_InitArray($nDtls, 0);
  981. $this->GrandMn =& ewrpt_InitArray($nDtls, NULL);
  982. $this->GrandMx =& ewrpt_InitArray($nDtls, NULL);
  983. // Set up if accumulation required
  984. $this->Col = array(FALSE, FALSE, FALSE, FALSE);
  985. // Set up groups per page dynamically
  986. $this->SetUpDisplayGrps();
  987. $Emp_Reports_by_Year->department_name->SelectionList = "";
  988. $Emp_Reports_by_Year->department_name->DefaultSelectionList = "";
  989. $Emp_Reports_by_Year->department_name->ValueList = "";
  990. $Emp_Reports_by_Year->year->SelectionList = "";
  991. $Emp_Reports_by_Year->year->DefaultSelectionList = "";
  992. $Emp_Reports_by_Year->year->ValueList = "";
  993. // Load default filter values
  994. $this->LoadDefaultFilters();
  995. // Load custom filters
  996. $Emp_Reports_by_Year->Filters_Load();
  997. // Set up popup filter
  998. $this->SetupPopup();
  999. // Extended filter
  1000. $sExtendedFilter = "";
  1001. // Build popup filter
  1002. $sPopupFilter = $this->GetPopupFilter();
  1003. //ewrpt_SetDebugMsg("popup filter: " . $sPopupFilter);
  1004. if ($sPopupFilter <> "") {
  1005. if ($this->Filter <> "")
  1006. $this->Filter = "($this->Filter) AND ($sPopupFilter)";
  1007. else
  1008. $this->Filter = $sPopupFilter;
  1009. }
  1010. // Check if filter applied
  1011. $this->FilterApplied = $this->CheckFilter();
  1012. $this->ExportOptions->GetItem("resetfilter")->Visible = $this->FilterApplied;
  1013. // Get sort
  1014. $this->Sort = $this->GetSort();
  1015. // Get total group count
  1016. $sGrpSort = ewrpt_UpdateSortFields($Emp_Reports_by_Year->SqlOrderByGroup(), $this->Sort, 2); // Get grouping field only
  1017. $sSql = ewrpt_BuildReportSql($Emp_Reports_by_Year->SqlSelectGroup(), $Emp_Reports_by_Year->SqlWhere(), $Emp_Reports_by_Year->SqlGroupBy(), $Emp_Reports_by_Year->SqlHaving(), $Emp_Reports_by_Year->SqlOrderByGroup(), $this->Filter, $sGrpSort);
  1018. $this->TotalGrps = $this->GetGrpCnt($sSql);
  1019. if ($this->DisplayGrps <= 0) // Display all groups
  1020. $this->DisplayGrps = $this->TotalGrps;
  1021. $this->StartGrp = 1;
  1022. // Show header
  1023. $this->ShowFirstHeader = ($this->TotalGrps > 0);
  1024. //$this->ShowFirstHeader = TRUE; // Uncomment to always show header
  1025. // Set up start position if not export all
  1026. if ($Emp_Reports_by_Year->ExportAll && $Emp_Reports_by_Year->Export <> "")
  1027. $this->DisplayGrps = $this->TotalGrps;
  1028. else
  1029. $this->SetUpStartGroup();
  1030. // Hide all options if export
  1031. if ($Emp_Reports_by_Year->Export <> "") {
  1032. $this->ExportOptions->HideAllOptions();
  1033. }
  1034. // Get current page groups
  1035. $rsgrp = $this->GetGrpRs($sSql, $this->StartGrp, $this->DisplayGrps);
  1036. // Init detail recordset
  1037. $rs = NULL;
  1038. }
  1039. // Check level break
  1040. function ChkLvlBreak($lvl) {
  1041. global $Emp_Reports_by_Year;
  1042. switch ($lvl) {
  1043. case 1:
  1044. return (is_null($Emp_Reports_by_Year->department_name->CurrentValue) && !is_null($Emp_Reports_by_Year->department_name->OldValue)) ||
  1045. (!is_null($Emp_Reports_by_Year->department_name->CurrentValue) && is_null($Emp_Reports_by_Year->department_name->OldValue)) ||
  1046. ($Emp_Reports_by_Year->department_name->GroupValue() <> $Emp_Reports_by_Year->department_name->GroupOldValue());
  1047. case 2:
  1048. return (is_null($Emp_Reports_by_Year->year->CurrentValue) && !is_null($Emp_Reports_by_Year->year->OldValue)) ||
  1049. (!is_null($Emp_Reports_by_Year->year->CurrentValue) && is_null($Emp_Reports_by_Year->year->OldValue)) ||
  1050. ($Emp_Reports_by_Year->year->GroupValue() <> $Emp_Reports_by_Year->year->GroupOldValue()) || $this->ChkLvlBreak(1); // Recurse upper level
  1051. }
  1052. }
  1053. // Accummulate summary
  1054. function AccumulateSummary() {
  1055. $cntx = count($this->Smry);
  1056. for ($ix = 0; $ix < $cntx; $ix++) {
  1057. $cnty = count($this->Smry[$ix]);
  1058. for ($iy = 1; $iy < $cnty; $iy++) {
  1059. $this->Cnt[$ix][$iy]++;
  1060. if ($this->Col[$iy]) {
  1061. $valwrk = $this->Val[$iy];
  1062. if (is_null($valwrk) || !is_numeric($valwrk)) {
  1063. // skip
  1064. } else {
  1065. $this->Smry[$ix][$iy] += $valwrk;
  1066. if (is_null($this->Mn[$ix][$iy])) {
  1067. $this->Mn[$ix][$iy] = $valwrk;
  1068. $this->Mx[$ix][$iy] = $valwrk;
  1069. } else {
  1070. if ($this->Mn[$ix][$iy] > $valwrk) $this->Mn[$ix][$iy] = $valwrk;
  1071. if ($this->Mx[$ix][$iy] < $valwrk) $this->Mx[$ix][$iy] = $valwrk;
  1072. }
  1073. }
  1074. }
  1075. }
  1076. }
  1077. $cntx = count($this->Smry);
  1078. for ($ix = 1; $ix < $cntx; $ix++) {
  1079. $this->Cnt[$ix][0]++;
  1080. }
  1081. }
  1082. // Reset level summary
  1083. function ResetLevelSummary($lvl) {
  1084. // Clear summary values
  1085. $cntx = count($this->Smry);
  1086. fo

Large files files are truncated, but you can click here to view the full file