<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title><?php echo($WA_CART_TITLE);?></title>

<style>
.wa-cart-global-table{border:1px solid #cccccc;width:600px;}
.wa-cart-global-table td{border:1px solid #999999;}
.wa-cart-title td{border:0px solid black; background-color:#BBBBBB;;}

.wa-cart-option{font-size:11px;}

.wa-cart-table-total{border-collapse:collapse;border:0px solid black;width:100%;}
.wa-cart-table-total td{border-collapse:collapse;border:0px solid black;}
.wa-cart-promo{}
.wa-cart-total{font-weight: bold;font-size:15pt;}

.wa-shipping-info{border:1px solid #cccccc;font-weight: normal;font-size:11pt;vertical-align: top;}
.wa-shipping-info tr{vertical-align: top;}

.wa-title{font-size:13pt;border:1px solid #cccccc;width:300px;}
.wa-title td{border:0px solid black; background-color:#BBBBBB;text-align:center;;}

input.checkout {background-color: #cccccc; font-weight: bold; font-size: 15px; }
body{ font-family:Arial; background-color: #ffffff; } 
</style>

</head>
<body>
<div style="text-align: center;">
<span style="font-size:16pt;font-weight: bold;"><?php echo($WA_CART_TITLE);?></span>

<br>
<br>
<table style="width:100%;">
	<tr>
		<td align=center>
<table class=wa-title>
	<tr>
		<td>
			<span><?php echo($WA_PREFIXE_ORDER);?></span>
			<span style="font-weight: bold;"><?php echo($wa_market_id_order);?></span>
		</td>
	</tr>
</table>
</td>
</tr>
</table>

<br>
<!--
<br>
<span style=""><?php echo($WA_CART_TITLE);?> :</span>
<br>
-->
<br>

<!--begin card-->
<table style="width:100%;text-align: left; margin-left: auto; margin-right: auto;">
	<tr>
		<td align=center>
<!-- begin tag-->
<?php echo($wa_html_cart);?>		
<!--end card-->
<?php
if ($wa_has_market_promo_code==true)
{
	echo("<br>");
	echo ("promo code: ".$wa_market_promo_code."<br>");
}
?>

<?php
if ($type_payment=="pagseguro")
{
	// PHP_VERSION_ID and PHP_XXX_VERSION are available for PHP >= 5.2.7, emulate them if needed
	if ( !defined( 'PHP_VERSION_ID' ) ) {
		$version = explode( '.', PHP_VERSION );
		
		define( 'PHP_VERSION_ID', ( $version[ 0 ] *10000 +$version[ 1 ] *100 +$version[ 2 ] ) );

		if ( PHP_VERSION_ID < 50207 ) {
			define( 'PHP_MAJOR_VERSION', $version[ 0 ] );
			define( 'PHP_MINOR_VERSION', $version[ 1 ] );
			define( 'PHP_RELEASE_VERSION', $version[ 2 ] );
		}
	}
	
	if ( PHP_MAJOR_VERSION >= 5 ) {
		include_once("wa_market/3rd_libraries/inc.pagseguro.php");
	}
	else {
		die( '<br /><h1 style="color: red;">PagSeguro require PHP >= 5.x.<br />You have version '.PHP_VERSION.'.</h1><br />' );
	}
}
?>

<?php
if ($type_payment=="paypal")
{
	?>
	
		<form target="_blank" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post">
		<input type="hidden" name="cmd" value="_xclick">
		<input type="hidden" name="business" value="<?php echo($PAYPAL_EMAIL);?>">

		<input type="hidden" name="item_name" value="<?php echo($WA_LABEL_PAYPAL_CART_TITLE);?>">
		<input type="hidden" name="item_number" value="<?php echo($wa_market_id_order);?>">
		<input type="hidden" name="amount" value="<?php echo($wa_market_total_price);?>">
		<input type="hidden" name="currency_code" value="<?php echo($wa_market_currency);?>">
		
		<input type="hidden" name="email" value="<?php echo($wa_market_email_buyer);?>"> 
		<input type="hidden"name="H_PhoneNumber"value="<?php echo($wa_market_phone);?>">
		
		<input type="hidden" name="first_name" value="<?php echo($wa_market_first_name);?>">
		<input type="hidden" name="last_name" value="<?php echo($wa_market_last_name);?>">
		<input type="hidden" name="address1" value="<?php echo($wa_market_address1);?>">
		<input type="hidden" name="address2" value="<?php echo($wa_market_address2);?>">
		<input type="hidden" name="city" value="<?php echo($wa_market_city);?>">
		<input type="hidden" name="country" value="<?php echo($wa_market_country);?>">
		<input type="hidden" name="zip" value="<?php echo($wa_market_zip);?>">
		<input type="hidden" name="state" value="<?php echo($wa_market_state);?>">

		<input type="hidden" name="invoice" value="<?php echo($wa_market_id_order);?>">
		<input type="hidden" name="charset" value="utf-8">
		<input type="hidden" name="no_shipping" value="2">
		<input type="hidden" name="address_override" value="1">
		
		<input type="hidden" name="lc" value="<?php echo($wa_market_lang);?>">

		<input type="hidden" name="no_note" value="1">
		
		<span style="font-size:13pt;font-weight:bold;">
			<br>
			<?php 
			echo($WA_LABEL_CHECKOUT_WARNING);
			?>
			<br>
			<br>
		</span>						
		
		<input type="submit" class="checkout" value="<?php echo($WA_LABEL_PROCESS_ORDER);?>" name="submit">
		</form>
	<?php
}
?>

<br>
<table style="width:100%;text-align: left; margin-left: auto; margin-right: auto;;">
	<tr>
		<td align=center>
			<table class="wa-shipping-info">
				<tr>
					<td>
						<?php echo($wa_infos_shipping);?>			
					</td>
					
					<?php
					if (strlen($wa_infos_billing)>0)
					{
						?>
						<td>
							<?php echo($wa_infos_billing);?>		
						</td>
						<?php	
					}
					?>
				</tr>
			</table>		
		</td>
	</tr>
</table>



<br>
<table style="width:607px;text-align: center; margin-left: auto; margin-right: auto;">
	<tr>
		<td>
<span><?php echo($WA_LABEL_TYPE_PAYMENT);?> : </span><span style="color:#000000;"><b><?php echo($WA_TYPE_PAYMENT);?> </b></span>
		</td>
	</tr>

	
	
	<?php
	if ($type_payment=="wire")
	{
		?>
		<tr>
			<td >
					<br>
					<span style="font-weight:normal;"><?php echo($WA_MESSAGE_WIRE);?></span>
			</td>
		</tr>
		<tr>
			<td >
				<br>
				<span style="font-size:13pt;font-weight:bold;">
					<?php echo($wa_wire_information);?>
				</span>
			</td>
		</tr>
		<?php
	}
	?>	

	
	
	<?php
	if ($type_payment=="check")
	{
		?>
		<tr>
			<td >
					<br>
					<span style="font-weight:normal;"><?php echo($WA_MESSAGE_CHECK);?></span>
			</td>
		</tr>
		<tr>
			<td >
				<br>
				<span style="font-size:13pt;font-weight:bold;">
					<?php echo($wa_check_information);?>
				</span>
			</td>
		</tr>
		<?php
	}
	?>
	
	
	<tr>
		<td >
				<br>
				<?php
				if (($type_payment=="check")||($type_payment=="wire"))
				{
					?>
					<input type="button" style="font-size:13pt;" value="   <?php echo($WA_LABEL_PRINT);?>  " onclick="printMarketForm()">
					<?php
				}


				if ($type_payment=="custom_script_0")
				{
					?>
					$$MARKET_CUSTOM_SCRIPT_0
					<?php
				}
				
				if ($type_payment=="custom_script_1")
				{
					?>
					$$MARKET_CUSTOM_SCRIPT_1
					<?php
				}
				
				if ($type_payment=="custom_script_2")
				{
					?>
					$$MARKET_CUSTOM_SCRIPT_2
					<?php
				}
												
				?>

		</td>
	</tr>
</table>

</div>
</body>
</html>
