/osj-osj2duser_levellist.php
PHP | 1178 lines | 957 code | 107 blank | 114 comment | 322 complexity | 81839b44f6b8a82b9e76ca28d5d34f0f 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-user_level', 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-osj2duser_levelinfo.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-user_level');
- if (!$Security->CanAdmin()) {
- $Security->SaveLastUrl();
- 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
- $osj2Duser_level->Export = @$_GET["export"]; // Get export parameter
- $sExport = $osj2Duser_level->Export; // Get export parameter, used in header
- $sExportFile = $osj2Duser_level->TableVar; // Get export file, used in header
- ?>
- <?php
- if ($osj2Duser_level->Export == "html") {
-
- // Printer friendly, no action required
- }
- if ($osj2Duser_level->Export == "xml") {
- header('Content-Type: text/xml');
- header('Content-Disposition: attachment; filename=' . $sExportFile .'.xml');
- }
- if ($osj2Duser_level->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();
-
- // Check QueryString parameters
- if (@$_GET["a"] <> "") {
- $osj2Duser_level->CurrentAction = $_GET["a"];
-
- // Clear inline mode
- if ($osj2Duser_level->CurrentAction == "cancel") {
- ClearInlineMode();
- }
-
- // Switch to inline edit mode
- if ($osj2Duser_level->CurrentAction == "edit") {
- InlineEditMode();
- }
- } else {
-
- // Create form object
- $objForm = new cFormObj;
- if (@$_POST["a_list"] <> "") {
- $osj2Duser_level->CurrentAction = $_POST["a_list"]; // Get action
-
- // Inline Update
- if ($osj2Duser_level->CurrentAction == "update" && @$_SESSION[EW_SESSION_INLINE_MODE] == "edit") {
- InlineUpdate();
- }
- }
- }
-
- // Build filter
- $sFilter = "";
- if (!$Security->CanList()) {
- $sFilter = "(0=1)"; // Filter all records
- }
- if ($sDbDetailFilter <> "") {
- if ($sFilter <> "") $sFilter .= " AND ";
- $sFilter .= "(" . $sDbDetailFilter . ")";
- }
- if ($sSrchWhere <> "") {
- if ($sFilter <> "") $sFilter .= " AND ";
- $sFilter .= "(" . $sSrchWhere . ")";
- }
-
- // Set up filter in Session
- $osj2Duser_level->setSessionWhere($sFilter);
- $osj2Duser_level->CurrentFilter = "";
-
- // Set Up Sorting Order
- SetUpSortOrder();
-
- // Export data only
- if ($osj2Duser_level->Export == "xml" || $osj2Duser_level->Export == "csv") {
- ExportData();
- Page_Terminate(); // Terminate response
- }
-
- // Set Return Url
- $osj2Duser_level->setReturnUrl("osj-osj2duser_levellist.php");
- ?>
- <?php include "osj-header.php" ?>
- <?php if ($osj2Duser_level->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">
- <!--
-
- function ew_ValidateForm(fobj) {
- if (fobj.a_confirm && fobj.a_confirm.value == "F")
- return true;
- var i, elm, aelm, infix;
- var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
- for (i=0; i<rowcnt; i++) {
- infix = (fobj.key_count) ? String(i+1) : "";
- elm = fobj.elements["x" + infix + "_user_level_id"];
- if (elm && !ew_HasValue(elm)) {
- if (!ew_OnError(elm, "Please enter required field - user level id"))
- return false;
- }
- elm = fobj.elements["x" + infix + "_user_level_id"];
- if (elm && !ew_CheckInteger(elm.value)) {
- if (!ew_OnError(elm, "Incorrect integer - user level id"))
- return false;
- }
- elm = fobj.elements["x" + infix + "_user_level_name"];
- if (elm && !ew_HasValue(elm)) {
- if (!ew_OnError(elm, "Please enter required field - user level name"))
- return false;
- }
- elmId = fobj.elements["x" + infix + "_user_level_id"];
- elmName = fobj.elements["x" + infix + "_user_level_name"];
- if (elmId && elmName) {
- elmId.value = elmId.value.replace(/^\s+|\s+$/, '');
- elmName.value = elmName.value.replace(/^\s+|\s+$/, '');
- if (elmId && !ew_CheckInteger(elmId.value)) {
- if (!ew_OnError(elmId, "User Level ID must be integer"))
- return false;
- }
- var level = parseInt(elmId.value);
- if (level == 0) {
- if (elmName.value.toLowerCase() != "default") {
- if (!ew_OnError(elmName, "User level name for user level 0 must be 'Default'"))
- return false;
- }
- } else if (level == -1) {
- if (elmName.value.toLowerCase() != "administrator") {
- if (!ew_OnError(elmName, "User level name for user level -1 must be 'Administrator'"))
- return false;
- }
- } else if (level < -1) {
- if (!ew_OnError(elmId, "User defined User Level ID must be larger than 0"))
- return false;
- } else if (level > 0) {
- if (elmName.value.toLowerCase() == "administrator" || elmName.value.toLowerCase() == "default") {
- if (!ew_OnError(elmName, "User defined User Level name cannot be 'Administrator' or 'Default'"))
- return false;
- }
- }
- }
- }
- return true;
- }
-
- //-->
- </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 ($osj2Duser_level->Export == "") { ?>
- <?php } ?>
- <?php
-
- // Load recordset
- $bExportAll = (defined("EW_EXPORT_ALL") && $osj2Duser_level->Export <> "");
- $bSelectLimit = ($osj2Duser_level->Export == "" && $osj2Duser_level->SelectLimit);
- if (!$bSelectLimit) $rs = LoadRecordset();
- $nTotalRecs = ($bSelectLimit) ? $osj2Duser_level->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: User Levels
- <?php if ($osj2Duser_level->Export == "") { ?>
- <a href="osj-osj2duser_levellist.php?export=html">Printer Friendly</a>
- <a href="osj-osj2duser_levellist.php?export=xml">Export to XML</a>
- <a href="osj-osj2duser_levellist.php?export=csv">Export to CSV</a>
- <?php } ?>
- </span></p>
- <?php if ($osj2Duser_level->Export == "") { ?>
- <?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 ($osj2Duser_level->Export == "") { ?>
- <form action="osj-osj2duser_levellist.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-osj2duser_levellist.php?start=<?php echo $Pager->FirstButton->Start ?>"><b>First</b></a>
- <?php } ?>
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <a href="osj-osj2duser_levellist.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-osj2duser_levellist.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-osj2duser_levellist.php?start=<?php echo $Pager->NextButton->Start ?>"><b>Next</b></a>
- <?php } ?>
- <?php if ($Pager->LastButton->Enabled) { ?>
- <a href="osj-osj2duser_levellist.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 name="fosj2Duser_levellist" id="fosj2Duser_levellist" action="osj-osj2duser_levellist.php" method="post">
- <?php if ($osj2Duser_level->Export == "") { ?>
- <table>
- <tr><td><span class="phpmaker">
- <?php if ($Security->CanAdd()) { ?>
- <a href="osj-osj2duser_leveladd.php">Add</a>
- <?php } ?>
- <?php if ($nTotalRecs > 0) { ?>
- <?php if ($Security->CanDelete()) { ?>
- <a href="" onClick="if (!ew_Selected(document.fosj2Duser_levellist)) alert('No records selected'); else {document.fosj2Duser_levellist.action='osj-osj2duser_leveldelete.php';document.fosj2Duser_levellist.encoding='application/x-www-form-urlencoded';document.fosj2Duser_levellist.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
- }
- $OptionCnt++; // permission
- if ($Security->CanDelete()) {
- $OptionCnt++; // multi select
- }
- ?>
- <!-- Table header -->
- <tr class="ewTableHeader">
- <?php if ($osj2Duser_level->Export == "") { ?>
- <?php if ($Security->CanView()) { ?>
- <td nowrap> </td>
- <?php } ?>
- <?php if ($Security->CanEdit()) { ?>
- <td nowrap> </td>
- <?php } ?>
- <td nowrap> </td>
- <?php if ($Security->CanDelete()) { ?>
- <td nowrap><input type="checkbox" class="phpmaker" onClick="ew_SelectKey(this);"></td>
- <?php } ?>
- <?php } ?>
- <td valign="top">
- <?php if ($osj2Duser_level->Export <> "") { ?>
- user level id
- <?php } else { ?>
- <a href="osj-osj2duser_levellist.php?order=<?php echo urlencode('user_level_id') ?>&ordertype=<?php echo $osj2Duser_level->user_level_id->ReverseSort() ?>">user level id<?php if ($osj2Duser_level->user_level_id->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($osj2Duser_level->user_level_id->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></a>
- <?php } ?>
- </td>
- <td valign="top">
- <?php if ($osj2Duser_level->Export <> "") { ?>
- user level name
- <?php } else { ?>
- <a href="osj-osj2duser_levellist.php?order=<?php echo urlencode('user_level_name') ?>&ordertype=<?php echo $osj2Duser_level->user_level_name->ReverseSort() ?>">user level name<?php if ($osj2Duser_level->user_level_name->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($osj2Duser_level->user_level_name->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></a>
- <?php } ?>
- </td>
- </tr>
- <?php
- if (defined("EW_EXPORT_ALL") && $osj2Duser_level->Export <> "") {
- $nStopRec = $nTotalRecs;
- } else {
- $nStopRec = $nStartRec + $nDisplayRecs - 1; // Set the last record to display
- }
- $nRecCount = $nStartRec - 1;
- if (!$rs->EOF) {
- $rs->MoveFirst();
- if (!$osj2Duser_level->SelectLimit) $rs->Move($nStartRec - 1); // Move to first record directly
- }
- $RowCnt = 0;
- $nEditRowCnt = 0;
- if ($osj2Duser_level->CurrentAction == "edit") $RowIndex = 1;
- while (!$rs->EOF && $nRecCount < $nStopRec) {
- $nRecCount++;
- if (intval($nRecCount) >= intval($nStartRec)) {
- $RowCnt++;
-
- // Init row class and style
- $osj2Duser_level->CssClass = "ewTableRow";
- $osj2Duser_level->CssStyle = "";
-
- // Init row event
- $osj2Duser_level->RowClientEvents = "onmouseover='ew_MouseOver(this);' onmouseout='ew_MouseOut(this);' onclick='ew_Click(this);'";
-
- // Display alternate color for rows
- if ($RowCnt % 2 == 0) {
- $osj2Duser_level->CssClass = "ewTableAltRow";
- }
- LoadRowValues($rs); // Load row values
- $osj2Duser_level->RowType = EW_ROWTYPE_VIEW; // Render view
- if ($osj2Duser_level->CurrentAction == "edit") {
- if (CheckInlineEditKey() && $nEditRowCnt == 0) { // Inline edit
- $osj2Duser_level->RowType = EW_ROWTYPE_EDIT; // Render edit
- }
- }
- if ($osj2Duser_level->RowType == EW_ROWTYPE_EDIT && $osj2Duser_level->EventCancelled) { // Update failed
- if ($osj2Duser_level->CurrentAction == "edit") {
- RestoreFormValues(); // Restore form values
- }
- }
- if ($osj2Duser_level->RowType == EW_ROWTYPE_EDIT) { // Edit row
- $nEditRowCnt++;
- $osj2Duser_level->CssClass = "ewTableEditRow";
- $osj2Duser_level->RowClientEvents = "onmouseover='this.edit=true;ew_MouseOver(this);' onmouseout='ew_MouseOut(this);' onclick='ew_Click(this);'";
- }
- RenderRow();
- ?>
- <!-- Table body -->
- <tr<?php echo $osj2Duser_level->DisplayAttributes() ?>>
- <?php if ($osj2Duser_level->RowType == EW_ROWTYPE_EDIT) { ?>
- <?php if ($osj2Duser_level->CurrentAction == "edit") { ?>
- <td colspan="<?php echo $OptionCnt ?>" align="right"><span class="phpmaker">
- <a href="" onClick="if (ew_ValidateForm(document.fosj2Duser_levellist)) document.fosj2Duser_levellist.submit();return false;">Update</a> <a href="osj-osj2duser_levellist.php?a=cancel">Cancel</a>
- <input type="hidden" name="a_list" id="a_list" value="update">
- </span></td>
- <?php } ?>
- <?php } else { ?>
- <?php if ($osj2Duser_level->Export == "") { ?>
- <?php if ($Security->CanView()) { ?>
- <td nowrap><span class="phpmaker"><?php if ($osj2Duser_level->user_level_id->CurrentValue <= 0) { ?>-<?php } else { ?>
- <a href="<?php echo $osj2Duser_level->ViewUrl() ?>">View</a>
- <?php } ?></span></td>
- <?php } ?>
- <?php if ($Security->CanEdit()) { ?>
- <td nowrap><span class="phpmaker"><?php if ($osj2Duser_level->user_level_id->CurrentValue <= 0) { ?>-<?php } else { ?>
- <a href="<?php echo $osj2Duser_level->EditUrl() ?>">Edit</a><span class="ewSeparator"> | </span><a href="<?php echo $osj2Duser_level->InlineEditUrl() ?>">Inline Edit</a>
- <?php } ?></span></td>
- <?php } ?>
- <td nowrap><span class="phpmaker"><?php if ($osj2Duser_level->user_level_id->CurrentValue < 0) { ?>-<?php } else { ?>
- <a href="osj-userpriv.php?user_level_id=<?php echo $osj2Duser_level->user_level_id->CurrentValue ?>">Permission</a>
- <?php } ?></span></td>
- <?php if ($Security->CanDelete()) { ?>
- <td nowrap><span class="phpmaker"><?php if ($osj2Duser_level->user_level_id->CurrentValue <= 0) { ?>-<?php } else { ?>
- <input type="checkbox" name="key_m[]" id="key_m[]" value="<?php echo ew_HtmlEncode($osj2Duser_level->user_level_id->CurrentValue) ?>" class="phpmaker" onclick='ew_ClickMultiCheckbox(this);'>
- <?php } ?></span></td>
- <?php } ?>
- <?php } ?>
- <?php } ?>
- <!-- user_level_id -->
- <td<?php echo $osj2Duser_level->user_level_id->CellAttributes() ?>>
- <?php if ($osj2Duser_level->RowType == EW_ROWTYPE_EDIT) { // Edit Record ?>
- <div<?php echo $osj2Duser_level->user_level_id->ViewAttributes() ?>><?php echo $osj2Duser_level->user_level_id->EditValue ?></div>
- <input type="hidden" name="x<?php echo $RowIndex ?>_user_level_id" id="x<?php echo $RowIndex ?>_user_level_id" value="<?php echo ew_HtmlEncode($osj2Duser_level->user_level_id->CurrentValue) ?>">
- <?php } else { ?>
- <div<?php echo $osj2Duser_level->user_level_id->ViewAttributes() ?>><?php echo $osj2Duser_level->user_level_id->ViewValue ?></div>
- <?php } ?>
- </td>
- <!-- user_level_name -->
- <td<?php echo $osj2Duser_level->user_level_name->CellAttributes() ?>>
- <?php if ($osj2Duser_level->RowType == EW_ROWTYPE_EDIT) { // Edit Record ?>
- <input type="text" name="x<?php echo $RowIndex ?>_user_level_name" id="x<?php echo $RowIndex ?>_user_level_name" title="User Level Description" size="30" maxlength="50" value="<?php echo $osj2Duser_level->user_level_name->EditValue ?>"<?php echo $osj2Duser_level->user_level_name->EditAttributes() ?>>
- <?php } else { ?>
- <div<?php echo $osj2Duser_level->user_level_name->ViewAttributes() ?>><?php echo $osj2Duser_level->user_level_name->ViewValue ?></div>
- <?php } ?>
- </td>
- </tr>
- <?php if ($osj2Duser_level->RowType == EW_ROWTYPE_EDIT) { ?>
- <?php } ?>
- <?php
- }
- $rs->MoveNext();
- }
- ?>
- </table>
- <?php if ($osj2Duser_level->Export == "") { ?>
- <table>
- <tr><td><span class="phpmaker">
- <?php if ($Security->CanAdd()) { ?>
- <a href="osj-osj2duser_leveladd.php">Add</a>
- <?php } ?>
- <?php if ($nTotalRecs > 0) { ?>
- <?php if ($Security->CanDelete()) { ?>
- <a href="" onClick="if (!ew_Selected(document.fosj2Duser_levellist)) alert('No records selected'); else {document.fosj2Duser_levellist.action='osj-osj2duser_leveldelete.php';document.fosj2Duser_levellist.encoding='application/x-www-form-urlencoded';document.fosj2Duser_levellist.submit();};return false;">Delete Selected Records</a>
- <?php } ?>
- <?php } ?>
- </span></td></tr>
- </table>
- <?php } ?>
- <?php } ?>
- <?php if ($osj2Duser_level->CurrentAction == "edit") { ?>
- <input type="hidden" name="key_count" id="key_count" value="<?php echo $RowIndex ?>">
- <?php } ?>
- </form>
- <?php
-
- // Close recordset and connection
- if ($rs) $rs->Close();
- ?>
- <?php if ($osj2Duser_level->Export == "") { ?>
- <form action="osj-osj2duser_levellist.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-osj2duser_levellist.php?start=<?php echo $Pager->FirstButton->Start ?>"><b>First</b></a>
- <?php } ?>
- <?php if ($Pager->PrevButton->Enabled) { ?>
- <a href="osj-osj2duser_levellist.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-osj2duser_levellist.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-osj2duser_levellist.php?start=<?php echo $Pager->NextButton->Start ?>"><b>Next</b></a>
- <?php } ?>
- <?php if ($Pager->LastButton->Enabled) { ?>
- <a href="osj-osj2duser_levellist.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 ($osj2Duser_level->Export == "") { ?>
- <?php } ?>
- <?php if ($osj2Duser_level->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, $osj2Duser_level;
- $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
- }
- }
- $osj2Duser_level->setRecordsPerPage($nDisplayRecs); // Save to Session
-
- // Reset start position
- $nStartRec = 1;
- $osj2Duser_level->setStartRecordNumber($nStartRec);
- } else {
- if ($osj2Duser_level->getRecordsPerPage() <> "") {
- $nDisplayRecs = $osj2Duser_level->getRecordsPerPage(); // Restore from Session
- } else {
- $nDisplayRecs = 10; // Load default
- }
- }
- }
-
- // Exit out of inline mode
- function ClearInlineMode() {
- global $osj2Duser_level;
- $osj2Duser_level->setKey("user_level_id", ""); // Clear inline edit key
- $osj2Duser_level->CurrentAction = ""; // Clear action
- $_SESSION[EW_SESSION_INLINE_MODE] = ""; // Clear inline mode
- }
-
- // Switch to Inline Edit Mode
- function InlineEditMode() {
- global $Security, $osj2Duser_level;
- if (!$Security->CanEdit()) Page_Terminate("osj-login.php"); // Go to login page
- $bInlineEdit = TRUE;
- if (@$_GET["user_level_id"] <> "") {
- $osj2Duser_level->user_level_id->setQueryStringValue($_GET["user_level_id"]);
- } else {
- $bInlineEdit = FALSE;
- }
- if ($bInlineEdit) {
- if (LoadRow()) {
- $osj2Duser_level->setKey("user_level_id", $osj2Duser_level->user_level_id->CurrentValue); // Set up inline edit key
- $_SESSION[EW_SESSION_INLINE_MODE] = "edit"; // Enable inline edit
- }
- }
- }
-
- // Peform update to inline edit record
- function InlineUpdate() {
- global $objForm, $osj2Duser_level;
- $objForm->Index = 1;
- LoadFormValues(); // Get form values
- if (CheckInlineEditKey()) { // Check key
- $osj2Duser_level->SendEmail = TRUE; // Send email on update success
- $bInlineUpdate = EditRow(); // Update record
- } else {
- $bInlineUpdate = FALSE;
- }
- if ($bInlineUpdate) { // Update success
- $_SESSION[EW_SESSION_MESSAGE] = "Update successful"; // Set success message
- ClearInlineMode(); // Clear inline edit mode
- } else {
- if (@$_SESSION[EW_SESSION_MESSAGE] == "") {
- $_SESSION[EW_SESSION_MESSAGE] = "Update failed"; // Set update failed message
- }
- $osj2Duser_level->EventCancelled = TRUE; // Cancel event
- $osj2Duser_level->CurrentAction = "edit"; // Stay in edit mode
- }
- }
-
- // Check inline edit key
- function CheckInlineEditKey() {
- global $osj2Duser_level;
-
- //CheckInlineEditKey = True
- if (strval($osj2Duser_level->getKey("user_level_id")) <> strval($osj2Duser_level->user_level_id->CurrentValue)) {
- return FALSE;
- }
- return TRUE;
- }
-
- // Set up Sort parameters based on Sort Links clicked
- function SetUpSortOrder() {
- global $osj2Duser_level;
-
- // Check for an Order parameter
- if (@$_GET["order"] <> "") {
- $osj2Duser_level->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
- $osj2Duser_level->CurrentOrderType = @$_GET["ordertype"];
-
- // Field user_level_id
- $osj2Duser_level->UpdateSort($osj2Duser_level->user_level_id);
-
- // Field user_level_name
- $osj2Duser_level->UpdateSort($osj2Duser_level->user_level_name);
- $osj2Duser_level->setStartRecordNumber(1); // Reset start position
- }
- $sOrderBy = $osj2Duser_level->getSessionOrderBy(); // Get order by from Session
- if ($sOrderBy == "") {
- if ($osj2Duser_level->SqlOrderBy() <> "") {
- $sOrderBy = $osj2Duser_level->SqlOrderBy();
- $osj2Duser_level->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 $osj2Duser_level;
-
- // Get reset cmd
- if (@$_GET["cmd"] <> "") {
- $sCmd = $_GET["cmd"];
-
- // Reset Sort Criteria
- if (strtolower($sCmd) == "resetsort") {
- $sOrderBy = "";
- $osj2Duser_level->setSessionOrderBy($sOrderBy);
- $osj2Duser_level->user_level_id->setSort("");
- $osj2Duser_level->user_level_name->setSort("");
- }
-
- // Reset start position
- $nStartRec = 1;
- $osj2Duser_level->setStartRecordNumber($nStartRec);
- }
- }
- ?>
- <?php
-
- // Set up Starting Record parameters based on Pager Navigation
- function SetUpStartRec() {
- global $nDisplayRecs, $nStartRec, $nTotalRecs, $nPageNo, $osj2Duser_level;
- if ($nDisplayRecs == 0) return;
-
- // Check for a START parameter
- if (@$_GET[EW_TABLE_START_REC] <> "") {
- $nStartRec = $_GET[EW_TABLE_START_REC];
- $osj2Duser_level->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;
- }
- $osj2Duser_level->setStartRecordNumber($nStartRec);
- } else {
- $nStartRec = $osj2Duser_level->getStartRecordNumber();
- }
- } else {
- $nStartRec = $osj2Duser_level->getStartRecordNumber();
- }
-
- // Check if correct start record counter
- if (!is_numeric($nStartRec) || $nStartRec == "") { // Avoid invalid start record counter
- $nStartRec = 1; // Reset start record counter
- $osj2Duser_level->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
- $osj2Duser_level->setStartRecordNumber($nStartRec);
- } elseif (($nStartRec-1) % $nDisplayRecs <> 0) {
- $nStartRec = intval(($nStartRec-1)/$nDisplayRecs)*$nDisplayRecs+1; // Point to page boundary
- $osj2Duser_level->setStartRecordNumber($nStartRec);
- }
- }
- ?>
- <?php
-
- // Load form values
- function LoadFormValues() {
-
- // Load from form
- global $objForm, $osj2Duser_level;
- $osj2Duser_level->user_level_id->setFormValue($objForm->GetValue("x_user_level_id"));
- $osj2Duser_level->user_level_name->setFormValue($objForm->GetValue("x_user_level_name"));
- }
-
- // Restore form values
- function RestoreFormValues() {
- global $osj2Duser_level;
- $osj2Duser_level->user_level_id->CurrentValue = $osj2Duser_level->user_level_id->FormValue;
- $osj2Duser_level->user_level_name->CurrentValue = $osj2Duser_level->user_level_name->FormValue;
- }
- ?>
- <?php
-
- // Load recordset
- function LoadRecordset($offset = -1, $rowcnt = -1) {
- global $conn, $osj2Duser_level;
-
- // Call Recordset Selecting event
- $osj2Duser_level->Recordset_Selecting($osj2Duser_level->CurrentFilter);
-
- // Load list page sql
- $sSql = $osj2Duser_level->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
- $osj2Duser_level->Recordset_Selected($rs);
- return $rs;
- }
- ?>
- <?php
-
- // Load row based on key values
- function LoadRow() {
- global $conn, $Security, $osj2Duser_level;
- $sFilter = $osj2Duser_level->SqlKeyFilter();
- if (!is_numeric($osj2Duser_level->user_level_id->CurrentValue)) {
- return FALSE; // Invalid key, exit
- }
- $sFilter = str_replace("@user_level_id@", ew_AdjustSql($osj2Duser_level->user_level_id->CurrentValue), $sFilter); // Replace key value
-
- // Call Row Selecting event
- $osj2Duser_level->Row_Selecting($sFilter);
-
- // Load sql based on filter
- $osj2Duser_level->CurrentFilter = $sFilter;
- $sSql = $osj2Duser_level->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
- $osj2Duser_level->Row_Selected($rs);
- }
- $rs->Close();
- } else {
- $LoadRow = FALSE;
- }
- return $LoadRow;
- }
-
- // Load row values from recordset
- function LoadRowValues(&$rs) {
- global $osj2Duser_level;
- $osj2Duser_level->user_level_id->setDbValue($rs->fields('user_level_id'));
- if (is_null($osj2Duser_level->user_level_id->CurrentValue)) {
- $osj2Duser_level->user_level_id->CurrentValue = 0;
- } else {
- $osj2Duser_level->user_level_id->CurrentValue = intval($osj2Duser_level->user_level_id->CurrentValue);
- }
- $osj2Duser_level->user_level_name->setDbValue($rs->fields('user_level_name'));
- }
- ?>
- <?php
-
- // Render row values based on field settings
- function RenderRow() {
- global $conn, $Security, $osj2Duser_level;
-
- // Call Row Rendering event
- $osj2Duser_level->Row_Rendering();
-
- // Common render codes for all row types
- // user_level_id
-
- $osj2Duser_level->user_level_id->CellCssStyle = "";
- $osj2Duser_level->user_level_id->CellCssClass = "";
-
- // user_level_name
- $osj2Duser_level->user_level_name->CellCssStyle = "";
- $osj2Duser_level->user_level_name->CellCssClass = "";
- if ($osj2Duser_level->RowType == EW_ROWTYPE_VIEW) { // View row
-
- // user_level_id
- $osj2Duser_level->user_level_id->ViewValue = $osj2Duser_level->user_level_id->CurrentValue;
- $osj2Duser_level->user_level_id->CssStyle = "";
- $osj2Duser_level->user_level_id->CssClass = "";
- $osj2Duser_level->user_level_id->ViewCustomAttributes = "";
-
- // user_level_name
- $osj2Duser_level->user_level_name->ViewValue = $osj2Duser_level->user_level_name->CurrentValue;
- $osj2Duser_level->user_level_name->CssStyle = "";
- $osj2Duser_level->user_level_name->CssClass = "";
- $osj2Duser_level->user_level_name->ViewCustomAttributes = "";
-
- // user_level_id
- $osj2Duser_level->user_level_id->HrefValue = "";
-
- // user_level_name
- $osj2Duser_level->user_level_name->HrefValue = "";
- } elseif ($osj2Duser_level->RowType == EW_ROWTYPE_ADD) { // Add row
- } elseif ($osj2Duser_level->RowType == EW_ROWTYPE_EDIT) { // Edit row
-
- // user_level_id
- $osj2Duser_level->user_level_id->EditCustomAttributes = "";
- $osj2Duser_level->user_level_id->EditValue = $osj2Duser_level->user_level_id->CurrentValue;
- $osj2Duser_level->user_level_id->CssStyle = "";
- $osj2Duser_level->user_level_id->CssClass = "";
- $osj2Duser_level->user_level_id->ViewCustomAttributes = "";
-
- // user_level_name
- $osj2Duser_level->user_level_name->EditCustomAttributes = "";
- $osj2Duser_level->user_level_name->EditValue = ew_HtmlEncode($osj2Duser_level->user_level_name->CurrentValue);
- } elseif ($osj2Duser_level->RowType == EW_ROWTYPE_SEARCH) { // Search row
- }
-
- // Call Row Rendered event
- $osj2Duser_level->Row_Rendered();
- }
- ?>
- <?php
-
- // Update record based on key values
- function EditRow() {
- global $conn, $Security, $osj2Duser_level;
- $sFilter = $osj2Duser_level->SqlKeyFilter();
- if (!is_numeric($osj2Duser_level->user_level_id->CurrentValue)) {
- return FALSE;
- }
- $sFilter = str_replace("@user_level_id@", ew_AdjustSql($osj2Duser_level->user_level_id->CurrentValue), $sFilter); // Replace key value
- $osj2Duser_level->CurrentFilter = $sFilter;
- $sSql = $osj2Duser_level->SQL();
- $conn->raiseErrorFn = 'ew_ErrorFn';
- $rs = $conn->Execute($sSql);
- $conn->raiseErrorFn = '';
- if ($rs === FALSE)
- return FALSE;
- if ($rs->EOF) {
- $EditRow = FALSE; // Update Failed
- } else {
-
- // Save old values
- $rsold =& $rs->fields;
- $rsnew = array();
-
- // Field user_level_id
- // Field user_level_name
-
- $osj2Duser_level->user_level_name->SetDbValueDef($osj2Duser_level->user_level_name->CurrentValue, "");
- $rsnew['user_level_name'] =& $osj2Duser_level->user_level_name->DbValue;
-
- // Call Row Updating event
- $bUpdateRow = $osj2Duser_level->Row_Updating($rsold, $rsnew);
- if ($bUpdateRow) {
- $conn->raiseErrorFn = 'ew_ErrorFn';
- $EditRow = $conn->Execute($osj2Duser_level->UpdateSQL($rsnew));
- $conn->raiseErrorFn = '';
- } else {
- if ($osj2Duser_level->CancelMessage <> "") {
- $_SESSION[EW_SESSION_MESSAGE] = $osj2Duser_level->CancelMessage;
- $osj2Duser_level->CancelMessage = "";
- } else {
- $_SESSION[EW_SESSION_MESSAGE] = "Update cancelled";
- }
- $EditRow = FALSE;
- }
- }
-
- // Call Row Updated event
- if ($EditRow) {
- $osj2Duser_level->Row_Updated($rsold, $rsnew);
- }
- if ($EditRow) {
- WriteAuditTrailOnEdit($rsold, $rsnew);
- }
- $rs->Close();
- return $EditRow;
- }
- ?>
- <?php
-
- // Export data in Xml or Csv format
- function ExportData() {
- global $nTotalRecs, $nStartRec, $nStopRec, $nTotalRecs, $nDisplayRecs, $osj2Duser_level;
- $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 ($osj2Duser_level->Export == "xml") {
- $XmlDoc = new cXMLDocument();
- }
- if ($osj2Duser_level->Export == "csv") {
- $sCsvStr .= "user_level_id" . ",";
- $sCsvStr .= "user_level_name" . ",";
- $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 ($osj2Duser_level->Export == "xml") {
- $XmlDoc->BeginRow();
- $XmlDoc->AddField('user_level_id', $osj2Duser_level->user_level_id->CurrentValue);
- $XmlDoc->AddField('user_level_name', $osj2Duser_level->user_level_name->CurrentValue);
- $XmlDoc->EndRow();
- }
- if ($osj2Duser_level->Export == "csv") {
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Duser_level->user_level_id->CurrentValue)) . '",';
- $sCsvStr .= '"' . str_replace('"', '""', strval($osj2Duser_level->user_level_name->CurrentValue)) . '",';
- $sCsvStr = substr($sCsvStr, 0, strlen($sCsvStr)-1); // Remove last comma
- $sCsvStr .= "\n";
- }
- }
- $rs->MoveNext();
- }
-
- // Close recordset
- $rs->Close();
- if ($osj2Duser_level->Export == "xml") {
- header("Content-Type: text/xml");
- echo $XmlDoc->XML();
- }
- if ($osj2Duser_level->Export == "csv") {
- echo $sCsvStr;
- }
- }
- ?>
- <?php
-
- // Write Audit Trail start/end for grid update
- function WriteAuditTrailDummy($typ) {
- $table = 'osj-user_level';
-
- // 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
-
- // Write Audit Trail (edit page)
- function WriteAuditTrailOnEdit(&$rsold, &$rsnew) {
- global $osj2Duser_level;
- $table = 'osj-user_level';
-
- // Get key value
- $key = "";
- if ($key <> "") $key .= EW_COMPOSITE_KEY_SEPARATOR;
- $key .= $rsold['user_level_id'];
-
- // Write Audit Trail
- $filePfx = "log";
- $curDate = date("Y/m/d");
- $curTime = date("H:i:s");
- $id = ew_ScriptName();
- $user = CurrentUserID();
- $action = "U";
- foreach (array_keys($rsnew) as $fldname) {
- if ($osj2Duser_level->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore Blob Field
- if ($osj2Duser_level->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) { // DateTime Field
- $modified = (ew_FormatDateTime($rsold[$fldname], 0) <> ew_FormatDateTime($rsnew[$fldname], 0));
- } else {
- $modified = ($rsold[$fldname] <> $rsnew[$fldname]);
- }
- if ($modified) {
- if ($osj2Duser_level->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) { // Memo Field
- $oldvalue = "<MEMO>";
- $newvalue = "<MEMO>";
- } else {
- $oldvalue = $rsold[$fldname];
- $newvalue = $rsnew[$fldname];
- }
- ew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $user, $action, $table, $fldname, $key, $oldvalue, $newvalue);
- }
- }
- }
- }
- ?>
- <?php
-
- // Page Load event
- function Page_Load() {
-
- //echo "Page Load";
- }
-
- // Page Unload event
- function Page_Unload() {
-
- //echo "Page Unload";
- }
- ?>