/osj-osj2duser_detailsrch.php
PHP | 446 lines | 346 code | 47 blank | 53 comment | 61 complexity | 7c1a6824d0f30c234bf1e93168edabcc MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0
- <?php
- define("EW_PAGE_ID", "search", TRUE); // Page ID
- define("EW_TABLE_NAME", 'osj-user_detail', 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_detailinfo.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_detail');
- if (!$Security->IsLoggedIn()) {
- $Security->SaveLastUrl();
- Page_Terminate("osj-login.php");
- }
- if (!$Security->CanSearch()) {
- $Security->SaveLastUrl();
- Page_Terminate("osj-osj2duser_detaillist.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
- $osj2Duser_detail->Export = @$_GET["export"]; // Get export parameter
- $sExport = $osj2Duser_detail->Export; // Get export parameter, used in header
- $sExportFile = $osj2Duser_detail->TableVar; // Get export file, used in header
- ?>
- <?php
-
- // Get action
- $osj2Duser_detail->CurrentAction = @$_POST["a_search"];
- switch ($osj2Duser_detail->CurrentAction) {
- case "S": // Get Search Criteria
-
- // Build search string for advanced search, remove blank field
- $sSrchStr = BuildAdvancedSearch();
- if ($sSrchStr <> "") {
- Page_Terminate("osj-osj2duser_detaillist.php?" . $sSrchStr); // Go to list page
- }
- break;
- default: // Restore search settings
- LoadAdvancedSearch();
- }
-
- // Render row for search
- $osj2Duser_detail->RowType = EW_ROWTYPE_SEARCH;
- RenderRow();
- ?>
- <?php include "osj-header.php" ?>
- <script type="text/javascript">
- <!--
- var EW_PAGE_ID = "search"; // 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) : "";
- }
- return true;
- }
-
- //-->
- </script>
- <script type="text/javascript">
- <!--
- var ew_DHTMLEditors = [];
-
- //-->
- </script>
- <script type="text/javascript">
- <!--
-
- // js for Popup Calendar
- //-->
-
- </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">Search TABLE: User Details<br><br><a href="osj-osj2duser_detaillist.php">Back to List</a></span></p>
- <form name="fosj2Duser_detailsearch" id="fosj2Duser_detailsearch" action="osj-osj2duser_detailsrch.php" method="post" onSubmit="return ew_ValidateForm(this);">
- <p>
- <input type="hidden" name="a_search" id="a_search" value="S">
- <table class="ewTable">
- <tr class="ewTableRow">
- <td class="ewTableHeader">user id</td>
- <td<?php echo $osj2Duser_detail->user_id->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_user_id" id="z_user_id" value="="></span></td>
- <td<?php echo $osj2Duser_detail->user_id->CellAttributes() ?>><span class="phpmaker">
- <?php if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin ?>
- <div<?php echo $osj2Duser_detail->user_id->ViewAttributes() ?>><?php echo $osj2Duser_detail->user_id->EditValue ?></div>
- <input type="hidden" name="x_user_id" id="x_user_id" value="<?php echo ew_HtmlEncode($osj2Duser_detail->user_id->AdvancedSearch->SearchValue) ?>">
- <?php } else { ?>
- <div><input type="text" name="x_user_id" id="x_user_id" size="30" value="<?php echo $osj2Duser_detail->user_id->EditValue ?>" onblur="ew_AstHideDiv('as_x_user_id');" onkeydown="ew_AstOnKeyDown('x_user_id', 'as_x_user_id', event);" onkeypress="return ew_AstOnKeyPress(event);" onkeyup="ew_AstOnKeyUp('x_user_id', 'as_x_user_id', event);" autocomplete="off"></div>
- <div class='ewAstList' style='visibility:hidden' id='as_x_user_id'></div>
- <input type="hidden" name="sv_x_user_id" id="sv_x_user_id" value="">
- <?php
- $sSqlWrk = "SELECT DISTINCT `user_email`, '' FROM `osj-users` WHERE (`user_email` LIKE '@FILTER_VALUE%')";
- $sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
- ?>
- <input type="hidden" name="s_x_user_id" id="s_x_user_id" value="<?php echo $sSqlWrk ?>">
- <input type="hidden" name="lt_x_user_id" id="lt_x_user_id" value="1">
- <?php } ?>
- </span></td>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader">detail creation date</td>
- <td<?php echo $osj2Duser_detail->user_detail_creation_date->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_user_detail_creation_date" id="z_user_detail_creation_date" value="="></span></td>
- <td<?php echo $osj2Duser_detail->user_detail_creation_date->CellAttributes() ?>><span class="phpmaker">
- </span></td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader">detail edit date</td>
- <td<?php echo $osj2Duser_detail->user_detail_edit_date->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_user_detail_edit_date" id="z_user_detail_edit_date" value="="></span></td>
- <td<?php echo $osj2Duser_detail->user_detail_edit_date->CellAttributes() ?>><span class="phpmaker">
- </span></td>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader">First Name</td>
- <td<?php echo $osj2Duser_detail->user_first_name->CellAttributes() ?>><span class="ewSearchOpr">contains<input type="hidden" name="z_user_first_name" id="z_user_first_name" value="LIKE"></span></td>
- <td<?php echo $osj2Duser_detail->user_first_name->CellAttributes() ?>><span class="phpmaker">
- <input type="text" name="x_user_first_name" id="x_user_first_name" size="30" maxlength="255" value="<?php echo $osj2Duser_detail->user_first_name->EditValue ?>"<?php echo $osj2Duser_detail->user_first_name->EditAttributes() ?>>
- </span></td>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader" align="right">
- <input type="radio" name="v_user_first_name" id="v_user_first_name" value="AND"<?php if ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchCondition <> "OR") echo " checked" ?>>and <span name="_v_user_first_name" id="_v_user_first_name"><input type="radio" name="v_user_first_name" id="v_user_first_name" value="OR"<?php if ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchCondition == "OR") echo " checked" ?>>or</span>
- </td>
- <td<?php echo $osj2Duser_detail->user_first_name->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_first_name" id="_w_user_first_name"><select name="w_user_first_name" id="w_user_first_name"><option value="="<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2=="=")?" selected":"" ?>>=</option><option value="<>"<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2=="<>")?" selected":"" ?>><></option><option value="<"<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2=="<")?" selected":"" ?>><</option><option value="<="<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2=="<=")?" selected":"" ?>><=</option><option value=">"<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2==">")?" selected":"" ?>>></option><option value=">="<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2==">=")?" selected":"" ?>>>=</option><option value="LIKE"<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2=="LIKE")?" selected":"" ?>>contains</option><option value="NOT LIKE"<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2=="NOT LIKE")?" selected":"" ?>>not contains</option><option value="STARTS WITH"<?php echo ($osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2=="STARTS WITH")?" selected":"" ?>>starts with</option></select></span></td>
- <td<?php echo $osj2Duser_detail->user_first_name->CellAttributes() ?>><span class="phpmaker">
- <input type="text" name="y_user_first_name" id="y_user_first_name" size="30" maxlength="255" value="<?php echo $osj2Duser_detail->user_first_name->EditValue2 ?>"<?php echo $osj2Duser_detail->user_first_name->EditAttributes() ?>>
- </span></td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader">Last Name</td>
- <td<?php echo $osj2Duser_detail->user_last_name->CellAttributes() ?>><span class="ewSearchOpr">contains<input type="hidden" name="z_user_last_name" id="z_user_last_name" value="LIKE"></span></td>
- <td<?php echo $osj2Duser_detail->user_last_name->CellAttributes() ?>><span class="phpmaker">
- <input type="text" name="x_user_last_name" id="x_user_last_name" size="30" maxlength="255" value="<?php echo $osj2Duser_detail->user_last_name->EditValue ?>"<?php echo $osj2Duser_detail->user_last_name->EditAttributes() ?>>
- </span></td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader" align="right">
- <input type="radio" name="v_user_last_name" id="v_user_last_name" value="AND"<?php if ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchCondition <> "OR") echo " checked" ?>>and <span name="_v_user_last_name" id="_v_user_last_name"><input type="radio" name="v_user_last_name" id="v_user_last_name" value="OR"<?php if ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchCondition == "OR") echo " checked" ?>>or</span>
- </td>
- <td<?php echo $osj2Duser_detail->user_last_name->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_last_name" id="_w_user_last_name"><select name="w_user_last_name" id="w_user_last_name"><option value="="<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2=="=")?" selected":"" ?>>=</option><option value="<>"<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2=="<>")?" selected":"" ?>><></option><option value="<"<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2=="<")?" selected":"" ?>><</option><option value="<="<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2=="<=")?" selected":"" ?>><=</option><option value=">"<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2==">")?" selected":"" ?>>></option><option value=">="<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2==">=")?" selected":"" ?>>>=</option><option value="LIKE"<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2=="LIKE")?" selected":"" ?>>contains</option><option value="NOT LIKE"<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2=="NOT LIKE")?" selected":"" ?>>not contains</option><option value="STARTS WITH"<?php echo ($osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2=="STARTS WITH")?" selected":"" ?>>starts with</option></select></span></td>
- <td<?php echo $osj2Duser_detail->user_last_name->CellAttributes() ?>><span class="phpmaker">
- <input type="text" name="y_user_last_name" id="y_user_last_name" size="30" maxlength="255" value="<?php echo $osj2Duser_detail->user_last_name->EditValue2 ?>"<?php echo $osj2Duser_detail->user_last_name->EditAttributes() ?>>
- </span></td>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader">Description</td>
- <td<?php echo $osj2Duser_detail->user_description->CellAttributes() ?>><span class="ewSearchOpr">contains<input type="hidden" name="z_user_description" id="z_user_description" value="LIKE"></span></td>
- <td<?php echo $osj2Duser_detail->user_description->CellAttributes() ?>><span class="phpmaker">
- <textarea name="x_user_description" id="x_user_description" cols="35" rows="4"<?php echo $osj2Duser_detail->user_description->EditAttributes() ?>><?php echo $osj2Duser_detail->user_description->EditValue ?></textarea>
- </span></td>
- </tr>
- <tr class="ewTableAltRow">
- <td class="ewTableHeader" align="right">
- <input type="radio" name="v_user_description" id="v_user_description" value="AND"<?php if ($osj2Duser_detail->user_description->AdvancedSearch->SearchCondition <> "OR") echo " checked" ?>>and <span name="_v_user_description" id="_v_user_description"><input type="radio" name="v_user_description" id="v_user_description" value="OR"<?php if ($osj2Duser_detail->user_description->AdvancedSearch->SearchCondition == "OR") echo " checked" ?>>or</span>
- </td>
- <td<?php echo $osj2Duser_detail->user_description->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_description" id="_w_user_description"><select name="w_user_description" id="w_user_description"><option value="="<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2=="=")?" selected":"" ?>>=</option><option value="<>"<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2=="<>")?" selected":"" ?>><></option><option value="<"<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2=="<")?" selected":"" ?>><</option><option value="<="<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2=="<=")?" selected":"" ?>><=</option><option value=">"<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2==">")?" selected":"" ?>>></option><option value=">="<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2==">=")?" selected":"" ?>>>=</option><option value="LIKE"<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2=="LIKE")?" selected":"" ?>>contains</option><option value="NOT LIKE"<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2=="NOT LIKE")?" selected":"" ?>>not contains</option><option value="STARTS WITH"<?php echo ($osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2=="STARTS WITH")?" selected":"" ?>>starts with</option></select></span></td>
- <td<?php echo $osj2Duser_detail->user_description->CellAttributes() ?>><span class="phpmaker">
- <textarea name="y_user_description" id="y_user_description" cols="35" rows="4"<?php echo $osj2Duser_detail->user_description->EditAttributes() ?>><?php echo $osj2Duser_detail->user_description->EditValue2 ?></textarea>
- </span></td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader">Company</td>
- <td<?php echo $osj2Duser_detail->user_company->CellAttributes() ?>><span class="ewSearchOpr">contains<input type="hidden" name="z_user_company" id="z_user_company" value="LIKE"></span></td>
- <td<?php echo $osj2Duser_detail->user_company->CellAttributes() ?>><span class="phpmaker">
- <input type="text" name="x_user_company" id="x_user_company" size="30" maxlength="255" value="<?php echo $osj2Duser_detail->user_company->EditValue ?>"<?php echo $osj2Duser_detail->user_company->EditAttributes() ?>>
- </span></td>
- </tr>
- <tr class="ewTableRow">
- <td class="ewTableHeader" align="right">
- <input type="radio" name="v_user_company" id="v_user_company" value="AND"<?php if ($osj2Duser_detail->user_company->AdvancedSearch->SearchCondition <> "OR") echo " checked" ?>>and <span name="_v_user_company" id="_v_user_company"><input type="radio" name="v_user_company" id="v_user_company" value="OR"<?php if ($osj2Duser_detail->user_company->AdvancedSearch->SearchCondition == "OR") echo " checked" ?>>or</span>
- </td>
- <td<?php echo $osj2Duser_detail->user_company->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_company" id="_w_user_company"><select name="w_user_company" id="w_user_company"><option value="="<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2=="=")?" selected":"" ?>>=</option><option value="<>"<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2=="<>")?" selected":"" ?>><></option><option value="<"<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2=="<")?" selected":"" ?>><</option><option value="<="<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2=="<=")?" selected":"" ?>><=</option><option value=">"<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2==">")?" selected":"" ?>>></option><option value=">="<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2==">=")?" selected":"" ?>>>=</option><option value="LIKE"<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2=="LIKE")?" selected":"" ?>>contains</option><option value="NOT LIKE"<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2=="NOT LIKE")?" selected":"" ?>>not contains</option><option value="STARTS WITH"<?php echo ($osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2=="STARTS WITH")?" selected":"" ?>>starts with</option></select></span></td>
- <td<?php echo $osj2Duser_detail->user_company->CellAttributes() ?>><span class="phpmaker">
- <input type="text" name="y_user_company" id="y_user_company" size="30" maxlength="255" value="<?php echo $osj2Duser_detail->user_company->EditValue2 ?>"<?php echo $osj2Duser_detail->user_company->EditAttributes() ?>>
- </span></td>
- </tr>
- </table>
- <p>
- <input type="submit" name="Action" id="Action" value=" Search ">
- <input type="button" name="Reset" id="Reset" value=" Reset " onclick="ew_ClearForm(this.form);">
- </form>
- <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
-
- // Build advanced search
- function BuildAdvancedSearch() {
- global $osj2Duser_detail;
- $sSrchUrl = "";
-
- // Field user_id
- BuildSearchUrl($sSrchUrl, $osj2Duser_detail->user_id, @$_POST["x_user_id"], @$_POST["z_user_id"], @$_POST["v_user_id"], @$_POST["y_user_id"], @$_POST["w_user_id"]);
-
- // Field user_detail_creation_date
- BuildSearchUrl($sSrchUrl, $osj2Duser_detail->user_detail_creation_date, ew_UnFormatDateTime(@$_POST["x_user_detail_creation_date"],6), @$_POST["z_user_detail_creation_date"], @$_POST["v_user_detail_creation_date"], ew_UnFormatDateTime(@$_POST["y_user_detail_creation_date"],6), @$_POST["w_user_detail_creation_date"]);
-
- // Field user_detail_edit_date
- BuildSearchUrl($sSrchUrl, $osj2Duser_detail->user_detail_edit_date, ew_UnFormatDateTime(@$_POST["x_user_detail_edit_date"],6), @$_POST["z_user_detail_edit_date"], @$_POST["v_user_detail_edit_date"], ew_UnFormatDateTime(@$_POST["y_user_detail_edit_date"],6), @$_POST["w_user_detail_edit_date"]);
-
- // Field user_first_name
- BuildSearchUrl($sSrchUrl, $osj2Duser_detail->user_first_name, @$_POST["x_user_first_name"], @$_POST["z_user_first_name"], @$_POST["v_user_first_name"], @$_POST["y_user_first_name"], @$_POST["w_user_first_name"]);
-
- // Field user_last_name
- BuildSearchUrl($sSrchUrl, $osj2Duser_detail->user_last_name, @$_POST["x_user_last_name"], @$_POST["z_user_last_name"], @$_POST["v_user_last_name"], @$_POST["y_user_last_name"], @$_POST["w_user_last_name"]);
-
- // Field user_description
- BuildSearchUrl($sSrchUrl, $osj2Duser_detail->user_description, @$_POST["x_user_description"], @$_POST["z_user_description"], @$_POST["v_user_description"], @$_POST["y_user_description"], @$_POST["w_user_description"]);
-
- // Field user_company
- BuildSearchUrl($sSrchUrl, $osj2Duser_detail->user_company, @$_POST["x_user_company"], @$_POST["z_user_company"], @$_POST["v_user_company"], @$_POST["y_user_company"], @$_POST["w_user_company"]);
- return $sSrchUrl;
- }
-
- // Function to build search URL
- function BuildSearchUrl(&$Url, &$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 == "BETWEEN") {
- $IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
- ($Fld->FldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal) && is_numeric($FldVal2));
- if ($FldVal <> "" && $FldVal2 <> "" && $IsValidValue) {
- $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
- "&y_" . $FldParm . "=" . urlencode($FldVal2) .
- "&z_" . $FldParm . "=" . urlencode($FldOpr);
- }
- } elseif ($FldOpr == "IS NULL" || $FldOpr == "IS NOT NULL") {
- $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
- "&z_" . $FldParm . "=" . urlencode($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 = "x_" . $FldParm . "=" . urlencode($FldVal) .
- "&z_" . $FldParm . "=" . urlencode($FldOpr);
- }
- $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 .= "&v_" . $FldParm . "=" . urlencode($FldCond) . "&";
- $sWrk .= "&y_" . $FldParm . "=" . urlencode($FldVal2) .
- "&w_" . $FldParm . "=" . urlencode($FldOpr2);
- }
- }
- if ($sWrk <> "") {
- if ($Url <> "") $Url .= "&";
- $Url .= $sWrk;
- }
- }
- ?>
- <?php
-
- // Render row values based on field settings
- function RenderRow() {
- global $conn, $Security, $osj2Duser_detail;
-
- // Call Row Rendering event
- $osj2Duser_detail->Row_Rendering();
-
- // Common render codes for all row types
- if ($osj2Duser_detail->RowType == EW_ROWTYPE_VIEW) { // View row
- } elseif ($osj2Duser_detail->RowType == EW_ROWTYPE_ADD) { // Add row
- } elseif ($osj2Duser_detail->RowType == EW_ROWTYPE_EDIT) { // Edit row
- } elseif ($osj2Duser_detail->RowType == EW_ROWTYPE_SEARCH) { // Search row
-
- // user_id
- $osj2Duser_detail->user_id->EditCustomAttributes = "";
- if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin
- $osj2Duser_detail->user_id->AdvancedSearch->SearchValue = $Security->CurrentUserID();
- $osj2Duser_detail->user_id->EditValue = $osj2Duser_detail->user_id->AdvancedSearch->SearchValue;
- $osj2Duser_detail->user_id->CssStyle = "";
- $osj2Duser_detail->user_id->CssClass = "";
- $osj2Duser_detail->user_id->ViewCustomAttributes = "";
- } else {
- $osj2Duser_detail->user_id->EditValue = ew_HtmlEncode($osj2Duser_detail->user_id->AdvancedSearch->SearchValue);
- }
-
- // user_detail_creation_date
- $osj2Duser_detail->user_detail_creation_date->EditCustomAttributes = "";
-
- // user_detail_edit_date
- $osj2Duser_detail->user_detail_edit_date->EditCustomAttributes = "";
-
- // user_first_name
- $osj2Duser_detail->user_first_name->EditCustomAttributes = "";
- $osj2Duser_detail->user_first_name->EditValue = ew_HtmlEncode($osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue);
- $osj2Duser_detail->user_first_name->EditCustomAttributes = "";
- $osj2Duser_detail->user_first_name->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue2);
-
- // user_last_name
- $osj2Duser_detail->user_last_name->EditCustomAttributes = "";
- $osj2Duser_detail->user_last_name->EditValue = ew_HtmlEncode($osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue);
- $osj2Duser_detail->user_last_name->EditCustomAttributes = "";
- $osj2Duser_detail->user_last_name->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue2);
-
- // user_description
- $osj2Duser_detail->user_description->EditCustomAttributes = "";
- $osj2Duser_detail->user_description->EditValue = ew_HtmlEncode($osj2Duser_detail->user_description->AdvancedSearch->SearchValue);
- $osj2Duser_detail->user_description->EditCustomAttributes = "";
- $osj2Duser_detail->user_description->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_description->AdvancedSearch->SearchValue2);
-
- // user_company
- $osj2Duser_detail->user_company->EditCustomAttributes = "";
- $osj2Duser_detail->user_company->EditValue = ew_HtmlEncode($osj2Duser_detail->user_company->AdvancedSearch->SearchValue);
- $osj2Duser_detail->user_company->EditCustomAttributes = "";
- $osj2Duser_detail->user_company->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_company->AdvancedSearch->SearchValue2);
- }
-
- // Call Row Rendered event
- $osj2Duser_detail->Row_Rendered();
- }
- ?>
- <?php
-
- // Load advanced search
- function LoadAdvancedSearch() {
- global $osj2Duser_detail;
- $osj2Duser_detail->user_id->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_id");
- $osj2Duser_detail->user_detail_creation_date->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_detail_creation_date");
- $osj2Duser_detail->user_detail_edit_date->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_detail_edit_date");
- $osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_first_name");
- $osj2Duser_detail->user_first_name->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_first_name");
- $osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_first_name");
- $osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_first_name");
- $osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_last_name");
- $osj2Duser_detail->user_last_name->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_last_name");
- $osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_last_name");
- $osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_last_name");
- $osj2Duser_detail->user_description->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_description");
- $osj2Duser_detail->user_description->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_description");
- $osj2Duser_detail->user_description->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_description");
- $osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_description");
- $osj2Duser_detail->user_company->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_company");
- $osj2Duser_detail->user_company->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_company");
- $osj2Duser_detail->user_company->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_company");
- $osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_company");
- }
- ?>
- <?php
-
- // Page Load event
- function Page_Load() {
-
- //echo "Page Load";
- }
-
- // Page Unload event
- function Page_Unload() {
-
- //echo "Page Unload";
- }
- ?>