query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: '$sqlquery'" . $result->getMessage()); $count = 0; while ($row = $result->fetch_assoc()): $retArray[$count][0] = $row["ph_year"]; $retArray[$count][1] = $row["ph_month"]; $retArray[$count][2] = $row["ph_day"]; $retArray[$count][3] = $row["ph_time_from"]; $retArray[$count][4] = $row["ph_time_to"]; $count++; endwhile; $result->free(); endif; // Special javascript output as string ... if ($mode == "1") : $retString = "var ph = new Array();\n"; for ($i = 0; $i < $count; $i++) : $retString .= "ph[" . $i . "] = new Array();\n"; $retString .= "ph[" . $i . "][0] = \"" . $retArray[$i][0] . "\";\n"; $retString .= "ph[" . $i . "][1] = \"" . $retArray[$i][1] . "\";\n"; $retString .= "ph[" . $i . "][2] = \"" . $retArray[$i][2] . "\";\n"; $retString .= "ph[" . $i . "][3] = \"" . $retArray[$i][3] . "\";\n"; $retString .= "ph[" . $i . "][4] = \"" . $retArray[$i][4] . "\";\n"; endfor; return $retString; endif; // If no special $mode specified the 2-D-Array will be returned !!! return $retArray; } // Gets the public holiday of the specified year and the next one function convertPublicHolidayArrayToDateArray($phArray, $mode = "") { $retArray = array(); if (is_array($phArray)) : $phArrayLen = count($phArray); for ($i = 0; $i < $phArrayLen; $i++) : $retArray[] = $phArray[$i][0] . "-" . pad($phArray[$i][1],2) . "-" . pad($phArray[$i][2],2); endfor; endif; return $retArray; } ?>