<?php $wrkcnt += 1; } } } for ($i = 0; $i < $cntd; $i++) { $selwrk = " selected=\"selected\""; ?> <option value="<?php echo $Page->dateCreated->DropDownList[$i]; ?> "<?php echo $selwrk; ?> ><?php echo ewr_DropDownDisplayValue($Page->dateCreated->DropDownList[$i], $Page->dateCreated->DateFilter, 5); ?> </option> <?php $wrkcnt += 1; } ?> </select> <?php $sSqlWrk = "SELECT DISTINCT YEAR(`dateCreated`), YEAR(`dateCreated`) AS `DispFld` FROM `jobpositionvsjoboffered`"; $sWhereWrk = ""; // Call Lookup selecting $Page->Lookup_Selecting($Page->dateCreated, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; }
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); }