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

/saldo_iglesialist.php

https://github.com/fredd-for/emaus_tesoreria
PHP | 1581 lines | 1198 code | 182 blank | 201 comment | 372 complexity | 666aefcc6bb95734a5a4ce4a70b42530 MD5 | raw file
Possible License(s): LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  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 "saldo_iglesiainfo.php" ?>
  9. <?php include "usuarioinfo.php" ?>
  10. <?php include "userfn6.php" ?>
  11. <?php
  12. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  13. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
  14. header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
  15. header("Cache-Control: post-check=0, pre-check=0", false);
  16. header("Pragma: no-cache"); // HTTP/1.0
  17. ?>
  18. <?php
  19. // Define page object
  20. $saldo_iglesia_list = new csaldo_iglesia_list();
  21. $Page =& $saldo_iglesia_list;
  22. // Page init processing
  23. $saldo_iglesia_list->Page_Init();
  24. // Page main processing
  25. $saldo_iglesia_list->Page_Main();
  26. ?>
  27. <?php include "header.php" ?>
  28. <?php if ($saldo_iglesia->Export == "") { ?>
  29. <script type="text/javascript">
  30. <!--
  31. // Create page object
  32. var saldo_iglesia_list = new ew_Page("saldo_iglesia_list");
  33. // page properties
  34. saldo_iglesia_list.PageID = "list"; // page ID
  35. var EW_PAGE_ID = saldo_iglesia_list.PageID; // for backward compatibility
  36. // extend page with ValidateForm function
  37. saldo_iglesia_list.ValidateForm = function(fobj) {
  38. if (!this.ValidateRequired)
  39. return true; // ignore validation
  40. if (fobj.a_confirm && fobj.a_confirm.value == "F")
  41. return true;
  42. var i, elm, aelm, infix;
  43. var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
  44. for (i=0; i<rowcnt; i++) {
  45. infix = (fobj.key_count) ? String(i+1) : "";
  46. elm = fobj.elements["x" + infix + "_fecha"];
  47. if (elm && !ew_HasValue(elm))
  48. return ew_OnError(this, elm, "Por favor ingrese los campos requeridos - Fecha");
  49. elm = fobj.elements["x" + infix + "_fecha"];
  50. if (elm && !ew_CheckEuroDate(elm.value))
  51. return ew_OnError(this, elm, "Fecha incorrecta, formato = dd-mm-yyyy - Fecha");
  52. elm = fobj.elements["x" + infix + "_nro_fact_recibo"];
  53. if (elm && !ew_CheckInteger(elm.value))
  54. return ew_OnError(this, elm, "Entero Incorrecto - Recibo");
  55. elm = fobj.elements["x" + infix + "_detalle"];
  56. if (elm && !ew_HasValue(elm))
  57. return ew_OnError(this, elm, "Por favor ingrese los campos requeridos - Detalle");
  58. elm = fobj.elements["x" + infix + "_ingreso"];
  59. if (elm && !ew_CheckNumber(elm.value))
  60. return ew_OnError(this, elm, "Número de Punto Flotante Incorrecto - Ingreso");
  61. elm = fobj.elements["x" + infix + "_egreso"];
  62. if (elm && !ew_CheckNumber(elm.value))
  63. return ew_OnError(this, elm, "Número de Punto Flotante Incorrecto - Egreso");
  64. // Call Form Custom Validate event
  65. if (!this.Form_CustomValidate(fobj)) return false;
  66. }
  67. return true;
  68. }
  69. // extend page with Form_CustomValidate function
  70. saldo_iglesia_list.Form_CustomValidate =
  71. function(fobj) { // DO NOT CHANGE THIS LINE!
  72. // Your custom validation code here, return false if invalid.
  73. return true;
  74. }
  75. <?php if (EW_CLIENT_VALIDATE) { ?>
  76. saldo_iglesia_list.ValidateRequired = true; // uses JavaScript validation
  77. <?php } else { ?>
  78. saldo_iglesia_list.ValidateRequired = false; // no JavaScript validation
  79. <?php } ?>
  80. //-->
  81. </script>
  82. <link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-1.css" title="win2k-1">
  83. <script type="text/javascript" src="calendar/calendar.js"></script>
  84. <script type="text/javascript" src="calendar/lang/calendar-en.js"></script>
  85. <script type="text/javascript" src="calendar/calendar-setup.js"></script>
  86. <script type="text/javascript">
  87. <!--
  88. var ew_DHTMLEditors = [];
  89. //-->
  90. </script>
  91. <script language="JavaScript" type="text/javascript">
  92. <!--
  93. // Write your client script here, no need to add script tags.
  94. // To include another .js script, use:
  95. // ew_ClientScriptInclude("my_javascript.js");
  96. //-->
  97. </script>
  98. <?php } ?>
  99. <?php if ($saldo_iglesia->Export == "") { ?>
  100. <?php } ?>
  101. <?php
  102. $bSelectLimit = ($saldo_iglesia->Export == "" && $saldo_iglesia->SelectLimit);
  103. if (!$bSelectLimit)
  104. $rs = $saldo_iglesia_list->LoadRecordset();
  105. $saldo_iglesia_list->lTotalRecs = ($bSelectLimit) ? $saldo_iglesia->SelectRecordCount() : $rs->RecordCount();
  106. $saldo_iglesia_list->lStartRec = 1;
  107. if ($saldo_iglesia_list->lDisplayRecs <= 0) // Display all records
  108. $saldo_iglesia_list->lDisplayRecs = $saldo_iglesia_list->lTotalRecs;
  109. if (!($saldo_iglesia->ExportAll && $saldo_iglesia->Export <> ""))
  110. $saldo_iglesia_list->SetUpStartRec(); // Set up start record position
  111. if ($bSelectLimit)
  112. $rs = $saldo_iglesia_list->LoadRecordset($saldo_iglesia_list->lStartRec-1, $saldo_iglesia_list->lDisplayRecs);
  113. ?>
  114. <p><span class="phpmaker" style="white-space: nowrap;">TABLA: Saldo Iglesia
  115. <?php if ($saldo_iglesia->Export == "" && $saldo_iglesia->CurrentAction == "") { ?>
  116. &nbsp;&nbsp;<a href="<?php echo $saldo_iglesia_list->PageUrl() ?>export=excel">Exportar a Excel</a>
  117. <?php } ?>
  118. </span></p>
  119. <?php $saldo_iglesia_list->ShowMessage() ?>
  120. <br>
  121. <table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
  122. <div class="ewGridMiddlePanel">
  123. <form name="fsaldo_iglesialist" id="fsaldo_iglesialist" class="ewForm" action="<?php echo ew_CurrentPage() ?>" method="post">
  124. <input type="hidden" name="t" id="t" value="saldo_iglesia">
  125. <?php if ($saldo_iglesia_list->lTotalRecs > 0 || $saldo_iglesia->CurrentAction == "add" || $saldo_iglesia->CurrentAction == "copy") { ?>
  126. <table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
  127. <?php
  128. $saldo_iglesia_list->lOptionCnt = 0;
  129. if ($Security->IsLoggedIn()) {
  130. $saldo_iglesia_list->lOptionCnt++; // edit
  131. }
  132. if ($Security->IsLoggedIn()) {
  133. $saldo_iglesia_list->lOptionCnt++; // Delete
  134. }
  135. $saldo_iglesia_list->lOptionCnt += count($saldo_iglesia_list->ListOptions->Items); // Custom list options
  136. ?>
  137. <?php echo $saldo_iglesia->TableCustomInnerHtml ?>
  138. <thead><!-- Table header -->
  139. <tr class="ewTableHeader">
  140. <?php if ($saldo_iglesia->idSaldoIglesia->Visible) { // idSaldoIglesia ?>
  141. <?php if ($saldo_iglesia->SortUrl($saldo_iglesia->idSaldoIglesia) == "") { ?>
  142. <td>No</td>
  143. <?php } else { ?>
  144. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $saldo_iglesia->SortUrl($saldo_iglesia->idSaldoIglesia) ?>',1);">
  145. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>No</td><td style="width: 10px;"><?php if ($saldo_iglesia->idSaldoIglesia->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($saldo_iglesia->idSaldoIglesia->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  146. </td>
  147. <?php } ?>
  148. <?php } ?>
  149. <?php if ($saldo_iglesia->fecha->Visible) { // fecha ?>
  150. <?php if ($saldo_iglesia->SortUrl($saldo_iglesia->fecha) == "") { ?>
  151. <td>Fecha</td>
  152. <?php } else { ?>
  153. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $saldo_iglesia->SortUrl($saldo_iglesia->fecha) ?>',1);">
  154. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Fecha</td><td style="width: 10px;"><?php if ($saldo_iglesia->fecha->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($saldo_iglesia->fecha->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  155. </td>
  156. <?php } ?>
  157. <?php } ?>
  158. <?php if ($saldo_iglesia->nro_fact_recibo->Visible) { // nro_fact_recibo ?>
  159. <?php if ($saldo_iglesia->SortUrl($saldo_iglesia->nro_fact_recibo) == "") { ?>
  160. <td>Recibo</td>
  161. <?php } else { ?>
  162. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $saldo_iglesia->SortUrl($saldo_iglesia->nro_fact_recibo) ?>',1);">
  163. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Recibo</td><td style="width: 10px;"><?php if ($saldo_iglesia->nro_fact_recibo->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($saldo_iglesia->nro_fact_recibo->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  164. </td>
  165. <?php } ?>
  166. <?php } ?>
  167. <?php if ($saldo_iglesia->detalle->Visible) { // detalle ?>
  168. <?php if ($saldo_iglesia->SortUrl($saldo_iglesia->detalle) == "") { ?>
  169. <td>Detalle</td>
  170. <?php } else { ?>
  171. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $saldo_iglesia->SortUrl($saldo_iglesia->detalle) ?>',1);">
  172. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Detalle</td><td style="width: 10px;"><?php if ($saldo_iglesia->detalle->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($saldo_iglesia->detalle->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  173. </td>
  174. <?php } ?>
  175. <?php } ?>
  176. <?php if ($saldo_iglesia->ingreso->Visible) { // ingreso ?>
  177. <?php if ($saldo_iglesia->SortUrl($saldo_iglesia->ingreso) == "") { ?>
  178. <td>Ingreso</td>
  179. <?php } else { ?>
  180. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $saldo_iglesia->SortUrl($saldo_iglesia->ingreso) ?>',1);">
  181. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Ingreso</td><td style="width: 10px;"><?php if ($saldo_iglesia->ingreso->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($saldo_iglesia->ingreso->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  182. </td>
  183. <?php } ?>
  184. <?php } ?>
  185. <?php if ($saldo_iglesia->egreso->Visible) { // egreso ?>
  186. <?php if ($saldo_iglesia->SortUrl($saldo_iglesia->egreso) == "") { ?>
  187. <td>Egreso</td>
  188. <?php } else { ?>
  189. <td class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $saldo_iglesia->SortUrl($saldo_iglesia->egreso) ?>',1);">
  190. <table cellspacing="0" class="ewTableHeaderBtn"><tr><td>Egreso</td><td style="width: 10px;"><?php if ($saldo_iglesia->egreso->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($saldo_iglesia->egreso->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></table>
  191. </td>
  192. <?php } ?>
  193. <?php } ?>
  194. <?php if ($saldo_iglesia->Export == "") { ?>
  195. <?php if ($Security->IsLoggedIn()) { ?>
  196. <td style="white-space: nowrap;">&nbsp;</td>
  197. <?php } ?>
  198. <?php if ($Security->IsLoggedIn()) { ?>
  199. <?php if ($saldo_iglesia_list->lOptionCnt == 0 && $saldo_iglesia->CurrentAction == "add") { ?>
  200. <td style="white-space: nowrap;">&nbsp;</td>
  201. <?php } ?>
  202. <?php } ?>
  203. <?php if ($Security->IsLoggedIn()) { ?>
  204. <td style="white-space: nowrap;">&nbsp;</td>
  205. <?php } ?>
  206. <?php
  207. // Custom list options
  208. foreach ($saldo_iglesia_list->ListOptions->Items as $ListOption) {
  209. if ($ListOption->Visible)
  210. echo $ListOption->HeaderCellHtml;
  211. }
  212. ?>
  213. <?php } ?>
  214. </tr>
  215. </thead>
  216. <?php
  217. if ($saldo_iglesia->CurrentAction == "add" || $saldo_iglesia->CurrentAction == "copy") {
  218. $saldo_iglesia_list->lRowIndex = 1;
  219. if ($saldo_iglesia->CurrentAction == "add")
  220. $saldo_iglesia_list->LoadDefaultValues();
  221. if ($saldo_iglesia->EventCancelled) // Insert failed
  222. $saldo_iglesia_list->RestoreFormValues(); // Restore form values
  223. // Set row properties
  224. $saldo_iglesia->CssClass = "ewTableEditRow";
  225. $saldo_iglesia->CssStyle = "";
  226. $saldo_iglesia->RowClientEvents = "onmouseover='ew_MouseOver(event, this);' onmouseout='ew_MouseOut(event, this);' onclick='ew_Click(event, this);'";
  227. $saldo_iglesia->RowType = EW_ROWTYPE_ADD;
  228. // Render row
  229. $saldo_iglesia_list->RenderRow();
  230. ?>
  231. <tr<?php echo $saldo_iglesia->RowAttributes() ?>>
  232. <?php if ($saldo_iglesia->idSaldoIglesia->Visible) { // idSaldoIglesia ?>
  233. <td>&nbsp;</td>
  234. <?php } ?>
  235. <?php if ($saldo_iglesia->fecha->Visible) { // fecha ?>
  236. <td>
  237. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" value="<?php echo $saldo_iglesia->fecha->EditValue ?>"<?php echo $saldo_iglesia->fecha->EditAttributes() ?>>
  238. &nbsp;<img src="images/calendar.png" id="cal_x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" name="cal_x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" alt="Seleccione una fecha" style="cursor:pointer;cursor:hand;">
  239. <script type="text/javascript">
  240. Calendar.setup({
  241. inputField : "x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha", // ID of the input field
  242. ifFormat : "%d-%m-%Y", // the date format
  243. button : "cal_x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" // ID of the button
  244. });
  245. </script>
  246. </td>
  247. <?php } ?>
  248. <?php if ($saldo_iglesia->nro_fact_recibo->Visible) { // nro_fact_recibo ?>
  249. <td>
  250. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_nro_fact_recibo" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_nro_fact_recibo" size="10" value="<?php echo $saldo_iglesia->nro_fact_recibo->EditValue ?>"<?php echo $saldo_iglesia->nro_fact_recibo->EditAttributes() ?>>
  251. </td>
  252. <?php } ?>
  253. <?php if ($saldo_iglesia->detalle->Visible) { // detalle ?>
  254. <td>
  255. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_detalle" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_detalle" size="30" maxlength="255" value="<?php echo $saldo_iglesia->detalle->EditValue ?>"<?php echo $saldo_iglesia->detalle->EditAttributes() ?>>
  256. </td>
  257. <?php } ?>
  258. <?php if ($saldo_iglesia->ingreso->Visible) { // ingreso ?>
  259. <td>
  260. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_ingreso" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_ingreso" size="10" value="<?php echo $saldo_iglesia->ingreso->EditValue ?>"<?php echo $saldo_iglesia->ingreso->EditAttributes() ?>>
  261. </td>
  262. <?php } ?>
  263. <?php if ($saldo_iglesia->egreso->Visible) { // egreso ?>
  264. <td>
  265. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_egreso" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_egreso" size="10" value="<?php echo $saldo_iglesia->egreso->EditValue ?>"<?php echo $saldo_iglesia->egreso->EditAttributes() ?>>
  266. </td>
  267. <?php } ?>
  268. <td colspan="<?php echo $saldo_iglesia_list->lOptionCnt ?>"><span class="phpmaker">
  269. <a href="" onclick="if (saldo_iglesia_list.ValidateForm(document.fsaldo_iglesialist)) document.fsaldo_iglesialist.submit();return false;">Insertar</a>&nbsp;<a href="<?php echo $saldo_iglesia_list->PageUrl() ?>a=cancel">Cancelar</a>
  270. <input type="hidden" name="a_list" id="a_list" value="insert">
  271. </span></td>
  272. </tr>
  273. <?php
  274. }
  275. ?>
  276. <?php
  277. if ($saldo_iglesia->ExportAll && $saldo_iglesia->Export <> "") {
  278. $saldo_iglesia_list->lStopRec = $saldo_iglesia_list->lTotalRecs;
  279. } else {
  280. $saldo_iglesia_list->lStopRec = $saldo_iglesia_list->lStartRec + $saldo_iglesia_list->lDisplayRecs - 1; // Set the last record to display
  281. }
  282. $saldo_iglesia_list->lRecCount = $saldo_iglesia_list->lStartRec - 1;
  283. if ($rs && !$rs->EOF) {
  284. $rs->MoveFirst();
  285. if (!$saldo_iglesia->SelectLimit && $saldo_iglesia_list->lStartRec > 1)
  286. $rs->Move($saldo_iglesia_list->lStartRec - 1);
  287. }
  288. $saldo_iglesia_list->lRowCnt = 0;
  289. $saldo_iglesia_list->lEditRowCnt = 0;
  290. if ($saldo_iglesia->CurrentAction == "edit")
  291. $saldo_iglesia_list->lRowIndex = 1;
  292. while (($saldo_iglesia->CurrentAction == "gridadd" || !$rs->EOF) &&
  293. $saldo_iglesia_list->lRecCount < $saldo_iglesia_list->lStopRec) {
  294. $saldo_iglesia_list->lRecCount++;
  295. if (intval($saldo_iglesia_list->lRecCount) >= intval($saldo_iglesia_list->lStartRec)) {
  296. $saldo_iglesia_list->lRowCnt++;
  297. // Init row class and style
  298. $saldo_iglesia->CssClass = "";
  299. $saldo_iglesia->CssStyle = "";
  300. $saldo_iglesia->RowClientEvents = "onmouseover='ew_MouseOver(event, this);' onmouseout='ew_MouseOut(event, this);' onclick='ew_Click(event, this);'";
  301. if ($saldo_iglesia->CurrentAction == "gridadd") {
  302. $saldo_iglesia_list->LoadDefaultValues(); // Load default values
  303. } else {
  304. $saldo_iglesia_list->LoadRowValues($rs); // Load row values
  305. }
  306. $saldo_iglesia->RowType = EW_ROWTYPE_VIEW; // Render view
  307. if ($saldo_iglesia->CurrentAction == "edit") {
  308. if ($saldo_iglesia_list->CheckInlineEditKey() && $saldo_iglesia_list->lEditRowCnt == 0) // Inline edit
  309. $saldo_iglesia->RowType = EW_ROWTYPE_EDIT; // Render edit
  310. }
  311. if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT && $saldo_iglesia->EventCancelled) { // Update failed
  312. if ($saldo_iglesia->CurrentAction == "edit")
  313. $saldo_iglesia_list->RestoreFormValues(); // Restore form values
  314. }
  315. if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { // Edit row
  316. $saldo_iglesia_list->lEditRowCnt++;
  317. $saldo_iglesia->RowClientEvents = "onmouseover='this.edit=true;ew_MouseOver(event, this);' onmouseout='ew_MouseOut(event, this);' onclick='ew_Click(event, this);'";
  318. }
  319. if ($saldo_iglesia->RowType == EW_ROWTYPE_ADD || $saldo_iglesia->RowType == EW_ROWTYPE_EDIT) // Add / Edit row
  320. $saldo_iglesia->CssClass = "ewTableEditRow";
  321. // Render row
  322. $saldo_iglesia_list->RenderRow();
  323. ?>
  324. <tr<?php echo $saldo_iglesia->RowAttributes() ?>>
  325. <?php if ($saldo_iglesia->idSaldoIglesia->Visible) { // idSaldoIglesia ?>
  326. <td<?php echo $saldo_iglesia->idSaldoIglesia->CellAttributes() ?>>
  327. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
  328. <div<?php echo $saldo_iglesia->idSaldoIglesia->ViewAttributes() ?>><?php echo $saldo_iglesia->idSaldoIglesia->EditValue ?></div><input type="hidden" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_idSaldoIglesia" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_idSaldoIglesia" value="<?php echo ew_HtmlEncode($saldo_iglesia->idSaldoIglesia->CurrentValue) ?>">
  329. <?php } ?>
  330. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_VIEW) { // View record ?>
  331. <div<?php echo $saldo_iglesia->idSaldoIglesia->ViewAttributes() ?>><?php echo $saldo_iglesia->idSaldoIglesia->ListViewValue() ?></div>
  332. <?php } ?>
  333. </td>
  334. <?php } ?>
  335. <?php if ($saldo_iglesia->fecha->Visible) { // fecha ?>
  336. <td<?php echo $saldo_iglesia->fecha->CellAttributes() ?>>
  337. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
  338. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" value="<?php echo $saldo_iglesia->fecha->EditValue ?>"<?php echo $saldo_iglesia->fecha->EditAttributes() ?>>
  339. &nbsp;<img src="images/calendar.png" id="cal_x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" name="cal_x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" alt="Seleccione una fecha" style="cursor:pointer;cursor:hand;">
  340. <script type="text/javascript">
  341. Calendar.setup({
  342. inputField : "x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha", // ID of the input field
  343. ifFormat : "%d-%m-%Y", // the date format
  344. button : "cal_x<?php echo $saldo_iglesia_list->lRowIndex ?>_fecha" // ID of the button
  345. });
  346. </script>
  347. <?php } ?>
  348. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_VIEW) { // View record ?>
  349. <div<?php echo $saldo_iglesia->fecha->ViewAttributes() ?>><?php echo $saldo_iglesia->fecha->ListViewValue() ?></div>
  350. <?php } ?>
  351. </td>
  352. <?php } ?>
  353. <?php if ($saldo_iglesia->nro_fact_recibo->Visible) { // nro_fact_recibo ?>
  354. <td<?php echo $saldo_iglesia->nro_fact_recibo->CellAttributes() ?>>
  355. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
  356. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_nro_fact_recibo" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_nro_fact_recibo" size="10" value="<?php echo $saldo_iglesia->nro_fact_recibo->EditValue ?>"<?php echo $saldo_iglesia->nro_fact_recibo->EditAttributes() ?>>
  357. <?php } ?>
  358. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_VIEW) { // View record ?>
  359. <div<?php echo $saldo_iglesia->nro_fact_recibo->ViewAttributes() ?>><?php echo $saldo_iglesia->nro_fact_recibo->ListViewValue() ?></div>
  360. <?php } ?>
  361. </td>
  362. <?php } ?>
  363. <?php if ($saldo_iglesia->detalle->Visible) { // detalle ?>
  364. <td<?php echo $saldo_iglesia->detalle->CellAttributes() ?>>
  365. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
  366. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_detalle" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_detalle" size="30" maxlength="255" value="<?php echo $saldo_iglesia->detalle->EditValue ?>"<?php echo $saldo_iglesia->detalle->EditAttributes() ?>>
  367. <?php } ?>
  368. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_VIEW) { // View record ?>
  369. <div<?php echo $saldo_iglesia->detalle->ViewAttributes() ?>><?php echo $saldo_iglesia->detalle->ListViewValue() ?></div>
  370. <?php } ?>
  371. </td>
  372. <?php } ?>
  373. <?php if ($saldo_iglesia->ingreso->Visible) { // ingreso ?>
  374. <td<?php echo $saldo_iglesia->ingreso->CellAttributes() ?>>
  375. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
  376. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_ingreso" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_ingreso" size="10" value="<?php echo $saldo_iglesia->ingreso->EditValue ?>"<?php echo $saldo_iglesia->ingreso->EditAttributes() ?>>
  377. <?php } ?>
  378. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_VIEW) { // View record ?>
  379. <div<?php echo $saldo_iglesia->ingreso->ViewAttributes() ?>><?php echo $saldo_iglesia->ingreso->ListViewValue() ?></div>
  380. <?php } ?>
  381. </td>
  382. <?php } ?>
  383. <?php if ($saldo_iglesia->egreso->Visible) { // egreso ?>
  384. <td<?php echo $saldo_iglesia->egreso->CellAttributes() ?>>
  385. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
  386. <input type="text" name="x<?php echo $saldo_iglesia_list->lRowIndex ?>_egreso" id="x<?php echo $saldo_iglesia_list->lRowIndex ?>_egreso" size="10" value="<?php echo $saldo_iglesia->egreso->EditValue ?>"<?php echo $saldo_iglesia->egreso->EditAttributes() ?>>
  387. <?php } ?>
  388. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_VIEW) { // View record ?>
  389. <div<?php echo $saldo_iglesia->egreso->ViewAttributes() ?>><?php echo $saldo_iglesia->egreso->ListViewValue() ?></div>
  390. <?php } ?>
  391. </td>
  392. <?php } ?>
  393. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_ADD || $saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { ?>
  394. <?php if ($saldo_iglesia->CurrentAction == "edit") { ?>
  395. <td colspan="<?php echo $saldo_iglesia_list->lOptionCnt ?>"><span class="phpmaker">
  396. <a href="" onclick="if (saldo_iglesia_list.ValidateForm(document.fsaldo_iglesialist)) document.fsaldo_iglesialist.submit();return false;">Actualizar</a>&nbsp;<a href="<?php echo $saldo_iglesia_list->PageUrl() ?>a=cancel">Cancelar</a>
  397. <input type="hidden" name="a_list" id="a_list" value="update">
  398. </span></td>
  399. <?php } ?>
  400. <?php } else { ?>
  401. <?php if ($saldo_iglesia->Export == "") { ?>
  402. <?php if ($Security->IsLoggedIn()) { ?>
  403. <td style="white-space: nowrap;"><span class="phpmaker">
  404. <a href="<?php echo $saldo_iglesia->InlineEditUrl() ?>">Editar en linea</a>
  405. </span></td>
  406. <?php } ?>
  407. <?php if ($Security->IsLoggedIn()) { ?>
  408. <?php if ($saldo_iglesia_list->lOptionCnt == 0 && $saldo_iglesia->CurrentAction == "add") { ?>
  409. <td style="white-space: nowrap;">&nbsp;</td>
  410. <?php } ?>
  411. <?php } ?>
  412. <?php if ($Security->IsLoggedIn()) { ?>
  413. <td style="white-space: nowrap;"><span class="phpmaker">
  414. <a onclick="ew_ClickDelete(this);return ew_ConfirmDelete('<?php echo $saldo_iglesia_list->sDeleteConfirmMsg ?>', this);" href="<?php echo $saldo_iglesia->DeleteUrl() ?>">Borrar</a>
  415. </span></td>
  416. <?php } ?>
  417. <?php
  418. // Custom list options
  419. foreach ($saldo_iglesia_list->ListOptions->Items as $ListOption) {
  420. if ($ListOption->Visible)
  421. echo $ListOption->BodyCellHtml;
  422. }
  423. ?>
  424. <?php } ?>
  425. <?php } ?>
  426. </tr>
  427. <?php if ($saldo_iglesia->RowType == EW_ROWTYPE_EDIT) { ?>
  428. <?php } ?>
  429. <?php
  430. }
  431. if ($saldo_iglesia->CurrentAction <> "gridadd")
  432. $rs->MoveNext();
  433. }
  434. ?>
  435. </tbody>
  436. </table>
  437. <?php } ?>
  438. <?php if ($saldo_iglesia->CurrentAction == "add" || $saldo_iglesia->CurrentAction == "copy") { ?>
  439. <input type="hidden" name="key_count" id="key_count" value="<?php echo $saldo_iglesia_list->lRowIndex ?>">
  440. <?php } ?>
  441. <?php if ($saldo_iglesia->CurrentAction == "edit") { ?>
  442. <input type="hidden" name="key_count" id="key_count" value="<?php echo $saldo_iglesia_list->lRowIndex ?>">
  443. <?php } ?>
  444. </form>
  445. <?php
  446. // Close recordset
  447. if ($rs)
  448. $rs->Close();
  449. ?>
  450. </div>
  451. <?php if ($saldo_iglesia->Export == "") { ?>
  452. <div class="ewGridLowerPanel">
  453. <?php if ($saldo_iglesia->CurrentAction <> "gridadd" && $saldo_iglesia->CurrentAction <> "gridedit") { ?>
  454. <form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
  455. <table border="0" cellspacing="0" cellpadding="0" class="ewPager">
  456. <tr>
  457. <td nowrap>
  458. <?php if (!isset($saldo_iglesia_list->Pager)) $saldo_iglesia_list->Pager = new cPrevNextPager($saldo_iglesia_list->lStartRec, $saldo_iglesia_list->lDisplayRecs, $saldo_iglesia_list->lTotalRecs) ?>
  459. <?php if ($saldo_iglesia_list->Pager->RecordCount > 0) { ?>
  460. <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker">Página&nbsp;</span></td>
  461. <!--first page button-->
  462. <?php if ($saldo_iglesia_list->Pager->FirstButton->Enabled) { ?>
  463. <td><a href="<?php echo $saldo_iglesia_list->PageUrl() ?>start=<?php echo $saldo_iglesia_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="Primera" width="16" height="16" border="0"></a></td>
  464. <?php } else { ?>
  465. <td><img src="images/firstdisab.gif" alt="Primera" width="16" height="16" border="0"></td>
  466. <?php } ?>
  467. <!--previous page button-->
  468. <?php if ($saldo_iglesia_list->Pager->PrevButton->Enabled) { ?>
  469. <td><a href="<?php echo $saldo_iglesia_list->PageUrl() ?>start=<?php echo $saldo_iglesia_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="Anterior" width="16" height="16" border="0"></a></td>
  470. <?php } else { ?>
  471. <td><img src="images/prevdisab.gif" alt="Anterior" width="16" height="16" border="0"></td>
  472. <?php } ?>
  473. <!--current page number-->
  474. <td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $saldo_iglesia_list->Pager->CurrentPage ?>" size="4"></td>
  475. <!--next page button-->
  476. <?php if ($saldo_iglesia_list->Pager->NextButton->Enabled) { ?>
  477. <td><a href="<?php echo $saldo_iglesia_list->PageUrl() ?>start=<?php echo $saldo_iglesia_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="Siguiente" width="16" height="16" border="0"></a></td>
  478. <?php } else { ?>
  479. <td><img src="images/nextdisab.gif" alt="Siguiente" width="16" height="16" border="0"></td>
  480. <?php } ?>
  481. <!--last page button-->
  482. <?php if ($saldo_iglesia_list->Pager->LastButton->Enabled) { ?>
  483. <td><a href="<?php echo $saldo_iglesia_list->PageUrl() ?>start=<?php echo $saldo_iglesia_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="Ultima" width="16" height="16" border="0"></a></td>
  484. <?php } else { ?>
  485. <td><img src="images/lastdisab.gif" alt="Ultima" width="16" height="16" border="0"></td>
  486. <?php } ?>
  487. <td><span class="phpmaker">&nbsp;de <?php echo $saldo_iglesia_list->Pager->PageCount ?></span></td>
  488. </tr></table>
  489. </td>
  490. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  491. <td>
  492. <span class="phpmaker">Registro <?php echo $saldo_iglesia_list->Pager->FromIndex ?> a <?php echo $saldo_iglesia_list->Pager->ToIndex ?> de <?php echo $saldo_iglesia_list->Pager->RecordCount ?></span>
  493. <?php } else { ?>
  494. <?php if ($saldo_iglesia_list->sSrchWhere == "0=101") { ?>
  495. <span class="phpmaker">Por favor ingrese criterio de busqueda</span>
  496. <?php } else { ?>
  497. <span class="phpmaker">No se encontraron registros</span>
  498. <?php } ?>
  499. <?php } ?>
  500. </td>
  501. <?php if ($saldo_iglesia_list->lTotalRecs > 0) { ?>
  502. <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  503. <td><table border="0" cellspacing="0" cellpadding="0"><tr><td>Registros por página&nbsp;</td><td>
  504. <input type="hidden" id="t" name="t" value="saldo_iglesia">
  505. <select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onchange="this.form.submit();" class="phpmaker">
  506. <option value="20"<?php if ($saldo_iglesia_list->lDisplayRecs == 20) { ?> selected="selected"<?php } ?>>20</option>
  507. <option value="50"<?php if ($saldo_iglesia_list->lDisplayRecs == 50) { ?> selected="selected"<?php } ?>>50</option>
  508. <option value="ALL"<?php if ($saldo_iglesia->getRecordsPerPage() == -1) { ?> selected="selected"<?php } ?>>Todos los registros</option>
  509. </select></td></tr></table>
  510. </td>
  511. <?php } ?>
  512. </tr>
  513. </table>
  514. </form>
  515. <?php } ?>
  516. <?php //if ($saldo_iglesia_list->lTotalRecs > 0) { ?>
  517. <span class="phpmaker">
  518. <?php if ($Security->IsLoggedIn()) { ?>
  519. <a href="<?php echo $saldo_iglesia_list->PageUrl() ?>a=add">Adicionar en linea</a>&nbsp;&nbsp;
  520. <?php } ?>
  521. </span>
  522. <?php //} ?>
  523. </div>
  524. <?php } ?>
  525. </td></tr></table>
  526. <?php if ($saldo_iglesia->Export == "" && $saldo_iglesia->CurrentAction == "") { ?>
  527. <script type="text/javascript">
  528. <!--
  529. //ew_ToggleSearchPanel(saldo_iglesia_list); // uncomment to init search panel as collapsed
  530. //-->
  531. </script>
  532. <?php } ?>
  533. <?php if ($saldo_iglesia->Export == "") { ?>
  534. <script language="JavaScript" type="text/javascript">
  535. <!--
  536. // Write your table-specific startup script here
  537. // document.write("page loaded");
  538. //-->
  539. </script>
  540. <?php } ?>
  541. <?php include "footer.php" ?>
  542. <?php
  543. //
  544. // Page Class
  545. //
  546. class csaldo_iglesia_list {
  547. // Page ID
  548. var $PageID = 'list';
  549. // Table Name
  550. var $TableName = 'saldo_iglesia';
  551. // Page Object Name
  552. var $PageObjName = 'saldo_iglesia_list';
  553. // Page Name
  554. function PageName() {
  555. return ew_CurrentPage();
  556. }
  557. // Page Url
  558. function PageUrl() {
  559. $PageUrl = ew_CurrentPage() . "?";
  560. global $saldo_iglesia;
  561. if ($saldo_iglesia->UseTokenInUrl) $PageUrl .= "t=" . $saldo_iglesia->TableVar . "&"; // add page token
  562. return $PageUrl;
  563. }
  564. // Message
  565. function getMessage() {
  566. return @$_SESSION[EW_SESSION_MESSAGE];
  567. }
  568. function setMessage($v) {
  569. if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
  570. $_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
  571. } else {
  572. $_SESSION[EW_SESSION_MESSAGE] = $v;
  573. }
  574. }
  575. // Show Message
  576. function ShowMessage() {
  577. if ($this->getMessage() <> "") { // Message in Session, display
  578. echo "<p><span class=\"ewMessage\">" . $this->getMessage() . "</span></p>";
  579. $_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
  580. }
  581. }
  582. // Validate Page request
  583. function IsPageRequest() {
  584. global $objForm, $saldo_iglesia;
  585. if ($saldo_iglesia->UseTokenInUrl) {
  586. //IsPageRequest = False
  587. if ($objForm)
  588. return ($saldo_iglesia->TableVar == $objForm->GetValue("t"));
  589. if (@$_GET["t"] <> "")
  590. return ($saldo_iglesia->TableVar == $_GET["t"]);
  591. } else {
  592. return TRUE;
  593. }
  594. }
  595. //
  596. // Class initialize
  597. // - init objects
  598. // - open connection
  599. //
  600. function csaldo_iglesia_list() {
  601. global $conn;
  602. // Initialize table object
  603. $GLOBALS["saldo_iglesia"] = new csaldo_iglesia();
  604. // Initialize other table object
  605. $GLOBALS['usuario'] = new cusuario();
  606. // Intialize page id (for backward compatibility)
  607. if (!defined("EW_PAGE_ID"))
  608. define("EW_PAGE_ID", 'list', TRUE);
  609. // Initialize table name (for backward compatibility)
  610. if (!defined("EW_TABLE_NAME"))
  611. define("EW_TABLE_NAME", 'saldo_iglesia', TRUE);
  612. // Open connection to the database
  613. $conn = ew_Connect();
  614. // Initialize list options
  615. $this->ListOptions = new cListOptions();
  616. }
  617. //
  618. // Page_Init
  619. //
  620. function Page_Init() {
  621. global $gsExport, $gsExportFile, $saldo_iglesia;
  622. global $Security;
  623. $Security = new cAdvancedSecurity();
  624. if (!$Security->IsLoggedIn()) $Security->AutoLogin();
  625. if (!$Security->IsLoggedIn()) {
  626. $Security->SaveLastUrl();
  627. $this->Page_Terminate("login.php");
  628. }
  629. $saldo_iglesia->Export = @$_GET["export"]; // Get export parameter
  630. $gsExport = $saldo_iglesia->Export; // Get export parameter, used in header
  631. $gsExportFile = $saldo_iglesia->TableVar; // Get export file, used in header
  632. if ($saldo_iglesia->Export == "excel") {
  633. header('Content-Type: application/vnd.ms-excel');
  634. header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
  635. }
  636. // Global page loading event (in userfn6.php)
  637. Page_Loading();
  638. // Page load event, used in current page
  639. $this->Page_Load();
  640. }
  641. //
  642. // Page_Terminate
  643. // - called when exit page
  644. // - if URL specified, redirect to the URL
  645. //
  646. function Page_Terminate($url = "") {
  647. global $conn;
  648. // Page unload event, used in current page
  649. $this->Page_Unload();
  650. // Global page unloaded event (in userfn*.php)
  651. Page_Unloaded();
  652. // Close Connection
  653. $conn->Close();
  654. // Go to URL if specified
  655. if ($url <> "") {
  656. ob_end_clean();
  657. header("Location: $url");
  658. }
  659. exit();
  660. }
  661. var $lDisplayRecs; // Number of display records
  662. var $lStartRec;
  663. var $lStopRec;
  664. var $lTotalRecs;
  665. var $lRecRange;
  666. var $sSrchWhere;
  667. var $lRecCnt;
  668. var $lEditRowCnt;
  669. var $lRowCnt;
  670. var $lRowIndex;
  671. var $lOptionCnt;
  672. var $lRecPerRow;
  673. var $lColCnt;
  674. var $sDeleteConfirmMsg; // Delete confirm message
  675. var $sDbMasterFilter;
  676. var $sDbDetailFilter;
  677. var $bMasterRecordExists;
  678. var $ListOptions;
  679. var $sMultiSelectKey;
  680. //
  681. // Page main processing
  682. //
  683. function Page_Main() {
  684. global $objForm, $gsSearchError, $Security, $saldo_iglesia;
  685. $this->lDisplayRecs = 20;
  686. $this->lRecRange = 10;
  687. $this->lRecCnt = 0; // Record count
  688. // Search filters
  689. $sSrchAdvanced = ""; // Advanced search filter
  690. $sSrchBasic = ""; // Basic search filter
  691. $sFilter = "";
  692. $this->sSrchWhere = ""; // Search WHERE clause
  693. $this->sDeleteConfirmMsg = "żQuiere borrar este registro?"; // Delete confirm message
  694. // Master/Detail
  695. $this->sDbMasterFilter = ""; // Master filter
  696. $this->sDbDetailFilter = ""; // Detail filter
  697. // Create form object
  698. $objForm = new cFormObj();
  699. if ($this->IsPageRequest()) { // Validate request
  700. // Set up records per page dynamically
  701. $this->SetUpDisplayRecs();
  702. // Handle reset command
  703. $this->ResetCmd();
  704. // Check QueryString parameters
  705. if (@$_GET["a"] <> "") {
  706. $saldo_iglesia->CurrentAction = $_GET["a"];
  707. // Clear inline mode
  708. if ($saldo_iglesia->CurrentAction == "cancel")
  709. $this->ClearInlineMode();
  710. // Switch to inline edit mode
  711. if ($saldo_iglesia->CurrentAction == "edit")
  712. $this->InlineEditMode();
  713. // Switch to inline add mode
  714. if ($saldo_iglesia->CurrentAction == "add" || $saldo_iglesia->CurrentAction == "copy")
  715. $this->InlineAddMode();
  716. } else {
  717. if (@$_POST["a_list"] <> "") {
  718. $saldo_iglesia->CurrentAction = $_POST["a_list"]; // Get action
  719. // Inline Update
  720. if ($saldo_iglesia->CurrentAction == "update" && @$_SESSION[EW_SESSION_INLINE_MODE] == "edit")
  721. $this->InlineUpdate();
  722. // Insert Inline
  723. if ($saldo_iglesia->CurrentAction == "insert" && @$_SESSION[EW_SESSION_INLINE_MODE] == "add")
  724. $this->InlineInsert();
  725. }
  726. }
  727. // Set Up Sorting Order
  728. $this->SetUpSortOrder();
  729. } // End Validate Request
  730. // Restore display records
  731. if ($saldo_iglesia->getRecordsPerPage() <> "") {
  732. $this->lDisplayRecs = $saldo_iglesia->getRecordsPerPage(); // Restore from Session
  733. } else {
  734. $this->lDisplayRecs = 20; // Load default
  735. }
  736. // Load Sorting Order
  737. $this->LoadSortOrder();
  738. // Build filter
  739. $sFilter = "";
  740. if ($this->sDbDetailFilter <> "")
  741. $sFilter = ($sFilter <> "") ? "($sFilter) AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
  742. if ($this->sSrchWhere <> "")
  743. $sFilter = ($sFilter <> "") ? "($sFilter) AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;
  744. // Set up filter in Session
  745. $saldo_iglesia->setSessionWhere($sFilter);
  746. $saldo_iglesia->CurrentFilter = "";
  747. // Export data only
  748. if (in_array($saldo_iglesia->Export, array("html","word","excel","xml","csv"))) {
  749. $this->ExportData();
  750. $this->Page_Terminate(); // Terminate response
  751. exit();
  752. }
  753. }
  754. // Set up number of records displayed per page
  755. function SetUpDisplayRecs() {
  756. global $saldo_iglesia;
  757. $sWrk = @$_GET[EW_TABLE_REC_PER_PAGE];
  758. if ($sWrk <> "") {
  759. if (is_numeric($sWrk)) {
  760. $this->lDisplayRecs = intval($sWrk);
  761. } else {
  762. if (strtolower($sWrk) == "all") { // Display all records
  763. $this->lDisplayRecs = -1;
  764. } else {
  765. $this->lDisplayRecs = 20; // Non-numeric, load default
  766. }
  767. }
  768. $saldo_iglesia->setRecordsPerPage($this->lDisplayRecs); // Save to Session
  769. // Reset start position
  770. $this->lStartRec = 1;
  771. $saldo_iglesia->setStartRecordNumber($this->lStartRec);
  772. }
  773. }
  774. // Exit out of inline mode
  775. function ClearInlineMode() {
  776. global $saldo_iglesia;
  777. $saldo_iglesia->setKey("idSaldoIglesia", ""); // Clear inline edit key
  778. $saldo_iglesia->CurrentAction = ""; // Clear action
  779. $_SESSION[EW_SESSION_INLINE_MODE] = ""; // Clear inline mode
  780. }
  781. // Switch to Inline Edit Mode
  782. function InlineEditMode() {
  783. global $Security, $saldo_iglesia;
  784. $bInlineEdit = TRUE;
  785. if (@$_GET["idSaldoIglesia"] <> "") {
  786. $saldo_iglesia->idSaldoIglesia->setQueryStringValue($_GET["idSaldoIglesia"]);
  787. } else {
  788. $bInlineEdit = FALSE;
  789. }
  790. if ($bInlineEdit) {
  791. if ($this->LoadRow()) {
  792. $saldo_iglesia->setKey("idSaldoIglesia", $saldo_iglesia->idSaldoIglesia->CurrentValue); // Set up inline edit key
  793. $_SESSION[EW_SESSION_INLINE_MODE] = "edit"; // Enable inline edit
  794. }
  795. }
  796. }
  797. // Peform update to inline edit record
  798. function InlineUpdate() {
  799. global $objForm, $gsFormError, $saldo_iglesia;
  800. $objForm->Index = 1;
  801. $this->LoadFormValues(); // Get form values
  802. // Validate Form
  803. $bInlineUpdate = TRUE;
  804. if (!$this->ValidateForm()) {
  805. $bInlineUpdate = FALSE; // Form error, reset action
  806. $this->setMessage($gsFormError);
  807. } else {
  808. $bInlineUpdate = FALSE;
  809. if ($this->CheckInlineEditKey()) { // Check key
  810. $saldo_iglesia->SendEmail = TRUE; // Send email on update success
  811. $bInlineUpdate = $this->EditRow(); // Update record
  812. } else {
  813. $bInlineUpdate = FALSE;
  814. }
  815. }
  816. if ($bInlineUpdate) { // Update success
  817. $this->setMessage("Actualizacion exitosa"); // Set success message
  818. $this->ClearInlineMode(); // Clear inline edit mode
  819. } else {
  820. if ($this->getMessage() == "")
  821. $this->setMessage("Actualizacion a fallado"); // Set update failed message
  822. $saldo_iglesia->EventCancelled = TRUE; // Cancel event
  823. $saldo_iglesia->CurrentAction = "edit"; // Stay in edit mode
  824. }
  825. }
  826. // Check inline edit key
  827. function CheckInlineEditKey() {
  828. global $saldo_iglesia;
  829. //CheckInlineEditKey = True
  830. if (strval($saldo_iglesia->getKey("idSaldoIglesia")) <> strval($saldo_iglesia->idSaldoIglesia->CurrentValue))
  831. return FALSE;
  832. return TRUE;
  833. }
  834. // Switch to Inline Add Mode
  835. function InlineAddMode() {
  836. global $Security, $saldo_iglesia;
  837. $saldo_iglesia->CurrentAction = "add";
  838. $_SESSION[EW_SESSION_INLINE_MODE] = "add"; // Enable inline add
  839. }
  840. // Peform update to inline add/copy record
  841. function InlineInsert() {
  842. global $objForm, $gsFormError, $saldo_iglesia;
  843. $objForm->Index = 1;
  844. $this->LoadFormValues(); // Get form values
  845. // Validate Form
  846. if (!$this->ValidateForm()) {
  847. $this->setMessage($gsFormError); // Set validation error message
  848. $saldo_iglesia->EventCancelled = TRUE; // Set event cancelled
  849. $saldo_iglesia->CurrentAction = "add"; // Stay in add mode
  850. return;
  851. }
  852. $saldo_iglesia->SendEmail = TRUE; // Send email on add success
  853. if ($this->AddRow()) { // Add record
  854. $this->setMessage("Registro agregado satisfactoriamente"); // Set add success message
  855. $this->ClearInlineMode(); // Clear inline add mode
  856. } else { // Add failed
  857. $saldo_iglesia->EventCancelled = TRUE; // Set event cancelled
  858. $saldo_iglesia->CurrentAction = "add"; // Stay in add mode
  859. }
  860. }
  861. // Set up Sort parameters based on Sort Links clicked
  862. function SetUpSortOrder() {
  863. global $saldo_iglesia;
  864. // Check for an Order parameter
  865. if (@$_GET["order"] <> "") {
  866. $saldo_iglesia->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
  867. $saldo_iglesia->CurrentOrderType = @$_GET["ordertype"];
  868. $saldo_iglesia->UpdateSort($saldo_iglesia->idSaldoIglesia); // Field
  869. $saldo_iglesia->UpdateSort($saldo_iglesia->fecha); // Field
  870. $saldo_iglesia->UpdateSort($saldo_iglesia->nro_fact_recibo); // Field
  871. $saldo_iglesia->UpdateSort($saldo_iglesia->detalle); // Field
  872. $saldo_iglesia->UpdateSort($saldo_iglesia->ingreso); // Field
  873. $saldo_iglesia->UpdateSort($saldo_iglesia->egreso); // Field
  874. $saldo_iglesia->setStartRecordNumber(1); // Reset start position
  875. }
  876. }
  877. // Load Sort Order parameters
  878. function LoadSortOrder() {
  879. global $saldo_iglesia;
  880. $sOrderBy = $saldo_iglesia->getSessionOrderBy(); // Get order by from Session
  881. if ($sOrderBy == "") {
  882. if ($saldo_iglesia->SqlOrderBy() <> "") {
  883. $sOrderBy = $saldo_iglesia->SqlOrderBy();
  884. $saldo_iglesia->setSessionOrderBy($sOrderBy);
  885. }
  886. }
  887. }
  888. // Reset command based on querystring parameter cmd=
  889. // - RESET: reset search parameters
  890. // - RESETALL: reset search & master/detail parameters
  891. // - RESETSORT: reset sort parameters
  892. function ResetCmd() {
  893. global $saldo_iglesia;
  894. // Get reset cmd
  895. if (@$_GET["cmd"] <> "") {
  896. $sCmd = $_GET["cmd"];
  897. // Reset sort criteria
  898. if (strtolower($sCmd) == "resetsort") {
  899. $sOrderBy = "";
  900. $saldo_iglesia->setSessionOrderBy($sOrderBy);
  901. $saldo_iglesia->idSaldoIglesia->setSort("");
  902. $saldo_iglesia->fecha->setSort("");
  903. $saldo_iglesia->nro_fact_recibo->setSort("");
  904. $saldo_iglesia->detalle->setSort("");
  905. $saldo_iglesia->ingreso->setSort("");
  906. $saldo_iglesia->egreso->setSort("");
  907. }
  908. // Reset start position
  909. $this->lStartRec = 1;
  910. $saldo_iglesia->setStartRecordNumber($this->lStartRec);
  911. }
  912. }
  913. // Set up Starting Record parameters based on Pager Navigation
  914. function SetUpStartRec() {
  915. global $saldo_iglesia;
  916. if ($this->lDisplayRecs == 0)
  917. return;
  918. if ($this->IsPageRequest()) { // Validate request
  919. if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
  920. $this->lStartRec = $_GET[EW_TABLE_START_REC];
  921. $saldo_iglesia->setStartRecordNumber($this->lStartRec);
  922. } elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
  923. $this->nPageNo = $_GET[EW_TABLE_PAGE_NO];
  924. if (is_numeric($this->nPageNo)) {
  925. $this->lStartRec = ($this->nPageNo-1)*$this->lDisplayRecs+1;
  926. if ($this->lStartRec <= 0) {
  927. $this->lStartRec = 1;
  928. } elseif ($this->lStartRec >= intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1) {
  929. $this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1;
  930. }
  931. $saldo_iglesia->setStartRecordNumber($this->lStartRec);
  932. }
  933. }
  934. }
  935. $this->lStartRec = $saldo_iglesia->getStartRecordNumber();
  936. // Check if correct start record counter
  937. if (!is_numeric($this->lStartRec) || $this->lStartRec == "") { // Avoid invalid start record counter
  938. $this->lStartRec = 1; // Reset start record counter
  939. $saldo_iglesia->setStartRecordNumber($this->lStartRec);
  940. } elseif (intval($this->lStartRec) > intval($this->lTotalRecs)) { // Avoid starting record > total records
  941. $this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to last page first record
  942. $saldo_iglesia->setStartRecordNumber($this->lStartRec);
  943. } elseif (($this->lStartRec-1) % $this->lDisplayRecs <> 0) {
  944. $this->lStartRec = intval(($this->lStartRec-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to page boundary
  945. $saldo_iglesia->setStartRecordNumber($this->lStartRec);
  946. }
  947. }
  948. // Load default values
  949. function LoadDefaultValues() {
  950. global $saldo_iglesia;
  951. }
  952. // Load form values
  953. function LoadFormValues() {
  954. // Load from form
  955. global $objForm, $saldo_iglesia;
  956. $saldo_iglesia->idSaldoIglesia->setFormValue($objForm->GetValue("x_idSaldoIglesia"));
  957. $saldo_iglesia->fecha->setFormValue($objForm->GetValue("x_fecha"));
  958. $saldo_iglesia->fecha->CurrentValue = ew_UnFormatDateTime($saldo_iglesia->fecha->CurrentValue, 7);
  959. $saldo_iglesia->nro_fact_recibo->setFormValue($objForm->GetValue("x_nro_fact_recibo"));
  960. $saldo_iglesia->detalle->setFormValue($objForm->GetValue("x_detalle"));
  961. $saldo_iglesia->ingreso->setFormValue($objForm->GetValue("x_ingreso"));
  962. $saldo_iglesia->egreso->setFormValue($objForm->GetValue("x_egreso"));
  963. }
  964. // Restore form values
  965. function RestoreFormValues() {
  966. global $saldo_iglesia;
  967. $saldo_iglesia->idSaldoIglesia->CurrentValue = $saldo_iglesia->idSaldoIglesia->FormValue;
  968. $saldo_iglesia->fecha->CurrentValue = $saldo_iglesia->fecha->FormValue;
  969. $saldo_iglesia->fecha->CurrentValue = ew_UnFormatDateTime($saldo_iglesia->fecha->CurrentValue, 7);
  970. $saldo_iglesia->nro_fact_recibo->CurrentValue = $saldo_iglesia->nro_fact_recibo->FormValue;
  971. $saldo_iglesia->detalle->CurrentValue = $saldo_iglesia->detalle->FormValue;
  972. $saldo_iglesia->ingreso->CurrentValue = $saldo_iglesia->ingreso->FormValue;
  973. $saldo_iglesia->egreso->CurrentValue = $saldo_iglesia->egreso->FormValue;
  974. }
  975. // Load recordset
  976. function LoadRecordset($offset = -1, $rowcnt = -1) {
  977. global $conn, $saldo_iglesia;
  978. // Call Recordset Selecting event
  979. $saldo_iglesia->Recordset_Selecting($saldo_iglesia->CurrentFilter);
  980. // Load list page SQL
  981. $sSql = $saldo_iglesia->SelectSQL();
  982. if ($offset > -1 && $rowcnt > -1) $sSql .= " LIMIT $offset, $rowcnt";
  983. // Load recordset
  984. $conn->raiseErrorFn = 'ew_ErrorFn';
  985. $rs = $conn->Execute($sSql);
  986. $conn->raiseErrorFn = '';
  987. // Call Recordset Selected event
  988. $saldo_iglesia->Recordset_Selected($rs);
  989. return $rs;
  990. }
  991. // Load row based on key values
  992. function LoadRow() {
  993. global $conn, $Security, $saldo_iglesia;
  994. $sFilter = $saldo_iglesia->KeyFilter();
  995. // Call Row Selecting event
  996. $saldo_iglesia->Row_Selecting($sFilter);
  997. // Load sql based on filter
  998. $saldo_iglesia->CurrentFilter = $sFilter;
  999. $sSql = $saldo_iglesia->SQL();
  1000. if ($rs = $conn->Execute($sSql)) {
  1001. if ($rs->EOF) {
  1002. $LoadRow = FALSE;
  1003. } else {
  1004. $LoadRow = TRUE;
  1005. $rs->MoveFirst();
  1006. $this->LoadRowValues($rs); // Load row values
  1007. // Call Row Selected event
  1008. $saldo_iglesia->Row_Selected($rs);
  1009. }
  1010. $rs->Close();
  1011. } else {
  1012. $LoadRow = FALSE;
  1013. }
  1014. return $LoadRow;
  1015. }
  1016. // Load row values from recordset
  1017. function LoadRowValues(&$rs) {
  1018. global $saldo_iglesia;
  1019. $saldo_iglesia->idSaldoIglesia->setDbValue($rs->fields('idSaldoIglesia'));
  1020. $saldo_iglesia->fecha->setDbValue($rs->fields('fecha'));
  1021. $saldo_iglesia->nro_fact_recibo->setDbValue($rs->fields('nro_fact_recibo'));
  1022. $saldo_iglesia->detalle->setDbValue($rs->fields('detalle'));
  1023. $saldo_iglesia->ingreso->setDbValue($rs->fields('ingreso'));
  1024. $saldo_iglesia->egreso->setDbValue($rs->fields('egreso'));
  1025. $saldo_iglesia->fechaCreacion->setDbValue($rs->fields('fechaCreacion'));
  1026. $saldo_iglesia->fechaModificacion->setDbValue($rs->fields('fechaModificacion'));
  1027. $saldo_iglesia->diezmo->setDbValue($rs->fields('diezmo'));
  1028. }
  1029. // Render row values based on field settings
  1030. function RenderRow() {
  1031. global $conn, $Security, $saldo_iglesia;
  1032. // Call Row_Rendering event
  1033. $saldo_iglesia->Row_Rendering();
  1034. // Common render codes for all row types
  1035. // idSaldoIglesia
  1036. $saldo_iglesia->idSaldoIglesia->CellCssStyle = "";
  1037. $saldo_iglesia->idSaldoIglesia->CellCssClass = "";
  1038. // fecha
  1039. $saldo_iglesia->fecha->CellCssStyle = "";
  1040. $saldo_iglesia->fecha->CellCssClass = "";
  1041. // nro_fact_recibo
  1042. $saldo_iglesia->nro_fact_recibo->CellCssStyle = "";
  1043. $saldo_iglesia->nro_fact_recibo->CellCssClass = "";
  1044. // detalle
  1045. $saldo_iglesia->detalle->CellCssStyle = "";
  1046. $saldo_iglesia->detalle->CellCssClass = "";
  1047. // ingreso
  1048. $saldo_iglesia->ingreso->CellCssStyle = "";
  1049. $saldo_iglesia->ingreso->CellCssClass = "";
  1050. // egreso
  1051. $saldo_iglesia->egreso->CellCssStyle = "";
  1052. $saldo_iglesia->egreso->CellCssClass = "";
  1053. if ($saldo_iglesia->RowType == EW_ROWTYPE_VIEW) { // View row
  1054. // idSaldoIglesia
  1055. $saldo_iglesia->idSaldoIglesia->ViewValue = $saldo_iglesia->idSaldoIglesia->CurrentValue;
  1056. $saldo_iglesia->idSaldoIglesia->CssStyle = "";
  1057. $saldo_iglesia->idSaldoIglesia->CssClass = "";
  1058. $saldo_iglesia->idSaldoIglesia->ViewCustomAttributes = "";
  1059. // fecha
  1060. $saldo_iglesia->fecha->ViewValue = $saldo_iglesia->fecha->CurrentValue;
  1061. $saldo_iglesia->fecha->ViewValue = ew_FormatDateTime($saldo_iglesia->fecha->ViewValue, 7);
  1062. $saldo_iglesia->fecha->CssStyle = "";
  1063. $saldo_iglesia->fecha->CssClass = "";
  1064. $saldo_iglesia->fecha->ViewCustomAttributes = "";
  1065. // nro_fact_recibo
  1066. $saldo_iglesia->nro_fact_recibo->ViewValue = $saldo_iglesia->nro_fact_recibo->CurrentValue;
  1067. $saldo_iglesia->nro_fact_recibo->CssStyle = "";
  1068. $saldo_iglesia->nro_fact_recibo->CssClass = "";
  1069. $saldo_iglesia->nro_fact_recibo->ViewCustomAttributes = "";
  1070. // detalle
  1071. $saldo_iglesia->detalle->ViewValue = $saldo_iglesia->detalle->CurrentValue;
  1072. $saldo_iglesia->detalle->CssStyle = "";
  1073. $saldo_iglesia->detalle->CssClass = "";
  1074. $saldo_iglesia->detalle->ViewCustomAttributes = "";
  1075. // ingreso
  1076. $saldo_iglesia->ingreso->ViewValue = $saldo_iglesia->ingreso->CurrentValue;
  1077. $saldo_iglesia->ingreso->CssStyle = "";
  1078. $saldo_iglesia->ingreso->CssClass = "";
  1079. $saldo_iglesia->ingreso->ViewCustomAttributes = "";
  1080. // egreso
  1081. $saldo_iglesia->egreso->ViewValue = $saldo_iglesia->egreso->CurrentValue;
  1082. $saldo_iglesia->egreso->CssStyle = "";
  1083. $saldo_iglesia->egreso->CssClass = "";
  1084. $saldo_iglesia->egreso->ViewCustomAttributes = "";
  1085. // idSaldoIglesia
  1086. $saldo_iglesia->idSaldoIglesia->HrefValue = "";
  1087. // fecha
  1088. $saldo_iglesia->fecha->HrefValue = "";
  1089. // nro_fact_recibo
  1090. $saldo_iglesia->nro_fact_recibo->HrefValue = "";
  1091. // detalle
  1092. $saldo_iglesia->detalle->HrefValue = "";
  1093. // ingreso
  1094. $saldo_iglesia->ingreso->HrefValue = "";
  1095. // egreso
  1096. $saldo_iglesia->egreso->HrefValue = "";
  1097. } elseif ($saldo_iglesia->RowType == EW_ROWTYPE_ADD) { // Add row
  1098. // idSaldoIglesia
  1099. // fecha
  1100. $saldo_iglesia->fecha->EditCustomAttributes = "";
  1101. $saldo_iglesia->fecha->EditValue = ew_HtmlEncode(ew_FormatDateTime($saldo_iglesia->fecha->CurrentValue, 7));
  1102. // nro_fact_recibo
  1103. $saldo_iglesia->nro_fact_recibo->EditCustomAttributes = "";
  1104. $saldo_iglesia->nro_fact_recibo->EditValue = ew_HtmlEncode($saldo_iglesia->nro_fact_recibo->CurrentValue);
  1105. // detalle
  1106. $saldo_iglesia->detalle->EditCustomAttributes = "";
  1107. $saldo_iglesia->detalle->EditValue = ew_HtmlEncode($saldo_iglesia->detalle->CurrentValue);
  1108. // ingreso
  1109. $saldo_iglesia->ingreso->EditCustomAttributes = "";
  1110. $saldo_iglesia->ingreso->EditValue = ew_HtmlEncode($saldo_iglesia->ingreso->CurrentValue);
  1111. // egreso
  1112. $saldo_iglesia->egreso->EditCustomAttributes = "";
  1113. $saldo_iglesia->egreso->EditValue = ew_HtmlE

Large files files are truncated, but you can click here to view the full file