function __construct() { global $conn, $Language; $GLOBALS["Page"] =& $this; // Language object if (!isset($Language)) { $Language = new cLanguage(); } // Parent constuctor parent::__construct(); // Table object (tipo_gastos) if (!isset($GLOBALS["tipo_gastos"]) || get_class($GLOBALS["tipo_gastos"]) == "ctipo_gastos") { $GLOBALS["tipo_gastos"] =& $this; $GLOBALS["Table"] =& $GLOBALS["tipo_gastos"]; } // Table object (usuarios) if (!isset($GLOBALS['usuarios'])) { $GLOBALS['usuarios'] = new cusuarios(); } // User table object (usuarios) if (!isset($GLOBALS["UserTable"])) { $GLOBALS["UserTable"] = new cusuarios(); } // Page ID if (!defined("EW_PAGE_ID")) { define("EW_PAGE_ID", 'addopt', TRUE); } // Table name (for backward compatibility) if (!defined("EW_TABLE_NAME")) { define("EW_TABLE_NAME", 'tipo_gastos', TRUE); } // Start timer if (!isset($GLOBALS["gTimer"])) { $GLOBALS["gTimer"] = new cTimer(); } // Open connection if (!isset($conn)) { $conn = ew_Connect(); } }
function __construct() { global $conn, $Language; $GLOBALS["Page"] =& $this; // Language object if (!isset($Language)) { $Language = new cLanguage(); } // Parent constuctor parent::__construct(); // Table object (tipo_gastos) if (!isset($GLOBALS["tipo_gastos"]) || get_class($GLOBALS["tipo_gastos"]) == "ctipo_gastos") { $GLOBALS["tipo_gastos"] =& $this; $GLOBALS["Table"] =& $GLOBALS["tipo_gastos"]; } $KeyUrl = ""; if (@$_GET["codigo"] != "") { $this->RecKey["codigo"] = $_GET["codigo"]; $KeyUrl .= "&codigo=" . urlencode($this->RecKey["codigo"]); } $this->ExportPrintUrl = $this->PageUrl() . "export=print" . $KeyUrl; $this->ExportHtmlUrl = $this->PageUrl() . "export=html" . $KeyUrl; $this->ExportExcelUrl = $this->PageUrl() . "export=excel" . $KeyUrl; $this->ExportWordUrl = $this->PageUrl() . "export=word" . $KeyUrl; $this->ExportXmlUrl = $this->PageUrl() . "export=xml" . $KeyUrl; $this->ExportCsvUrl = $this->PageUrl() . "export=csv" . $KeyUrl; $this->ExportPdfUrl = $this->PageUrl() . "export=pdf" . $KeyUrl; // Table object (usuarios) if (!isset($GLOBALS['usuarios'])) { $GLOBALS['usuarios'] = new cusuarios(); } // User table object (usuarios) if (!isset($GLOBALS["UserTable"])) { $GLOBALS["UserTable"] = new cusuarios(); } // Page ID if (!defined("EW_PAGE_ID")) { define("EW_PAGE_ID", 'view', TRUE); } // Table name (for backward compatibility) if (!defined("EW_TABLE_NAME")) { define("EW_TABLE_NAME", 'tipo_gastos', TRUE); } // Start timer if (!isset($GLOBALS["gTimer"])) { $GLOBALS["gTimer"] = new cTimer(); } // Open connection if (!isset($conn)) { $conn = ew_Connect(); } // Export options $this->ExportOptions = new cListOptions(); $this->ExportOptions->Tag = "div"; $this->ExportOptions->TagClassName = "ewExportOption"; // Other options $this->OtherOptions['action'] = new cListOptions(); $this->OtherOptions['action']->Tag = "div"; $this->OtherOptions['action']->TagClassName = "ewActionOption"; $this->OtherOptions['detail'] = new cListOptions(); $this->OtherOptions['detail']->Tag = "div"; $this->OtherOptions['detail']->TagClassName = "ewDetailOption"; }
function ExportData() { $utf8 = strtolower(EW_CHARSET) == "utf-8"; $bSelectLimit = EW_SELECT_LIMIT; // Load recordset if ($bSelectLimit) { $this->TotalRecs = $this->SelectRecordCount(); } else { if (!$this->Recordset) { $this->Recordset = $this->LoadRecordset(); } $rs =& $this->Recordset; if ($rs) { $this->TotalRecs = $rs->RecordCount(); } } $this->StartRec = 1; // Export all if ($this->ExportAll) { set_time_limit(EW_EXPORT_ALL_TIME_LIMIT); $this->DisplayRecs = $this->TotalRecs; $this->StopRec = $this->TotalRecs; } else { // Export one page only $this->SetUpStartRec(); // Set up start record position // Set the last record to display if ($this->DisplayRecs <= 0) { $this->StopRec = $this->TotalRecs; } else { $this->StopRec = $this->StartRec + $this->DisplayRecs - 1; } } if ($bSelectLimit) { $rs = $this->LoadRecordset($this->StartRec - 1, $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs); } if (!$rs) { header("Content-Type:"); // Remove header header("Content-Disposition:"); $this->ShowMessage(); return; } $this->ExportDoc = ew_ExportDocument($this, "h"); $Doc =& $this->ExportDoc; if ($bSelectLimit) { $this->StartRec = 1; $this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs; } else { //$this->StartRec = $this->StartRec; //$this->StopRec = $this->StopRec; } // Call Page Exporting server event $this->ExportDoc->ExportCustom = !$this->Page_Exporting(); $ParentTable = ""; // Export master record if (EW_EXPORT_MASTER_RECORD && $this->GetMasterFilter() != "" && $this->getCurrentMasterTable() == "hoja_rutas") { global $hoja_rutas; if (!isset($hoja_rutas)) { $hoja_rutas = new choja_rutas(); } $rsmaster = $hoja_rutas->LoadRs($this->DbMasterFilter); // Load master record if ($rsmaster && !$rsmaster->EOF) { $ExportStyle = $Doc->Style; $Doc->SetStyle("v"); // Change to vertical if ($this->Export != "csv" || EW_EXPORT_MASTER_RECORD_FOR_CSV) { $Doc->Table =& $hoja_rutas; $hoja_rutas->ExportDocument($Doc, $rsmaster, 1, 1); $Doc->ExportEmptyRow(); $Doc->Table =& $this; } $Doc->SetStyle($ExportStyle); // Restore $rsmaster->Close(); } } // Export master record if (EW_EXPORT_MASTER_RECORD && $this->GetMasterFilter() != "" && $this->getCurrentMasterTable() == "tipo_gastos") { global $tipo_gastos; if (!isset($tipo_gastos)) { $tipo_gastos = new ctipo_gastos(); } $rsmaster = $tipo_gastos->LoadRs($this->DbMasterFilter); // Load master record if ($rsmaster && !$rsmaster->EOF) { $ExportStyle = $Doc->Style; $Doc->SetStyle("v"); // Change to vertical if ($this->Export != "csv" || EW_EXPORT_MASTER_RECORD_FOR_CSV) { $Doc->Table =& $tipo_gastos; $tipo_gastos->ExportDocument($Doc, $rsmaster, 1, 1); $Doc->ExportEmptyRow(); $Doc->Table =& $this; } $Doc->SetStyle($ExportStyle); // Restore $rsmaster->Close(); } } $sHeader = $this->PageHeader; $this->Page_DataRendering($sHeader); $Doc->Text .= $sHeader; $this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, ""); $sFooter = $this->PageFooter; $this->Page_DataRendered($sFooter); $Doc->Text .= $sFooter; // Close recordset $rs->Close(); // Export header and footer $Doc->ExportHeaderAndFooter(); // Call Page Exported server event $this->Page_Exported(); // Clean output buffer if (!EW_DEBUG_ENABLED && ob_get_length()) { ob_end_clean(); } // Write debug message if enabled if (EW_DEBUG_ENABLED) { echo ew_DebugMsg(); } // Output data $Doc->Export(); }
function __construct() { global $conn, $Language; $GLOBALS["Page"] =& $this; // Language object if (!isset($Language)) { $Language = new cLanguage(); } // Parent constuctor parent::__construct(); // Table object (tipo_gastos) if (!isset($GLOBALS["tipo_gastos"]) || get_class($GLOBALS["tipo_gastos"]) == "ctipo_gastos") { $GLOBALS["tipo_gastos"] =& $this; $GLOBALS["Table"] =& $GLOBALS["tipo_gastos"]; } // Initialize URLs $this->ExportPrintUrl = $this->PageUrl() . "export=print"; $this->ExportExcelUrl = $this->PageUrl() . "export=excel"; $this->ExportWordUrl = $this->PageUrl() . "export=word"; $this->ExportHtmlUrl = $this->PageUrl() . "export=html"; $this->ExportXmlUrl = $this->PageUrl() . "export=xml"; $this->ExportCsvUrl = $this->PageUrl() . "export=csv"; $this->ExportPdfUrl = $this->PageUrl() . "export=pdf"; $this->AddUrl = "tipo_gastosadd.php?" . EW_TABLE_SHOW_DETAIL . "="; $this->InlineAddUrl = $this->PageUrl() . "a=add"; $this->GridAddUrl = $this->PageUrl() . "a=gridadd"; $this->GridEditUrl = $this->PageUrl() . "a=gridedit"; $this->MultiDeleteUrl = "tipo_gastosdelete.php"; $this->MultiUpdateUrl = "tipo_gastosupdate.php"; // Table object (usuarios) if (!isset($GLOBALS['usuarios'])) { $GLOBALS['usuarios'] = new cusuarios(); } // User table object (usuarios) if (!isset($GLOBALS["UserTable"])) { $GLOBALS["UserTable"] = new cusuarios(); } // Page ID if (!defined("EW_PAGE_ID")) { define("EW_PAGE_ID", 'list', TRUE); } // Table name (for backward compatibility) if (!defined("EW_TABLE_NAME")) { define("EW_TABLE_NAME", 'tipo_gastos', TRUE); } // Start timer if (!isset($GLOBALS["gTimer"])) { $GLOBALS["gTimer"] = new cTimer(); } // Open connection if (!isset($conn)) { $conn = ew_Connect(); } // List options $this->ListOptions = new cListOptions(); $this->ListOptions->TableVar = $this->TableVar; // Export options $this->ExportOptions = new cListOptions(); $this->ExportOptions->Tag = "div"; $this->ExportOptions->TagClassName = "ewExportOption"; // Other options $this->OtherOptions['addedit'] = new cListOptions(); $this->OtherOptions['addedit']->Tag = "div"; $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption"; $this->OtherOptions['detail'] = new cListOptions(); $this->OtherOptions['detail']->Tag = "div"; $this->OtherOptions['detail']->TagClassName = "ewDetailOption"; $this->OtherOptions['action'] = new cListOptions(); $this->OtherOptions['action']->Tag = "div"; $this->OtherOptions['action']->TagClassName = "ewActionOption"; }