/osj-osj2dresumeslist.php
PHP | 1201 lines | 953 code | 120 blank | 128 comment | 303 complexity | f2c5228e6c83e4591f31e72a65b6b175 MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0
- <?php
- define("EW_PAGE_ID", "list", TRUE); // Page ID
- define("EW_TABLE_NAME", 'osj-resumes', TRUE);
- ?>
- <?php
- session_start(); // Initialize session data
- ob_start(); // Turn on output buffering
- ?>
- <?php include "osj-ewcfg50.php" ?>
- <?php include "osj-ewmysql50.php" ?>
- <?php include "osj-phpfn50.php" ?>
- <?php include "osj-osj2dresumesinfo.php" ?>
- <?php include "osj-userfn50.php" ?>
- <?php include "osj-osj2dusersinfo.php" ?>
- <?php
- header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
- header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
- header("Cache-Control: post-check=0, pre-check=0", false);
- header("Pragma: no-cache"); // HTTP/1.0
- ?>
- <?php
-
- // Open connection to the database
- $conn = ew_Connect();
- ?>
- <?php
- $Security = new cAdvancedSecurity();
- ?>
- <?php
- if (!$Security->IsLoggedIn()) $Security->AutoLogin();
- $Security->LoadCurrentUserLevel('osj-resumes');
- if (!$Security->IsLoggedIn()) {
- $Security->SaveLastUrl();
- Page_Terminate("osj-login.php");
- }
- if (!$Security->CanList()) {
- $Security->SaveLastUrl();
- Page_Terminate("osj-login.php");
- }
- if ($Security->IsLoggedIn() && $Security->CurrentUserID() == "") {
- $_SESSION[EW_SESSION_MESSAGE] = "You do not have the right permission to view the page";
- Page_Terminate("osj-login.php");
- }
- ?>
- <?php
-
- // Common page loading event (in userfn*.php)
- Page_Loading();
- ?>
- <?php
-
- // Page load event, used in current page
- Page_Load();
- ?>
- <?php
- $osj2Dresumes->Export = @$_GET["export"]; // Get export parameter
- $sExport = $osj2Dresumes->Export; // Get export parameter, used in header
- $sExportFile = $osj2Dresumes->TableVar; // Get export file, used in header
- ?>
- <?php
- if ($osj2Dresumes->Export == "html") {
-
- // Printer friendly, no action required
- }
- if ($osj2Dresumes->Export == "xml") {
- header('Content-Type: text/xml');
- header('Content-Disposition: attachment; filename=' . $sExportFile .'.xml');
- }
- if ($osj2Dresumes->Export == "csv") {
- header('Content-Type: application/csv');
- header('Content-Disposition: attachment; filename=' . $sExportFile .'.csv');
- }
- ?>
- <?php
-
- // Paging variables
- $nStartRec = 0; // Start record index
- $nStopRec = 0; // Stop record index
- $nTotalRecs = 0; // Total number of records
- $nDisplayRecs = 10;
- $nRecRange = 10;
- $nRecCount = 0; // Record count
-
- // Search filters
- $sSrchAdvanced = ""; // Advanced search filter
- $sSrchBasic = ""; // Basic search filter
- $sSrchWhere = ""; // Search where clause
- $sFilter = "";
-
- // Master/Detail
- $sDbMasterFilter = ""; // Master filter
- $sDbDetailFilter = ""; // Detail filter
- $sSqlMaster = ""; // Sql for master record
-
- // Set up records per page dynamically
- SetUpDisplayRecs();
-
- // Handle reset command
- ResetCmd();
-
- // Get search criteria for advanced search
- $sSrchAdvanced = AdvancedSearchWhere();
-
- // Get basic search criteria
- $sSrchBasic = BasicSearchWhere();
-
- // Build search criteria
- if ($sSrchAdvanced <> "") {
- if ($sSrchWhere <> "") $sSrchWhere .= " AND ";
- $sSrchWhere .= "(" . $sSrchAdvanced . ")";
- }
- if ($sSrchBasic <> "") {
- if ($sSrchWhere <> "") $sSrchWhere .= " AND ";
- $sSrchWhere .= "(" . $sSrchBasic . ")";
- }
-
- // Save search criteria
- if ($sSrchWhere <> "") {
- if ($sSrchBasic == "") ResetBasicSearchParms();
- if ($sSrchAdvanced == "") ResetAdvancedSearchParms();
- $osj2Dresumes->setSearchWhere($sSrchWhere); // Save to Session
- $nStartRec = 1; // Reset start record counter
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- } else {
- RestoreSearchParms();
- }
-
- // Build filter
- $sFilter = "";
- if (!$Security->CanList()) {
- $sFilter = "(0=1)"; // Filter all records
- }
- if ($Security->CurrentUserID() <> "" && !$Security->IsAdmin()) { // Non system admin
- $sFilter = $osj2Dresumes->AddUserIDFilter($sFilter, $Security->CurrentUserID()); // Add User ID filter
- }
- if ($sDbDetailFilter <> "") {
- if ($sFilter <> "") $sFilter .= " AND ";
- $sFilter .= "(" . $sDbDetailFilter . ")";
- }
- if ($sSrchWhere <> "") {
- if ($sFilter <> "") $sFilter .= " AND ";
- $sFilter .= "(" . $sSrchWhere . ")";
- }
-
- // Set up filter in Session
- $osj2Dresumes->setSessionWhere($sFilter);
- $osj2Dresumes->CurrentFilter = "";
-
- // Set Up Sorting Order
- SetUpSortOrder();
-
- // Export data only
- if ($osj2Dresumes->Export == "xml" || $osj2Dresumes->Export == "csv") {
- ExportData();
- Page_Terminate(); // Terminate response
- }
-
- // Set Return Url
- $osj2Dresumes->setReturnUrl("osj-osj2dresumeslist.php");
- ?>
- <?php include "osj-header.php" ?>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <script type="text/javascript">
- <!--
- var EW_PAGE_ID = "list"; // Page id
- var EW_SHOW_HIGHLIGHT = "Show highlight";
- var EW_HIDE_HIGHLIGHT = "Hide highlight";
-
- //-->
- </script>
- <script type="text/javascript">
- <!--
- var firstrowoffset = 1; // First data row start at
- var lastrowoffset = 0; // Last data row end at
- var EW_LIST_TABLE_NAME = 'ewlistmain'; // Table name for list page
- var rowclass = 'ewTableRow'; // Row class
- var rowaltclass = 'ewTableAltRow'; // Row alternate class
- var rowmoverclass = 'ewTableHighlightRow'; // Row mouse over class
- var rowselectedclass = 'ewTableSelectRow'; // Row selected class
- var roweditclass = 'ewTableEditRow'; // Row edit class
-
- //-->
- </script>
- <script type="text/javascript">
- <!--
- var ew_DHTMLEditors = [];
-
- //-->
- </script>
- <script type="text/javascript">
- <!--
-
- // js for Popup Calendar
- //-->
-
- </script>
- <script type="text/javascript">
- <!--
-
- function ew_SelectKey(elem) {
- var f = elem.form;
- if (!f.elements["key_m[]"]) return;
- if (f.elements["key_m[]"][0]) {
- for (var i=0; i<f.elements["key_m[]"].length; i++)
- f.elements["key_m[]"][i].checked = elem.checked;
- } else {
- f.elements["key_m[]"].checked = elem.checked;
- }
- ew_ClickAll(elem);
- }
-
- function ew_Selected(f) {
- if (!f.elements["key_m[]"]) return false;
- if (f.elements["key_m[]"][0]) {
- for (var i=0; i<f.elements["key_m[]"].length; i++)
- if (f.elements["key_m[]"][i].checked) return true;
- } else {
- return f.elements["key_m[]"].checked;
- }
- return false;
- }
-
- //-->
- </script>
- <script language="JavaScript" type="text/javascript">
- <!--
-
- // Write your client script here, no need to add script tags.
- // To include another .js script, use:
- // ew_ClientScriptInclude("my_javascript.js");
- //-->
-
- </script>
- <?php } ?>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <?php } ?>
- <?php
-
- // Load recordset
- $bExportAll = (defined("EW_EXPORT_ALL") && $osj2Dresumes->Export <> "");
- $bSelectLimit = ($osj2Dresumes->Export == "" && $osj2Dresumes->SelectLimit);
- if (!$bSelectLimit) $rs = LoadRecordset();
- $nTotalRecs = ($bSelectLimit) ? $osj2Dresumes->SelectRecordCount() : $rs->RecordCount();
- $nStartRec = 1;
- if ($nDisplayRecs <= 0) $nDisplayRecs = $nTotalRecs; // Display all records
- if (!$bExportAll) SetUpStartRec(); // Set up start record position
- if ($bSelectLimit) $rs = LoadRecordset($nStartRec-1, $nDisplayRecs);
- ?>
- <p><span class="phpmaker" style="white-space: nowrap;">TABLE: Resumes
- <?php if ($osj2Dresumes->Export == "") { ?>
- <a href="osj-osj2dresumeslist.php?export=html">Printer Friendly</a>
- <a href="osj-osj2dresumeslist.php?export=xml">Export to XML</a>
- <a href="osj-osj2dresumeslist.php?export=csv">Export to CSV</a>
- <?php } ?>
- </span></p>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <?php if ($Security->CanSearch()) { ?>
- <form name="fosj2Dresumeslistsrch" id="fosj2Dresumeslistsrch" action="osj-osj2dresumeslist.php" >
- <table class="ewBasicSearch">
- <tr>
- <td><span class="phpmaker">
- <input type="text" name="<?php echo EW_TABLE_BASIC_SEARCH ?>" id="<?php echo EW_TABLE_BASIC_SEARCH ?>" size="20" value="<?php echo ew_HtmlEncode($osj2Dresumes->getBasicSearchKeyword()) ?>">
- <input type="Submit" name="Submit" id="Submit" value="Search (*)">
- <a href="osj-osj2dresumeslist.php?cmd=reset">Show all</a>
- <a href="osj-osj2dresumessrch.php">Advanced Search</a>
- <?php if ($sSrchWhere <> "" && $nTotalRecs > 0) { ?>
- <a href="javascript:void(0);" onclick="ew_ToggleHighlight(this);">Hide highlight</a>
- <?php } ?>
- </span></td>
- </tr>
- <tr>
- <td><span class="phpmaker"><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="" <?php if ($osj2Dresumes->getBasicSearchType() == "") { ?>checked<?php } ?>>Exact phrase <input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="AND" <?php if ($osj2Dresumes->getBasicSearchType() == "AND") { ?>checked<?php } ?>>All words <input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="OR" <?php if ($osj2Dresumes->getBasicSearchType() == "OR") { ?>checked<?php } ?>>Any word</span></td>
- </tr>
- </table>
- </form>
- <?php } ?>
- <?php } ?>
- <?php
- if (@$_SESSION[EW_SESSION_MESSAGE] <> "") {
- ?>
- <p><span class="ewmsg"><?php echo $_SESSION[EW_SESSION_MESSAGE] ?></span></p>
- <?php
- $_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message
- }
- ?>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <form action="osj-osj2dresumeslist.php" name="ewpagerform" id="ewpagerform">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td nowrap>
- <span class="phpmaker">
- <?php if (!isset($Pager)) $Pager = new cNumericPager($nStartRec, $nDisplayRecs, $nTotalRecs, $nRecRange) ?>
- <?php if ($Pager->RecordCount > 0) { ?>
- <?php if ($Pager->FirstButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->FirstButton->Start ?>"><b>First</b></a>
- <?php } ?>
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->PrevButton->Start ?>"><b>Previous</b></a>
- <?php } ?>
- <?php foreach ($Pager->Items as $PagerItem) { ?>
- <?php if ($PagerItem->Enabled) { ?><a href="osj-osj2dresumeslist.php?start=<?php echo $PagerItem->Start ?>"><?php } ?><b><?php echo $PagerItem->Text ?></b><?php if ($PagerItem->Enabled) { ?></a><?php } ?>
- <?php } ?>
- <?php if ($Pager->NextButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->NextButton->Start ?>"><b>Next</b></a>
- <?php } ?>
- <?php if ($Pager->LastButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->LastButton->Start ?>"><b>Last</b></a>
- <?php } ?>
- <?php if ($Pager->ButtonCount > 0) { ?><br><?php } ?>
- Records <?php echo $Pager->FromIndex ?> to <?php echo $Pager->ToIndex ?> of <?php echo $Pager->RecordCount ?>
- <?php } else { ?>
- <?php if ($Security->CanList()) { ?>
- <?php if ($sSrchWhere == "0=101") { ?>
- Please enter search criteria
- <?php } else { ?>
- No records found
- <?php } ?>
- <?php } else { ?>
- You do not have the right permission to view the page
- <?php } ?>
- <?php } ?>
- </span>
- </td>
- <?php if ($nTotalRecs > 0) { ?>
- <td nowrap> </td>
- <td align="right" valign="top" nowrap><span class="phpmaker">Records Per Page
- <select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onChange="this.form.submit();" class="phpmaker">
- <option value="10"<?php if ($nDisplayRecs == 10) echo " selected" ?>>10</option>
- <option value="20"<?php if ($nDisplayRecs == 20) echo " selected" ?>>20</option>
- <option value="50"<?php if ($nDisplayRecs == 50) echo " selected" ?>>50</option>
- </select>
- </span></td>
- <?php } ?>
- </tr>
- </table>
- </form>
- <?php } ?>
- <form method="post" name="fosj2Dresumeslist" id="fosj2Dresumeslist">
- <?php if ($osj2Dresumes->Export == "") { ?>
- <table>
- <tr><td><span class="phpmaker">
- <?php if ($Security->CanAdd()) { ?>
- <a href="osj-osj2dresumesadd.php">Add</a>
- <?php } ?>
- <?php if ($nTotalRecs > 0) { ?>
- <?php if ($Security->CanDelete()) { ?>
- <a href="" onClick="if (!ew_Selected(document.fosj2Dresumeslist)) alert('No records selected'); else {document.fosj2Dresumeslist.action='osj-osj2dresumesdelete.php';document.fosj2Dresumeslist.encoding='application/x-www-form-urlencoded';document.fosj2Dresumeslist.submit();};return false;">Delete Selected Records</a>
- <?php } ?>
- <?php } ?>
- </span></td></tr>
- </table>
- <?php } ?>
- <?php if ($nTotalRecs > 0) { ?>
- <table id="ewlistmain" class="ewTable">
- <?php
- $OptionCnt = 0;
- if ($Security->CanView()) {
- $OptionCnt++; // view
- }
- if ($Security->CanEdit()) {
- $OptionCnt++; // edit
- }
- if ($Security->CanDelete()) {
- $OptionCnt++; // multi select
- }
- ?>
- <!-- Table header -->
- <tr class="ewTableHeader">
- <?php if ($osj2Dresumes->Export == "") { ?>
- <?php if ($Security->CanView()) { ?>
- <td nowrap> </td>
- <?php } ?>
- <?php if ($Security->CanEdit()) { ?>
- <td nowrap> </td>
- <?php } ?>
- <?php if ($Security->CanDelete()) { ?>
- <td nowrap><input type="checkbox" class="phpmaker" onClick="ew_SelectKey(this);"></td>
- <?php } ?>
- <?php } ?>
- <td valign="top">
- <?php if ($osj2Dresumes->Export <> "") { ?>
- Resume Status Level
- <?php } else { ?>
- <a href="osj-osj2dresumeslist.php?order=<?php echo urlencode('resume_permissions_id') ?>&ordertype=<?php echo $osj2Dresumes->resume_permissions_id->ReverseSort() ?>">Resume Status Level<?php if ($osj2Dresumes->resume_permissions_id->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($osj2Dresumes->resume_permissions_id->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></a>
- <?php } ?>
- </td>
- <td valign="top">
- <?php if ($osj2Dresumes->Export <> "") { ?>
- Resume Edit Date
- <?php } else { ?>
- <a href="osj-osj2dresumeslist.php?order=<?php echo urlencode('resume_edit_date') ?>&ordertype=<?php echo $osj2Dresumes->resume_edit_date->ReverseSort() ?>">Resume Edit Date<?php if ($osj2Dresumes->resume_edit_date->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($osj2Dresumes->resume_edit_date->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></a>
- <?php } ?>
- </td>
- <td valign="top">
- <?php if ($osj2Dresumes->Export <> "") { ?>
- Resume Title
- <?php } else { ?>
- <a href="osj-osj2dresumeslist.php?order=<?php echo urlencode('resume_title') ?>&ordertype=<?php echo $osj2Dresumes->resume_title->ReverseSort() ?>">Resume Title (*)<?php if ($osj2Dresumes->resume_title->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($osj2Dresumes->resume_title->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></a>
- <?php } ?>
- </td>
- </tr>
- <?php
- if (defined("EW_EXPORT_ALL") && $osj2Dresumes->Export <> "") {
- $nStopRec = $nTotalRecs;
- } else {
- $nStopRec = $nStartRec + $nDisplayRecs - 1; // Set the last record to display
- }
- $nRecCount = $nStartRec - 1;
- if (!$rs->EOF) {
- $rs->MoveFirst();
- if (!$osj2Dresumes->SelectLimit) $rs->Move($nStartRec - 1); // Move to first record directly
- }
- $RowCnt = 0;
- while (!$rs->EOF && $nRecCount < $nStopRec) {
- $nRecCount++;
- if (intval($nRecCount) >= intval($nStartRec)) {
- $RowCnt++;
-
- // Init row class and style
- $osj2Dresumes->CssClass = "ewTableRow";
- $osj2Dresumes->CssStyle = "";
-
- // Init row event
- $osj2Dresumes->RowClientEvents = "onmouseover='ew_MouseOver(this);' onmouseout='ew_MouseOut(this);' onclick='ew_Click(this);'";
-
- // Display alternate color for rows
- if ($RowCnt % 2 == 0) {
- $osj2Dresumes->CssClass = "ewTableAltRow";
- }
- LoadRowValues($rs); // Load row values
- $osj2Dresumes->RowType = EW_ROWTYPE_VIEW; // Render view
- RenderRow();
- ?>
- <!-- Table body -->
- <tr<?php echo $osj2Dresumes->DisplayAttributes() ?>>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <?php if ($Security->CanView()) { ?>
- <td nowrap><span class="phpmaker"><?php if (ShowOptionLink()) { ?>
- <a href="<?php echo $osj2Dresumes->ViewUrl() ?>">View</a>
- <?php } ?></span></td>
- <?php } ?>
- <?php if ($Security->CanEdit()) { ?>
- <td nowrap><span class="phpmaker"><?php if (ShowOptionLink()) { ?>
- <a href="<?php echo $osj2Dresumes->EditUrl() ?>">Edit</a>
- <?php } ?></span></td>
- <?php } ?>
- <?php if ($Security->CanDelete()) { ?>
- <td nowrap><span class="phpmaker"><?php if (ShowOptionLink()) { ?>
- <input type="checkbox" name="key_m[]" id="key_m[]" value="<?php echo ew_HtmlEncode($osj2Dresumes->resume_id->CurrentValue) ?>" class="phpmaker" onclick='ew_ClickMultiCheckbox(this);'>
- <?php } ?></span></td>
- <?php } ?>
- <?php } ?>
- <!-- resume_permissions_id -->
- <td<?php echo $osj2Dresumes->resume_permissions_id->CellAttributes() ?>>
- <div<?php echo $osj2Dresumes->resume_permissions_id->ViewAttributes() ?>><?php echo $osj2Dresumes->resume_permissions_id->ViewValue ?></div>
- </td>
- <!-- resume_edit_date -->
- <td<?php echo $osj2Dresumes->resume_edit_date->CellAttributes() ?>>
- <div<?php echo $osj2Dresumes->resume_edit_date->ViewAttributes() ?>><?php echo $osj2Dresumes->resume_edit_date->ViewValue ?></div>
- </td>
- <!-- resume_title -->
- <td<?php echo $osj2Dresumes->resume_title->CellAttributes() ?>>
- <div<?php echo $osj2Dresumes->resume_title->ViewAttributes() ?>><?php echo $osj2Dresumes->resume_title->ViewValue ?></div>
- </td>
- </tr>
- <?php
- }
- $rs->MoveNext();
- }
- ?>
- </table>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <table>
- <tr><td><span class="phpmaker">
- <?php if ($Security->CanAdd()) { ?>
- <a href="osj-osj2dresumesadd.php">Add</a>
- <?php } ?>
- <?php if ($nTotalRecs > 0) { ?>
- <?php if ($Security->CanDelete()) { ?>
- <a href="" onClick="if (!ew_Selected(document.fosj2Dresumeslist)) alert('No records selected'); else {document.fosj2Dresumeslist.action='osj-osj2dresumesdelete.php';document.fosj2Dresumeslist.encoding='application/x-www-form-urlencoded';document.fosj2Dresumeslist.submit();};return false;">Delete Selected Records</a>
- <?php } ?>
- <?php } ?>
- </span></td></tr>
- </table>
- <?php } ?>
- <?php } ?>
- </form>
- <?php
-
- // Close recordset and connection
- if ($rs) $rs->Close();
- ?>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <form action="osj-osj2dresumeslist.php" name="ewpagerform" id="ewpagerform">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td nowrap>
- <span class="phpmaker">
- <?php if (!isset($Pager)) $Pager = new cNumericPager($nStartRec, $nDisplayRecs, $nTotalRecs, $nRecRange) ?>
- <?php if ($Pager->RecordCount > 0) { ?>
- <?php if ($Pager->FirstButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->FirstButton->Start ?>"><b>First</b></a>
- <?php } ?>
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->PrevButton->Start ?>"><b>Previous</b></a>
- <?php } ?>
- <?php foreach ($Pager->Items as $PagerItem) { ?>
- <?php if ($PagerItem->Enabled) { ?><a href="osj-osj2dresumeslist.php?start=<?php echo $PagerItem->Start ?>"><?php } ?><b><?php echo $PagerItem->Text ?></b><?php if ($PagerItem->Enabled) { ?></a><?php } ?>
- <?php } ?>
- <?php if ($Pager->NextButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->NextButton->Start ?>"><b>Next</b></a>
- <?php } ?>
- <?php if ($Pager->LastButton->Enabled) { ?>
- <a href="osj-osj2dresumeslist.php?start=<?php echo $Pager->LastButton->Start ?>"><b>Last</b></a>
- <?php } ?>
- <?php if ($Pager->ButtonCount > 0) { ?><br><?php } ?>
- Records <?php echo $Pager->FromIndex ?> to <?php echo $Pager->ToIndex ?> of <?php echo $Pager->RecordCount ?>
- <?php } else { ?>
- <?php if ($Security->CanList()) { ?>
- <?php if ($sSrchWhere == "0=101") { ?>
- Please enter search criteria
- <?php } else { ?>
- No records found
- <?php } ?>
- <?php } else { ?>
- You do not have the right permission to view the page
- <?php } ?>
- <?php } ?>
- </span>
- </td>
- <?php if ($nTotalRecs > 0) { ?>
- <td nowrap> </td>
- <td align="right" valign="top" nowrap><span class="phpmaker">Records Per Page
- <select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onChange="this.form.submit();" class="phpmaker">
- <option value="10"<?php if ($nDisplayRecs == 10) echo " selected" ?>>10</option>
- <option value="20"<?php if ($nDisplayRecs == 20) echo " selected" ?>>20</option>
- <option value="50"<?php if ($nDisplayRecs == 50) echo " selected" ?>>50</option>
- </select>
- </span></td>
- <?php } ?>
- </tr>
- </table>
- </form>
- <?php } ?>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <?php } ?>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <script language="JavaScript" type="text/javascript">
- <!--
-
- // Write your table-specific startup script here
- // document.write("page loaded");
- //-->
-
- </script>
- <?php } ?>
- <?php include "osj-footer.php" ?>
- <?php
-
- // If control is passed here, simply terminate the page without redirect
- Page_Terminate();
-
- // -----------------------------------------------------------------
- // Subroutine Page_Terminate
- // - called when exit page
- // - clean up connection and objects
- // - if url specified, redirect to url, otherwise end response
- function Page_Terminate($url = "") {
- global $conn;
-
- // Page unload event, used in current page
- Page_Unload();
-
- // Global page unloaded event (in userfn*.php)
- Page_Unloaded();
-
- // Close Connection
- $conn->Close();
-
- // Go to url if specified
- if ($url <> "") {
- ob_end_clean();
- header("Location: $url");
- }
- exit();
- }
- ?>
- <?php
-
- // Set up number of records displayed per page
- function SetUpDisplayRecs() {
- global $nDisplayRecs, $nStartRec, $osj2Dresumes;
- $sWrk = @$_GET[EW_TABLE_REC_PER_PAGE];
- if ($sWrk <> "") {
- if (is_numeric($sWrk)) {
- $nDisplayRecs = intval($sWrk);
- } else {
- if (strtolower($sWrk) == "all") { // Display all records
- $nDisplayRecs = -1;
- } else {
- $nDisplayRecs = 10; // Non-numeric, load default
- }
- }
- $osj2Dresumes->setRecordsPerPage($nDisplayRecs); // Save to Session
-
- // Reset start position
- $nStartRec = 1;
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- } else {
- if ($osj2Dresumes->getRecordsPerPage() <> "") {
- $nDisplayRecs = $osj2Dresumes->getRecordsPerPage(); // Restore from Session
- } else {
- $nDisplayRecs = 10; // Load default
- }
- }
- }
-
- // Return Advanced Search Where based on QueryString parameters
- function AdvancedSearchWhere() {
- global $Security, $osj2Dresumes;
- $sWhere = "";
- if (!$Security->CanSearch()) return "";
-
- // Field resume_creation_date
- BuildSearchSql($sWhere, $osj2Dresumes->resume_creation_date, ew_UnFormatDateTime(@$_GET["x_resume_creation_date"],10), @$_GET["z_resume_creation_date"], @$_GET["v_resume_creation_date"], ew_UnFormatDateTime(@$_GET["y_resume_creation_date"],10), @$_GET["w_resume_creation_date"]);
-
- // Field resume_edit_date
- BuildSearchSql($sWhere, $osj2Dresumes->resume_edit_date, ew_UnFormatDateTime(@$_GET["x_resume_edit_date"],10), @$_GET["z_resume_edit_date"], @$_GET["v_resume_edit_date"], ew_UnFormatDateTime(@$_GET["y_resume_edit_date"],10), @$_GET["w_resume_edit_date"]);
-
- // Field resume_text
- BuildSearchSql($sWhere, $osj2Dresumes->resume_text, @$_GET["x_resume_text"], @$_GET["z_resume_text"], @$_GET["v_resume_text"], @$_GET["y_resume_text"], @$_GET["w_resume_text"]);
-
- // Field resume_title
- BuildSearchSql($sWhere, $osj2Dresumes->resume_title, @$_GET["x_resume_title"], @$_GET["z_resume_title"], @$_GET["v_resume_title"], @$_GET["y_resume_title"], @$_GET["w_resume_title"]);
-
- //AdvancedSearchWhere = sWhere
- // Set up search parm
-
- if ($sWhere <> "") {
-
- // Field resume_creation_date
- SetSearchParm($osj2Dresumes->resume_creation_date, ew_UnFormatDateTime(@$_GET["x_resume_creation_date"],10), @$_GET["z_resume_creation_date"], @$_GET["v_resume_creation_date"], ew_UnFormatDateTime(@$_GET["y_resume_creation_date"],10), @$_GET["w_resume_creation_date"]);
-
- // Field resume_edit_date
- SetSearchParm($osj2Dresumes->resume_edit_date, ew_UnFormatDateTime(@$_GET["x_resume_edit_date"],10), @$_GET["z_resume_edit_date"], @$_GET["v_resume_edit_date"], ew_UnFormatDateTime(@$_GET["y_resume_edit_date"],10), @$_GET["w_resume_edit_date"]);
-
- // Field resume_text
- SetSearchParm($osj2Dresumes->resume_text, @$_GET["x_resume_text"], @$_GET["z_resume_text"], @$_GET["v_resume_text"], @$_GET["y_resume_text"], @$_GET["w_resume_text"]);
-
- // Field resume_title
- SetSearchParm($osj2Dresumes->resume_title, @$_GET["x_resume_title"], @$_GET["z_resume_title"], @$_GET["v_resume_title"], @$_GET["y_resume_title"], @$_GET["w_resume_title"]);
- }
- return $sWhere;
- }
-
- // Build search sql
- function BuildSearchSql(&$Where, &$Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2) {
- $sWrk = "";
- $FldParm = substr($Fld->FldVar, 2);
- $FldVal = ew_StripSlashes($FldVal);
- if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
- $FldVal2 = ew_StripSlashes($FldVal2);
- if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
- $FldOpr = strtoupper(trim($FldOpr));
- if ($FldOpr == "") $FldOpr = "=";
- $FldOpr2 = strtoupper(trim($FldOpr2));
- if ($FldOpr2 == "") $FldOpr2 = "=";
- if ($Fld->FldDataType == EW_DATATYPE_BOOLEAN) {
- if ($FldVal <> "") $FldVal = ($FldVal == "1") ? $Fld->TrueValue : $Fld->FalseValue;
- if ($FldVal2 <> "") $FldVal2 = ($FldVal2 == "1") ? $Fld->TrueValue : $Fld->FalseValue;
- } elseif ($Fld->FldDataType == EW_DATATYPE_DATE) {
- if ($FldVal <> "") $FldVal = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat);
- if ($FldVal2 <> "") $FldVal2 = ew_UnFormatDateTime($FldVal2, $Fld->FldDateTimeFormat);
- }
- if ($FldOpr == "BETWEEN") {
- $IsValidValue = (($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
- ($Fld->FldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal) && is_numeric($FldVal2)));
- if ($FldVal <> "" && $FldVal2 <> "" && $IsValidValue) {
- $sWrk = $Fld->FldExpression . " BETWEEN " . ew_QuotedValue($FldVal, $Fld->FldDataType) .
- " AND " . ew_QuotedValue($FldVal2, $Fld->FldDataType);
- }
- } elseif ($FldOpr == "IS NULL" || $FldOpr == "IS NOT NULL") {
- $sWrk = $Fld->FldExpression . " " . $FldOpr;
- } else {
- $IsValidValue = (($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
- ($Fld->FldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal)));
- if ($FldVal <> "" && $IsValidValue && ew_IsValidOpr($FldOpr, $Fld->FldDataType)) {
- $sWrk = $Fld->FldExpression . SearchString($FldOpr, $FldVal, $Fld->FldDataType);
- }
- $IsValidValue = (($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
- ($Fld->FldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal2)));
- if ($FldVal2 <> "" && $IsValidValue && ew_IsValidOpr($FldOpr2, $Fld->FldDataType)) {
- if ($sWrk <> "") {
- $sWrk .= " " . (($FldCond=="OR")?"OR":"AND") . " ";
- }
- $sWrk .= $Fld->FldExpression . SearchString($FldOpr2, $FldVal2, $Fld->FldDataType);
- }
- }
- if ($sWrk <> "") {
- if ($Where <> "") $Where .= " AND ";
- $Where .= "(" . $sWrk . ")";
- }
- }
-
- // Return search string
- function SearchString($FldOpr, $FldVal, $FldType) {
- if ($FldOpr == "LIKE" || $FldOpr == "NOT LIKE") {
- return " " . $FldOpr . " " . ew_QuotedValue("%" . $FldVal . "%", $FldType);
- } elseif ($FldOpr == "STARTS WITH") {
- return " LIKE " . ew_QuotedValue($FldVal . "%", $FldType);
- } else {
- return " " . $FldOpr . " " . ew_QuotedValue($FldVal, $FldType);
- }
- }
-
- // Set search parm
- function SetSearchParm($Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2) {
- global $osj2Dresumes;
- $FldParm = substr($Fld->FldVar, 2);
- $FldVal = ew_StripSlashes($FldVal);
- if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
- $FldVal2 = ew_StripSlashes($FldVal2);
- if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
- $osj2Dresumes->setAdvancedSearch("x_" . $FldParm, $FldVal);
- $osj2Dresumes->setAdvancedSearch("z_" . $FldParm, $FldOpr);
- $osj2Dresumes->setAdvancedSearch("v_" . $FldParm, $FldCond);
- $osj2Dresumes->setAdvancedSearch("y_" . $FldParm, $FldVal2);
- $osj2Dresumes->setAdvancedSearch("w_" . $FldParm, $FldOpr2);
- }
-
- // Return Basic Search sql
- function BasicSearchSQL($Keyword) {
- $sKeyword = ew_AdjustSql($Keyword);
- $sql = "";
- $sql .= "`resume_text` LIKE '%" . $sKeyword . "%' OR ";
- $sql .= "`resume_title` LIKE '%" . $sKeyword . "%' OR ";
- if (substr($sql, -4) == " OR ") $sql = substr($sql, 0, strlen($sql)-4);
- return $sql;
- }
-
- // Return Basic Search Where based on search keyword and type
- function BasicSearchWhere() {
- global $Security, $osj2Dresumes;
- $sSearchStr = "";
- if (!$Security->CanSearch()) return "";
- $sSearchKeyword = ew_StripSlashes(@$_GET[EW_TABLE_BASIC_SEARCH]);
- $sSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];
- if ($sSearchKeyword <> "") {
- $sSearch = trim($sSearchKeyword);
- if ($sSearchType <> "") {
- while (strpos($sSearch, " ") !== FALSE)
- $sSearch = str_replace(" ", " ", $sSearch);
- $arKeyword = explode(" ", trim($sSearch));
- foreach ($arKeyword as $sKeyword) {
- if ($sSearchStr <> "") $sSearchStr .= " " . $sSearchType . " ";
- $sSearchStr .= "(" . BasicSearchSQL($sKeyword) . ")";
- }
- } else {
- $sSearchStr = BasicSearchSQL($sSearch);
- }
- }
- if ($sSearchKeyword <> "") {
- $osj2Dresumes->setBasicSearchKeyword($sSearchKeyword);
- $osj2Dresumes->setBasicSearchType($sSearchType);
- }
- return $sSearchStr;
- }
-
- // Clear all search parameters
- function ResetSearchParms() {
-
- // Clear search where
- global $osj2Dresumes;
- $sSrchWhere = "";
- $osj2Dresumes->setSearchWhere($sSrchWhere);
-
- // Clear basic search parameters
- ResetBasicSearchParms();
-
- // Clear advanced search parameters
- ResetAdvancedSearchParms();
- }
-
- // Clear all basic search parameters
- function ResetBasicSearchParms() {
-
- // Clear basic search parameters
- global $osj2Dresumes;
- $osj2Dresumes->setBasicSearchKeyword("");
- $osj2Dresumes->setBasicSearchType("");
- }
-
- // Clear all advanced search parameters
- function ResetAdvancedSearchParms() {
-
- // Clear advanced search parameters
- global $osj2Dresumes;
- $osj2Dresumes->setAdvancedSearch("x_resume_creation_date", "");
- $osj2Dresumes->setAdvancedSearch("z_resume_creation_date", "");
- $osj2Dresumes->setAdvancedSearch("x_resume_edit_date", "");
- $osj2Dresumes->setAdvancedSearch("z_resume_edit_date", "");
- $osj2Dresumes->setAdvancedSearch("x_resume_text", "");
- $osj2Dresumes->setAdvancedSearch("x_resume_title", "");
- }
-
- // Restore all search parameters
- function RestoreSearchParms() {
- global $sSrchWhere, $osj2Dresumes;
- $sSrchWhere = $osj2Dresumes->getSearchWhere();
-
- // Restore advanced search settings
- RestoreAdvancedSearchParms();
- }
-
- // Restore all advanced search parameters
- function RestoreAdvancedSearchParms() {
-
- // Restore advanced search parms
- global $osj2Dresumes;
- $osj2Dresumes->resume_creation_date->AdvancedSearch->SearchValue = $osj2Dresumes->getAdvancedSearch("x_resume_creation_date");
- $osj2Dresumes->resume_creation_date->AdvancedSearch->SearchOperator = $osj2Dresumes->getAdvancedSearch("z_resume_creation_date");
- $osj2Dresumes->resume_edit_date->AdvancedSearch->SearchValue = $osj2Dresumes->getAdvancedSearch("x_resume_edit_date");
- $osj2Dresumes->resume_edit_date->AdvancedSearch->SearchOperator = $osj2Dresumes->getAdvancedSearch("z_resume_edit_date");
- $osj2Dresumes->resume_text->AdvancedSearch->SearchValue = $osj2Dresumes->getAdvancedSearch("x_resume_text");
- $osj2Dresumes->resume_title->AdvancedSearch->SearchValue = $osj2Dresumes->getAdvancedSearch("x_resume_title");
- }
-
- // Set up Sort parameters based on Sort Links clicked
- function SetUpSortOrder() {
- global $osj2Dresumes;
-
- // Check for an Order parameter
- if (@$_GET["order"] <> "") {
- $osj2Dresumes->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
- $osj2Dresumes->CurrentOrderType = @$_GET["ordertype"];
-
- // Field resume_permissions_id
- $osj2Dresumes->UpdateSort($osj2Dresumes->resume_permissions_id);
-
- // Field resume_edit_date
- $osj2Dresumes->UpdateSort($osj2Dresumes->resume_edit_date);
-
- // Field resume_title
- $osj2Dresumes->UpdateSort($osj2Dresumes->resume_title);
- $osj2Dresumes->setStartRecordNumber(1); // Reset start position
- }
- $sOrderBy = $osj2Dresumes->getSessionOrderBy(); // Get order by from Session
- if ($sOrderBy == "") {
- if ($osj2Dresumes->SqlOrderBy() <> "") {
- $sOrderBy = $osj2Dresumes->SqlOrderBy();
- $osj2Dresumes->setSessionOrderBy($sOrderBy);
- }
- }
- }
-
- // Reset command based on querystring parameter cmd=
- // - RESET: reset search parameters
- // - RESETALL: reset search & master/detail parameters
- // - RESETSORT: reset sort parameters
- function ResetCmd() {
- global $sDbMasterFilter, $sDbDetailFilter, $nStartRec, $sOrderBy;
- global $osj2Dresumes;
-
- // Get reset cmd
- if (@$_GET["cmd"] <> "") {
- $sCmd = $_GET["cmd"];
-
- // Reset search criteria
- if (strtolower($sCmd) == "reset" || strtolower($sCmd) == "resetall") {
- ResetSearchParms();
- }
-
- // Reset Sort Criteria
- if (strtolower($sCmd) == "resetsort") {
- $sOrderBy = "";
- $osj2Dresumes->setSessionOrderBy($sOrderBy);
- $osj2Dresumes->resume_permissions_id->setSort("");
- $osj2Dresumes->resume_edit_date->setSort("");
- $osj2Dresumes->resume_title->setSort("");
- }
-
- // Reset start position
- $nStartRec = 1;
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- }
- }
- ?>
- <?php
-
- // Set up Starting Record parameters based on Pager Navigation
- function SetUpStartRec() {
- global $nDisplayRecs, $nStartRec, $nTotalRecs, $nPageNo, $osj2Dresumes;
- if ($nDisplayRecs == 0) return;
-
- // Check for a START parameter
- if (@$_GET[EW_TABLE_START_REC] <> "") {
- $nStartRec = $_GET[EW_TABLE_START_REC];
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- } elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
- $nPageNo = $_GET[EW_TABLE_PAGE_NO];
- if (is_numeric($nPageNo)) {
- $nStartRec = ($nPageNo-1)*$nDisplayRecs+1;
- if ($nStartRec <= 0) {
- $nStartRec = 1;
- } elseif ($nStartRec >= intval(($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1) {
- $nStartRec = intval(($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1;
- }
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- } else {
- $nStartRec = $osj2Dresumes->getStartRecordNumber();
- }
- } else {
- $nStartRec = $osj2Dresumes->getStartRecordNumber();
- }
-
- // Check if correct start record counter
- if (!is_numeric($nStartRec) || $nStartRec == "") { // Avoid invalid start record counter
- $nStartRec = 1; // Reset start record counter
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- } elseif (intval($nStartRec) > intval($nTotalRecs)) { // Avoid starting record > total records
- $nStartRec = intval(($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1; // Point to last page first record
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- } elseif (($nStartRec-1) % $nDisplayRecs <> 0) {
- $nStartRec = intval(($nStartRec-1)/$nDisplayRecs)*$nDisplayRecs+1; // Point to page boundary
- $osj2Dresumes->setStartRecordNumber($nStartRec);
- }
- }
- ?>
- <?php
-
- // Load recordset
- function LoadRecordset($offset = -1, $rowcnt = -1) {
- global $conn, $osj2Dresumes;
-
- // Call Recordset Selecting event
- $osj2Dresumes->Recordset_Selecting($osj2Dresumes->CurrentFilter);
-
- // Load list page sql
- $sSql = $osj2Dresumes->SelectSQL();
- if ($offset > -1 && $rowcnt > -1) $sSql .= " LIMIT $offset, $rowcnt";
-
- // Load recordset
- $conn->raiseErrorFn = 'ew_ErrorFn';
- $rs = $conn->Execute($sSql);
- $conn->raiseErrorFn = '';
-
- // Call Recordset Selected event
- $osj2Dresumes->Recordset_Selected($rs);
- return $rs;
- }
- ?>
- <?php
-
- // Load row based on key values
- function LoadRow() {
- global $conn, $Security, $osj2Dresumes;
- $sFilter = $osj2Dresumes->SqlKeyFilter();
- if (!is_numeric($osj2Dresumes->resume_id->CurrentValue)) {
- return FALSE; // Invalid key, exit
- }
- $sFilter = str_replace("@resume_id@", ew_AdjustSql($osj2Dresumes->resume_id->CurrentValue), $sFilter); // Replace key value
- if ($Security->CurrentUserID() <> "" && !$Security->IsAdmin()) { // Non system admin
- $sFilter = $osj2Dresumes->AddUserIDFilter($sFilter, $Security->CurrentUserID()); // Add User ID filter
- }
-
- // Call Row Selecting event
- $osj2Dresumes->Row_Selecting($sFilter);
-
- // Load sql based on filter
- $osj2Dresumes->CurrentFilter = $sFilter;
- $sSql = $osj2Dresumes->SQL();
- if ($rs = $conn->Execute($sSql)) {
- if ($rs->EOF) {
- $LoadRow = FALSE;
- } else {
- $LoadRow = TRUE;
- $rs->MoveFirst();
- LoadRowValues($rs); // Load row values
-
- // Call Row Selected event
- $osj2Dresumes->Row_Selected($rs);
- }
- $rs->Close();
- } else {
- $LoadRow = FALSE;
- }
- return $LoadRow;
- }
-
- // Load row values from recordset
- function LoadRowValues(&$rs) {
- global $osj2Dresumes;
- $osj2Dresumes->resume_id->setDbValue($rs->fields('resume_id'));
- $osj2Dresumes->user_id->setDbValue($rs->fields('user_id'));
- $osj2Dresumes->resume_permissions_id->setDbValue($rs->fields('resume_permissions_id'));
- $osj2Dresumes->resume_creation_date->setDbValue($rs->fields('resume_creation_date'));
- $osj2Dresumes->resume_edit_date->setDbValue($rs->fields('resume_edit_date'));
- $osj2Dresumes->resume_text->setDbValue($rs->fields('resume_text'));
- $osj2Dresumes->resume_file->Upload->DbValue = $rs->fields('resume_file');
- $osj2Dresumes->resume_categories->setDbValue($rs->fields('resume_categories'));
- $osj2Dresumes->resume_title->setDbValue($rs->fields('resume_title'));
- }
- ?>
- <?php
-
- // Render row values based on field settings
- function RenderRow() {
- global $conn, $Security, $osj2Dresumes;
-
- // Call Row Rendering event
- $osj2Dresumes->Row_Rendering();
-
- // Common render codes for all row types
- // resume_permissions_id
-
- $osj2Dresumes->resume_permissions_id->CellCssStyle = "";
- $osj2Dresumes->resume_permissions_id->CellCssClass = "";
-
- // resume_edit_date
- $osj2Dresumes->resume_edit_date->CellCssStyle = "";
- $osj2Dresumes->resume_edit_date->CellCssClass = "";
-
- // resume_title
- $osj2Dresumes->resume_title->CellCssStyle = "";
- $osj2Dresumes->resume_title->CellCssClass = "";
- if ($osj2Dresumes->RowType == EW_ROWTYPE_VIEW) { // View row
-
- // resume_permissions_id
- if (!is_null($osj2Dresumes->resume_permissions_id->CurrentValue)) {
- switch ($osj2Dresumes->resume_permissions_id->CurrentValue) {
- case "0":
- $osj2Dresumes->resume_permissions_id->ViewValue = "Inactive";
- break;
- case "1":
- $osj2Dresumes->resume_permissions_id->ViewValue = "Active";
- break;
- default:
- $osj2Dresumes->resume_permissions_id->ViewValue = $osj2Dresumes->resume_permissions_id->CurrentValue;
- }
- } else {
- $osj2Dresumes->resume_permissions_id->ViewValue = NULL;
- }
- $osj2Dresumes->resume_permissions_id->CssStyle = "";
- $osj2Dresumes->resume_permissions_id->CssClass = "";
- $osj2Dresumes->resume_permissions_id->ViewCustomAttributes = "";
-
- // resume_edit_date
- $osj2Dresumes->resume_edit_date->ViewValue = $osj2Dresumes->resume_edit_date->CurrentValue;
- $osj2Dresumes->resume_edit_date->ViewValue = ew_FormatDateTime($osj2Dresumes->resume_edit_date->ViewValue, 10);
- $osj2Dresumes->resume_edit_date->CssStyle = "";
- $osj2Dresumes->resume_edit_date->CssClass = "";
- $osj2Dresumes->resume_edit_date->ViewCustomAttributes = "";
-
- // resume_title
- $osj2Dresumes->resume_title->ViewValue = $osj2Dresumes->resume_title->CurrentValue;
- $osj2Dresumes->resume_title->ViewValue = ew_Highlight($osj2Dresumes->resume_title->ViewValue, $osj2Dresumes->getBasicSearchKeyword(), $osj2Dresumes->getBasicSearchType(), $osj2Dresumes->getAdvancedSearch("x_resume_title"));
- $osj2Dresumes->resume_title->CssStyle = "";
- $osj2Dresumes->resume_title->CssClass = "";
- $osj2Dresumes->resume_title->ViewCustomAttributes = "";
-
- // resume_permissions_id
- $osj2Dresumes->resume_permissions_id->HrefValue = "";
-
- // resume_edit_date
- $osj2Dresumes->resume_edit_date->HrefValue = "";
-
- // resume_title
- $osj2Dresumes->resume_title->HrefValue = "";
- } elseif ($osj2Dresumes->RowType == EW_ROWTYPE_ADD) { // Add row
- } elseif ($osj2Dresumes->RowType == EW_ROWTYPE_EDIT) { // Edit row
- } elseif ($osj2Dresumes->RowType == EW_ROWTYPE_SEARCH) { // Search row
- }
-
- // Call Row Rendered event
- $osj2Dresumes->Row_Rendered();
- }
- ?>
- <?php
-
- // Load advanced search
- function LoadAdvancedSearch() {
- global $osj2Dresumes;
- }
- ?>
- <?php
-
- // Export data in Xml or Csv format
- function ExportData() {
- global $nTotalRecs, $nStartRec, $nStopRec, $nTotalRecs, $nDisplayRecs, $osj2Dresumes;
- $sCsvStr = "";
- $rs = LoadRecordset();
- $nTotalRecs = $rs->RecordCount();
- $nStartRec = 1;
-
- // Export all
- if (defined("EW_EXPORT_ALL")) {
- $nStopRec = $nTotalRecs;
- } else { // Export 1 page only
- SetUpStartRec(); // Set Up Start Record Position
-
- // Set the last record to display
- if ($nDisplayRecs < 0) {
- $nStopRec = $nTotalRecs;
- } else {
- $nStopRec = $nStartRec + $nDisplayRecs - 1;
- }
- }
- if ($osj2Dresumes->Export == "xml") {
- $XmlDoc = new cXMLDocument();
- }
- if ($osj2Dresumes->Export == "csv") {
- $sCsvStr .= "resume_permissions_id" . ",";
- $sCsvStr .= "resume_edit_date" . ",";
- $sCsvStr .= "resume_title" . ",";
- $sCsvStr = substr($sCsvStr, 0, strlen($sCsvStr)-1); // Remove last comma
- $sCsvStr .= "\n";
- }
-
- // Move to first record directly for performance reason
- $nRecCount = $nStartRec - 1;
- if (!$rs->EOF) {
- $rs->MoveFirst();
- $rs->Move($nStartRec - 1);
- }
- while (!$rs->EOF && $nRecCount < $nStopRec) {
- $nRecCount++;
- if (intval($nRecCount) >= intval($nStartRec)) {
- LoadRowValues($rs);
- if ($osj2Dresumes->Export == "xml") {
- $XmlDoc->BeginRow();
- $XmlDoc->AddField('resume_permissions_id', $osj2Dresumes->resume_permissions_id->CurrentValue);
- $XmlDoc->AddField('resume_edit_date', $osj2Dresumes->resume_edit_date->CurrentValue);
- $XmlDoc->AddField('resume_title', $osj2Dresumes->resume_title->CurrentValue);
- $XmlDoc->EndRow();
- }
- if ($osj2Dresumes->Export == "csv") {
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_permissions_id->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_edit_date->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_title->CurrentValue)) . '",';
- $sCsvStr = substr($sCsvStr, 0, strlen($sCsvStr)-1); // Remove last comma
- $sCsvStr .= "\n";
- }
- }
- $rs->MoveNext();
- }
-
- // Close recordset
- $rs->Close();
- if ($osj2Dresumes->Export == "xml") {
- header("Content-Type: text/xml");
- echo $XmlDoc->XML();
- }
- if ($osj2Dresumes->Export == "csv") {
- echo $sCsvStr;
- }
- }
- ?>
- <?php
-
- // Show link optionally based on User ID
- function ShowOptionLink() {
- global $Security, $osj2Dresumes;
- if ($Security->IsLoggedIn()) {
- if (!$Security->IsAdmin()) {
- return $Security->IsValidUserID($osj2Dresumes->user_id->CurrentValue);
- }
- }
- return TRUE;
- }
- ?>
- <?php
-
- // Write Audit Trail start/end for grid update
- function WriteAuditTrailDummy($typ) {
- $table = 'osj-resumes';
-
- // Write Audit Trail
- $filePfx = "log";
- $curDate = date("Y/m/d");
- $curTime = date("H:i:s");
- $id = ew_ScriptName();
- $user = CurrentUserID();
- $action = $typ;
- ew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $user, $action, $table, "", "", "", "");
- }
- ?>
- <?php
-
- // Page Load event
- function Page_Load() {
-
- //echo "Page Load";
- }
-
- // Page Unload event
- function Page_Unload() {
-
- //echo "Page Unload";
- }
- ?>