Beispiel #1
0
 function GetLookupValues($sql, $ds, $df, $dlm)
 {
     global $ReportLanguage;
     $rsarr = array();
     $rowcnt = 0;
     $conn = ewr_Connect();
     if ($rs = $conn->Execute($sql)) {
         $rowcnt = $rs->RecordCount();
         $fldcnt = $rs->FieldCount();
         $rsarr = $rs->GetRows();
         $rs->Close();
     }
     $conn->Close();
     // Clean output buffer
     if (!EWR_DEBUG_ENABLED && ob_get_length()) {
         ob_end_clean();
     }
     // Output
     $key = array();
     $arr = array();
     if (is_array($rsarr) && $rowcnt > 0) {
         for ($i = 0; $i < $rowcnt; $i++) {
             $row = $rsarr[$i];
             if ($dlm != "") {
                 $cnt = 0;
                 for ($j = 0; $j < $fldcnt; $j++) {
                     if (strpos(strval($row[$j]), $dlm) !== FALSE) {
                         $row[$j] = explode($dlm, $row[$j]);
                         if (count($row[$j]) > $cnt) {
                             $cnt = count($row[$j]);
                         }
                     } else {
                         if ($cnt < 1) {
                             $cnt = 1;
                         }
                     }
                 }
             } else {
                 $cnt = 1;
             }
             for ($k = 0; $k < $cnt; $k++) {
                 $val0 = "";
                 $str0 = "";
                 $rec = array();
                 for ($j = 0; $j < $fldcnt; $j++) {
                     if ($dlm != "" && is_array($row[$j])) {
                         if (count($row[$j]) > $k) {
                             $val = $row[$j][$k];
                         } else {
                             $val = $row[$j][0];
                         }
                     } else {
                         $val = $row[$j];
                     }
                     if ($j == 0) {
                         $str = ewr_ConvertValue($ds, $val);
                         $val0 = $val;
                         $str0 = $str;
                     } elseif ($j == 1 && is_null($val0)) {
                         $str = $ReportLanguage->Phrase("NullLabel");
                     } elseif ($j == 1 && strval($val0) == "") {
                         $str = $ReportLanguage->Phrase("EmptyLabel");
                     } elseif ($j == 1) {
                         $str = ewr_DropDownDisplayValue(ewr_ConvertValue($ds, $val), $ds, $df);
                     } else {
                         $str = strval($val);
                     }
                     $str = ewr_ConvertToUtf8($str);
                     $rec[$j] = $str;
                 }
                 if (!in_array($str0, $key)) {
                     $arr[] = $rec;
                     $key[] = $str0;
                 }
             }
         }
     }
     echo ewr_ArrayToJson($arr);
 }
 function __construct()
 {
     global $conn, $ReportLanguage;
     // Language object
     $ReportLanguage = new crLanguage();
     // Parent constuctor
     parent::__construct();
     // Table object (University_Vs_Rejected_Candidates)
     if (!isset($GLOBALS["University_Vs_Rejected_Candidates"])) {
         $GLOBALS["University_Vs_Rejected_Candidates"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["University_Vs_Rejected_Candidates"];
     }
     // Initialize URLs
     $this->ExportPrintUrl = $this->PageUrl() . "export=print";
     $this->ExportExcelUrl = $this->PageUrl() . "export=excel";
     $this->ExportWordUrl = $this->PageUrl() . "export=word";
     $this->ExportPdfUrl = $this->PageUrl() . "export=pdf";
     // Page ID
     if (!defined("EWR_PAGE_ID")) {
         define("EWR_PAGE_ID", 'crosstab', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EWR_TABLE_NAME")) {
         define("EWR_TABLE_NAME", 'University Vs Rejected Candidates', TRUE);
     }
     // Start timer
     $GLOBALS["gsTimer"] = new crTimer();
     // Open connection
     $conn = ewr_Connect();
     // Export options
     $this->ExportOptions = new crListOptions();
     $this->ExportOptions->Tag = "div";
     $this->ExportOptions->TagClassName = "ewExportOption";
     // Search options
     $this->SearchOptions = new crListOptions();
     $this->SearchOptions->Tag = "div";
     $this->SearchOptions->TagClassName = "ewSearchOption";
     // Filter options
     $this->FilterOptions = new crListOptions();
     $this->FilterOptions->Tag = "div";
     $this->FilterOptions->TagClassName = "ewFilterOption fUniversity_Vs_Rejected_Candidatescrosstab";
 }
Beispiel #3
0
 function __construct()
 {
     global $conn, $ReportLanguage;
     // Language object
     $ReportLanguage = new crLanguage();
     // Page ID
     if (!defined("EWR_PAGE_ID")) {
         define("EWR_PAGE_ID", 'rptdefault', TRUE);
     }
     // Start timer
     $GLOBALS["gsTimer"] = new crTimer();
     // Open connection
     $conn = ewr_Connect();
 }