PageRenderTime 144ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/osj-osj2duser_detailsrch.php

http://osjobber.googlecode.com/
PHP | 446 lines | 346 code | 47 blank | 53 comment | 61 complexity | 7c1a6824d0f30c234bf1e93168edabcc MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0
  1. <?php
  2. define("EW_PAGE_ID", "search", TRUE); // Page ID
  3. define("EW_TABLE_NAME", 'osj-user_detail', TRUE);
  4. ?>
  5. <?php
  6. session_start(); // Initialize session data
  7. ob_start(); // Turn on output buffering
  8. ?>
  9. <?php include "osj-ewcfg50.php" ?>
  10. <?php include "osj-ewmysql50.php" ?>
  11. <?php include "osj-phpfn50.php" ?>
  12. <?php include "osj-osj2duser_detailinfo.php" ?>
  13. <?php include "osj-userfn50.php" ?>
  14. <?php include "osj-osj2dusersinfo.php" ?>
  15. <?php
  16. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  17. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
  18. header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
  19. header("Cache-Control: post-check=0, pre-check=0", false);
  20. header("Pragma: no-cache"); // HTTP/1.0
  21. ?>
  22. <?php
  23. // Open connection to the database
  24. $conn = ew_Connect();
  25. ?>
  26. <?php
  27. $Security = new cAdvancedSecurity();
  28. ?>
  29. <?php
  30. if (!$Security->IsLoggedIn()) $Security->AutoLogin();
  31. $Security->LoadCurrentUserLevel('osj-user_detail');
  32. if (!$Security->IsLoggedIn()) {
  33. $Security->SaveLastUrl();
  34. Page_Terminate("osj-login.php");
  35. }
  36. if (!$Security->CanSearch()) {
  37. $Security->SaveLastUrl();
  38. Page_Terminate("osj-osj2duser_detaillist.php");
  39. }
  40. if ($Security->IsLoggedIn() && $Security->CurrentUserID() == "") {
  41. $_SESSION[EW_SESSION_MESSAGE] = "You do not have the right permission to view the page";
  42. Page_Terminate("osj-login.php");
  43. }
  44. ?>
  45. <?php
  46. // Common page loading event (in userfn*.php)
  47. Page_Loading();
  48. ?>
  49. <?php
  50. // Page load event, used in current page
  51. Page_Load();
  52. ?>
  53. <?php
  54. $osj2Duser_detail->Export = @$_GET["export"]; // Get export parameter
  55. $sExport = $osj2Duser_detail->Export; // Get export parameter, used in header
  56. $sExportFile = $osj2Duser_detail->TableVar; // Get export file, used in header
  57. ?>
  58. <?php
  59. // Get action
  60. $osj2Duser_detail->CurrentAction = @$_POST["a_search"];
  61. switch ($osj2Duser_detail->CurrentAction) {
  62. case "S": // Get Search Criteria
  63. // Build search string for advanced search, remove blank field
  64. $sSrchStr = BuildAdvancedSearch();
  65. if ($sSrchStr <> "") {
  66. Page_Terminate("osj-osj2duser_detaillist.php?" . $sSrchStr); // Go to list page
  67. }
  68. break;
  69. default: // Restore search settings
  70. LoadAdvancedSearch();
  71. }
  72. // Render row for search
  73. $osj2Duser_detail->RowType = EW_ROWTYPE_SEARCH;
  74. RenderRow();
  75. ?>
  76. <?php include "osj-header.php" ?>
  77. <script type="text/javascript">
  78. <!--
  79. var EW_PAGE_ID = "search"; // Page id
  80. var EW_SHOW_HIGHLIGHT = "Show highlight";
  81. var EW_HIDE_HIGHLIGHT = "Hide highlight";
  82. //-->
  83. </script>
  84. <script type="text/javascript">
  85. <!--
  86. function ew_ValidateForm(fobj) {
  87. if (fobj.a_confirm && fobj.a_confirm.value == "F")
  88. return true;
  89. var i, elm, aelm, infix;
  90. var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
  91. for (i=0; i<rowcnt; i++) {
  92. infix = (fobj.key_count) ? String(i+1) : "";
  93. }
  94. return true;
  95. }
  96. //-->
  97. </script>
  98. <script type="text/javascript">
  99. <!--
  100. var ew_DHTMLEditors = [];
  101. //-->
  102. </script>
  103. <script type="text/javascript">
  104. <!--
  105. // js for Popup Calendar
  106. //-->
  107. </script>
  108. <script language="JavaScript" type="text/javascript">
  109. <!--
  110. // Write your client script here, no need to add script tags.
  111. // To include another .js script, use:
  112. // ew_ClientScriptInclude("my_javascript.js");
  113. //-->
  114. </script>
  115. <p><span class="phpmaker">Search TABLE: User Details<br><br><a href="osj-osj2duser_detaillist.php">Back to List</a></span></p>
  116. <form name="fosj2Duser_detailsearch" id="fosj2Duser_detailsearch" action="osj-osj2duser_detailsrch.php" method="post" onSubmit="return ew_ValidateForm(this);">
  117. <p>
  118. <input type="hidden" name="a_search" id="a_search" value="S">
  119. <table class="ewTable">
  120. <tr class="ewTableRow">
  121. <td class="ewTableHeader">user id</td>
  122. <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>
  123. <td<?php echo $osj2Duser_detail->user_id->CellAttributes() ?>><span class="phpmaker">
  124. <?php if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin ?>
  125. <div<?php echo $osj2Duser_detail->user_id->ViewAttributes() ?>><?php echo $osj2Duser_detail->user_id->EditValue ?></div>
  126. <input type="hidden" name="x_user_id" id="x_user_id" value="<?php echo ew_HtmlEncode($osj2Duser_detail->user_id->AdvancedSearch->SearchValue) ?>">
  127. <?php } else { ?>
  128. <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>
  129. <div class='ewAstList' style='visibility:hidden' id='as_x_user_id'></div>
  130. <input type="hidden" name="sv_x_user_id" id="sv_x_user_id" value="">
  131. <?php
  132. $sSqlWrk = "SELECT DISTINCT `user_email`, '' FROM `osj-users` WHERE (`user_email` LIKE '@FILTER_VALUE%')";
  133. $sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
  134. ?>
  135. <input type="hidden" name="s_x_user_id" id="s_x_user_id" value="<?php echo $sSqlWrk ?>">
  136. <input type="hidden" name="lt_x_user_id" id="lt_x_user_id" value="1">
  137. <?php } ?>
  138. </span></td>
  139. </tr>
  140. <tr class="ewTableAltRow">
  141. <td class="ewTableHeader">detail creation date</td>
  142. <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>
  143. <td<?php echo $osj2Duser_detail->user_detail_creation_date->CellAttributes() ?>><span class="phpmaker">
  144. </span></td>
  145. </tr>
  146. <tr class="ewTableRow">
  147. <td class="ewTableHeader">detail edit date</td>
  148. <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>
  149. <td<?php echo $osj2Duser_detail->user_detail_edit_date->CellAttributes() ?>><span class="phpmaker">
  150. </span></td>
  151. </tr>
  152. <tr class="ewTableAltRow">
  153. <td class="ewTableHeader">First Name</td>
  154. <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>
  155. <td<?php echo $osj2Duser_detail->user_first_name->CellAttributes() ?>><span class="phpmaker">
  156. <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() ?>>
  157. </span></td>
  158. </tr>
  159. <tr class="ewTableAltRow">
  160. <td class="ewTableHeader" align="right">
  161. <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>
  162. </td>
  163. <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>
  164. <td<?php echo $osj2Duser_detail->user_first_name->CellAttributes() ?>><span class="phpmaker">
  165. <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() ?>>
  166. </span></td>
  167. </tr>
  168. <tr class="ewTableRow">
  169. <td class="ewTableHeader">Last Name</td>
  170. <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>
  171. <td<?php echo $osj2Duser_detail->user_last_name->CellAttributes() ?>><span class="phpmaker">
  172. <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() ?>>
  173. </span></td>
  174. </tr>
  175. <tr class="ewTableRow">
  176. <td class="ewTableHeader" align="right">
  177. <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>
  178. </td>
  179. <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>
  180. <td<?php echo $osj2Duser_detail->user_last_name->CellAttributes() ?>><span class="phpmaker">
  181. <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() ?>>
  182. </span></td>
  183. </tr>
  184. <tr class="ewTableAltRow">
  185. <td class="ewTableHeader">Description</td>
  186. <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>
  187. <td<?php echo $osj2Duser_detail->user_description->CellAttributes() ?>><span class="phpmaker">
  188. <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>
  189. </span></td>
  190. </tr>
  191. <tr class="ewTableAltRow">
  192. <td class="ewTableHeader" align="right">
  193. <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>
  194. </td>
  195. <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>
  196. <td<?php echo $osj2Duser_detail->user_description->CellAttributes() ?>><span class="phpmaker">
  197. <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>
  198. </span></td>
  199. </tr>
  200. <tr class="ewTableRow">
  201. <td class="ewTableHeader">Company</td>
  202. <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>
  203. <td<?php echo $osj2Duser_detail->user_company->CellAttributes() ?>><span class="phpmaker">
  204. <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() ?>>
  205. </span></td>
  206. </tr>
  207. <tr class="ewTableRow">
  208. <td class="ewTableHeader" align="right">
  209. <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>
  210. </td>
  211. <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>
  212. <td<?php echo $osj2Duser_detail->user_company->CellAttributes() ?>><span class="phpmaker">
  213. <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() ?>>
  214. </span></td>
  215. </tr>
  216. </table>
  217. <p>
  218. <input type="submit" name="Action" id="Action" value=" Search ">
  219. <input type="button" name="Reset" id="Reset" value=" Reset " onclick="ew_ClearForm(this.form);">
  220. </form>
  221. <script language="JavaScript" type="text/javascript">
  222. <!--
  223. // Write your table-specific startup script here
  224. // document.write("page loaded");
  225. //-->
  226. </script>
  227. <?php include "osj-footer.php" ?>
  228. <?php
  229. // If control is passed here, simply terminate the page without redirect
  230. Page_Terminate();
  231. // -----------------------------------------------------------------
  232. // Subroutine Page_Terminate
  233. // - called when exit page
  234. // - clean up connection and objects
  235. // - if url specified, redirect to url, otherwise end response
  236. function Page_Terminate($url = "") {
  237. global $conn;
  238. // Page unload event, used in current page
  239. Page_Unload();
  240. // Global page unloaded event (in userfn*.php)
  241. Page_Unloaded();
  242. // Close Connection
  243. $conn->Close();
  244. // Go to url if specified
  245. if ($url <> "") {
  246. ob_end_clean();
  247. header("Location: $url");
  248. }
  249. exit();
  250. }
  251. ?>
  252. <?php
  253. // Build advanced search
  254. function BuildAdvancedSearch() {
  255. global $osj2Duser_detail;
  256. $sSrchUrl = "";
  257. // Field user_id
  258. 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"]);
  259. // Field user_detail_creation_date
  260. 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"]);
  261. // Field user_detail_edit_date
  262. 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"]);
  263. // Field user_first_name
  264. 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"]);
  265. // Field user_last_name
  266. 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"]);
  267. // Field user_description
  268. 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"]);
  269. // Field user_company
  270. 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"]);
  271. return $sSrchUrl;
  272. }
  273. // Function to build search URL
  274. function BuildSearchUrl(&$Url, &$Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2) {
  275. $sWrk = "";
  276. $FldParm = substr($Fld->FldVar, 2);
  277. $FldVal = ew_StripSlashes($FldVal);
  278. if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
  279. $FldVal2 = ew_StripSlashes($FldVal2);
  280. if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
  281. $FldOpr = strtoupper(trim($FldOpr));
  282. if ($FldOpr == "BETWEEN") {
  283. $IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
  284. ($Fld->FldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal) && is_numeric($FldVal2));
  285. if ($FldVal <> "" && $FldVal2 <> "" && $IsValidValue) {
  286. $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
  287. "&y_" . $FldParm . "=" . urlencode($FldVal2) .
  288. "&z_" . $FldParm . "=" . urlencode($FldOpr);
  289. }
  290. } elseif ($FldOpr == "IS NULL" || $FldOpr == "IS NOT NULL") {
  291. $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
  292. "&z_" . $FldParm . "=" . urlencode($FldOpr);
  293. } else {
  294. $IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
  295. ($Fld->FldDataType = EW_DATATYPE_NUMBER && is_numeric($FldVal));
  296. if ($FldVal <> "" && $IsValidValue && ew_IsValidOpr($FldOpr, $Fld->FldDataType)) {
  297. $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
  298. "&z_" . $FldParm . "=" . urlencode($FldOpr);
  299. }
  300. $IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
  301. ($Fld->FldDataType = EW_DATATYPE_NUMBER && is_numeric($FldVal2));
  302. if ($FldVal2 <> "" && $IsValidValue && ew_IsValidOpr($FldOpr2, $Fld->FldDataType)) {
  303. if ($sWrk <> "") $sWrk .= "&v_" . $FldParm . "=" . urlencode($FldCond) . "&";
  304. $sWrk .= "&y_" . $FldParm . "=" . urlencode($FldVal2) .
  305. "&w_" . $FldParm . "=" . urlencode($FldOpr2);
  306. }
  307. }
  308. if ($sWrk <> "") {
  309. if ($Url <> "") $Url .= "&";
  310. $Url .= $sWrk;
  311. }
  312. }
  313. ?>
  314. <?php
  315. // Render row values based on field settings
  316. function RenderRow() {
  317. global $conn, $Security, $osj2Duser_detail;
  318. // Call Row Rendering event
  319. $osj2Duser_detail->Row_Rendering();
  320. // Common render codes for all row types
  321. if ($osj2Duser_detail->RowType == EW_ROWTYPE_VIEW) { // View row
  322. } elseif ($osj2Duser_detail->RowType == EW_ROWTYPE_ADD) { // Add row
  323. } elseif ($osj2Duser_detail->RowType == EW_ROWTYPE_EDIT) { // Edit row
  324. } elseif ($osj2Duser_detail->RowType == EW_ROWTYPE_SEARCH) { // Search row
  325. // user_id
  326. $osj2Duser_detail->user_id->EditCustomAttributes = "";
  327. if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin
  328. $osj2Duser_detail->user_id->AdvancedSearch->SearchValue = $Security->CurrentUserID();
  329. $osj2Duser_detail->user_id->EditValue = $osj2Duser_detail->user_id->AdvancedSearch->SearchValue;
  330. $osj2Duser_detail->user_id->CssStyle = "";
  331. $osj2Duser_detail->user_id->CssClass = "";
  332. $osj2Duser_detail->user_id->ViewCustomAttributes = "";
  333. } else {
  334. $osj2Duser_detail->user_id->EditValue = ew_HtmlEncode($osj2Duser_detail->user_id->AdvancedSearch->SearchValue);
  335. }
  336. // user_detail_creation_date
  337. $osj2Duser_detail->user_detail_creation_date->EditCustomAttributes = "";
  338. // user_detail_edit_date
  339. $osj2Duser_detail->user_detail_edit_date->EditCustomAttributes = "";
  340. // user_first_name
  341. $osj2Duser_detail->user_first_name->EditCustomAttributes = "";
  342. $osj2Duser_detail->user_first_name->EditValue = ew_HtmlEncode($osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue);
  343. $osj2Duser_detail->user_first_name->EditCustomAttributes = "";
  344. $osj2Duser_detail->user_first_name->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue2);
  345. // user_last_name
  346. $osj2Duser_detail->user_last_name->EditCustomAttributes = "";
  347. $osj2Duser_detail->user_last_name->EditValue = ew_HtmlEncode($osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue);
  348. $osj2Duser_detail->user_last_name->EditCustomAttributes = "";
  349. $osj2Duser_detail->user_last_name->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue2);
  350. // user_description
  351. $osj2Duser_detail->user_description->EditCustomAttributes = "";
  352. $osj2Duser_detail->user_description->EditValue = ew_HtmlEncode($osj2Duser_detail->user_description->AdvancedSearch->SearchValue);
  353. $osj2Duser_detail->user_description->EditCustomAttributes = "";
  354. $osj2Duser_detail->user_description->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_description->AdvancedSearch->SearchValue2);
  355. // user_company
  356. $osj2Duser_detail->user_company->EditCustomAttributes = "";
  357. $osj2Duser_detail->user_company->EditValue = ew_HtmlEncode($osj2Duser_detail->user_company->AdvancedSearch->SearchValue);
  358. $osj2Duser_detail->user_company->EditCustomAttributes = "";
  359. $osj2Duser_detail->user_company->EditValue2 = ew_HtmlEncode($osj2Duser_detail->user_company->AdvancedSearch->SearchValue2);
  360. }
  361. // Call Row Rendered event
  362. $osj2Duser_detail->Row_Rendered();
  363. }
  364. ?>
  365. <?php
  366. // Load advanced search
  367. function LoadAdvancedSearch() {
  368. global $osj2Duser_detail;
  369. $osj2Duser_detail->user_id->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_id");
  370. $osj2Duser_detail->user_detail_creation_date->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_detail_creation_date");
  371. $osj2Duser_detail->user_detail_edit_date->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_detail_edit_date");
  372. $osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_first_name");
  373. $osj2Duser_detail->user_first_name->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_first_name");
  374. $osj2Duser_detail->user_first_name->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_first_name");
  375. $osj2Duser_detail->user_first_name->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_first_name");
  376. $osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_last_name");
  377. $osj2Duser_detail->user_last_name->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_last_name");
  378. $osj2Duser_detail->user_last_name->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_last_name");
  379. $osj2Duser_detail->user_last_name->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_last_name");
  380. $osj2Duser_detail->user_description->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_description");
  381. $osj2Duser_detail->user_description->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_description");
  382. $osj2Duser_detail->user_description->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_description");
  383. $osj2Duser_detail->user_description->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_description");
  384. $osj2Duser_detail->user_company->AdvancedSearch->SearchValue = $osj2Duser_detail->getAdvancedSearch("x_user_company");
  385. $osj2Duser_detail->user_company->AdvancedSearch->SearchCondition = $osj2Duser_detail->getAdvancedSearch("v_user_company");
  386. $osj2Duser_detail->user_company->AdvancedSearch->SearchValue2 = $osj2Duser_detail->getAdvancedSearch("y_user_company");
  387. $osj2Duser_detail->user_company->AdvancedSearch->SearchOperator2 = $osj2Duser_detail->getAdvancedSearch("w_user_company");
  388. }
  389. ?>
  390. <?php
  391. // Page Load event
  392. function Page_Load() {
  393. //echo "Page Load";
  394. }
  395. // Page Unload event
  396. function Page_Unload() {
  397. //echo "Page Unload";
  398. }
  399. ?>