foreach ($_GET as $key => $val)
{
$$key = $val;
}
foreach ($_POST as $key => $val)
{
$$key = $val;
}
?>
### last update 06-12-2006
### --> update schlagermuziek.be
################################################################################################# NEW f_date 10/2006
function replace_day_short($string)
{
$eng[0] = "/\bSun\b/";
$eng[1] = "/\bMon\b/";
$eng[2] = "/\bTue\b/";
$eng[3] = "/\bWed\b/";
$eng[4] = "/\bThu\b/";
$eng[5] = "/\bFri\b/";
$eng[6] = "/\bSat\b/";
$nld[0] = "zo";
$nld[1] = "ma";
$nld[2] = "di";
$nld[3] = "wo";
$nld[4] = "do";
$nld[5] = "vr";
$nld[6] = "za";
return preg_replace($eng, $nld, $string);
}
function replace_day_long($string)
{
$eng[0] = "/Sunday/";
$eng[1] = "/Monday/";
$eng[2] = "/Tuesday/";
$eng[3] = "/Wednesday/";
$eng[4] = "/Thursday/";
$eng[5] = "/Friday /";
$eng[6] = "/Saturday/";
$nld[0] = "zondag";
$nld[1] = "maandag";
$nld[2] = "dinsdag";
$nld[3] = "woensdag";
$nld[4] = "donderdag";
$nld[5] = "vrijdag";
$nld[6] = "zaterdag";
return preg_replace($eng, $nld, $string);
}
function replace_month_short($string)
{
$eng[1] = "/\bJan\b/";
$eng[2] = "/\bFeb\b/";
$eng[3] = "/\bMar\b/";
$eng[4] = "/\bApr\b/";
$eng[5] = "/\bMay\b/";
$eng[6] = "/\bJun\b/";
$eng[7] = "/\bJul\b/";
$eng[8] = "/\bAug\b/";
$eng[9] = "/\bSep\b/";
$eng[10] = "/\bOct\b/";
$eng[11] = "/\bNov\b/";
$eng[12] = "/\bDec\b/";
$nld[1] = "jan";
$nld[2] = "feb";
$nld[3] = "maa";
$nld[4] = "apr";
$nld[5] = "mei";
$nld[6] = "jun";
$nld[7] = "jul";
$nld[8] = "aug";
$nld[9] = "sep";
$nld[10] = "okt";
$nld[11] = "nov";
$nld[12] = "dec";
return preg_replace($eng, $nld, $string);
}
function replace_month_long($string)
{
$eng[1] = "/\bJanuary\b/";
$eng[2] = "/\bFebruary\b/";
$eng[3] = "/\bMarch\b/";
$eng[4] = "/\bApril\b/";
$eng[5] = "/\bMay\b/";
$eng[6] = "/\bJune\b/";
$eng[7] = "/\bJuly\b/";
$eng[8] = "/\bAugust\b/";
$eng[9] = "/\bSeptember\b/";
$eng[10] = "/\bOctober\b/";
$eng[11] = "/\bNovember\b/";
$eng[12] = "/\bDecember\b/";
$nld[1] = "januari";
$nld[2] = "februari";
$nld[3] = "maart";
$nld[4] = "april";
$nld[5] = "mei";
$nld[6] = "juni";
$nld[7] = "juli";
$nld[8] = "augustus";
$nld[9] = "september";
$nld[10] = "oktober";
$nld[11] = "november";
$nld[12] = "december";
return preg_replace($eng, $nld, $string);
}
#### DEUTSCH
function replace_day_long_de($string)
{
$eng[0] = "/Sunday/";
$eng[1] = "/Monday/";
$eng[2] = "/Tuesday/";
$eng[3] = "/Wednesday/";
$eng[4] = "/Thursday/";
$eng[5] = "/Friday /";
$eng[6] = "/Saturday/";
$ger[0] = "zondag";
$ger[1] = "maandag";
$ger[2] = "dinsdag";
$ger[3] = "Mittwoch";
$ger[4] = "donderdag";
$ger[5] = "Freitag";
$ger[6] = "zaterdag";
return preg_replace($eng, $ger, $string);
}
function replace_month_long_de($string)
{
$eng[1] = "/\bJanuary\b/";
$eng[2] = "/\bFebruary\b/";
$eng[3] = "/\bMarch\b/";
$eng[4] = "/\bApril\b/";
$eng[5] = "/\bMay\b/";
$eng[6] = "/\bJune\b/";
$eng[7] = "/\bJuly\b/";
$eng[8] = "/\bAugust\b/";
$eng[9] = "/\bSeptember\b/";
$eng[10] = "/\bOctober\b/";
$eng[11] = "/\bNovember\b/";
$eng[12] = "/\bDecember\b/";
$ger[1] = "januari";
$ger[2] = "februari";
$ger[3] = "maart";
$ger[4] = "april";
$ger[5] = "mei";
$ger[6] = "juni";
$ger[7] = "juli";
$ger[8] = "augustus";
$ger[9] = "september";
$ger[10] = "oktober";
$ger[11] = "november";
$ger[12] = "december";
return preg_replace($eng, $nld, $string);
}
function return_date_de($format, $timestamp)
{
$timestamp = format_timestamp ($timestamp);
if ($timestamp==0)
{
return "(niet beschikbaar)";
}
$date = date($format, my_mktime($timestamp));
$date = replace_day_short($date);
$date = replace_day_long_de($date);
$date = replace_month_short($date);
$date = replace_month_long_de($date);
return $date;
}
#### DEUTSCH
// verzekert formaat timestamp = yyyymmddhhiiss
function format_timestamp ($timestamp)
{
$fragment = explode ("-", $timestamp);
$timestamp = implode ($fragment);
$fragment = explode (" ", $timestamp);
$timestamp = implode ($fragment);
$fragment = explode (":", $timestamp);
$timestamp = implode ($fragment);
if ($timestamp<99990000)
{
$timestamp = $timestamp."000000";
}
return $timestamp;
}
// myMktime
// deze functie converteert een datum naar een getal waarmee gerekend kan worden
function my_mktime ($timestamp)
{
$Y = substr($timestamp,0,4);
$m = substr($timestamp,4,2);
$d = substr($timestamp,6,2);
$H = substr($timestamp,8,2);
$i = substr($timestamp,10,2);
$s = substr($timestamp,12,2);
$mktime = mktime($H, $i, $s, $m, $d, $Y);
return $mktime;
}
// timeMove
// laat de datum een opgegeven aantal tijd verplaatsten
// $format kan enkel één van volgende zijn: "YmdHis"
function time_move ($format, $amount, $timestamp)
{
$timestamp = format_timestamp ($timestamp);
// check if input is valid - else return NULL
if (preg_match("/[YmdHis]/", $format))
{
$Y = substr($timestamp,0,4);
$m = substr($timestamp,4,2);
$d = substr($timestamp,6,2);
$H = substr($timestamp,8,2);
$i = substr($timestamp,10,2);
$s = substr($timestamp,12,2);
$$format = $$format + $amount;
$result = date("YmdHis", mktime($H, $i, $s, $m, $d, $Y));
return $result;
}
}
// simple makeTimestamp function
function make_timestamp ($year, $month, $day, $hour, $minute, $second)
{
$timestamp = date("YmdHis", mktime($hour, $minute, $second, $month, $day, $year));
return $timestamp;
}
function time_to_timestamp ($time)
{
$time_element = explode(":", $time);
$timestamp = date("YmdHis", mktime($time_element[0], $time_element[1], $time_element[2], date("m"), date("d"), date("Y")));
return $timestamp;
}
// timeDifference
// geeft het verschil weer in tijd tussen twee tijdsvariabelen
// $format kan enkel één van volgende zijn: "YmdHis"
function time_difference ($format, $timestamp_1, $timestamp_2)
{
$timestamp_1 = format_timestamp ($timestamp_1);
$timestamp_2 = format_timestamp ($timestamp_2);
// check if input is valid - else return NULL
if (preg_match("/[YmdHis]/", $format))
{
$s = 1;
$i = 60;
$H = 60*60;
$d = 24*60*60;
$m = 30*24*60*60;
$Y = 12*30*24*60*60;
if ($format=="d")
{
$timestamp_1 = return_date("Ymd", $timestamp_1)."000000";
$timestamp_2 = return_date("Ymd", $timestamp_2)."000000";
}
$difference = my_mktime ($timestamp_1) - my_mktime ($timestamp_2);
$difference = $difference/$$format;
return (int)$difference;
}
}
function print_time($time)
{
$time_element = explode(":", $time);
$time = $time_element[0]."u".$time_element[1];
return $time;
}
/// maakt van een timestamp een leesbare weergave
/// $format = date() format char
function return_date($format, $timestamp)
{
$timestamp = format_timestamp ($timestamp);
if ($timestamp==0)
{
return "(niet beschikbaar)";
}
$date = date($format, my_mktime($timestamp));
$date = replace_day_short($date);
$date = replace_day_long($date);
$date = replace_month_short($date);
$date = replace_month_long($date);
return $date;
}
// historyMessage
// vb. gisteren / 2 weken geleden
function time_message ($timestamp)
{
$timestamp = format_timestamp ($timestamp);
if ($timestamp==0)
{
return "(niet beschikbaar)";
}
$difference = time_difference ("d", date("YmdHis"), $timestamp);
$years = NULL;
while ($difference>364)
{
$difference = $difference-365;
$years++;
}
$months = NULL;
while ($difference>29)
{
$difference = $difference-30;
$months++;
}
if ($years!=NULL)
{
return $years." jaar geleden";
}
else if ($months==1)
{
return $months." maand geleden";
}
else if ($months>1)
{
return $months." maanden geleden";
}
else if ($difference>2)
{
return $difference." dagen geleden";
}
else if ($difference==2)
{
return "eergisteren";
}
else if ($difference==1)
{
return "gisteren";
}
else if ($difference==0)
{
return "vandaag";
}
$return = $return.$difference." dagen geleden";
return $return;
}
################################################################################################# NEW f_date 10/2006
// numberofdaysold
// deze functie converteert een datum naar een getal waarmee gerekend kan worden
function numberofdaysold($inputDate)
{
list($date, $time) = explode(" ", $inputDate);
list($year, $month, $day) = explode("-", $date);
list($hour, $minute, $second) = explode(":", $time);
$ageindays = gmmktime($hour, $minute, $second, $month, $day, $year);
return $ageindays;
}
//
function time_chrono ($timestamp)
{
$timestamp = format_timestamp ($timestamp);
if ($timestamp==0)
{
return NULL;
}
$difference = time_difference ("i", date("YmdHis"), $timestamp);
$hours = NULL;
while ($difference >= 60)
{
$difference = $difference-60;
$hours++;
}
$return = NULL;
if ($hours > 0)
{
$return = $hours."u";
}
$return = $return.$difference."m";
return $return;
}
function get_next_weekday_date($current_date, $day_nr)
{
$current_day = return_date("w", time_move ("d", 1, $current_date));
$return_date = return_date("Y-m-d", time_move ("d", 1, $current_date));
while ($day_nr!=$current_day)
{
$current_day = return_date("w", time_move ("d", 1, $return_date));
$return_date = return_date("Y-m-d", time_move ("d", 1, $return_date));
}
return $return_date;
}
#############################
## readability functions
#############################
/// geeft datum weer in ofwel tekst of wel date-formaat
/// vb. vandaag - 13u15
function view_time($timestamp)
{
$timestamp = format_timestamp($timestamp);
$difference[0] = "vandaag - ".return_date("H\ui", $timestamp);
$difference[1] = "gisteren - ".return_date("H\ui", $timestamp);
$difference[2] = return_date("D d-m-Y - H\ui", $timestamp);
$result = time_difference ("d", date("YmdHis"), $timestamp);
if ($result>1)
{
$result = 2;
}
return $difference[$result];
}
function reverseFormat($date)
{
$newDate = explode("-", $date);
$returnDate = $newDate[2]."-".$newDate[1]."-".$newDate[0];
return $returnDate;
}
function format_time($time)
{
$time_element = explode("u", $time);
$time = $time_element[0].":".$time_element[1].":".$time_element[2];
return $time;
}
function print_month($month_nr)
{
$nld[1] = "januari";
$nld[2] = "februari";
$nld[3] = "maart";
$nld[4] = "april";
$nld[5] = "mei";
$nld[6] = "juni";
$nld[7] = "juli";
$nld[8] = "augustus";
$nld[9] = "september";
$nld[10] = "oktober";
$nld[11] = "november";
$nld[12] = "december";
return $nld[$month_nr];
}
?>
define("DB_SERVER", "localhost");
define("DB_USER", "exportca_rs");
define("DB_PASS", "yTpjEl5z");
function error_report ()
{
echo "Error: ".mysql_errno().";
beschrijving: ".mysql_error()."
\n";
}
?>
class htmlStructure
{
//