/osj-osj2dresumesview.php
PHP | 777 lines | 620 code | 75 blank | 82 comment | 135 complexity | f785a1a78e6f1067a85b096c923bbf16 MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0
- <?php
- define("EW_PAGE_ID", "view", 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->CanView()) {
- $Security->SaveLastUrl();
- Page_Terminate("osj-osj2dresumeslist.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 (@$_GET["resume_id"] <> "") {
- if ($sExportFile <> "") $sExportFile .= "_";
- $sExportFile .= ew_StripSlashes($_GET["resume_id"]);
- }
- 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 = 1;
- $nRecRange = 10;
-
- // Load current record
- $bLoadCurrentRecord = FALSE;
- if (@$_GET["resume_id"] <> "") {
- $osj2Dresumes->resume_id->setQueryStringValue($_GET["resume_id"]);
- } else {
- $bLoadCurrentRecord = TRUE;
- }
-
- // Get action
- if (@$_POST["a_view"] <> "") {
- $osj2Dresumes->CurrentAction = $_POST["a_view"];
- } else {
- $osj2Dresumes->CurrentAction = "I"; // Display form
- }
- switch ($osj2Dresumes->CurrentAction) {
- case "I": // Get a record to display
- $nStartRec = 1; // Initialize start position
- $rs = LoadRecordset(); // Load records
- $nTotalRecs = $rs->RecordCount(); // Get record count
- if ($nTotalRecs <= 0) { // No record found
- $_SESSION[EW_SESSION_MESSAGE] = "No records found"; // Set no record message
- Page_Terminate("osj-osj2dresumeslist.php"); // Return to list page
- } elseif ($bLoadCurrentRecord) { // Load current record position
- SetUpStartRec(); // Set up start record position
-
- // Point to current record
- if (intval($nStartRec) <= intval($nTotalRecs)) {
- $rs->Move($nStartRec-1);
- }
- } else { // Match key values
- $bMatchRecord = FALSE;
- while (!$rs->EOF) {
- if (strval($osj2Dresumes->resume_id->CurrentValue) == strval($rs->fields('resume_id'))) {
- $bMatchRecord = TRUE;
- break;
- } else {
- $nStartRec++;
- $rs->MoveNext();
- }
- }
- if (!$bMatchRecord) {
- $_SESSION[EW_SESSION_MESSAGE] = "No records found"; // Set no record message
- Page_Terminate("osj-osj2dresumeslist.php"); // Return to list
- } else {
- $osj2Dresumes->setStartRecordNumber($nStartRec); // Save record position
- }
- }
- LoadRowValues($rs); // Load row values
- }
-
- // Export data only
- if ($osj2Dresumes->Export == "xml" || $osj2Dresumes->Export == "csv") {
- ExportData();
- Page_Terminate(); // Terminate response
- }
-
- // Set return url
- $osj2Dresumes->setReturnUrl("osj-osj2dresumesview.php");
-
- // Render row
- $osj2Dresumes->RowType = EW_ROWTYPE_VIEW;
- RenderRow();
- ?>
- <?php include "osj-header.php" ?>
- <script type="text/javascript">
- <!--
- var EW_PAGE_ID = "view"; // Page id
- var EW_SHOW_HIGHLIGHT = "Show highlight";
- var EW_HIDE_HIGHLIGHT = "Hide highlight";
-
- //-->
- </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>
- <p><span class="phpmaker">View TABLE: Resumes
- <?php if ($osj2Dresumes->Export == "") { ?>
- <a href="osj-osj2dresumesview.php?export=html&resume_id=<?php echo urlencode($osj2Dresumes->resume_id->CurrentValue) ?>">Printer Friendly</a>
- <a href="osj-osj2dresumesview.php?export=xml&resume_id=<?php echo urlencode($osj2Dresumes->resume_id->CurrentValue) ?>">Export to XML</a>
- <a href="osj-osj2dresumesview.php?export=csv&resume_id=<?php echo urlencode($osj2Dresumes->resume_id->CurrentValue) ?>">Export to CSV</a>
- <?php } ?>
- <br><br>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <a href="osj-osj2dresumeslist.php">Back to List</a>
- <?php if ($Security->CanAdd()) { ?>
- <?php if (ShowOptionLink()) { ?>
- <a href="osj-osj2dresumesadd.php">Add</a>
- <?php } ?>
- <?php } ?>
- <?php if ($Security->CanEdit()) { ?>
- <?php if (ShowOptionLink()) { ?>
- <a href="<?php echo $osj2Dresumes->EditUrl() ?>">Edit</a>
- <?php } ?>
- <?php } ?>
- <?php if ($Security->CanDelete()) { ?>
- <?php if (ShowOptionLink()) { ?>
- <a href="<?php echo $osj2Dresumes->DeleteUrl() ?>">Delete</a>
- <?php } ?>
- <?php } ?>
- <?php } ?>
- </span>
- </p>
- <?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
- }
- ?>
- <p>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <form action="osj-osj2dresumesview.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-osj2dresumesview.php?start=<?php echo $Pager->FirstButton->Start ?>"><b>First</b></a>
- <?php } ?>
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <a href="osj-osj2dresumesview.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-osj2dresumesview.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-osj2dresumesview.php?start=<?php echo $Pager->NextButton->Start ?>"><b>Next</b></a>
- <?php } ?>
- <?php if ($Pager->LastButton->Enabled) { ?>
- <a href="osj-osj2dresumesview.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>
- </tr>
- </table>
- </form>
- <?php } ?>
- <form>
- <table class="ewTable">
- <tr class="ewTableRow">
- <td class="ewTableHeader">Resume ID</td>
- <td<?php echo $osj2Dresumes->resume_id->CellAttributes() ?>>
- </td>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader">User ID</td>
- <td<?php echo $osj2Dresumes->user_id->CellAttributes() ?>>
- <div<?php echo $osj2Dresumes->user_id->ViewAttributes() ?>><?php echo $osj2Dresumes->user_id->ViewValue ?></div>
- </td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader">Resume Status Level</td>
- <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>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader">Resume Created Date</td>
- <td<?php echo $osj2Dresumes->resume_creation_date->CellAttributes() ?>>
- <div<?php echo $osj2Dresumes->resume_creation_date->ViewAttributes() ?>><?php echo $osj2Dresumes->resume_creation_date->ViewValue ?></div>
- </td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader">Resume Edit Date</td>
- <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>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader">Resume Text</td>
- <td<?php echo $osj2Dresumes->resume_text->CellAttributes() ?>>
- <div<?php echo $osj2Dresumes->resume_text->ViewAttributes() ?>><?php echo $osj2Dresumes->resume_text->ViewValue ?></div>
- </td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader">Resume Attachment</td>
- <td<?php echo $osj2Dresumes->resume_file->CellAttributes() ?>>
- <?php if ($osj2Dresumes->resume_file->HrefValue <> "") { ?>
- <?php if (!is_null($osj2Dresumes->resume_file->Upload->DbValue)) { ?>
- <a href="<?php echo $osj2Dresumes->resume_file->HrefValue ?>" target="_blank"><?php echo $osj2Dresumes->resume_file->ViewValue ?></a>
- <?php } ?>
- <?php } else { ?>
- <?php if (!is_null($osj2Dresumes->resume_file->Upload->DbValue)) { ?>
- <?php echo $osj2Dresumes->resume_file->ViewValue ?>
- <?php } ?>
- <?php } ?>
- </td>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader">Resume Categories</td>
- <td<?php echo $osj2Dresumes->resume_categories->CellAttributes() ?>>
- </td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader">Resume Title</td>
- <td<?php echo $osj2Dresumes->resume_title->CellAttributes() ?>>
- <div<?php echo $osj2Dresumes->resume_title->ViewAttributes() ?>><?php echo $osj2Dresumes->resume_title->ViewValue ?></div>
- </td>
- </tr>
- </table>
- </form>
- <?php if ($osj2Dresumes->Export == "") { ?>
- <form action="osj-osj2dresumesview.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-osj2dresumesview.php?start=<?php echo $Pager->FirstButton->Start ?>"><b>First</b></a>
- <?php } ?>
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <a href="osj-osj2dresumesview.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-osj2dresumesview.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-osj2dresumesview.php?start=<?php echo $Pager->NextButton->Start ?>"><b>Next</b></a>
- <?php } ?>
- <?php if ($Pager->LastButton->Enabled) { ?>
- <a href="osj-osj2dresumesview.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>
- </tr>
- </table>
- </form>
- <?php } ?>
- <p>
- <script language="JavaScript" type="text/javascript">
- <!--
-
- // Write your table-specific startup script here
- // document.write("page loaded");
- //-->
-
- </script>
- <?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
-
- // 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_id
-
- $osj2Dresumes->resume_id->CellCssStyle = "";
- $osj2Dresumes->resume_id->CellCssClass = "";
-
- // user_id
- $osj2Dresumes->user_id->CellCssStyle = "";
- $osj2Dresumes->user_id->CellCssClass = "";
-
- // resume_permissions_id
- $osj2Dresumes->resume_permissions_id->CellCssStyle = "";
- $osj2Dresumes->resume_permissions_id->CellCssClass = "";
-
- // resume_creation_date
- $osj2Dresumes->resume_creation_date->CellCssStyle = "";
- $osj2Dresumes->resume_creation_date->CellCssClass = "";
-
- // resume_edit_date
- $osj2Dresumes->resume_edit_date->CellCssStyle = "";
- $osj2Dresumes->resume_edit_date->CellCssClass = "";
-
- // resume_text
- $osj2Dresumes->resume_text->CellCssStyle = "";
- $osj2Dresumes->resume_text->CellCssClass = "";
-
- // resume_file
- $osj2Dresumes->resume_file->CellCssStyle = "";
- $osj2Dresumes->resume_file->CellCssClass = "";
-
- // resume_categories
- $osj2Dresumes->resume_categories->CellCssStyle = "";
- $osj2Dresumes->resume_categories->CellCssClass = "";
-
- // resume_title
- $osj2Dresumes->resume_title->CellCssStyle = "";
- $osj2Dresumes->resume_title->CellCssClass = "";
- if ($osj2Dresumes->RowType == EW_ROWTYPE_VIEW) { // View row
-
- // resume_id
- $osj2Dresumes->resume_id->CssStyle = "";
- $osj2Dresumes->resume_id->CssClass = "";
- $osj2Dresumes->resume_id->ViewCustomAttributes = "";
-
- // user_id
- $osj2Dresumes->user_id->ViewValue = $osj2Dresumes->user_id->CurrentValue;
- $osj2Dresumes->user_id->CssStyle = "";
- $osj2Dresumes->user_id->CssClass = "";
- $osj2Dresumes->user_id->ViewCustomAttributes = "";
-
- // 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_creation_date
- $osj2Dresumes->resume_creation_date->ViewValue = $osj2Dresumes->resume_creation_date->CurrentValue;
- $osj2Dresumes->resume_creation_date->ViewValue = ew_FormatDateTime($osj2Dresumes->resume_creation_date->ViewValue, 10);
- $osj2Dresumes->resume_creation_date->CssStyle = "";
- $osj2Dresumes->resume_creation_date->CssClass = "";
- $osj2Dresumes->resume_creation_date->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_text
- $osj2Dresumes->resume_text->ViewValue = $osj2Dresumes->resume_text->CurrentValue;
- if (!is_null($osj2Dresumes->resume_text->ViewValue)) $osj2Dresumes->resume_text->ViewValue = str_replace("\n", "<br>", $osj2Dresumes->resume_text->ViewValue);
- $osj2Dresumes->resume_text->CssStyle = "";
- $osj2Dresumes->resume_text->CssClass = "";
- $osj2Dresumes->resume_text->ViewCustomAttributes = "";
-
- // resume_file
- if (!is_null($osj2Dresumes->resume_file->Upload->DbValue)) {
- $osj2Dresumes->resume_file->ViewValue = "Resume Attachment";
- } else {
- $osj2Dresumes->resume_file->ViewValue = "";
- }
- $osj2Dresumes->resume_file->CssStyle = "";
- $osj2Dresumes->resume_file->CssClass = "";
- $osj2Dresumes->resume_file->ViewCustomAttributes = "";
-
- // resume_categories
- $osj2Dresumes->resume_categories->CssStyle = "";
- $osj2Dresumes->resume_categories->CssClass = "";
- $osj2Dresumes->resume_categories->ViewCustomAttributes = "";
-
- // resume_title
- $osj2Dresumes->resume_title->ViewValue = $osj2Dresumes->resume_title->CurrentValue;
- $osj2Dresumes->resume_title->CssStyle = "";
- $osj2Dresumes->resume_title->CssClass = "";
- $osj2Dresumes->resume_title->ViewCustomAttributes = "";
-
- // resume_id
- $osj2Dresumes->resume_id->HrefValue = "";
-
- // user_id
- $osj2Dresumes->user_id->HrefValue = "";
-
- // resume_permissions_id
- $osj2Dresumes->resume_permissions_id->HrefValue = "";
-
- // resume_creation_date
- $osj2Dresumes->resume_creation_date->HrefValue = "";
-
- // resume_edit_date
- $osj2Dresumes->resume_edit_date->HrefValue = "";
-
- // resume_text
- $osj2Dresumes->resume_text->HrefValue = "";
-
- // resume_file
- if (!is_null($osj2Dresumes->resume_file->Upload->DbValue)) {
- $osj2Dresumes->resume_file->HrefValue = "osj-osj2dresumes_resume_file_bv.php?resume_id=" . $osj2Dresumes->resume_id->CurrentValue;
- if ($osj2Dresumes->Export <> "") $osj2Dresumes->resume_file->HrefValue = ew_ConvertFullUrl($osj2Dresumes->resume_file->HrefValue);
- } else {
- $osj2Dresumes->resume_file->HrefValue = "";
- }
-
- // resume_categories
- $osj2Dresumes->resume_categories->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
-
- // Export data in Xml or Csv format
- function ExportData() {
- global $nTotalRecs, $nStartRec, $nStopRec, $nTotalRecs, $nDisplayRecs, $osj2Dresumes;
- $sCsvStr = "";
- $rs = LoadRecordset();
- $nTotalRecs = $rs->RecordCount();
- $nStartRec = 1;
- 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_id" . ",";
- $sCsvStr .= "user_id" . ",";
- $sCsvStr .= "resume_permissions_id" . ",";
- $sCsvStr .= "resume_creation_date" . ",";
- $sCsvStr .= "resume_edit_date" . ",";
- $sCsvStr .= "resume_text" . ",";
- $sCsvStr .= "resume_categories" . ",";
- $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_id', $osj2Dresumes->resume_id->CurrentValue);
- $XmlDoc->AddField('user_id', $osj2Dresumes->user_id->CurrentValue);
- $XmlDoc->AddField('resume_permissions_id', $osj2Dresumes->resume_permissions_id->CurrentValue);
- $XmlDoc->AddField('resume_creation_date', $osj2Dresumes->resume_creation_date->CurrentValue);
- $XmlDoc->AddField('resume_edit_date', $osj2Dresumes->resume_edit_date->CurrentValue);
- $XmlDoc->AddField('resume_text', $osj2Dresumes->resume_text->CurrentValue);
- $XmlDoc->AddField('resume_categories', $osj2Dresumes->resume_categories->CurrentValue);
- $XmlDoc->AddField('resume_title', $osj2Dresumes->resume_title->CurrentValue);
- $XmlDoc->EndRow();
- }
- if ($osj2Dresumes->Export == "csv") {
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_id->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->user_id->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_permissions_id->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_creation_date->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_edit_date->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_text->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Dresumes->resume_categories->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
-
- // 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
-
- // Page Load event
- function Page_Load() {
-
- //echo "Page Load";
- }
-
- // Page Unload event
- function Page_Unload() {
-
- //echo "Page Unload";
- }
- ?>