<?php
$data_file_path  = '/HIER HET VOLLEDIGE PAD NAAR JE/clientraw.txt'; 
$image_format = 'gif';
$font_file = '/HIER HET PAD NAAR JE/banner/console/LCDM2B__.TTF';
$barom_units = ' mb';
$rain_units = ' mm';
$degree_units = ' C';
$wind_units = ' km/u';
$wind_chill_threshold = '60';
$heat_index_threshold = '70';
$curr_cond_icon = 'no';
$time_format = '24HR';
$temp_conv = 'C';
$temp_prec = '1';
$wind_conv = 'KPH';
$wind_prec = '1';
$barom_conv = 'MB';
$barom_prec = '2';
$rain_conv = 'MM';
$rain_prec = '2';

function define_colors() {
  global $img, $color1, $color2, $color3, $color4, $color5, $trans_color,
         $anti_alias;

  $color1 = imagecolorallocate($img,255,0,0);      // RED
  $color2 = imagecolorallocate($img,0,128,0);      // GREEN
  $color3 = imagecolorallocate($img,0,0,255);      // BLUE
  $color4 = imagecolorallocate($img,0,0,0);        // BLACK
  $color5 = imagecolorallocate($img,255,255,255);  // WHITE  
  $color6 = imagecolorallocate($img,229,229,229);  // GREY  

  $anti_alias = 'on';

}

function write_console() {

  global $color1, $color2, $color3, $color4, $color5, $date, $time, $forecast, $temp, 
         $degree_units, $winds, $winddir, $wind_units, $gust, $raintoday, $rain_units, 
         $barom, $barom_units, $baromtrendwords, $dewpt, $humidity, $heatindex,
         $heat_index_threshold, $windchill, $wind_chill_threshold, 
         $banner_icon_x, $banner_icon_y, $anti_alias;

  
  switch (TRUE){
  case ($windchill <= $wind_chill_threshold):
       $feelslike = "$windchill$degree_units";
       imagecenteredtext(230, 185, "$feelslike", 5, 14, $color4, 0);
  break; 
  case ($heatindex >= $heat_index_threshold):
       $feelslike = "Heat Idx: $heatindex$degree_units";
       imagecenteredtext(90, 50, "$feelslike", 5, 14, $color4, 0);
  break;
  }
  imagecenteredtext(300, 40, "HIER JE STATIONS NAAM", 5, 14, $color5, 0); 
  imagecenteredtext(100, 100, " ", 2, 7, $color4, 0); 
  imagecenteredtext(300, 80, "$time", 5, 14, $color4, 0); 
  imagecenteredtext(420, 80, "$date ", 5, 14, $color4, 0); 
  imagecenteredtext(230, 130, "$temp$degree_units", 5, 14, $color4, 0); 
  imagecenteredtext(315, 130, "$humidity", 5, 14, $color4, 0); 
  imagecenteredtext(110, 100, "$winddir", 1, 14, $color4, 0); 
  imagecenteredtext(120, 130, "$winds", 1, 14, $color4, 0); 
  imagecenteredtext(230, 245, "$raintoday$rain_units", 5, 14, $color4, 0); 
  imagecenteredtext(405, 130, "$barom$barom_units", 5, 14, $color4, 0); 
  imagecenteredtext(400, 185, "$dewpt$degree_units", 5, 14, $color4, 0); 
} 
?>