$_root = "http://".$_SERVER['HTTP_HOST']."/";
$_table_width = '100%';
$_upload_temp = "upload/temp/"; // Upload temporary folder ...
$_upload_mail = "upload/mailing/"; // Mailing's
$_upload_mail_digi = "upload/mailing_digi/"; // Digi. Mailing's
$_upload_imp = "upload/import/"; // Import to this folder...
$_sep_line_color = "#0080C0";
/*
Remember these values...
$_a_light = "#E84B00";
*/
function showError($id) {
if (isset($id) && is_numeric($id)) {
$_errors = array (
'0' => "U kunt deze hoofd-groep niet verwijderen vanwege aanwezige sub-groepen in deze hoofd-groep !!!",
'1' => "U kunt deze sub-groep niet verwijderen vanwege aanwezige producten in deze groep !!!",
'1000' => "U heeft geen Groep ingevoerd.",
'1001' => "U heeft geen Naam ingevoerd.",
'1002' => "U heeft geen Email ingevoerd.",
'1003' => "U heeft geen geldig Emailadres ingevoerd.",
);
$_mes = $_errors[$id];
return "
".$_mes." ";
} else {
return "";
}
}
$weekDays = array (
'0' => 'Zondag',
'1' => 'Maandag',
'2' => 'Dinsdag',
'3' => 'Woensdag',
'4' => 'Donderdag',
'5' => 'Vrijdag',
'6' => 'Zaterdag'
);
$weekDays_short = array (
'0' => 'Zo.',
'1' => 'Ma.',
'2' => 'Di.',
'3' => 'Wo.',
'4' => 'Do.',
'5' => 'Vr.',
'6' => 'Za.'
);
function load_timer_page($loc='', $frm='', $wait=2000) {
$out = "";
return $out;
}
function GetPageHeader($_title=' ', $_info=' ', $_table_width='100%') {
$_val = "
";
return $_val;
}
function GetBoxHeaderRow($colSpan='1',$classHeader='light_header', $title) {
$_val = "
";
return $_val;
}
function get_ip() {
if (isset($_SERVER) and !empty($_SERVER)) {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else if (isset($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
} else {
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} else if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
} else {
$ip = getenv('REMOTE_ADDR');
}
}
return $ip;
}
function GetExtension($file_type) {
switch ($file_type) {
case 'image/gif':
return "gif";
break;
case 'image/jpeg':
return "jpg";
break;
case 'image/pjpeg':
return "jpg";
break;
case 'image/png':
return "png";
break;
default:
return "";
}
}
function get_lines($_val, $_nr=1, $_max_chars=0) {
$_text = "";
$_occ = split(" ", $_val);
$_found = count($_occ);
if ($_found >= $_nr) {
$_i = 0;
while ($_i < $_nr) {
$_text .= $_occ[$_i]." ";
$_i++;
}
} else {
$_text = $_occ[0];
}
$_len = strlen($_text);
if ($_max_chars==0 || $_len <= $_max_chars) {
$_return = $_text;
} else {
$_char = substr($_text, $_max_chars, 1);
while ($_char != " " && $_max_chars < $_len) {
$_max_chars++;
$_char = substr($_text, $_max_chars, 1);
}
$_return = substr($_text, 0, $_max_chars)." ...";
}
return $_return;
}
function make_comp_text($_val) {
$_search = array("\"");
$_replace = array("'");
return addslashes(str_replace($_search,$_replace,trim($_val)));
}
function undo_comp_text($_val) {
$_search = array("\r\n");
$_replace = array(" ");
return stripslashes(str_replace($_search,$_replace,trim($_val)));
}
function make_currency($_val) {
return "€ ".number_format($_val,2,",",".");
}
function retouch($_file) {
$_new = "";
if ($fp = @fopen ($_file, "r")) {
while (!feof($fp)) {
$_line = str_replace("\r\n", "", fgets($fp, 4096));
if (substr($_line, 0, 7)=='Artikel') {
$_new .= "".$_line." ";
} else {
$_pos = strpos($_line, "\t");
if ($_pos === false) {
$_new .= $_line;
} else {
$_sub = substr($_line, 0, $_pos);
if (substr_count($_sub, ".")==2) {
$_new .= "".$_sub." ".substr($_line, $_pos)." ";
}
}
}
}
fclose($fp);
}
return $_new;
}
function modifyPicture($pictureSource, $pictureDestination, $resize_to, $resize_what="", $binder=0, $_color='#CCCCCC', $watermarkSource="", $addWatermark=0, $constrain_wh=0)
{
$gd2=true;
// ### Photo manipulation for display ###
$border_color=$_color; // Photo background color
$table_color=$_color; // Page background color
$border_width=0; // Add border around photo - width in px (0=no border)
$show_bordershadow=false; // Display shadow around border: true or false
$show_binder=$binder; // Display binder: true or false
$binder_spacing=8; // Space between binder-rings in px
$clip_corner=0; // Clip corner of photo - size in % of width (0=no clipping)
$clip_corner_round=false; // Clip corner of photo - rounded or straight: true or false
$show_number=false; // Display photo number in thumbnail: true or false
$image_resize=true; // Set to true to resize photo for display, use this to show large photos in a smaller size: true or false
$image_resizeto=$resize_to; // Size in px for resize (min. 30 pixels)
$image_inflate=false; // Allow photo to be enlarged: true or false
$copyright=''; // Add copyright notice to photo (only when $image_resize=true)
$image_greyscale=false; // Convert color jpg photo to grayscale (only when $image_resize=true) - only for GDLib2+
$image_sepia_depth=80; // Add 'aged' effect to jpg photo only when $image_greyscale=true (0=disabled) - only for GDLib2+
$image_noise_depth=10; // Add random noise to jpg photo to make it look older only when $image_greyscale=true (0=disabled) - only for GDLib2+
$size=@GetImageSize($pictureSource);
if ($size[2]==1) {
if (imagetypes() & IMG_GIF) {
$im=@imagecreatefromgif($pictureSource);
} else {
exit;
}
}
if ($size[2]==2) {
if (imagetypes() & IMG_JPG) {
$im=@imagecreatefromjpeg($pictureSource);
} else {
exit;
}
}
if ($size[2]==3) {
if (imagetypes() & IMG_PNG) {
$im=@imagecreatefrompng($pictureSource);
} else {
exit;
}
}
if ($size[2]!=1 && $size[2]!=2 && $size[2]!=3) {
exit();
} else {
if ($image_resizeto < 30)
$image_resizeto = 30;
if ($image_resize) {
if (!$image_inflate) {
if ($image_resizeto>$size[0] && $image_resizeto>$size[1])
$image_resizeto=max($size[0],$size[1]);
}
}
if ($show_binder)
$border_offset=3;
else
$border_offset=2;
if ($show_bordershadow)
$shadow_offset=4;
else
$shadow_offset=0;
if ($gd2) {
if ($constrain_wh==1) {
//FIX: Doesn't work correctly.
$thumb=imagecreatetruecolor($border_width*$border_offset+$image_resizeto+$shadow_offset,$border_width*$border_offset+$image_resizeto+$shadow_offset);
} else {
//echo "» ".$size[0]." x ".$size[1]." , resize_to: ".$image_resizeto." , resize_what: ".$resize_what;
if ($size[0]>$size[1]) {
if ($resize_what=='h') {
$_h = $border_width*$border_offset+ceil($image_resizeto)+$shadow_offset;
$_w = $border_width*$border_offset+ceil($size[0]/($size[1]/$image_resizeto))+$shadow_offset;
$thumb = imagecreatetruecolor($_w,$_h);
} else if ($resize_what=='w') {
$_h = $border_width*$border_offset+ceil($size[1]/($size[0]/$image_resizeto))+$shadow_offset;
$_w = $border_width*$border_offset+ceil($image_resizeto)+$shadow_offset;
$thumb = imagecreatetruecolor($_w,$_h);
} else {
$_h = $border_width*$border_offset+ceil($size[1]/($size[0]/$image_resizeto))+$shadow_offset;
$_w = $border_width*$border_offset+ceil($image_resizeto)+$shadow_offset;
$thumb = imagecreatetruecolor($_w,$_h);
}
} else {
if ($resize_what=='h') {
$_h = $border_width*$border_offset+$shadow_offset+ceil($image_resizeto);
$_w = $border_width*$border_offset+$shadow_offset+ceil($size[0]/($size[1]/$image_resizeto));
$thumb = imagecreatetruecolor($_w,$_h);
} else if ($resize_what=='w') {
$_h = $border_width*$border_offset+ceil($size[1]/($size[0]/$image_resizeto))+$shadow_offset;
$_w = $border_width*$border_offset+$shadow_offset+ceil($image_resizeto);
$thumb = imagecreatetruecolor($_w,$_h);
} else {
$_h = $border_width*$border_offset+$shadow_offset+ceil($image_resizeto);
$_w = $border_width*$border_offset+ceil($size[0]/($size[1]/$image_resizeto))+$shadow_offset;
$thumb = imagecreatetruecolor($_w,$_h);
}
}
}
} else {
if ($constrain_wh==1) {
//FIX: Doesn't work correctly.
$thumb=imagecreatetruecolor($border_width*$border_offset+$image_resizeto+$shadow_offset,$border_width*$border_offset+$image_resizeto+$shadow_offset);
} else {
if ($size[0]>$size[1]) {
$thumb=imagecreate($border_width*$border_offset+$image_resizeto+$shadow_offset,$border_width*2+ceil($size[1]/($size[0]/$image_resizeto))+$shadow_offset);
} else {
if ($resize_what=='h') {
$_h = $border_width*$border_offset+ceil($size[0]/($size[1]/$image_resizeto))+$shadow_offset;
$_w = $border_width*$border_offset+ceil($size[0]/($size[1]/$_h))+$shadow_offset;
$thumb = imagecreate($_w,$_h);
} else {
$thumb = imagecreate($border_width*$bortider_offset+ceil($size[0]/($size[1]/$image_resizeto))+$shadow_offset,$border_width*2+$image_resizeto+$shadow_offset);
}
}
}
}
$black = imagecolorallocate($thumb,0,0,0);
$white = imagecolorallocate($thumb,255,255,255);
$gray = "#BC23AF"; //imagecolorallocate($thumb,192,192,192);
$middlegray = "#8E098E"; //imagecolorallocate($thumb,158,158,158);
$darkgray = "#60065F"; //imagecolorallocate($thumb,128,128,128);
imagefill($thumb,0,0,imagecolorallocate($thumb,hexdec(substr($table_color,1,2)),hexdec(substr($table_color,3,2)),hexdec(substr($table_color,5,2))));
if ($show_binder)
$bind_offset=4;
else
$bind_offset=0;
imagefilledrectangle($thumb,$bind_offset,0,imagesx($thumb)-$shadow_offset,imagesy($thumb)-$shadow_offset,imagecolorallocate($thumb,hexdec(substr($border_color,1,2)),hexdec(substr($border_color,3,2)),hexdec(substr($border_color,5,2))));
if ($show_bordershadow) {
imagerectangle($thumb,$bind_offset,0,imagesx($thumb)-4,imagesy($thumb)-4,$gray);
imageline($thumb,$bind_offset,imagesy($thumb)-3,imagesx($thumb),imagesy($thumb)-3,$darkgray);
imageline($thumb,imagesx($thumb)-3,0,imagesx($thumb)-3,imagesy($thumb),$darkgray);
imageline($thumb,$bind_offset+2,imagesy($thumb)-2,imagesx($thumb),imagesy($thumb)-2,$middlegray);
imageline($thumb,imagesx($thumb)-2,2,imagesx($thumb)-2,imagesy($thumb),$middlegray);
imageline($thumb,$bind_offset+2,imagesy($thumb)-1,imagesx($thumb),imagesy($thumb)-1,$gray);
imageline($thumb,imagesx($thumb)-1,2,imagesx($thumb)-1,imagesy($thumb),$gray);
}
if ($clip_corner>0) {
$clip_corner=floor(imagesx($im)*($clip_corner/100));
if ($clip_corner_round){
$clip_degrees=90/$clip_corner;
// Set centre point for polygon
$points_tl=array(0,0);
$points_br=array(imagesx($im),imagesy($im));
$points_tr=array(imagesx($im),0);
$points_bl=array(0,imagesy($im));
}
$bgcolor=imagecolorallocate($im,hexdec(substr($border_color,1,2)),hexdec(substr($border_color,3,2)),hexdec(substr($border_color,5,2)));
for ($i=0;$i<$clip_corner;$i++) {
if ($clip_corner_round){
$x=$clip_corner*cos(deg2rad($i*$clip_degrees));
$y=$clip_corner*sin(deg2rad($i*$clip_degrees));
array_push($points_tl,$clip_corner-$x);
array_push($points_tl,$clip_corner-$y);
array_push($points_tr,imagesx($im)-$clip_corner+$x);
array_push($points_tr,$clip_corner-$y);
array_push($points_br,imagesx($im)-$clip_corner+$x);
array_push($points_br,imagesy($im)-$clip_corner+$y);
array_push($points_bl,$clip_corner-$x);
array_push($points_bl,imagesy($im)-$clip_corner+$y);
} else {
imageline($im,0,$i,$clip_corner-$i,$i,$bgcolor);
imageline($im,imagesx($im)-$clip_corner+$i,imagesy($im)-$i-1,imagesx($im)+$clip_corner-$i,imagesy($im)-$i-1,$bgcolor);
imageline($im,imagesx($im)-$clip_corner+$i,$i,imagesx($im)+$clip_corner-$i,$i,$bgcolor);
imageline($im,0,imagesy($im)-$i-1,$clip_corner-$i,imagesy($im)-$i-1,$bgcolor);
}
}
if ($clip_corner_round){
// Add the final points to cope with rounding error
array_push($points_tl,$clip_corner,0);
array_push($points_br,imagesx($im)-$clip_corner,imagesy($im));
array_push($points_tr,imagesx($im)-$clip_corner,0);
array_push($points_bl,$clip_corner,imagesy($im));
imagefilledpolygon($im,$points_tl,count($points_tl)/2,$bgcolor);
imagefilledpolygon($im,$points_br,count($points_br)/2,$bgcolor);
imagefilledpolygon($im,$points_tr,count($points_tr)/2,$bgcolor);
imagefilledpolygon($im,$points_bl,count($points_bl)/2,$bgcolor);
// Cleanup - remove 1px from outline of image
imagerectangle($im,0,0,imagesx($im)-1,imagesy($im)-1,$bgcolor);
}
}
// Image created - modify colors (only for jpg & gd2)
if ($image_greyscale && $size[2]==2 && $gd2) {
imagetruecolortopalette($im,1,256);
for ($c=0;$c<256;$c++) {
$col=imagecolorsforindex($im,$c);
$new_col=floor($col['red']*0.2125+$col['green']*0.7154+$col['blue']*0.0721);
$noise=rand(-$image_noise_depth,$image_noise_depth);
if ($image_sepia_depth>0) {
$r=$new_col+$image_sepia_depth+$noise;
$g=floor($new_col+$image_sepia_depth/1.86+$noise);
$b=floor($new_col+$image_sepia_depth/-3.48+$noise);
} else {
$r=$new_col+$noise;
$g=$new_col+$noise;
$b=$new_col+$noise;
}
imagecolorset($im,$c,max(0,min(255,$r)),max(0,min(255,$g)),max(0,min(255,$b)));
}
}
if ($gd2) {
if ($constrain_wh==0) {
imagecopyresampled($thumb,$im,$border_width*($border_offset-1),$border_width,0,0,imagesx($thumb)-($border_offset*$border_width)-$shadow_offset,imagesy($thumb)-2*$border_width-$shadow_offset,imagesx($im),imagesy($im));
} else {
//FIX: Doesn't work correctly.
if ($size[0]>$size[1])
$t_thumb=imagecreatetruecolor($border_width*$border_offset+$image_resizeto+$shadow_offset,$border_width*2+ceil($size[1]/($size[0]/$image_resizeto))+$shadow_offset);
else
$t_thumb=imagecreatetruecolor($border_width*$border_offset+ceil($size[0]/($size[1]/$image_resizeto))+$shadow_offset,$border_width*2+$image_resizeto+$shadow_offset);
imagecopyresampled($t_thumb,$im,$border_width*($border_offset-1),$border_width,0,0,imagesx($t_thumb)-($border_offset*$border_width)-$shadow_offset,imagesy($t_thumb)-2*$border_width-$shadow_offset,imagesx($im),imagesy($im));
imagecopymerge($thumb, $t_thumb, '0', '0', '0', '0', imagesx($im), imagesy($im), '60');
}
} else {
imagecopyresized($thumb,$im,$border_width*($border_offset-1),$border_width,0,0,imagesx($thumb)-($border_offset*$border_width)-$shadow_offset,imagesy($thumb)-2*$border_width-$shadow_offset,imagesx($im),imagesy($im));
}
if ($show_number && isset($_REQUEST['number']) && isset($_REQUEST['total'])) {
// Sample some pixels to determine text color
$colors=array();
for ($i=5;$i<25;$i++) {
$indexis=ImageColorAt($thumb,$i,4+ceil($i/5));
$rgbarray=ImageColorsForIndex($thumb,$indexis);
array_push($colors,$rgbarray['red'],$rgbarray['green'],$rgbarray['blue']);
}
if (array_sum($colors)/count($colors)>180)
$textcolor=$black;
else
$textcolor=$white;
if ($show_binder)
$number_offset=$border_width*2;
else
$number_offset=$border_width;
if ($border_width==0)
$number_offset=1;
imagestring($thumb,1,$number_offset,2,($_REQUEST['number']+1) . '/' . $_REQUEST['total'],$textcolor);
}
if ($show_binder) {
if ($binder_spacing<4)
$binder_spacing=4;
$spacing=floor(imagesy($thumb)/$binder_spacing)-2;
$offset=floor((imagesy($thumb)-($spacing*$binder_spacing))/2);
for ($i=$offset;$i<=$offset+$spacing*$binder_spacing;$i+=$binder_spacing) {
imagefilledrectangle($thumb,8,$i-2,10,$i+2,$black);
imageline($thumb,11,$i-1,11,$i+1,$darkgray);
imageline($thumb,8,$i-2,10,$i-2,$darkgray);
imageline($thumb,8,$i+2,10,$i+2,$darkgray);
imagefilledrectangle($thumb,0,$i-1,8,$i+1,$gray);
imageline($thumb,0,$i,8,$i,$white);
imageline($thumb,0,$i-1,0,$i+1,$gray);
imagesetpixel($thumb,0,$i,$darkgray);
}
}
if ($image_resize && $copyright!='') {
$colors=array();
for ($i=5;$i180)
imagestring($thumb,1,0,imagesy($thumb)-10,' '.$copyright,$black);
else
imagestring($thumb,1,0,imagesy($thumb)-10,' '.$copyright,$white);
}
$newPicture=$thumb;
}
if($addWatermark) {
$watermarkProperties = getimagesize($watermarkSource);
$resizeRatio = $_w/$watermarkProperties[0];
$newWatermarkWidth = $_w;
$newWatermarkHeight = ceil($resizeRatio*$watermarkProperties[1]);
$watermarkX = 0;
$watermarkY = ceil($_h-$newWatermarkHeight);
$watermark = imagecreatefrompng($watermarkSource);
imagecopyresampled($newPicture, $watermark,$watermarkX,$watermarkY,0,0,$newWatermarkWidth,$newWatermarkHeight, $watermarkProperties[0],$watermarkProperties[1]);
imagedestroy($watermark);
}
touch($pictureDestination);
imagejpeg($newPicture, $pictureDestination, 90);
imagedestroy($newPicture);
}
function ShowFoto($url, $max, $shw_txt=true, $art='', $_lnk='', $brd=1, $target='parent') {
ClearStatCache();
$not=false;
if (file_exists($url)) {
$file = fopen($url, 'r');
if ((!$file)) {
$not=true;
} else {
$not=false;
}
} else {
$not=true;
}
if ($not) {
if ($shw_txt) {
if ($_lnk=='') {
$rtn .= "Geen plaatje. ";
} else {
$rtn .= "
Geen plaatje.
";
}
} else {
$rtn .= " ";
}
} else {
$size = GetImageSize($url);
$size[0] = $size[0] + 0;
$size[1] = $size[1] + 0;
if ($size[0] >= $size[1]) {
$set_size_limit = "width ='$max'";
} else {
$set_size_limit = "height='$max'";
}
if ($_lnk == '') {
$rtn = " ";
} else {
if ($target=='_blank') {
$rtn = " ";
} else {
$rtn = " ";
}
}
}
return $rtn;
}
function printMonth($date_month) {
switch ($date_month) {
case '1':
$month="Jan";
break;
case '2':
$month="Feb";
break;
case '3':
$month="Mrt";
break;
case '4':
$month="Apr";
break;
case '5':
$month="Mei";
break;
case '6':
$month="Jun";
break;
case '7':
$month="Jul";
break;
case '8':
$month="Aug";
break;
case '9':
$month="Sep";
break;
case '10':
$month="Okt";
break;
case '11':
$month="Nov";
break;
case '12':
$month="Dec";
break;
}
return $month;
}
function unpackZip($path_zip, $output_dir) {
if ($zip = zip_open($path_zip)) {
if ($zip) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_open($zip,$zip_entry,"r")) {
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
$fp=fopen($output_dir."/".zip_entry_name($zip_entry),"w");
fwrite($fp,$buf);
zip_entry_close($zip_entry);
} else
return false;
}
zip_close($zip);
return true;
} else {
return false;
}
} else {
return false;
}
}
/*
* Functions m.b.t. Versturen van e-mails
*/
function audit() {
$digit = $_SESSION['Sje43SjeEj48'];
$userdigit = $_POST['userdigit'];
return ( strtoupper($digit) == strtoupper($userdigit) );
}
function isDirty($val, $ip, $email) {
$_add = true;
/* Blacklist: IP
*/
$_bl = array();
$_bl['70.160.86.230'] = true;
$_bl['194.126.179.33'] = true;
$_bl['202.236.109.11'] = true;
$_bl['195.175.37.70'] = true;
$_bl['202.236.109.11'] = true;
$_bl['201.57.66.2'] = true;
$_bl['219.93.178.162'] = true;
$_bl['62.75.144.248'] = true;
$_bl['165.228.128.11'] = true;
$_bl[''] = true;
$_bl[''] = true;
$_bl[''] = true;
$_bl[''] = true;
$_bl[''] = true;
$_bl[''] = true;
/* Blacklist: Email
*/
$_em = array();
$_em[0] = 'dd205';
$_bw = array("gay","porn","teen","fetish","lesbian","cock","sex","nude","inmature","sexy","dick","viagra","pussy","anal","ass","adult","fuck");
if ($_bl[$ip]) {
$_add = false;
} else {
for ($i=0 ; $i < count($_em) ; $i++) {
if (!(strpos($email, $_em[$i])===FALSE)) {
$_add=false;
$i=count($_em)+1;
}
}
}
if ($_add) {
for ($i=0 ; $i < count($_bw) ; $i++) {
if (!(strpos($val, $_bw[$i])===FALSE)) {
$_add=false;
$i=count($_bw)+1;
}
}
}
if ($_add) {
$pos1 = strpos($val, "href");
$pos2 = strpos($val, "http");
$pos3 = strpos($val, "www");
if ($pos1===false AND $pos2===false AND $pos3===false) {
$_add = true;
} else {
$_add = false;
}
} else {
$_add = false;
}
return ($_add ? false : true);
}
/**
* Encodes an ISO-8859-1 mixed variable to UTF-8 (PHP 4, PHP 5 compat)
* @param mixed $input An array, associative or simple
* @param boolean $encode_keys optional
* @return mixed ( utf-8 encoded $input)
*/
function utf8_encode_mix($input, $encode_keys=false)
{
if(is_array($input))
{
$result = array();
foreach($input as $k => $v)
{
$key = ($encode_keys)? utf8_encode($k) : $k;
$result[$key] = utf8_encode_mix( $v, $encode_keys);
}
}
else
{
$result = utf8_encode($input);
}
return $result;
}
?>
Tumbroeck Design Hotelinrichting - DONE - Schweibergerweg 49 6281 NE Mechelen (NL) 043-4553164 - Rue de la Presse 4, B-1000 Brussel