<?phprequire_once('config.php');$plate_type = in_array($_GET['plate_type'] , array('1','2','3') ) ? $_GET['plate_type'] : '1';switch ($plate_type) {case 1:	include_once('ukplate_config.php');	$fonts_reg_list  		= $ukplate_reg_fonts  ; 	$fonts_slogan_list  	= $ukplate_slogan_fonts ;	$backgrounds_list 		= $ukplate_backgrounds; 	$badges_list 			= $ukplate_badges; 	$borders_list 			= $ukplate_borders;	$front_plate_size_list	= $ukplate_front_plate_size;	$rear_plate_size_list	= $ukplate_rear_plate_size;	$surround_list			= $ukplate_surround;		$gen_plate_dir			= UK_PLATES_DIR;	    break;case 2:    include_once('irshplate_config.php');	$fonts_reg_list  		= $irshplate_reg_fonts  ; 	$fonts_slogan_list  	= $irshplate_slogan_fonts ;	$backgrounds_list 		= $irshplate_backgrounds; 	$badges_list 			= $irshplate_badges; 	$borders_list 			= $irshplate_borders;	$front_plate_size_list	= $irshplate_front_plate_size;	$rear_plate_size_list	= $irshplate_rear_plate_size;	$surround_list			= $irshplate_surround;		$gen_plate_dir			= IRISH_PLATES_DIR;	    break;case 3:	include_once('squareplate_config.php');	$fonts_reg_list  		= $squareplate_reg_fonts  ; 	$fonts_slogan_list  	= $squareplate_slogan_fonts ;	$backgrounds_list 		= $squareplate_backgrounds; 	$badges_list 			= $squareplate_badges; 	$borders_list 			= $squareplate_borders;	$front_plate_size_list	= $squareplate_front_plate_size;	$rear_plate_size_list	= $squareplate_rear_plate_size;	$surround_list			= $squareplate_surround;		$gen_plate_dir			= SQUARE_PLATES_DIR;	       break;default:    include_once('ukplate_config.php');	$fonts_reg_list  		= $ukplate_reg_fonts  ; 	$fonts_slogan_list  	= $ukplate_slogan_fonts ;	$backgrounds_list 		= $ukplate_backgrounds; 	$badges_list 			= $ukplate_badges; 	$borders_list 			= $ukplate_borders;	$front_plate_size_list	= $ukplate_front_plate_size;	$rear_plate_size_list	= $ukplate_rear_plate_size;	$surround_list			= $ukplate_surround;		$gen_plate_dir			= UK_PLATES_DIR;	}header("Content-type: image/png");$im	= imagecreatetruecolor(640, 210);$bg = imagecolorallocate($im, 255, 255, 255);imagefill($im, 0, 0, $bg);if($_GET['plate_rear']=='1'){	$im_plate    = imagecreatefromgif(IMAGES_DIR."ukplate_rear.gif");}else{	$im_plate    = imagecreatefromgif(IMAGES_DIR."ukplate.gif");}imagecopymerge  ( $im, $im_plate , 0, 0, 0, 0, imagesx($im_plate), imagesy($im_plate) ,100 );if($_GET['background']!=0){	$background 	=  BACKGROUNDS_DIR.$backgrounds_list[$_GET['background']]['filename'];	$im_background  = imagecreatefromgif($background);	imagecopymerge( $im, $im_background , 10, 15, 0, 0, imagesx($im_background), imagesy($im_background) ,100 );		$plate_cost += $ukplate_prices['background_price']; 	$_SESSION['plate']['background'] = $backgrounds_list[$_GET['background']]['name'];}else if ($_GET['background'] == '' ){	$_SESSION['plate']['background'] = 'None';}else{	$_SESSION['plate']['background'] = 'None';}if($_GET['border']!=0){	$border 	=  BORDERS_DIR.$borders_list[$_GET['border']]['filename'];	$im_border  = imagecreatefromgif($border);	imagecopymerge( $im, $im_border , 0, 0, 0, 0, imagesx($im_border), imagesy($im_border) ,100 );	$plate_cost += $ukplate_prices['border_price'];	$_SESSION['plate']['border'] = $borders_list[$_GET['border']]['name']; }else if ($_GET['border'] == '' ){	$_SESSION['plate']['border'] = 'None';}else{	$_SESSION['plate']['border'] = 'None';}if($_GET['badge'] != 0 ){	$badge		=	$_GET['badge'];		$im_badge   = imagecreatefromgif(BADGES_DIR.$badges_list[$_GET['badge']]['filename']);	imagecopymerge  ( $im, $im_badge , 30, 25, 0, 0, imagesx($im_badge), imagesy($im_badge) ,100  );	$plate_cost += $ukplate_prices['badge_price']; 	$_SESSION['plate']['badge'] = $badges_list[$_GET['badge']]['name']; }else if ($_GET['badge'] == '' ){	$_SESSION['plate']['badge'] = 'None';}else{	$_SESSION['plate']['badge'] = 'None';}//$color_shadow = imagecolorallocate($im, 255, 0, 0);//imagettftext($im, $size , $angle, $px+5, $py+2 , $color_shadow, $font, $text);if( $_GET['reg_text']!='' ){	$reg_text			= $_GET['reg_text'];		if($_GET['reg_text_font']!=0 && $_GET['reg_text'] )	{		$reg_text_font = FONTS_DIR.$fonts_reg_list[$_GET['reg_text_font']]['filename'] ;		$plate_cost += $ukplate_prices['reg_text_font_price']; 		$_SESSION['plate']['reg_text_font'] = $fonts_reg_list[$_GET['reg_text_font']]['name'];	}	else	{		$reg_text_font = FONTS_DIR.'arial.ttf';		$_SESSION['plate']['reg_text_font'] = 'Arial';	}		$reg_text_size   	= 60;	$reg_text_angle  	= 0; 	$reg_text_px     	= 80 + ((imagesx($im) - $reg_text_size * strlen( $reg_text )) / 2 )  ;	$reg_text_py     	= 70 + ($reg_text_size/2) ;	$reg_text_color		= imagecolorallocate($im, 0, 0, 0);		if($_GET['reg_text_position'] != '0' && $_GET['reg_text_position'] != '' )	{		 $reg_text_position = $_GET['reg_text_position']/5 ;		 $_SESSION['plate']['reg_text_position'] = abs($reg_text_position);		 if( $reg_text_position == abs($reg_text_position) )		 {		 	$_SESSION['plate']['reg_text_position_lr'] = "Left"; 		 }		 else		 {		 	$_SESSION['plate']['reg_text_position_lr'] = "Right";		 }		 	}	else if ($_GET['reg_text_position'] == '')	{		$_SESSION['plate']['reg_text_position'] = '0';		$_SESSION['plate']['reg_text_position_lr'] = "None";	}	else	{		$_SESSION['plate']['reg_text_position'] = '0';		$_SESSION['plate']['reg_text_position_lr'] = "None";	}		if($_GET['reg_text_elevation'] != '0' && $_GET['reg_text_elevation'] != '' )	{		$reg_text_elevation = $_GET['reg_text_elevation']/2 ;		$_SESSION['plate']['reg_text_elevation']=abs($reg_text_elevation);		if( $reg_text_elevation == abs($reg_text_elevation) )		{			$_SESSION['plate']['reg_text_elevation_ud'] = "Down"; 		}		else		{		 	$_SESSION['plate']['reg_text_elevation_ud'] = "Up";		}			}	else if ($_GET['reg_text_elevation'] == '')	{		$_SESSION['plate']['reg_text_elevation'] = '0';		$_SESSION['plate']['reg_text_elevation_ud'] = "None";	}	else	{		$_SESSION['plate']['reg_text_elevation'] = '0';		$_SESSION['plate']['reg_text_elevation_ud'] = "None";	}		if($_GET['reg_text_font_size'] != '0' && $_GET['reg_text_font_size'] != '' )	{		$reg_text_font_size = $_GET['reg_text_font_size'] ;		$_SESSION['plate']['reg_text_font_size'] = abs($reg_text_font_size);		if( $reg_text_font_size == abs($reg_text_font_size) )		{			$_SESSION['plate']['reg_text_font_size_id'] = "Increase"; 		}		else		{		 	$_SESSION['plate']['reg_text_font_size_id'] = "Decrease";		}			}	else if ($_GET['reg_text_font_size'] == '')	{		$_SESSION['plate']['reg_text_font_size'] = '0';		$_SESSION['plate']['reg_text_font_size_id'] = "None";	}	else	{		$_SESSION['plate']['reg_text_font_size'] = '0';		$_SESSION['plate']['reg_text_font_size_id'] = "None";	}							$reg_text_size = $reg_text_size +  $_GET['reg_text_font_size'];	$reg_text_px = $reg_text_px +  $_GET['reg_text_position'];	$reg_text_py = $reg_text_py +  $_GET['reg_text_elevation'];		if($_GET['reg_text_shadow_color']!='' )	{				$reg_text_shadow_color = imagecolorallocate($im, 		hexdec( substr($_GET['reg_text_shadow_color'], 0, 2) ), 		hexdec( substr($_GET['reg_text_shadow_color'], 2, 2) ), 		hexdec( substr($_GET['reg_text_shadow_color'], 4, 2) )		);		imagettftext($im, $reg_text_size , $reg_text_angle, $reg_text_px+5, $reg_text_py+2 , $reg_text_shadow_color, $reg_text_font, $reg_text );				$plate_cost += $ukplate_prices['shadow_price']; 		$_SESSION['plate']['reg_text_shadow_color'] =	$_GET['reg_text_shadow_color'];			}	else	{		$_SESSION['plate']['reg_text_shadow_color'] = 'None';	}		imagettftext($im, $reg_text_size , $reg_text_angle, $reg_text_px, $reg_text_py , $reg_text_color, $reg_text_font, $reg_text);		$plate_cost += $ukplate_prices['reg_text_price'];	$_SESSION['plate']['reg_text'] =	$_GET['reg_text']; }else{	$_SESSION['plate']['reg_text'] = 'None';	$_SESSION['plate']['reg_text_font'] = 'None';	$_SESSION['plate']['reg_text_font_size'] = '0';	$_SESSION['plate']['reg_text_shadow_color'] = 'None';	$_SESSION['plate']['reg_text_position'] = '0';	$_SESSION['plate']['reg_text_position_lr'] = "None";	$_SESSION['plate']['reg_text_elevation'] = '0';	$_SESSION['plate']['reg_text_elevation_ud'] = "None";}if( $_GET['slogan_text']!='' ){	$slogan_text   		= $_GET['slogan_text'];	if($_GET['slogan_text_font']!=0 && $_GET['slogan_text'] )	{		$slogan_text_font = FONTS_DIR.$fonts_slogan_list[$_GET['slogan_text_font']]['filename'] ;		$plate_cost += $ukplate_prices['slogan_text_font_price']; 		$_SESSION['plate']['slogan_text_font'] = $fonts_slogan_list[$_GET['slogan_text_font']]['name'];	}	else	{		$slogan_text_font = FONTS_DIR.'arial.ttf';		$_SESSION['plate']['slogan_text_font'] = 'Arial';	}			if($_GET['slogan_text_position'] != '0' && $_GET['slogan_text_position'] != '' )	{		 $slogan_text_position = $_GET['slogan_text_position']/5 ;		 $_SESSION['plate']['slogan_text_position'] = abs($slogan_text_position);		 if( $slogan_text_position == abs($slogan_text_position) )		 {		 	$_SESSION['plate']['slogan_text_position_lr'] = "Left"; 		 }		 else		 {		 	$_SESSION['plate']['slogan_text_position_lr'] = "Right";		 }	}	else if ($_GET['slogan_text_position'] == '')	{		$_SESSION['plate']['slogan_text_position'] = '0';		$_SESSION['plate']['slogan_text_position_lr'] = "None";	}	else	{		$_SESSION['plate']['slogan_text_position'] = '0';		$_SESSION['plate']['slogan_text_position_lr'] = "None";	}		if($_GET['slogan_text_elevation'] != '0' && $_GET['slogan_text_elevation'] != '' )	{		$slogan_text_elevation = $_GET['slogan_text_elevation']/2 ;		$_SESSION['plate']['slogan_text_elevation']=abs($slogan_text_elevation);		if( $slogan_text_elevation == abs($slogan_text_elevation) )		{			$_SESSION['plate']['slogan_text_elevation_ud'] = "Down"; 		}		else		{		 	$_SESSION['plate']['slogan_text_elevation_ud'] = "Up";		}	}	else if ($_GET['slogan_text_elevation'] == '')	{		$_SESSION['plate']['slogan_text_elevation'] = '0';		$_SESSION['plate']['slogan_text_elevation_ud'] = "None";	}	else	{		$_SESSION['plate']['slogan_text_elevation'] = '0';		$_SESSION['plate']['slogan_text_elevation_ud'] = "None";	}		if($_GET['slogan_text_font_size'] != '0' && $_GET['slogan_text_font_size'] != '' )	{		$slogan_text_font_size = $_GET['slogan_text_font_size'] ;		$_SESSION['plate']['slogan_text_font_size'] = abs($slogan_text_font_size);		if( $slogan_text_font_size == abs($slogan_text_font_size) )		{			$_SESSION['plate']['slogan_text_font_size_id'] = "Increase"; 		}		else		{		 	$_SESSION['plate']['slogan_text_font_size_id'] = "Decrease";		}			}	else if ($_GET['slogan_text_font_size'] == '')	{		$_SESSION['plate']['slogan_text_font_size'] = '0';		$_SESSION['plate']['slogan_text_font_size_id'] = "None";	}	else	{		$_SESSION['plate']['slogan_text_font_size'] = '0';		$_SESSION['plate']['slogan_text_font_size_id'] = "None";	}			$slogan_text_size   = 10;	$slogan_text_angle  = 0; 	$slogan_text_px     = 10 + ( imagesx($im)  - ($slogan_textsize * strlen( $slogan_text ))) / 2 ;	$slogan_text_py     = 130 ;		$slogan_text_size = $slogan_text_size +  $_GET['slogan_text_font_size'];	$slogan_text_px = $slogan_text_px +  $_GET['slogan_text_position'];	$slogan_text_py = $slogan_text_py +  $_GET['slogan_text_elevation'];		imagettftext($im, $slogan_text_size , $slogan_text_angle, $slogan_text_px, $slogan_text_py , $slogan_text_color, $slogan_text_font, stripslashes($slogan_text));		$plate_cost += $ukplate_prices['slogan_price']; 	$_SESSION['plate']['slogan_text'] =	$_GET['slogan_text']; }else{	$_SESSION['plate']['slogan_text'] =	'None';	$_SESSION['plate']['slogan_text_font'] = 'None';	$_SESSION['plate']['slogan_text_font_size'] = '0';	$_SESSION['plate']['slogan_text_position'] = '0';	$_SESSION['plate']['slogan_text_position_lr'] = "None";	$_SESSION['plate']['slogan_text_elevation'] = '0';	$_SESSION['plate']['slogan_text_elevation_ud'] = "None"; }if( $_GET['supply_front_plate']=='1' ){	$plate_cost += $ukplate_prices['supply_front_plate_price'];	$_SESSION['plate']['supply_front_plate'] = 'Yes';	 	if($_GET['front_plate_size']!='0')	{		$plate_cost += $ukplate_prices['front_plate_size_price'];		$_SESSION['plate']['front_plate_size'] =	$front_plate_size_list[$_GET['front_plate_size']]['name'];  	}	else	{		$_SESSION['plate']['front_plate_size'] =	$front_plate_size_list[$_GET['front_plate_size']]['name']; 	}}else{	$_SESSION['plate']['supply_front_plate'] = 'No';	$_SESSION['plate']['front_plate_size'] =	'None';}if( $_GET['supply_rear_plate']=='1' ){	$plate_cost += $ukplate_prices['supply_rear_plate_price'];	$_SESSION['plate']['supply_rear_plate'] = 'Yes';	 	if($_GET['rear_plate_size']!='0')	{		$plate_cost += $ukplate_prices['rear_plate_size_price'];		$_SESSION['plate']['rear_plate_size'] =	$rear_plate_size_list[$_GET['rear_plate_size']]['name']; 	}	else	{		$_SESSION['plate']['rear_plate_size'] =	$rear_plate_size_list[$_GET['rear_plate_size']]['name'];	}}else{	$_SESSION['plate']['supply_rear_plate'] = 'No';	$_SESSION['plate']['rear_plate_size'] =	'None';}if($_GET['surround']!='0' && $_GET['surround']!=''  ){	$plate_cost += $ukplate_prices['surround_price']; 	$_SESSION['plate']['surround']  = $surround_list[$_GET['surround']]['name'];}else{	$_SESSION['plate']['surround']  = 'None';}	if( $_GET['fixers']=='1' ){	$plate_cost += $ukplate_prices['fixers_price'];	$_SESSION['plate']['fixers']  = 'Yes'; }else{	$_SESSION['plate']['fixers']  = 'No';}$_SESSION['plate']['price'] = $plate_cost;$plate_cost_text   	 = "£ ".number_format($plate_cost, 2, '.', '');;$plate_cost_text_font   = FONTS_DIR.'arial.ttf';$plate_cost_text_size   = 20;$plate_cost_text_angle  = 0; $plate_cost_text_px     = 20 ;$plate_cost_text_py     = 180 ;$plate_cost_text_color = imagecolorallocate($im, 0, 0, 0);imagettftext($im, $plate_cost_text_size , $plate_cost_text_angle, $plate_cost_text_px, $plate_cost_text_py , $plate_cost_text_color, $plate_cost_text_font, $plate_cost_text);imagepng($im);//imagejpeg($im,session_id().".jpg",65); imagepng($im,$gen_plate_dir.session_id().".png");imagedestroy($im);?>