Beispiel #1
0
 function ExportData()
 {
     $utf8 = strtolower(EW_CHARSET) == "utf-8";
     $bSelectLimit = FALSE;
     // Load recordset
     if ($bSelectLimit) {
         $this->TotalRecs = $this->SelectRecordCount();
     } else {
         if ($rs = $this->LoadRecordset()) {
             $this->TotalRecs = $rs->RecordCount();
         }
     }
     $this->StartRec = 1;
     $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 (!$rs) {
         header("Content-Type:");
         // Remove header
         header("Content-Disposition:");
         $this->ShowMessage();
         return;
     }
     $this->ExportDoc = ew_ExportDocument($this, "v");
     $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 = "";
     $sHeader = $this->PageHeader;
     $this->Page_DataRendering($sHeader);
     $Doc->Text .= $sHeader;
     $this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, "view");
     // Export detail records (detalle_deudas)
     if (EW_EXPORT_DETAIL_RECORDS && in_array("detalle_deudas", explode(",", $this->getCurrentDetailTable()))) {
         global $detalle_deudas;
         if (!isset($detalle_deudas)) {
             $detalle_deudas = new cdetalle_deudas();
         }
         $rsdetail = $detalle_deudas->LoadRs($detalle_deudas->GetDetailFilter());
         // Load detail records
         if ($rsdetail && !$rsdetail->EOF) {
             $ExportStyle = $Doc->Style;
             $Doc->SetStyle("h");
             // Change to horizontal
             if ($this->Export != "csv" || EW_EXPORT_DETAIL_RECORDS_FOR_CSV) {
                 $Doc->ExportEmptyRow();
                 $detailcnt = $rsdetail->RecordCount();
                 $detalle_deudas->ExportDocument($Doc, $rsdetail, 1, $detailcnt);
             }
             $Doc->SetStyle($ExportStyle);
             // Restore
             $rsdetail->Close();
         }
     }
     // Export detail records (pagos)
     if (EW_EXPORT_DETAIL_RECORDS && in_array("pagos", explode(",", $this->getCurrentDetailTable()))) {
         global $pagos;
         if (!isset($pagos)) {
             $pagos = new cpagos();
         }
         $rsdetail = $pagos->LoadRs($pagos->GetDetailFilter());
         // Load detail records
         if ($rsdetail && !$rsdetail->EOF) {
             $ExportStyle = $Doc->Style;
             $Doc->SetStyle("h");
             // Change to horizontal
             if ($this->Export != "csv" || EW_EXPORT_DETAIL_RECORDS_FOR_CSV) {
                 $Doc->ExportEmptyRow();
                 $detailcnt = $rsdetail->RecordCount();
                 $pagos->ExportDocument($Doc, $rsdetail, 1, $detailcnt);
             }
             $Doc->SetStyle($ExportStyle);
             // Restore
             $rsdetail->Close();
         }
     }
     $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
     if ($this->Export == "email") {
         echo $this->ExportEmail($Doc->Text);
     } else {
         $Doc->Export();
     }
 }
Beispiel #2
0
 function __construct()
 {
     global $conn, $Language, $UserAgent;
     // User agent
     $UserAgent = ew_UserAgent();
     $GLOBALS["Page"] =& $this;
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (pagos)
     if (!isset($GLOBALS["pagos"])) {
         $GLOBALS["pagos"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["pagos"];
     }
     // 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 = "cciagpagosadd.php";
     $this->InlineAddUrl = $this->PageUrl() . "a=add";
     $this->GridAddUrl = $this->PageUrl() . "a=gridadd";
     $this->GridEditUrl = $this->PageUrl() . "a=gridedit";
     $this->MultiDeleteUrl = "cciagpagosdelete.php";
     $this->MultiUpdateUrl = "cciagpagosupdate.php";
     // Table object (usuario)
     if (!isset($GLOBALS['usuario'])) {
         $GLOBALS['usuario'] = new cusuario();
     }
     // 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", 'pagos', 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 = "span";
     $this->ExportOptions->TagClassName = "ewExportOption";
     // Other options
     $this->OtherOptions['addedit'] = new cListOptions();
     $this->OtherOptions['addedit']->Tag = "span";
     $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption";
     $this->OtherOptions['detail'] = new cListOptions();
     $this->OtherOptions['detail']->Tag = "span";
     $this->OtherOptions['detail']->TagClassName = "ewDetailOption";
     $this->OtherOptions['action'] = new cListOptions();
     $this->OtherOptions['action']->Tag = "span";
     $this->OtherOptions['action']->TagClassName = "ewActionOption";
 }
Beispiel #3
0
 function __construct()
 {
     global $conn, $Language, $UserAgent;
     // User agent
     $UserAgent = ew_UserAgent();
     $GLOBALS["Page"] =& $this;
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (pagos)
     if (!isset($GLOBALS["pagos"])) {
         $GLOBALS["pagos"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["pagos"];
     }
     // Table object (usuario)
     if (!isset($GLOBALS['usuario'])) {
         $GLOBALS['usuario'] = new cusuario();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'delete', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'pagos', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect();
     }
 }
Beispiel #4
0
 function __construct()
 {
     global $conn, $Language;
     $GLOBALS["Page"] =& $this;
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (pagos)
     if (!isset($GLOBALS["pagos"]) || get_class($GLOBALS["pagos"]) == "cpagos") {
         $GLOBALS["pagos"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["pagos"];
     }
     $KeyUrl = "";
     if (@$_GET["id"] != "") {
         $this->RecKey["id"] = $_GET["id"];
         $KeyUrl .= "&amp;id=" . urlencode($this->RecKey["id"]);
     }
     $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 (deudas)
     if (!isset($GLOBALS['deudas'])) {
         $GLOBALS['deudas'] = new cdeudas();
     }
     // Table object (socios)
     if (!isset($GLOBALS['socios'])) {
         $GLOBALS['socios'] = new csocios();
     }
     // Table object (usuario)
     if (!isset($GLOBALS['usuario'])) {
         $GLOBALS['usuario'] = new cusuario();
     }
     // User table object (usuario)
     if (!isset($GLOBALS["UserTable"])) {
         $GLOBALS["UserTable"] = new cusuario();
     }
     // 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", 'pagos', 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";
 }
Beispiel #5
0
 function __construct()
 {
     global $conn, $Language;
     $GLOBALS["Page"] =& $this;
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (pagos)
     if (!isset($GLOBALS["pagos"]) || get_class($GLOBALS["pagos"]) == "cpagos") {
         $GLOBALS["pagos"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["pagos"];
     }
     // Table object (deudas)
     if (!isset($GLOBALS['deudas'])) {
         $GLOBALS['deudas'] = new cdeudas();
     }
     // Table object (socios)
     if (!isset($GLOBALS['socios'])) {
         $GLOBALS['socios'] = new csocios();
     }
     // Table object (usuario)
     if (!isset($GLOBALS['usuario'])) {
         $GLOBALS['usuario'] = new cusuario();
     }
     // User table object (usuario)
     if (!isset($GLOBALS["UserTable"])) {
         $GLOBALS["UserTable"] = new cusuario();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'edit', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'pagos', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect();
     }
 }
 function __construct()
 {
     global $conn, $Language;
     $this->FormActionName .= '_' . $this->FormName;
     $this->FormKeyName .= '_' . $this->FormName;
     $this->FormOldKeyName .= '_' . $this->FormName;
     $this->FormBlankRowName .= '_' . $this->FormName;
     $this->FormKeyCountName .= '_' . $this->FormName;
     $GLOBALS["Grid"] =& $this;
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (pagos)
     if (!isset($GLOBALS["pagos"]) || get_class($GLOBALS["pagos"]) == "cpagos") {
         $GLOBALS["pagos"] =& $this;
         //			$GLOBALS["MasterTable"] = &$GLOBALS["Table"];
         //			if (!isset($GLOBALS["Table"])) $GLOBALS["Table"] = &$GLOBALS["pagos"];
     }
     // Table object (deudas)
     if (!isset($GLOBALS['deudas'])) {
         $GLOBALS['deudas'] = new cdeudas();
     }
     // Table object (usuario)
     if (!isset($GLOBALS['usuario'])) {
         $GLOBALS['usuario'] = new cusuario();
     }
     // User table object (usuario)
     if (!isset($GLOBALS["UserTable"])) {
         $GLOBALS["UserTable"] = new cusuario();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'grid', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'pagos', 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;
     // Other options
     $this->OtherOptions['addedit'] = new cListOptions();
     $this->OtherOptions['addedit']->Tag = "div";
     $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption";
 }