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

/osj-osj2duserssrch.php

http://osjobber.googlecode.com/
PHP | 490 lines | 392 code | 46 blank | 52 comment | 81 complexity | 624ad9a9b0a2d31ad78d835ccd672261 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-users', 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-osj2dusersinfo.php" ?>
  13. <?php include "osj-userfn50.php" ?>
  14. <?php
  15. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  16. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
  17. header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
  18. header("Cache-Control: post-check=0, pre-check=0", false);
  19. header("Pragma: no-cache"); // HTTP/1.0
  20. ?>
  21. <?php
  22. // Open connection to the database
  23. $conn = ew_Connect();
  24. ?>
  25. <?php
  26. $Security = new cAdvancedSecurity();
  27. ?>
  28. <?php
  29. if (!$Security->IsLoggedIn()) $Security->AutoLogin();
  30. $Security->LoadCurrentUserLevel('osj-users');
  31. if (!$Security->IsLoggedIn()) {
  32. $Security->SaveLastUrl();
  33. Page_Terminate("osj-login.php");
  34. }
  35. if (!$Security->CanSearch()) {
  36. $Security->SaveLastUrl();
  37. Page_Terminate("osj-osj2duserslist.php");
  38. }
  39. if ($Security->IsLoggedIn() && $Security->CurrentUserID() == "") {
  40. $_SESSION[EW_SESSION_MESSAGE] = "You do not have the right permission to view the page";
  41. Page_Terminate("osj-login.php");
  42. }
  43. ?>
  44. <?php
  45. // Common page loading event (in userfn*.php)
  46. Page_Loading();
  47. ?>
  48. <?php
  49. // Page load event, used in current page
  50. Page_Load();
  51. ?>
  52. <?php
  53. $osj2Dusers->Export = @$_GET["export"]; // Get export parameter
  54. $sExport = $osj2Dusers->Export; // Get export parameter, used in header
  55. $sExportFile = $osj2Dusers->TableVar; // Get export file, used in header
  56. ?>
  57. <?php
  58. // Get action
  59. $osj2Dusers->CurrentAction = @$_POST["a_search"];
  60. switch ($osj2Dusers->CurrentAction) {
  61. case "S": // Get Search Criteria
  62. // Build search string for advanced search, remove blank field
  63. $sSrchStr = BuildAdvancedSearch();
  64. if ($sSrchStr <> "") {
  65. Page_Terminate("osj-osj2duserslist.php?" . $sSrchStr); // Go to list page
  66. }
  67. break;
  68. default: // Restore search settings
  69. LoadAdvancedSearch();
  70. }
  71. // Render row for search
  72. $osj2Dusers->RowType = EW_ROWTYPE_SEARCH;
  73. RenderRow();
  74. ?>
  75. <?php include "osj-header.php" ?>
  76. <script type="text/javascript">
  77. <!--
  78. var EW_PAGE_ID = "search"; // Page id
  79. var EW_SHOW_HIGHLIGHT = "Show highlight";
  80. var EW_HIDE_HIGHLIGHT = "Hide highlight";
  81. //-->
  82. </script>
  83. <script type="text/javascript">
  84. <!--
  85. function ew_ValidateForm(fobj) {
  86. if (fobj.a_confirm && fobj.a_confirm.value == "F")
  87. return true;
  88. var i, elm, aelm, infix;
  89. var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
  90. for (i=0; i<rowcnt; i++) {
  91. infix = (fobj.key_count) ? String(i+1) : "";
  92. elm = fobj.elements["x" + infix + "_user_email"];
  93. if (elm && !ew_CheckEmail(elm.value)) {
  94. if (!ew_OnError(elm, "Users must provide a valid email address."))
  95. return false;
  96. }
  97. }
  98. return true;
  99. }
  100. //-->
  101. </script>
  102. <script type="text/javascript">
  103. <!--
  104. var ew_DHTMLEditors = [];
  105. //-->
  106. </script>
  107. <script type="text/javascript">
  108. <!--
  109. // js for Popup Calendar
  110. //-->
  111. </script>
  112. <script language="JavaScript" type="text/javascript">
  113. <!--
  114. // Write your client script here, no need to add script tags.
  115. // To include another .js script, use:
  116. // ew_ClientScriptInclude("my_javascript.js");
  117. //-->
  118. </script>
  119. <p><span class="phpmaker">Search TABLE: Users<br><br><a href="osj-osj2duserslist.php">Back to List</a></span></p>
  120. <form name="fosj2Duserssearch" id="fosj2Duserssearch" action="osj-osj2duserssrch.php" method="post" onSubmit="return ew_ValidateForm(this);">
  121. <p>
  122. <input type="hidden" name="a_search" id="a_search" value="S">
  123. <table class="ewTable">
  124. <tr class="ewTableRow">
  125. <td class="ewTableHeader">User ID</td>
  126. <td<?php echo $osj2Dusers->user_id->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_user_id" id="z_user_id" value="="></span></td>
  127. <td<?php echo $osj2Dusers->user_id->CellAttributes() ?>><span class="phpmaker">
  128. <?php if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin ?>
  129. <input type="hidden" name="x_user_id" id="x_user_id" value="<?php echo ew_HtmlEncode($osj2Dusers->user_id->AdvancedSearch->SearchValue) ?>">
  130. <?php } else { ?>
  131. <?php } ?>
  132. </span></td>
  133. </tr>
  134. <tr class="ewTableRow">
  135. <td class="ewTableHeader" align="right">
  136. <input type="radio" name="v_user_id" id="v_user_id" value="AND"<?php if ($osj2Dusers->user_id->AdvancedSearch->SearchCondition <> "OR") echo " checked" ?>>and <span name="_v_user_id" id="_v_user_id"><input type="radio" name="v_user_id" id="v_user_id" value="OR"<?php if ($osj2Dusers->user_id->AdvancedSearch->SearchCondition == "OR") echo " checked" ?>>or</span>
  137. </td>
  138. <td<?php echo $osj2Dusers->user_id->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_id" id="_w_user_id"><select name="w_user_id" id="w_user_id"><option value="="<?php echo ($osj2Dusers->user_id->AdvancedSearch->SearchOperator2=="=")?" selected":"" ?>>=</option><option value="<>"<?php echo ($osj2Dusers->user_id->AdvancedSearch->SearchOperator2=="<>")?" selected":"" ?>><></option><option value="<"<?php echo ($osj2Dusers->user_id->AdvancedSearch->SearchOperator2=="<")?" selected":"" ?>><</option><option value="<="<?php echo ($osj2Dusers->user_id->AdvancedSearch->SearchOperator2=="<=")?" selected":"" ?>><=</option><option value=">"<?php echo ($osj2Dusers->user_id->AdvancedSearch->SearchOperator2==">")?" selected":"" ?>>></option><option value=">="<?php echo ($osj2Dusers->user_id->AdvancedSearch->SearchOperator2==">=")?" selected":"" ?>>>=</option></select></span></td>
  139. <td<?php echo $osj2Dusers->user_id->CellAttributes() ?>><span class="phpmaker">
  140. <?php if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin ?>
  141. <input type="hidden" name="y_user_id" id="y_user_id" value="<?php echo ew_HtmlEncode($osj2Dusers->user_id->AdvancedSearch->SearchValue2) ?>">
  142. <?php } else { ?>
  143. <?php } ?>
  144. </span></td>
  145. </tr>
  146. <tr class="ewTableAltRow">
  147. <td class="ewTableHeader">Creation Date</td>
  148. <td<?php echo $osj2Dusers->user_creation_date->CellAttributes() ?>><span class="ewSearchOpr">between<input type="hidden" name="z_user_creation_date" id="z_user_creation_date" value="BETWEEN"></span></td>
  149. <td<?php echo $osj2Dusers->user_creation_date->CellAttributes() ?>><span class="phpmaker">
  150. </span></td>
  151. </tr>
  152. <tr class="ewTableAltRow">
  153. <td class="ewTableHeader" align="right">
  154. </td>
  155. <td<?php echo $osj2Dusers->user_creation_date->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_creation_date" id="_w_user_creation_date">and<input type="hidden" name="w_user_creation_date" id="w_user_creation_date" value="AND"></span></td>
  156. <td<?php echo $osj2Dusers->user_creation_date->CellAttributes() ?>><span class="phpmaker">
  157. </span></td>
  158. </tr>
  159. <tr class="ewTableRow">
  160. <td class="ewTableHeader">Edit Date</td>
  161. <td<?php echo $osj2Dusers->user_edit_date->CellAttributes() ?>><span class="ewSearchOpr">between<input type="hidden" name="z_user_edit_date" id="z_user_edit_date" value="BETWEEN"></span></td>
  162. <td<?php echo $osj2Dusers->user_edit_date->CellAttributes() ?>><span class="phpmaker">
  163. </span></td>
  164. </tr>
  165. <tr class="ewTableRow">
  166. <td class="ewTableHeader" align="right">
  167. </td>
  168. <td<?php echo $osj2Dusers->user_edit_date->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_edit_date" id="_w_user_edit_date">and<input type="hidden" name="w_user_edit_date" id="w_user_edit_date" value="AND"></span></td>
  169. <td<?php echo $osj2Dusers->user_edit_date->CellAttributes() ?>><span class="phpmaker">
  170. </span></td>
  171. </tr>
  172. <tr class="ewTableAltRow">
  173. <td class="ewTableHeader">Email</td>
  174. <td<?php echo $osj2Dusers->user_email->CellAttributes() ?>><span class="ewSearchOpr">starts with<input type="hidden" name="z_user_email" id="z_user_email" value="STARTS WITH"></span></td>
  175. <td<?php echo $osj2Dusers->user_email->CellAttributes() ?>><span class="phpmaker">
  176. <input type="text" name="x_user_email" id="x_user_email" title="Email" size="30" maxlength="255" value="<?php echo $osj2Dusers->user_email->EditValue ?>"<?php echo $osj2Dusers->user_email->EditAttributes() ?>>
  177. </span></td>
  178. </tr>
  179. <tr class="ewTableAltRow">
  180. <td class="ewTableHeader" align="right">
  181. <input type="radio" name="v_user_email" id="v_user_email" value="AND"<?php if ($osj2Dusers->user_email->AdvancedSearch->SearchCondition <> "OR") echo " checked" ?>>and <span name="_v_user_email" id="_v_user_email"><input type="radio" name="v_user_email" id="v_user_email" value="OR"<?php if ($osj2Dusers->user_email->AdvancedSearch->SearchCondition == "OR") echo " checked" ?>>or</span>
  182. </td>
  183. <td<?php echo $osj2Dusers->user_email->CellAttributes() ?>><span class="ewSearchOpr" name="_w_user_email" id="_w_user_email"><select name="w_user_email" id="w_user_email"><option value="="<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2=="=")?" selected":"" ?>>=</option><option value="<>"<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2=="<>")?" selected":"" ?>><></option><option value="<"<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2=="<")?" selected":"" ?>><</option><option value="<="<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2=="<=")?" selected":"" ?>><=</option><option value=">"<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2==">")?" selected":"" ?>>></option><option value=">="<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2==">=")?" selected":"" ?>>>=</option><option value="LIKE"<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2=="LIKE")?" selected":"" ?>>contains</option><option value="NOT LIKE"<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2=="NOT LIKE")?" selected":"" ?>>not contains</option><option value="STARTS WITH"<?php echo ($osj2Dusers->user_email->AdvancedSearch->SearchOperator2=="STARTS WITH")?" selected":"" ?>>starts with</option></select></span></td>
  184. <td<?php echo $osj2Dusers->user_email->CellAttributes() ?>><span class="phpmaker">
  185. <input type="text" name="y_user_email" id="y_user_email" title="Email" size="30" maxlength="255" value="<?php echo $osj2Dusers->user_email->EditValue2 ?>"<?php echo $osj2Dusers->user_email->EditAttributes() ?>>
  186. </span></td>
  187. </tr>
  188. <tr class="ewTableRow">
  189. <td class="ewTableHeader">User Level</td>
  190. <td<?php echo $osj2Dusers->user_level->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_user_level" id="z_user_level" value="="></span></td>
  191. <td<?php echo $osj2Dusers->user_level->CellAttributes() ?>><span class="phpmaker">
  192. <?php if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin ?>
  193. <div<?php echo $osj2Dusers->user_level->ViewAttributes() ?>><?php echo $osj2Dusers->user_level->EditValue ?></div>
  194. <?php } else { ?>
  195. <select id="x_user_level" name="x_user_level"<?php echo $osj2Dusers->user_level->EditAttributes() ?>>
  196. <!--option value="">Please Select</option-->
  197. <?php
  198. if (is_array($osj2Dusers->user_level->EditValue)) {
  199. $arwrk = $osj2Dusers->user_level->EditValue;
  200. $rowswrk = count($arwrk);
  201. for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
  202. $selwrk = (strval($osj2Dusers->user_level->AdvancedSearch->SearchValue) == strval($arwrk[$rowcntwrk][0])) ? " selected" : "";
  203. ?>
  204. <option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
  205. <?php echo $arwrk[$rowcntwrk][1] ?>
  206. </option>
  207. <?php
  208. }
  209. }
  210. ?>
  211. </select>
  212. <?php
  213. $sSqlWrk = "SELECT `user_level_id`, `user_level_name` FROM `osj-user_level`";
  214. $sSqlWrk .= " WHERE (" . "`user_level_name` != 'Default' AND `user_level_name`!= 'Administrator'" . ")";
  215. $sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
  216. ?>
  217. <input type="hidden" name="s_x_user_level" id="s_x_user_level" value="<?php echo $sSqlWrk ?>"><input type="hidden" name="lc_x_user_level" id="lc_x_user_level" value="2"><input type="hidden" name="ld1_x_user_level" id="ld1_x_user_level" value="1"><input type="hidden" name="ld2_x_user_level" id="ld2_x_user_level" value="-1"><input type="hidden" name="lft_x_user_level" id="lft_x_user_level" value="1">
  218. <?php } ?>
  219. </span></td>
  220. </tr>
  221. <tr class="ewTableAltRow">
  222. <td class="ewTableHeader">User Status</td>
  223. <td<?php echo $osj2Dusers->user_status->CellAttributes() ?>><span class="ewSearchOpr">=<input type="hidden" name="z_user_status" id="z_user_status" value="="></span></td>
  224. <td<?php echo $osj2Dusers->user_status->CellAttributes() ?>><span class="phpmaker">
  225. <select id="x_user_status" name="x_user_status"<?php echo $osj2Dusers->user_status->EditAttributes() ?>>
  226. <!--option value="">Please Select</option-->
  227. <?php
  228. if (is_array($osj2Dusers->user_status->EditValue)) {
  229. $arwrk = $osj2Dusers->user_status->EditValue;
  230. $rowswrk = count($arwrk);
  231. for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
  232. $selwrk = (strval($osj2Dusers->user_status->AdvancedSearch->SearchValue) == strval($arwrk[$rowcntwrk][0])) ? " selected" : "";
  233. ?>
  234. <option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
  235. <?php echo $arwrk[$rowcntwrk][1] ?>
  236. </option>
  237. <?php
  238. }
  239. }
  240. ?>
  241. </select>
  242. </span></td>
  243. </tr>
  244. </table>
  245. <p>
  246. <input type="submit" name="Action" id="Action" value=" Search ">
  247. <input type="button" name="Reset" id="Reset" value=" Reset " onclick="ew_ClearForm(this.form);">
  248. </form>
  249. <script language="JavaScript">
  250. <!--
  251. var f = document.fosj2Duserssearch;
  252. ew_AjaxUpdateOpt(f.x_user_level, f.x_user_level, false);
  253. //-->
  254. </script>
  255. <script language="JavaScript" type="text/javascript">
  256. <!--
  257. // Write your table-specific startup script here
  258. // document.write("page loaded");
  259. //-->
  260. </script>
  261. <?php include "osj-footer.php" ?>
  262. <?php
  263. // If control is passed here, simply terminate the page without redirect
  264. Page_Terminate();
  265. // -----------------------------------------------------------------
  266. // Subroutine Page_Terminate
  267. // - called when exit page
  268. // - clean up connection and objects
  269. // - if url specified, redirect to url, otherwise end response
  270. function Page_Terminate($url = "") {
  271. global $conn;
  272. // Page unload event, used in current page
  273. Page_Unload();
  274. // Global page unloaded event (in userfn*.php)
  275. Page_Unloaded();
  276. // Close Connection
  277. $conn->Close();
  278. // Go to url if specified
  279. if ($url <> "") {
  280. ob_end_clean();
  281. header("Location: $url");
  282. }
  283. exit();
  284. }
  285. ?>
  286. <?php
  287. // Build advanced search
  288. function BuildAdvancedSearch() {
  289. global $osj2Dusers;
  290. $sSrchUrl = "";
  291. // Field user_id
  292. BuildSearchUrl($sSrchUrl, $osj2Dusers->user_id, @$_POST["x_user_id"], @$_POST["z_user_id"], @$_POST["v_user_id"], @$_POST["y_user_id"], @$_POST["w_user_id"]);
  293. // Field user_creation_date
  294. BuildSearchUrl($sSrchUrl, $osj2Dusers->user_creation_date, ew_UnFormatDateTime(@$_POST["x_user_creation_date"],6), @$_POST["z_user_creation_date"], @$_POST["v_user_creation_date"], ew_UnFormatDateTime(@$_POST["y_user_creation_date"],6), @$_POST["w_user_creation_date"]);
  295. // Field user_edit_date
  296. BuildSearchUrl($sSrchUrl, $osj2Dusers->user_edit_date, ew_UnFormatDateTime(@$_POST["x_user_edit_date"],6), @$_POST["z_user_edit_date"], @$_POST["v_user_edit_date"], ew_UnFormatDateTime(@$_POST["y_user_edit_date"],6), @$_POST["w_user_edit_date"]);
  297. // Field user_email
  298. BuildSearchUrl($sSrchUrl, $osj2Dusers->user_email, @$_POST["x_user_email"], @$_POST["z_user_email"], @$_POST["v_user_email"], @$_POST["y_user_email"], @$_POST["w_user_email"]);
  299. // Field user_level
  300. BuildSearchUrl($sSrchUrl, $osj2Dusers->user_level, @$_POST["x_user_level"], @$_POST["z_user_level"], @$_POST["v_user_level"], @$_POST["y_user_level"], @$_POST["w_user_level"]);
  301. // Field user_status
  302. BuildSearchUrl($sSrchUrl, $osj2Dusers->user_status, @$_POST["x_user_status"], @$_POST["z_user_status"], @$_POST["v_user_status"], @$_POST["y_user_status"], @$_POST["w_user_status"]);
  303. return $sSrchUrl;
  304. }
  305. // Function to build search URL
  306. function BuildSearchUrl(&$Url, &$Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2) {
  307. $sWrk = "";
  308. $FldParm = substr($Fld->FldVar, 2);
  309. $FldVal = ew_StripSlashes($FldVal);
  310. if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
  311. $FldVal2 = ew_StripSlashes($FldVal2);
  312. if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
  313. $FldOpr = strtoupper(trim($FldOpr));
  314. if ($FldOpr == "BETWEEN") {
  315. $IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
  316. ($Fld->FldDataType == EW_DATATYPE_NUMBER && is_numeric($FldVal) && is_numeric($FldVal2));
  317. if ($FldVal <> "" && $FldVal2 <> "" && $IsValidValue) {
  318. $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
  319. "&y_" . $FldParm . "=" . urlencode($FldVal2) .
  320. "&z_" . $FldParm . "=" . urlencode($FldOpr);
  321. }
  322. } elseif ($FldOpr == "IS NULL" || $FldOpr == "IS NOT NULL") {
  323. $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
  324. "&z_" . $FldParm . "=" . urlencode($FldOpr);
  325. } else {
  326. $IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
  327. ($Fld->FldDataType = EW_DATATYPE_NUMBER && is_numeric($FldVal));
  328. if ($FldVal <> "" && $IsValidValue && ew_IsValidOpr($FldOpr, $Fld->FldDataType)) {
  329. $sWrk = "x_" . $FldParm . "=" . urlencode($FldVal) .
  330. "&z_" . $FldParm . "=" . urlencode($FldOpr);
  331. }
  332. $IsValidValue = ($Fld->FldDataType <> EW_DATATYPE_NUMBER) ||
  333. ($Fld->FldDataType = EW_DATATYPE_NUMBER && is_numeric($FldVal2));
  334. if ($FldVal2 <> "" && $IsValidValue && ew_IsValidOpr($FldOpr2, $Fld->FldDataType)) {
  335. if ($sWrk <> "") $sWrk .= "&v_" . $FldParm . "=" . urlencode($FldCond) . "&";
  336. $sWrk .= "&y_" . $FldParm . "=" . urlencode($FldVal2) .
  337. "&w_" . $FldParm . "=" . urlencode($FldOpr2);
  338. }
  339. }
  340. if ($sWrk <> "") {
  341. if ($Url <> "") $Url .= "&";
  342. $Url .= $sWrk;
  343. }
  344. }
  345. ?>
  346. <?php
  347. // Render row values based on field settings
  348. function RenderRow() {
  349. global $conn, $Security, $osj2Dusers;
  350. // Call Row Rendering event
  351. $osj2Dusers->Row_Rendering();
  352. // Common render codes for all row types
  353. if ($osj2Dusers->RowType == EW_ROWTYPE_VIEW) { // View row
  354. } elseif ($osj2Dusers->RowType == EW_ROWTYPE_ADD) { // Add row
  355. } elseif ($osj2Dusers->RowType == EW_ROWTYPE_EDIT) { // Edit row
  356. } elseif ($osj2Dusers->RowType == EW_ROWTYPE_SEARCH) { // Search row
  357. // user_id
  358. $osj2Dusers->user_id->EditCustomAttributes = "";
  359. if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin
  360. $osj2Dusers->user_id->AdvancedSearch->SearchValue = $Security->CurrentUserID();
  361. $osj2Dusers->user_id->CssStyle = "";
  362. $osj2Dusers->user_id->CssClass = "";
  363. $osj2Dusers->user_id->ViewCustomAttributes = "";
  364. } else {
  365. }
  366. $osj2Dusers->user_id->EditCustomAttributes = "";
  367. if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin
  368. $osj2Dusers->user_id->AdvancedSearch->SearchValue2 = $Security->CurrentUserID();
  369. $osj2Dusers->user_id->CssStyle = "";
  370. $osj2Dusers->user_id->CssClass = "";
  371. $osj2Dusers->user_id->ViewCustomAttributes = "";
  372. } else {
  373. }
  374. // user_creation_date
  375. $osj2Dusers->user_creation_date->EditCustomAttributes = "";
  376. $osj2Dusers->user_creation_date->EditCustomAttributes = "";
  377. // user_edit_date
  378. $osj2Dusers->user_edit_date->EditCustomAttributes = "";
  379. $osj2Dusers->user_edit_date->EditCustomAttributes = "";
  380. // user_email
  381. $osj2Dusers->user_email->EditCustomAttributes = "";
  382. $osj2Dusers->user_email->EditValue = ew_HtmlEncode($osj2Dusers->user_email->AdvancedSearch->SearchValue);
  383. $osj2Dusers->user_email->EditCustomAttributes = "";
  384. $osj2Dusers->user_email->EditValue2 = ew_HtmlEncode($osj2Dusers->user_email->AdvancedSearch->SearchValue2);
  385. // user_level
  386. $osj2Dusers->user_level->EditCustomAttributes = "";
  387. if (!$Security->CanAdmin()) { // System admin
  388. $osj2Dusers->user_level->EditValue = "********";
  389. } else {
  390. $sSqlWrk = "SELECT `user_level_id`, `user_level_name` FROM `osj-user_level`";
  391. if (trim(strval($osj2Dusers->user_level->AdvancedSearch->SearchValue)) == "") {
  392. $sSqlWrk .= " WHERE 0=1";
  393. } else {
  394. $sSqlWrk .= " WHERE `user_level_id` = " . ew_AdjustSql($osj2Dusers->user_level->AdvancedSearch->SearchValue) . "";
  395. }
  396. $sSqlWrk .= " AND (" . "`user_level_name` != 'Default' AND `user_level_name`!= 'Administrator'" . ")";
  397. $rswrk = $conn->Execute($sSqlWrk);
  398. $arwrk = ($rswrk) ? $rswrk->GetRows() : array();
  399. if ($rswrk) $rswrk->Close();
  400. array_unshift($arwrk, array("", "Please Select"));
  401. $osj2Dusers->user_level->EditValue = $arwrk;
  402. }
  403. // user_status
  404. $osj2Dusers->user_status->EditCustomAttributes = "";
  405. $arwrk = array();
  406. $arwrk[] = array("0", "Inactive");
  407. $arwrk[] = array("1", "Active");
  408. array_unshift($arwrk, array("", "Please Select"));
  409. $osj2Dusers->user_status->EditValue = $arwrk;
  410. }
  411. // Call Row Rendered event
  412. $osj2Dusers->Row_Rendered();
  413. }
  414. ?>
  415. <?php
  416. // Load advanced search
  417. function LoadAdvancedSearch() {
  418. global $osj2Dusers;
  419. $osj2Dusers->user_id->AdvancedSearch->SearchValue = $osj2Dusers->getAdvancedSearch("x_user_id");
  420. $osj2Dusers->user_id->AdvancedSearch->SearchCondition = $osj2Dusers->getAdvancedSearch("v_user_id");
  421. $osj2Dusers->user_id->AdvancedSearch->SearchValue2 = $osj2Dusers->getAdvancedSearch("y_user_id");
  422. $osj2Dusers->user_id->AdvancedSearch->SearchOperator2 = $osj2Dusers->getAdvancedSearch("w_user_id");
  423. $osj2Dusers->user_creation_date->AdvancedSearch->SearchValue = $osj2Dusers->getAdvancedSearch("x_user_creation_date");
  424. $osj2Dusers->user_creation_date->AdvancedSearch->SearchValue2 = $osj2Dusers->getAdvancedSearch("y_user_creation_date");
  425. $osj2Dusers->user_edit_date->AdvancedSearch->SearchValue = $osj2Dusers->getAdvancedSearch("x_user_edit_date");
  426. $osj2Dusers->user_edit_date->AdvancedSearch->SearchValue2 = $osj2Dusers->getAdvancedSearch("y_user_edit_date");
  427. $osj2Dusers->user_email->AdvancedSearch->SearchValue = $osj2Dusers->getAdvancedSearch("x_user_email");
  428. $osj2Dusers->user_email->AdvancedSearch->SearchCondition = $osj2Dusers->getAdvancedSearch("v_user_email");
  429. $osj2Dusers->user_email->AdvancedSearch->SearchValue2 = $osj2Dusers->getAdvancedSearch("y_user_email");
  430. $osj2Dusers->user_email->AdvancedSearch->SearchOperator2 = $osj2Dusers->getAdvancedSearch("w_user_email");
  431. $osj2Dusers->user_level->AdvancedSearch->SearchValue = $osj2Dusers->getAdvancedSearch("x_user_level");
  432. $osj2Dusers->user_status->AdvancedSearch->SearchValue = $osj2Dusers->getAdvancedSearch("x_user_status");
  433. }
  434. ?>
  435. <?php
  436. // Page Load event
  437. function Page_Load() {
  438. //echo "Page Load";
  439. }
  440. // Page Unload event
  441. function Page_Unload() {
  442. //echo "Page Unload";
  443. }
  444. ?>