PageRenderTime 54ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/usuariolist.php

https://github.com/fredd-for/emaus_tesoreria
PHP | 1069 lines | 818 code | 116 blank | 135 comment | 226 complexity | dfd54ca6fa74cd1a431ab7fe2bbeb41b MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. session_start(); // Initialize session data
  3. ob_start(); // Turn on output buffering
  4. ?>
  5. <?php include "ewcfg6.php" ?>
  6. <?php include "ewmysql6.php" ?>
  7. <?php include "phpfn6.php" ?>
  8. <?php include "usuarioinfo.php" ?>
  9. <?php include "userfn6.php" ?>
  10. <?php
  11. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  12. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
  13. header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
  14. header("Cache-Control: post-check=0, pre-check=0", false);
  15. header("Pragma: no-cache"); // HTTP/1.0
  16. ?>
  17. <?php
  18. // Define page object
  19. $usuario_list = new cusuario_list();
  20. $Page =& $usuario_list;
  21. // Page init processing
  22. $usuario_list->Page_Init();
  23. // Page main processing
  24. $usuario_list->Page_Main();
  25. ?>
  26. <?php include "header.php" ?>
  27. <?php if ($usuario->Export == "") { ?>
  28. <script type="text/javascript">
  29. <!--
  30. // Create page object
  31. var usuario_list = new ew_Page("usuario_list");
  32. // page properties
  33. usuario_list.PageID = "list"; // page ID
  34. var EW_PAGE_ID = usuario_list.PageID; // for backward compatibility
  35. // extend page with Form_CustomValidate function
  36. usuario_list.Form_CustomValidate =
  37. function(fobj) { // DO NOT CHANGE THIS LINE!
  38. // Your custom validation code here, return false if invalid.
  39. return true;
  40. }
  41. <?php if (EW_CLIENT_VALIDATE) { ?>
  42. usuario_list.ValidateRequired = true; // uses JavaScript validation
  43. <?php } else { ?>
  44. usuario_list.ValidateRequired = false; // no JavaScript validation
  45. <?php } ?>
  46. //-->
  47. </script>
  48. <script language="JavaScript" type="text/javascript">
  49. <!--
  50. // Write your client script here, no need to add script tags.
  51. // To include another .js script, use:
  52. // ew_ClientScriptInclude("my_javascript.js");
  53. //-->
  54. </script>
  55. <?php } ?>
  56. <?php if ($usuario->Export == "") { ?>
  57. <?php } ?>
  58. <?php
  59. $bSelectLimit = ($usuario->Export == "" && $usuario->SelectLimit);
  60. if (!$bSelectLimit)
  61. $rs = $usuario_list->LoadRecordset();
  62. $usuario_list->lTotalRecs = ($bSelectLimit) ? $usuario->SelectRecordCount() : $rs->RecordCount();
  63. $usuario_list->lStartRec = 1;
  64. if ($usuario_list->lDisplayRecs <= 0) // Display all records
  65. $usuario_list->lDisplayRecs = $usuario_list->lTotalRecs;
  66. if (!($usuario->ExportAll && $usuario->Export <> ""))
  67. $usuario_list->SetUpStartRec(); // Set up start record position
  68. if ($bSelectLimit)
  69. $rs = $usuario_list->LoadRecordset($usuario_list->lStartRec-1, $usuario_list->lDisplayRecs);
  70. ?>
  71. <p><span class="phpmaker" style="white-space: nowrap;">TABLA: Usuario
  72. <?php if ($usuario->Export == "" && $usuario->CurrentAction == "") { ?>
  73. &nbsp;&nbsp;<a href="<?php echo $usuario_list->PageUrl() ?>export=excel">Exportar a Excel</a>
  74. <?php } ?>
  75. </span></p>
  76. <?php $usuario_list->ShowMessage() ?>
  77. <br>
  78. <table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
  79. <div class="ewGridMiddlePanel">
  80. <form name="fusuariolist" id="fusuariolist" class="ewForm" action="" method="post">
  81. <?php if ($usuario_list->lTotalRecs > 0) { ?>
  82. <table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
  83. <?php
  84. $usuario_list->lOptionCnt = 0;
  85. if ($Security->CanView()) {
  86. $usuario_list->lOptionCnt++; // view
  87. }
  88. if ($Security->CanEdit()) {
  89. $usuario_list->lOptionCnt++; // edit
  90. }
  91. if ($Security->CanDelete()) {
  92. $usuario_list->lOptionCnt++; // Delete
  93. }
  94. $usuario_list->lOptionCnt += count($usuario_list->ListOptions->Items); // Custom list options
  95. ?>
  96. <?php echo $usuario->TableCustomInnerHtml ?>
  97. <thead><!-- Table header -->
  98. <tr class="ewTableHeader">
  99. <?php if ($usuario->idUsuario->Visible) { // idUsuario ?>
  100. <?php if ($usuario->SortUrl($usuario->idUsuario) == "") { ?>
  101. <td>No</td>
  102. <?php } else { ?>
  103. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $usuario->SortUrl($usuario->idUsuario) ?>',1);">
  104. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>No</td><td style="width: 10px;"><?php if ($usuario->idUsuario->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($usuario->idUsuario->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  105. </td>
  106. <?php } ?>
  107. <?php } ?>
  108. <?php if ($usuario->idRol->Visible) { // idRol ?>
  109. <?php if ($usuario->SortUrl($usuario->idRol) == "") { ?>
  110. <td>Rol</td>
  111. <?php } else { ?>
  112. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $usuario->SortUrl($usuario->idRol) ?>',1);">
  113. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Rol</td><td style="width: 10px;"><?php if ($usuario->idRol->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($usuario->idRol->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  114. </td>
  115. <?php } ?>
  116. <?php } ?>
  117. <?php if ($usuario->nombre->Visible) { // nombre ?>
  118. <?php if ($usuario->SortUrl($usuario->nombre) == "") { ?>
  119. <td>Nombre(s)</td>
  120. <?php } else { ?>
  121. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $usuario->SortUrl($usuario->nombre) ?>',1);">
  122. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Nombre(s)</td><td style="width: 10px;"><?php if ($usuario->nombre->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($usuario->nombre->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  123. </td>
  124. <?php } ?>
  125. <?php } ?>
  126. <?php if ($usuario->paterno->Visible) { // paterno ?>
  127. <?php if ($usuario->SortUrl($usuario->paterno) == "") { ?>
  128. <td>Apellido Paterno</td>
  129. <?php } else { ?>
  130. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $usuario->SortUrl($usuario->paterno) ?>',1);">
  131. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Apellido Paterno</td><td style="width: 10px;"><?php if ($usuario->paterno->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($usuario->paterno->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  132. </td>
  133. <?php } ?>
  134. <?php } ?>
  135. <?php if ($usuario->materno->Visible) { // materno ?>
  136. <?php if ($usuario->SortUrl($usuario->materno) == "") { ?>
  137. <td>Apellido Materno</td>
  138. <?php } else { ?>
  139. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $usuario->SortUrl($usuario->materno) ?>',1);">
  140. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Apellido Materno</td><td style="width: 10px;"><?php if ($usuario->materno->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($usuario->materno->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  141. </td>
  142. <?php } ?>
  143. <?php } ?>
  144. <?php if ($usuario->ci->Visible) { // ci ?>
  145. <?php if ($usuario->SortUrl($usuario->ci) == "") { ?>
  146. <td>C.I</td>
  147. <?php } else { ?>
  148. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $usuario->SortUrl($usuario->ci) ?>',1);">
  149. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>C.I</td><td style="width: 10px;"><?php if ($usuario->ci->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($usuario->ci->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  150. </td>
  151. <?php } ?>
  152. <?php } ?>
  153. <?php if ($usuario->cargo->Visible) { // cargo ?>
  154. <?php if ($usuario->SortUrl($usuario->cargo) == "") { ?>
  155. <td>Cargo en la Iglesia</td>
  156. <?php } else { ?>
  157. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $usuario->SortUrl($usuario->cargo) ?>',1);">
  158. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Cargo en la Iglesia</td><td style="width: 10px;"><?php if ($usuario->cargo->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($usuario->cargo->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  159. </td>
  160. <?php } ?>
  161. <?php } ?>
  162. <?php if ($usuario->Export == "") { ?>
  163. <?php if ($Security->CanView()) { ?>
  164. <td style="white-space: nowrap;">&nbsp;</td>
  165. <?php } ?>
  166. <?php if ($Security->CanEdit()) { ?>
  167. <td style="white-space: nowrap;">&nbsp;</td>
  168. <?php } ?>
  169. <?php if ($Security->CanDelete()) { ?>
  170. <td style="white-space: nowrap;">&nbsp;</td>
  171. <?php } ?>
  172. <?php
  173. // Custom list options
  174. foreach ($usuario_list->ListOptions->Items as $ListOption) {
  175. if ($ListOption->Visible)
  176. echo $ListOption->HeaderCellHtml;
  177. }
  178. ?>
  179. <?php } ?>
  180. </tr>
  181. </thead>
  182. <?php
  183. if ($usuario->ExportAll && $usuario->Export <> "") {
  184. $usuario_list->lStopRec = $usuario_list->lTotalRecs;
  185. } else {
  186. $usuario_list->lStopRec = $usuario_list->lStartRec + $usuario_list->lDisplayRecs - 1; // Set the last record to display
  187. }
  188. $usuario_list->lRecCount = $usuario_list->lStartRec - 1;
  189. if ($rs && !$rs->EOF) {
  190. $rs->MoveFirst();
  191. if (!$usuario->SelectLimit && $usuario_list->lStartRec > 1)
  192. $rs->Move($usuario_list->lStartRec - 1);
  193. }
  194. $usuario_list->lRowCnt = 0;
  195. while (($usuario->CurrentAction == "gridadd" || !$rs->EOF) &&
  196. $usuario_list->lRecCount < $usuario_list->lStopRec) {
  197. $usuario_list->lRecCount++;
  198. if (intval($usuario_list->lRecCount) >= intval($usuario_list->lStartRec)) {
  199. $usuario_list->lRowCnt++;
  200. // Init row class and style
  201. $usuario->CssClass = "";
  202. $usuario->CssStyle = "";
  203. $usuario->RowClientEvents = "onmouseover='ew_MouseOver(event, this);' onmouseout='ew_MouseOut(event, this);' onclick='ew_Click(event, this);'";
  204. if ($usuario->CurrentAction == "gridadd") {
  205. $usuario_list->LoadDefaultValues(); // Load default values
  206. } else {
  207. $usuario_list->LoadRowValues($rs); // Load row values
  208. }
  209. $usuario->RowType = EW_ROWTYPE_VIEW; // Render view
  210. // Render row
  211. $usuario_list->RenderRow();
  212. ?>
  213. <tr<?php echo $usuario->RowAttributes() ?>>
  214. <?php if ($usuario->idUsuario->Visible) { // idUsuario ?>
  215. <td<?php echo $usuario->idUsuario->CellAttributes() ?>>
  216. <div<?php echo $usuario->idUsuario->ViewAttributes() ?>><?php echo $usuario->idUsuario->ListViewValue() ?></div>
  217. </td>
  218. <?php } ?>
  219. <?php if ($usuario->idRol->Visible) { // idRol ?>
  220. <td<?php echo $usuario->idRol->CellAttributes() ?>>
  221. <div<?php echo $usuario->idRol->ViewAttributes() ?>><?php echo $usuario->idRol->ListViewValue() ?></div>
  222. </td>
  223. <?php } ?>
  224. <?php if ($usuario->nombre->Visible) { // nombre ?>
  225. <td<?php echo $usuario->nombre->CellAttributes() ?>>
  226. <div<?php echo $usuario->nombre->ViewAttributes() ?>><?php echo $usuario->nombre->ListViewValue() ?></div>
  227. </td>
  228. <?php } ?>
  229. <?php if ($usuario->paterno->Visible) { // paterno ?>
  230. <td<?php echo $usuario->paterno->CellAttributes() ?>>
  231. <div<?php echo $usuario->paterno->ViewAttributes() ?>><?php echo $usuario->paterno->ListViewValue() ?></div>
  232. </td>
  233. <?php } ?>
  234. <?php if ($usuario->materno->Visible) { // materno ?>
  235. <td<?php echo $usuario->materno->CellAttributes() ?>>
  236. <div<?php echo $usuario->materno->ViewAttributes() ?>><?php echo $usuario->materno->ListViewValue() ?></div>
  237. </td>
  238. <?php } ?>
  239. <?php if ($usuario->ci->Visible) { // ci ?>
  240. <td<?php echo $usuario->ci->CellAttributes() ?>>
  241. <div<?php echo $usuario->ci->ViewAttributes() ?>><?php echo $usuario->ci->ListViewValue() ?></div>
  242. </td>
  243. <?php } ?>
  244. <?php if ($usuario->cargo->Visible) { // cargo ?>
  245. <td<?php echo $usuario->cargo->CellAttributes() ?>>
  246. <div<?php echo $usuario->cargo->ViewAttributes() ?>><?php echo $usuario->cargo->ListViewValue() ?></div>
  247. </td>
  248. <?php } ?>
  249. <?php if ($usuario->Export == "") { ?>
  250. <?php if ($Security->CanView()) { ?>
  251. <td style="white-space: nowrap;"><span class="phpmaker">
  252. <a href="<?php echo $usuario->ViewUrl() ?>">Ver</a>
  253. </span></td>
  254. <?php } ?>
  255. <?php if ($Security->CanEdit()) { ?>
  256. <td style="white-space: nowrap;"><span class="phpmaker">
  257. <a href="<?php echo $usuario->EditUrl() ?>">Editar</a>
  258. </span></td>
  259. <?php } ?>
  260. <?php if ($Security->CanDelete()) { ?>
  261. <td style="white-space: nowrap;"><span class="phpmaker">
  262. <a onclick="ew_ClickDelete(this);return ew_ConfirmDelete('<?php echo $usuario_list->sDeleteConfirmMsg ?>', this);" href="<?php echo $usuario->DeleteUrl() ?>">Borrar</a>
  263. </span></td>
  264. <?php } ?>
  265. <?php
  266. // Custom list options
  267. foreach ($usuario_list->ListOptions->Items as $ListOption) {
  268. if ($ListOption->Visible)
  269. echo $ListOption->BodyCellHtml;
  270. }
  271. ?>
  272. <?php } ?>
  273. </tr>
  274. <?php
  275. }
  276. if ($usuario->CurrentAction <> "gridadd")
  277. $rs->MoveNext();
  278. }
  279. ?>
  280. </tbody>
  281. </table>
  282. <?php } ?>
  283. </form>
  284. <?php
  285. // Close recordset
  286. if ($rs)
  287. $rs->Close();
  288. ?>
  289. </div>
  290. <?php if ($usuario->Export == "") { ?>
  291. <div class="ewGridLowerPanel">
  292. <?php if ($usuario->CurrentAction <> "gridadd" && $usuario->CurrentAction <> "gridedit") { ?>
  293. <form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
  294. <table border="0" cellspacing="0" cellpadding="0" class="ewPager">
  295. <tr>
  296. <td nowrap>
  297. <?php if (!isset($usuario_list->Pager)) $usuario_list->Pager = new cPrevNextPager($usuario_list->lStartRec, $usuario_list->lDisplayRecs, $usuario_list->lTotalRecs) ?>
  298. <?php if ($usuario_list->Pager->RecordCount > 0) { ?>
  299. <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker">Página&nbsp;</span></td>
  300. <!--first page button-->
  301. <?php if ($usuario_list->Pager->FirstButton->Enabled) { ?>
  302. <td><a href="<?php echo $usuario_list->PageUrl() ?>start=<?php echo $usuario_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="Primera" width="16" height="16" border="0"></a></td>
  303. <?php } else { ?>
  304. <td><img src="images/firstdisab.gif" alt="Primera" width="16" height="16" border="0"></td>
  305. <?php } ?>
  306. <!--previous page button-->
  307. <?php if ($usuario_list->Pager->PrevButton->Enabled) { ?>
  308. <td><a href="<?php echo $usuario_list->PageUrl() ?>start=<?php echo $usuario_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="Anterior" width="16" height="16" border="0"></a></td>
  309. <?php } else { ?>
  310. <td><img src="images/prevdisab.gif" alt="Anterior" width="16" height="16" border="0"></td>
  311. <?php } ?>
  312. <!--current page number-->
  313. <td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $usuario_list->Pager->CurrentPage ?>" size="4"></td>
  314. <!--next page button-->
  315. <?php if ($usuario_list->Pager->NextButton->Enabled) { ?>
  316. <td><a href="<?php echo $usuario_list->PageUrl() ?>start=<?php echo $usuario_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="Siguiente" width="16" height="16" border="0"></a></td>
  317. <?php } else { ?>
  318. <td><img src="images/nextdisab.gif" alt="Siguiente" width="16" height="16" border="0"></td>
  319. <?php } ?>
  320. <!--last page button-->
  321. <?php if ($usuario_list->Pager->LastButton->Enabled) { ?>
  322. <td><a href="<?php echo $usuario_list->PageUrl() ?>start=<?php echo $usuario_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="Ultima" width="16" height="16" border="0"></a></td>
  323. <?php } else { ?>
  324. <td><img src="images/lastdisab.gif" alt="Ultima" width="16" height="16" border="0"></td>
  325. <?php } ?>
  326. <td><span class="phpmaker">&nbsp;de <?php echo $usuario_list->Pager->PageCount ?></span></td>
  327. </tr></table>
  328. </td>
  329. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  330. <td>
  331. <span class="phpmaker">Registro <?php echo $usuario_list->Pager->FromIndex ?> a <?php echo $usuario_list->Pager->ToIndex ?> de <?php echo $usuario_list->Pager->RecordCount ?></span>
  332. <?php } else { ?>
  333. <?php if ($Security->CanList()) { ?>
  334. <?php if ($usuario_list->sSrchWhere == "0=101") { ?>
  335. <span class="phpmaker">Por favor ingrese criterio de busqueda</span>
  336. <?php } else { ?>
  337. <span class="phpmaker">No se encontraron registros</span>
  338. <?php } ?>
  339. <?php } else { ?>
  340. <span class="phpmaker">No tiene permisos para consultar esta página</span>
  341. <?php } ?>
  342. <?php } ?>
  343. </td>
  344. <?php if ($usuario_list->lTotalRecs > 0) { ?>
  345. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  346. <td><table border="0" cellspacing="0" cellpadding="0"><tr><td>Registros por página&nbsp;</td><td>
  347. <input type="hidden" id="t" name="t" value="usuario">
  348. <select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onchange="this.form.submit();" class="phpmaker">
  349. <option value="20"<?php if ($usuario_list->lDisplayRecs == 20) { ?> selected="selected"<?php } ?>>20</option>
  350. <option value="50"<?php if ($usuario_list->lDisplayRecs == 50) { ?> selected="selected"<?php } ?>>50</option>
  351. <option value="ALL"<?php if ($usuario->getRecordsPerPage() == -1) { ?> selected="selected"<?php } ?>>Todos los registros</option>
  352. </select></td></tr></table>
  353. </td>
  354. <?php } ?>
  355. </tr>
  356. </table>
  357. </form>
  358. <?php } ?>
  359. <?php //if ($usuario_list->lTotalRecs > 0) { ?>
  360. <span class="phpmaker">
  361. <?php if ($Security->CanAdd()) { ?>
  362. <a href="<?php echo $usuario->AddUrl() ?>">Agregar</a>&nbsp;&nbsp;
  363. <?php } ?>
  364. </span>
  365. <?php //} ?>
  366. </div>
  367. <?php } ?>
  368. </td></tr></table>
  369. <?php if ($usuario->Export == "" && $usuario->CurrentAction == "") { ?>
  370. <script type="text/javascript">
  371. <!--
  372. //ew_ToggleSearchPanel(usuario_list); // uncomment to init search panel as collapsed
  373. //-->
  374. </script>
  375. <?php } ?>
  376. <?php if ($usuario->Export == "") { ?>
  377. <script language="JavaScript" type="text/javascript">
  378. <!--
  379. // Write your table-specific startup script here
  380. // document.write("page loaded");
  381. //-->
  382. </script>
  383. <?php } ?>
  384. <?php include "footer.php" ?>
  385. <?php
  386. //
  387. // Page Class
  388. //
  389. class cusuario_list {
  390. // Page ID
  391. var $PageID = 'list';
  392. // Table Name
  393. var $TableName = 'usuario';
  394. // Page Object Name
  395. var $PageObjName = 'usuario_list';
  396. // Page Name
  397. function PageName() {
  398. return ew_CurrentPage();
  399. }
  400. // Page Url
  401. function PageUrl() {
  402. $PageUrl = ew_CurrentPage() . "?";
  403. global $usuario;
  404. if ($usuario->UseTokenInUrl) $PageUrl .= "t=" . $usuario->TableVar . "&"; // add page token
  405. return $PageUrl;
  406. }
  407. // Message
  408. function getMessage() {
  409. return @$_SESSION[EW_SESSION_MESSAGE];
  410. }
  411. function setMessage($v) {
  412. if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
  413. $_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
  414. } else {
  415. $_SESSION[EW_SESSION_MESSAGE] = $v;
  416. }
  417. }
  418. // Show Message
  419. function ShowMessage() {
  420. if ($this->getMessage() <> "") { // Message in Session, display
  421. echo "<p><span class=\"ewMessage\">" . $this->getMessage() . "</span></p>";
  422. $_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
  423. }
  424. }
  425. // Validate Page request
  426. function IsPageRequest() {
  427. global $objForm, $usuario;
  428. if ($usuario->UseTokenInUrl) {
  429. //IsPageRequest = False
  430. if ($objForm)
  431. return ($usuario->TableVar == $objForm->GetValue("t"));
  432. if (@$_GET["t"] <> "")
  433. return ($usuario->TableVar == $_GET["t"]);
  434. } else {
  435. return TRUE;
  436. }
  437. }
  438. //
  439. // Class initialize
  440. // - init objects
  441. // - open connection
  442. //
  443. function cusuario_list() {
  444. global $conn;
  445. // Initialize table object
  446. $GLOBALS["usuario"] = new cusuario();
  447. // Intialize page id (for backward compatibility)
  448. if (!defined("EW_PAGE_ID"))
  449. define("EW_PAGE_ID", 'list', TRUE);
  450. // Initialize table name (for backward compatibility)
  451. if (!defined("EW_TABLE_NAME"))
  452. define("EW_TABLE_NAME", 'usuario', TRUE);
  453. // Open connection to the database
  454. $conn = ew_Connect();
  455. // Initialize list options
  456. $this->ListOptions = new cListOptions();
  457. }
  458. //
  459. // Page_Init
  460. //
  461. function Page_Init() {
  462. global $gsExport, $gsExportFile, $usuario;
  463. global $Security;
  464. $Security = new cAdvancedSecurity();
  465. if (!$Security->IsLoggedIn()) $Security->AutoLogin();
  466. if (!$Security->IsLoggedIn()) {
  467. $Security->SaveLastUrl();
  468. $this->Page_Terminate("login.php");
  469. }
  470. $Security->TablePermission_Loading();
  471. $Security->LoadCurrentUserLevel($this->TableName);
  472. $Security->TablePermission_Loaded();
  473. if (!$Security->IsLoggedIn()) {
  474. $Security->SaveLastUrl();
  475. $this->Page_Terminate("login.php");
  476. }
  477. if (!$Security->CanList()) {
  478. $Security->SaveLastUrl();
  479. $this->Page_Terminate("login.php");
  480. }
  481. $usuario->Export = @$_GET["export"]; // Get export parameter
  482. $gsExport = $usuario->Export; // Get export parameter, used in header
  483. $gsExportFile = $usuario->TableVar; // Get export file, used in header
  484. if ($usuario->Export == "excel") {
  485. header('Content-Type: application/vnd.ms-excel');
  486. header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
  487. }
  488. // Global page loading event (in userfn6.php)
  489. Page_Loading();
  490. // Page load event, used in current page
  491. $this->Page_Load();
  492. }
  493. //
  494. // Page_Terminate
  495. // - called when exit page
  496. // - if URL specified, redirect to the URL
  497. //
  498. function Page_Terminate($url = "") {
  499. global $conn;
  500. // Page unload event, used in current page
  501. $this->Page_Unload();
  502. // Global page unloaded event (in userfn*.php)
  503. Page_Unloaded();
  504. // Close Connection
  505. $conn->Close();
  506. // Go to URL if specified
  507. if ($url <> "") {
  508. ob_end_clean();
  509. header("Location: $url");
  510. }
  511. exit();
  512. }
  513. var $lDisplayRecs; // Number of display records
  514. var $lStartRec;
  515. var $lStopRec;
  516. var $lTotalRecs;
  517. var $lRecRange;
  518. var $sSrchWhere;
  519. var $lRecCnt;
  520. var $lEditRowCnt;
  521. var $lRowCnt;
  522. var $lRowIndex;
  523. var $lOptionCnt;
  524. var $lRecPerRow;
  525. var $lColCnt;
  526. var $sDeleteConfirmMsg; // Delete confirm message
  527. var $sDbMasterFilter;
  528. var $sDbDetailFilter;
  529. var $bMasterRecordExists;
  530. var $ListOptions;
  531. var $sMultiSelectKey;
  532. //
  533. // Page main processing
  534. //
  535. function Page_Main() {
  536. global $objForm, $gsSearchError, $Security, $usuario;
  537. $this->lDisplayRecs = 20;
  538. $this->lRecRange = 10;
  539. $this->lRecCnt = 0; // Record count
  540. // Search filters
  541. $sSrchAdvanced = ""; // Advanced search filter
  542. $sSrchBasic = ""; // Basic search filter
  543. $sFilter = "";
  544. $this->sSrchWhere = ""; // Search WHERE clause
  545. $this->sDeleteConfirmMsg = "żQuiere borrar este registro?"; // Delete confirm message
  546. // Master/Detail
  547. $this->sDbMasterFilter = ""; // Master filter
  548. $this->sDbDetailFilter = ""; // Detail filter
  549. if ($this->IsPageRequest()) { // Validate request
  550. // Set up records per page dynamically
  551. $this->SetUpDisplayRecs();
  552. // Handle reset command
  553. $this->ResetCmd();
  554. // Set Up Sorting Order
  555. $this->SetUpSortOrder();
  556. } // End Validate Request
  557. // Restore display records
  558. if ($usuario->getRecordsPerPage() <> "") {
  559. $this->lDisplayRecs = $usuario->getRecordsPerPage(); // Restore from Session
  560. } else {
  561. $this->lDisplayRecs = 20; // Load default
  562. }
  563. // Load Sorting Order
  564. $this->LoadSortOrder();
  565. // Build filter
  566. $sFilter = "";
  567. if (!$Security->CanList()) {
  568. $sFilter = "(0=1)"; // Filter all records
  569. }
  570. if ($this->sDbDetailFilter <> "")
  571. $sFilter = ($sFilter <> "") ? "($sFilter) AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
  572. if ($this->sSrchWhere <> "")
  573. $sFilter = ($sFilter <> "") ? "($sFilter) AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;
  574. // Set up filter in Session
  575. $usuario->setSessionWhere($sFilter);
  576. $usuario->CurrentFilter = "";
  577. // Export data only
  578. if (in_array($usuario->Export, array("html","word","excel","xml","csv"))) {
  579. $this->ExportData();
  580. $this->Page_Terminate(); // Terminate response
  581. exit();
  582. }
  583. }
  584. // Set up number of records displayed per page
  585. function SetUpDisplayRecs() {
  586. global $usuario;
  587. $sWrk = @$_GET[EW_TABLE_REC_PER_PAGE];
  588. if ($sWrk <> "") {
  589. if (is_numeric($sWrk)) {
  590. $this->lDisplayRecs = intval($sWrk);
  591. } else {
  592. if (strtolower($sWrk) == "all") { // Display all records
  593. $this->lDisplayRecs = -1;
  594. } else {
  595. $this->lDisplayRecs = 20; // Non-numeric, load default
  596. }
  597. }
  598. $usuario->setRecordsPerPage($this->lDisplayRecs); // Save to Session
  599. // Reset start position
  600. $this->lStartRec = 1;
  601. $usuario->setStartRecordNumber($this->lStartRec);
  602. }
  603. }
  604. // Set up Sort parameters based on Sort Links clicked
  605. function SetUpSortOrder() {
  606. global $usuario;
  607. // Check for an Order parameter
  608. if (@$_GET["order"] <> "") {
  609. $usuario->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
  610. $usuario->CurrentOrderType = @$_GET["ordertype"];
  611. $usuario->UpdateSort($usuario->idUsuario); // Field
  612. $usuario->UpdateSort($usuario->idRol); // Field
  613. $usuario->UpdateSort($usuario->nombre); // Field
  614. $usuario->UpdateSort($usuario->paterno); // Field
  615. $usuario->UpdateSort($usuario->materno); // Field
  616. $usuario->UpdateSort($usuario->ci); // Field
  617. $usuario->UpdateSort($usuario->cargo); // Field
  618. $usuario->setStartRecordNumber(1); // Reset start position
  619. }
  620. }
  621. // Load Sort Order parameters
  622. function LoadSortOrder() {
  623. global $usuario;
  624. $sOrderBy = $usuario->getSessionOrderBy(); // Get order by from Session
  625. if ($sOrderBy == "") {
  626. if ($usuario->SqlOrderBy() <> "") {
  627. $sOrderBy = $usuario->SqlOrderBy();
  628. $usuario->setSessionOrderBy($sOrderBy);
  629. }
  630. }
  631. }
  632. // Reset command based on querystring parameter cmd=
  633. // - RESET: reset search parameters
  634. // - RESETALL: reset search & master/detail parameters
  635. // - RESETSORT: reset sort parameters
  636. function ResetCmd() {
  637. global $usuario;
  638. // Get reset cmd
  639. if (@$_GET["cmd"] <> "") {
  640. $sCmd = $_GET["cmd"];
  641. // Reset sort criteria
  642. if (strtolower($sCmd) == "resetsort") {
  643. $sOrderBy = "";
  644. $usuario->setSessionOrderBy($sOrderBy);
  645. $usuario->idUsuario->setSort("");
  646. $usuario->idRol->setSort("");
  647. $usuario->nombre->setSort("");
  648. $usuario->paterno->setSort("");
  649. $usuario->materno->setSort("");
  650. $usuario->ci->setSort("");
  651. $usuario->cargo->setSort("");
  652. }
  653. // Reset start position
  654. $this->lStartRec = 1;
  655. $usuario->setStartRecordNumber($this->lStartRec);
  656. }
  657. }
  658. // Set up Starting Record parameters based on Pager Navigation
  659. function SetUpStartRec() {
  660. global $usuario;
  661. if ($this->lDisplayRecs == 0)
  662. return;
  663. if ($this->IsPageRequest()) { // Validate request
  664. if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
  665. $this->lStartRec = $_GET[EW_TABLE_START_REC];
  666. $usuario->setStartRecordNumber($this->lStartRec);
  667. } elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
  668. $this->nPageNo = $_GET[EW_TABLE_PAGE_NO];
  669. if (is_numeric($this->nPageNo)) {
  670. $this->lStartRec = ($this->nPageNo-1)*$this->lDisplayRecs+1;
  671. if ($this->lStartRec <= 0) {
  672. $this->lStartRec = 1;
  673. } elseif ($this->lStartRec >= intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1) {
  674. $this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1;
  675. }
  676. $usuario->setStartRecordNumber($this->lStartRec);
  677. }
  678. }
  679. }
  680. $this->lStartRec = $usuario->getStartRecordNumber();
  681. // Check if correct start record counter
  682. if (!is_numeric($this->lStartRec) || $this->lStartRec == "") { // Avoid invalid start record counter
  683. $this->lStartRec = 1; // Reset start record counter
  684. $usuario->setStartRecordNumber($this->lStartRec);
  685. } elseif (intval($this->lStartRec) > intval($this->lTotalRecs)) { // Avoid starting record > total records
  686. $this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to last page first record
  687. $usuario->setStartRecordNumber($this->lStartRec);
  688. } elseif (($this->lStartRec-1) % $this->lDisplayRecs <> 0) {
  689. $this->lStartRec = intval(($this->lStartRec-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to page boundary
  690. $usuario->setStartRecordNumber($this->lStartRec);
  691. }
  692. }
  693. // Load recordset
  694. function LoadRecordset($offset = -1, $rowcnt = -1) {
  695. global $conn, $usuario;
  696. // Call Recordset Selecting event
  697. $usuario->Recordset_Selecting($usuario->CurrentFilter);
  698. // Load list page SQL
  699. $sSql = $usuario->SelectSQL();
  700. if ($offset > -1 && $rowcnt > -1) $sSql .= " LIMIT $offset, $rowcnt";
  701. // Load recordset
  702. $conn->raiseErrorFn = 'ew_ErrorFn';
  703. $rs = $conn->Execute($sSql);
  704. $conn->raiseErrorFn = '';
  705. // Call Recordset Selected event
  706. $usuario->Recordset_Selected($rs);
  707. return $rs;
  708. }
  709. // Load row based on key values
  710. function LoadRow() {
  711. global $conn, $Security, $usuario;
  712. $sFilter = $usuario->KeyFilter();
  713. // Call Row Selecting event
  714. $usuario->Row_Selecting($sFilter);
  715. // Load sql based on filter
  716. $usuario->CurrentFilter = $sFilter;
  717. $sSql = $usuario->SQL();
  718. if ($rs = $conn->Execute($sSql)) {
  719. if ($rs->EOF) {
  720. $LoadRow = FALSE;
  721. } else {
  722. $LoadRow = TRUE;
  723. $rs->MoveFirst();
  724. $this->LoadRowValues($rs); // Load row values
  725. // Call Row Selected event
  726. $usuario->Row_Selected($rs);
  727. }
  728. $rs->Close();
  729. } else {
  730. $LoadRow = FALSE;
  731. }
  732. return $LoadRow;
  733. }
  734. // Load row values from recordset
  735. function LoadRowValues(&$rs) {
  736. global $usuario;
  737. $usuario->idUsuario->setDbValue($rs->fields('idUsuario'));
  738. $usuario->idRol->setDbValue($rs->fields('idRol'));
  739. $usuario->nombre->setDbValue($rs->fields('nombre'));
  740. $usuario->paterno->setDbValue($rs->fields('paterno'));
  741. $usuario->materno->setDbValue($rs->fields('materno'));
  742. $usuario->ci->setDbValue($rs->fields('ci'));
  743. $usuario->cargo->setDbValue($rs->fields('cargo'));
  744. $usuario->zlogin->setDbValue($rs->fields('login'));
  745. $usuario->password->setDbValue($rs->fields('password'));
  746. }
  747. // Render row values based on field settings
  748. function RenderRow() {
  749. global $conn, $Security, $usuario;
  750. // Call Row_Rendering event
  751. $usuario->Row_Rendering();
  752. // Common render codes for all row types
  753. // idUsuario
  754. $usuario->idUsuario->CellCssStyle = "";
  755. $usuario->idUsuario->CellCssClass = "";
  756. // idRol
  757. $usuario->idRol->CellCssStyle = "";
  758. $usuario->idRol->CellCssClass = "";
  759. // nombre
  760. $usuario->nombre->CellCssStyle = "";
  761. $usuario->nombre->CellCssClass = "";
  762. // paterno
  763. $usuario->paterno->CellCssStyle = "";
  764. $usuario->paterno->CellCssClass = "";
  765. // materno
  766. $usuario->materno->CellCssStyle = "";
  767. $usuario->materno->CellCssClass = "";
  768. // ci
  769. $usuario->ci->CellCssStyle = "";
  770. $usuario->ci->CellCssClass = "";
  771. // cargo
  772. $usuario->cargo->CellCssStyle = "";
  773. $usuario->cargo->CellCssClass = "";
  774. if ($usuario->RowType == EW_ROWTYPE_VIEW) { // View row
  775. // idUsuario
  776. $usuario->idUsuario->ViewValue = $usuario->idUsuario->CurrentValue;
  777. $usuario->idUsuario->CssStyle = "";
  778. $usuario->idUsuario->CssClass = "";
  779. $usuario->idUsuario->ViewCustomAttributes = "";
  780. // idRol
  781. if ($Security->CanAdmin()) { // System admin
  782. if (strval($usuario->idRol->CurrentValue) <> "") {
  783. $sSqlWrk = "SELECT `nombre` FROM `rol` WHERE `idRol` = " . ew_AdjustSql($usuario->idRol->CurrentValue) . "";
  784. $sSqlWrk .= " ORDER BY `nombre` Asc";
  785. $rswrk = $conn->Execute($sSqlWrk);
  786. if ($rswrk && !$rswrk->EOF) { // Lookup value(s) found
  787. $usuario->idRol->ViewValue = $rswrk->fields('nombre');
  788. $rswrk->Close();
  789. } else {
  790. $usuario->idRol->ViewValue = $usuario->idRol->CurrentValue;
  791. }
  792. } else {
  793. $usuario->idRol->ViewValue = NULL;
  794. }
  795. } else {
  796. $usuario->idRol->ViewValue = "********";
  797. }
  798. $usuario->idRol->CssStyle = "";
  799. $usuario->idRol->CssClass = "";
  800. $usuario->idRol->ViewCustomAttributes = "";
  801. // nombre
  802. $usuario->nombre->ViewValue = $usuario->nombre->CurrentValue;
  803. $usuario->nombre->CssStyle = "";
  804. $usuario->nombre->CssClass = "";
  805. $usuario->nombre->ViewCustomAttributes = "";
  806. // paterno
  807. $usuario->paterno->ViewValue = $usuario->paterno->CurrentValue;
  808. $usuario->paterno->CssStyle = "";
  809. $usuario->paterno->CssClass = "";
  810. $usuario->paterno->ViewCustomAttributes = "";
  811. // materno
  812. $usuario->materno->ViewValue = $usuario->materno->CurrentValue;
  813. $usuario->materno->CssStyle = "";
  814. $usuario->materno->CssClass = "";
  815. $usuario->materno->ViewCustomAttributes = "";
  816. // ci
  817. $usuario->ci->ViewValue = $usuario->ci->CurrentValue;
  818. $usuario->ci->CssStyle = "";
  819. $usuario->ci->CssClass = "";
  820. $usuario->ci->ViewCustomAttributes = "";
  821. // cargo
  822. $usuario->cargo->ViewValue = $usuario->cargo->CurrentValue;
  823. $usuario->cargo->CssStyle = "";
  824. $usuario->cargo->CssClass = "";
  825. $usuario->cargo->ViewCustomAttributes = "";
  826. // idUsuario
  827. $usuario->idUsuario->HrefValue = "";
  828. // idRol
  829. $usuario->idRol->HrefValue = "";
  830. // nombre
  831. $usuario->nombre->HrefValue = "";
  832. // paterno
  833. $usuario->paterno->HrefValue = "";
  834. // materno
  835. $usuario->materno->HrefValue = "";
  836. // ci
  837. $usuario->ci->HrefValue = "";
  838. // cargo
  839. $usuario->cargo->HrefValue = "";
  840. }
  841. // Call Row Rendered event
  842. $usuario->Row_Rendered();
  843. }
  844. // Export data in XML or CSV format
  845. function ExportData() {
  846. global $usuario;
  847. $sCsvStr = "";
  848. // Default export style
  849. $sExportStyle = "h";
  850. // Load recordset
  851. $rs = $this->LoadRecordset();
  852. $this->lTotalRecs = $rs->RecordCount();
  853. $this->lStartRec = 1;
  854. // Export all
  855. if ($usuario->ExportAll) {
  856. $this->lStopRec = $this->lTotalRecs;
  857. } else { // Export 1 page only
  858. $this->SetUpStartRec(); // Set up start record position
  859. // Set the last record to display
  860. if ($this->lDisplayRecs < 0) {
  861. $this->lStopRec = $this->lTotalRecs;
  862. } else {
  863. $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
  864. }
  865. }
  866. if ($usuario->Export == "xml") {
  867. $XmlDoc = new cXMLDocument();
  868. } else {
  869. echo ew_ExportHeader($usuario->Export);
  870. // Horizontal format, write header
  871. if ($sExportStyle <> "v" || $usuario->Export == "csv") {
  872. $sExportStr = "";
  873. ew_ExportAddValue($sExportStr, 'idUsuario', $usuario->Export);
  874. ew_ExportAddValue($sExportStr, 'idRol', $usuario->Export);
  875. ew_ExportAddValue($sExportStr, 'nombre', $usuario->Export);
  876. ew_ExportAddValue($sExportStr, 'paterno', $usuario->Export);
  877. ew_ExportAddValue($sExportStr, 'materno', $usuario->Export);
  878. ew_ExportAddValue($sExportStr, 'ci', $usuario->Export);
  879. ew_ExportAddValue($sExportStr, 'cargo', $usuario->Export);
  880. echo ew_ExportLine($sExportStr, $usuario->Export);
  881. }
  882. }
  883. // Move to first record
  884. $this->lRecCnt = $this->lStartRec - 1;
  885. if (!$rs->EOF) {
  886. $rs->MoveFirst();
  887. $rs->Move($this->lStartRec - 1);
  888. }
  889. while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
  890. $this->lRecCnt++;
  891. if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
  892. $this->LoadRowValues($rs);
  893. // Render row for display
  894. $usuario->RowType = EW_ROWTYPE_VIEW; // Render view
  895. $this->RenderRow();
  896. if ($usuario->Export == "xml") {
  897. $XmlDoc->BeginRow();
  898. $XmlDoc->AddField('idUsuario', $usuario->idUsuario->CurrentValue);
  899. $XmlDoc->AddField('idRol', $usuario->idRol->CurrentValue);
  900. $XmlDoc->AddField('nombre', $usuario->nombre->CurrentValue);
  901. $XmlDoc->AddField('paterno', $usuario->paterno->CurrentValue);
  902. $XmlDoc->AddField('materno', $usuario->materno->CurrentValue);
  903. $XmlDoc->AddField('ci', $usuario->ci->CurrentValue);
  904. $XmlDoc->AddField('cargo', $usuario->cargo->CurrentValue);
  905. $XmlDoc->EndRow();
  906. } else {
  907. if ($sExportStyle == "v" && $usuario->Export <> "csv") { // Vertical format
  908. echo ew_ExportField('idUsuario', $usuario->idUsuario->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  909. echo ew_ExportField('idRol', $usuario->idRol->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  910. echo ew_ExportField('nombre', $usuario->nombre->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  911. echo ew_ExportField('paterno', $usuario->paterno->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  912. echo ew_ExportField('materno', $usuario->materno->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  913. echo ew_ExportField('ci', $usuario->ci->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  914. echo ew_ExportField('cargo', $usuario->cargo->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  915. } else { // Horizontal format
  916. $sExportStr = "";
  917. ew_ExportAddValue($sExportStr, $usuario->idUsuario->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  918. ew_ExportAddValue($sExportStr, $usuario->idRol->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  919. ew_ExportAddValue($sExportStr, $usuario->nombre->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  920. ew_ExportAddValue($sExportStr, $usuario->paterno->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  921. ew_ExportAddValue($sExportStr, $usuario->materno->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  922. ew_ExportAddValue($sExportStr, $usuario->ci->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  923. ew_ExportAddValue($sExportStr, $usuario->cargo->ExportValue($usuario->Export, $usuario->ExportOriginalValue), $usuario->Export);
  924. echo ew_ExportLine($sExportStr, $usuario->Export);
  925. }
  926. }
  927. }
  928. $rs->MoveNext();
  929. }
  930. // Close recordset
  931. $rs->Close();
  932. if ($usuario->Export == "xml") {
  933. header("Content-Type: text/xml");
  934. echo $XmlDoc->XML();
  935. } else {
  936. echo ew_ExportFooter($usuario->Export);
  937. }
  938. }
  939. // Page Load event
  940. function Page_Load() {
  941. //echo "Page Load";
  942. }
  943. // Page Unload event
  944. function Page_Unload() {
  945. //echo "Page Unload";
  946. }
  947. // Form Custom Validate event
  948. function Form_CustomValidate(&$CustomError) {
  949. // Return error message in CustomError
  950. return TRUE;
  951. }
  952. }
  953. ?>