<?php
//Фон
$im = imagecreatefromjpeg( 'fermaimg/back.jpg' );

//Сеялка
if ( isset( $_GET[ se ] ) )
		{
				//Гидропоника
				$stamp        = imagecreatefrompng( 'fermaimg/t77.png' );
				$marge_right  = 0;
				$marge_bottom = 150;
				$sx           = imagesx( $stamp );
				$sy           = imagesy( $stamp );
				imagecopy( $im, $stamp, imagesx( $im ) - $sx - $marge_right, imagesy( $im ) - $sy - $marge_bottom, 0, 0, imagesx( $stamp ), imagesy( $stamp ) );
		}
//Грядки с пугалом
if ( isset( $_GET[ gr ] ) )
		{
				$stamp2 = imagecreatefrompng( 'fermaimg/t88.png' );
		}
else
		{
				$stamp2 = imagecreatefrompng( 'fermaimg/t8.png' );
		}
$marge_right2  = 420;
$marge_bottom2 = 90;
$sx2           = imagesx( $stamp2 );
$sy2           = imagesy( $stamp2 );
imagecopy( $im, $stamp2, imagesx( $im ) - $sx2 - $marge_right2, imagesy( $im ) - $sy2 - $marge_bottom2, 0, 0, imagesx( $stamp2 ), imagesy( $stamp2 ) );
if ( isset( $_GET[ hr ] ) )
		{
				//Гидра
				$stamp3        = imagecreatefrompng( 'fermaimg/t6.png' );
				$marge_right3  = 500;
				$marge_bottom3 = 0;
				$sx3           = imagesx( $stamp3 );
				$sy3           = imagesy( $stamp3 );
				imagecopy( $im, $stamp3, imagesx( $im ) - $sx3 - $marge_right3, imagesy( $im ) - $sy3 - $marge_bottom3, 0, 0, imagesx( $stamp3 ), imagesy( $stamp3 ) );
		}
if ( isset( $_GET[ zge ] ) )
		{
				//Загон
				$stamp4        = imagecreatefrompng( 'fermaimg/t24.png' );
				$marge_right4  = 0;
				$marge_bottom4 = 40;
				$sx4           = imagesx( $stamp4 );
				$sy4           = imagesy( $stamp4 );
				imagecopy( $im, $stamp4, imagesx( $im ) - $sx4 - $marge_right4, imagesy( $im ) - $sy4 - $marge_bottom4, 0, 0, imagesx( $stamp4 ), imagesy( $stamp4 ) );
		}
if ( isset( $_GET[ zg ] ) )
		{
				//Загон
				$stamp4        = imagecreatefrompng( 'fermaimg/t22.png' );
				$marge_right4  = 70;
				$marge_bottom4 = 0;
				$sx4           = imagesx( $stamp4 );
				$sy4           = imagesy( $stamp4 );
				imagecopy( $im, $stamp4, imagesx( $im ) - $sx4 - $marge_right4, imagesy( $im ) - $sy4 - $marge_bottom4, 0, 0, imagesx( $stamp4 ), imagesy( $stamp4 ) );
		}
if ( isset( $_GET[ zgk ] ) )
		{
				//Загон
				$stamp4        = imagecreatefrompng( 'fermaimg/t23.png' );
				$marge_right4  = 0;
				$marge_bottom4 = 0;
				$sx4           = imagesx( $stamp4 );
				$sy4           = imagesy( $stamp4 );
				imagecopy( $im, $stamp4, imagesx( $im ) - $sx4 - $marge_right4, imagesy( $im ) - $sy4 - $marge_bottom4, 0, 0, imagesx( $stamp4 ), imagesy( $stamp4 ) );
		}
if ( isset( $_GET[ oro ] ) )
		{
				//Колодец
				$stamp5        = imagecreatefrompng( 'fermaimg/t3.png' );
				$marge_right5  = 125;
				$marge_bottom5 = 120;
				$sx5           = imagesx( $stamp5 );
				$sy5           = imagesy( $stamp5 );
				imagecopy( $im, $stamp5, imagesx( $im ) - $sx5 - $marge_right5, imagesy( $im ) - $sy5 - $marge_bottom5, 0, 0, imagesx( $stamp5 ), imagesy( $stamp5 ) );
		}
if ( isset( $_GET[ kl ] ) )
		{
				//Клумба
				$stamp6        = imagecreatefrompng( 'fermaimg/t9.png' );
				$marge_right6  = 290;
				$marge_bottom6 = 100;
				$sx6           = imagesx( $stamp6 );
				$sy6           = imagesy( $stamp6 );
				imagecopy( $im, $stamp6, imagesx( $im ) - $sx6 - $marge_right6, imagesy( $im ) - $sy6 - $marge_bottom6, 0, 0, imagesx( $stamp6 ), imagesy( $stamp6 ) );
		}
if ( isset( $_GET[ ko ] ) )
		{
				//Комбаин
				$stamp7        = imagecreatefrompng( 'fermaimg/t11.png' );
				$marge_right7  = 540;
				$marge_bottom7 = 170;
				$sx7           = imagesx( $stamp7 );
				$sy7           = imagesy( $stamp7 );
				imagecopy( $im, $stamp7, imagesx( $im ) - $sx7 - $marge_right7, imagesy( $im ) - $sy7 - $marge_bottom7, 0, 0, imagesx( $stamp7 ), imagesy( $stamp7 ) );
		}
if ( isset( $_GET[ ud ] ) )
		{
				//Комбаин
				$stamp8        = imagecreatefrompng( 'fermaimg/t1.png' );
				$marge_right8  = 400;
				$marge_bottom8 = 180;
				$sx8           = imagesx( $stamp8 );
				$sy8           = imagesy( $stamp8 );
				imagecopy( $im, $stamp8, imagesx( $im ) - $sx8 - $marge_right8, imagesy( $im ) - $sy8 - $marge_bottom8, 0, 0, imagesx( $stamp8 ), imagesy( $stamp8 ) );
		}
if ( isset( $_GET[ tr ] ) )
		{
				//трактор
				$stamp9        = imagecreatefrompng( 'fermaimg/t4.png' );
				$marge_right9  = 220;
				$marge_bottom9 = 170;
				$sx9           = imagesx( $stamp9 );
				$sy9           = imagesy( $stamp9 );
				imagecopy( $im, $stamp9, imagesx( $im ) - $sx9 - $marge_right9, imagesy( $im ) - $sy9 - $marge_bottom9, 0, 0, imagesx( $stamp9 ), imagesy( $stamp9 ) );
		}
// Вывод и освобождение памяти
header( "Content-type: " . image_type_to_mime_type( IMAGETYPE_JPEG ) );
//imageJpeg($im, $im, 75);
imagejpeg( $im );
//imagepng($im);
imagedestroy( $im );
?>

