{{function name="yesNoTxt" bOption='0'}}
	{{if $bOption == 1}}
		{{$lang.yes}}
	{{else}}
		{{$lang.no}}
	{{/if}}
{{/function}}

<div id="user-order">
<div id="order-print">
<div class="message" id="ok"><h3>{{str_replace( '%iOrder%', $aOrderInfo.iOrder, $lang.Order_sent ) }}</h3></div>
	{{if $aOrderInfo.aPayment.iPrintForm}}
		<script type="text/javascript">
			function printPaymentForm(){
				var win = window.open("", "win", "width=750,height=500");
				with (win.document) {
					open("text/html", "replace");
					write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
						"<html><head>\n" +
						"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" +
						"<style type=\"text/css\">@import \"{{$config.dir_templates}}style_PaymentForm.css\";</style>\n"+
						"<style type=\"text/css\"></style>\n" +
						"</head><body onload=\"window.print();\">\n"+
						"<div id=\"druk\"><p id=\"nazwa1\">{{$config.invoices_company_name}}</p><p id=\"nazwa2\">{{$config.invoices_address}} {{$config.invoices_postal_code}} {{$config.invoices_city}}</p>" +
						"<p id=\"konto\">{{$aOrderInfo.account_id}}</p><p id=\"kwota\">{{$aOrderInfo.sOrderSummary}}</p><p id=\"kwota_sl\">{{$aOrderInfo.sSummaryText}}</p>" +
						"<p id=\"nazwaz1\">{{$aOrderInfo.sCompanyNameF}} {{$aOrderInfo.sFirstNameF}} {{$aOrderInfo.sLastNameF}}</p><p id=\"nazwaz2\">{{$aOrderInfo.sStreet}} {{$aOrderInfo.sZipCode}} {{$aOrderInfo.sCity}}</p><p id=\"tytul1\">{{$aOrderInfo.sFirstName}} {{$aOrderInfo.sLastName}}</p><p id=\"tytul2\">{{$lang.Order}} {{$aOrderInfo.iOrder}}</p></div>" +
						"<img src=\"{{$config.dir_templates}}images/druk_przelewu.jpg\" id=\"tlo\" />\n"+
						"</body></html>");
					close();
				}
			}
		</script>
		<a href="#" onclick="printPaymentForm()" id="PrintFormLink">{{$lang.Show_Print_Form}}</a>
	{{/if}}

<div class="clear"></div>



		<div class="col1">
		<fieldset id="personal-data">
		<h2>{{$lang.Your_personal_information}}</h2>
		<table class="table-styled">
		<tr><th>{{$lang.First_name}}:</th><td>{{$aOrderInfo.sFirstName}}</td></tr>
		<tr><th>{{$lang.Last_name}}:</th><td>{{$aOrderInfo.sLastName}}</td></tr>
		<tr><th class="street">{{$lang.Street}}:</th><td class="street">{{$aOrderInfo.sStreet}}</td></tr>
		<tr><th class="zipCode">{{$lang.Zip_code}}:</th><td class="zipCode">{{$aOrderInfo.sZipCode}}</td></tr>
		<tr><th class="city">{{$lang.City}}:</th><td class="city">{{$aOrderInfo.sCity}}</td></tr>
		<tr><th class="country">{{$lang.Country}}:</th><td class="country">{{$aOrderInfo.sCountry}}</td></tr>
		{{if !empty( $aOrderInfo.sRegion )}}<tr><th class="region">{{$lang.Region}}:</th><td class="region">{{$aOrderInfo.sRegion}}</td></tr>{{/if}}
		<tr><th class="phone">{{$lang.Telephone}}:</th><td class="phone">{{$aOrderInfo.sPhone}}</td></tr>
		<tr><th class="email">{{$lang.Email}}:</th><td class="email">{{$aOrderInfo.sEmail}}</td></tr>
		</table>
		</fieldset>
		
		
		{{if !$aOrderInfo.sCompanyName == null && !$aOrderInfo.sNip == null}}
			<fieldset id="company-data">
			<h2>{{$lang.Company}}</h2>
			<table class="table-styled">
			<tr><th class="company">{{$lang.Company}}:</th><td class="company">{{$aOrderInfo.sCompanyName}}</td></tr>
			<tr><th class="nip">{{$lang.Nip}}:</th><td class="nip">{{$aOrderInfo.sNip}}</td></tr>
			</table>
			</fieldset>
		{{/if}}
		
		</div>		
		
		<div class="col2" >
		<fieldset id="postal-data">
		<h2>{{$lang.PostalData}}</h2>
		<table class="table-styled">
		<tr><th class="postalName">{{$lang.Name}}:</th><td class="postalName">{{if !$aOrderInfo.sPostalName == null}}{{$aOrderInfo.sPostalName}}{{else}}{{$aOrderInfo.sCompanyName}} {{$aOrderInfo.sFirstName}} {{$aOrderInfo.sLastName}}{{/if}}</td></tr>
		<tr><th class="postalstreet">{{$lang.Street}}:</th><td class="postalstreet">{{if !$aOrderInfo.sPostalStreet == null}}{{$aOrderInfo.sPostalStreet}}{{else}}{{$aOrderInfo.sStreet}}{{/if}}</td></tr>
		<tr><th class="postalzipCode">{{$lang.Zip_code}}:</th><td class="postalzipCode">{{if !$aOrderInfo.sPostalZipCode == null}}{{$aOrderInfo.sPostalZipCode}}{{else}}{{$aOrderInfo.sZipCode}}{{/if}}</td></tr>
		<tr><th class="postalcity">{{$lang.City}}:</th><td class="postalcity">{{if !$aOrderInfo.sPostalCity == null}}{{$aOrderInfo.sPostalCity}}{{else}}{{$aOrderInfo.sCity}}{{/if}}</td></tr>
		<tr><th class="postalcountry">{{$lang.Country}}:</th><td class="postalcountry">{{if !$aOrderInfo.sPostalCountry == null}}{{$aOrderInfo.sPostalCountry}}{{else}}{{$aOrderInfo.sCountry}}{{/if}}</td></tr>
		{{if !empty( $aOrderInfo.sPostalRegion ) || !empty( $aOrderInfo.sRegion )}}<tr><th class="postalregion">{{$lang.Region}}:</th><td class="postalregion">{{if !$aOrderInfo.sPostalRegion == null}}{{$aOrderInfo.sPostalRegion}}{{else}}{{$aOrderInfo.sRegion}}{{/if}}</td></tr>{{/if}}
		<tr><th class="postalphone">{{$lang.Phone}}:</th><td class="postalphone">{{if !$aOrderInfo.sPostalPhone == null}}{{$aOrderInfo.sPostalPhone}}{{else}}{{$aOrderInfo.sPhone}}{{/if}}</td></tr>
		</table>
		</fieldset>

		<fieldset id="delivery-payment">
		<h2>Dokument zakupu</h2>
		<table class="table-styled">
		<tr><th class="invoice">{{$aOrderInfo.sInvoice}}</th><td class="invoice">{{if $aOrderInfo.iInvoice == 1}}{{$aOrderInfo.sCompanyName}}{{else}}{{$aOrderInfo.sFirstName}} {{$aOrderInfo.sLastName}}{{/if}}</td></tr>
			</table>
			</fieldset>

		<fieldset id="delivery-payment">
		<h2>{{$lang.Delivery_and_payment}}</h2>
		<table class="table-styled">
		<tr><th class="carrier">{{$lang.Carrier}}:</th><td class="carrier">{{$aOrderInfo.aCarrier.sName}}</td></tr>
		{{if $aOrderInfo.iCarrierSystem == $config.carrier_paczkomaty}}
			<tr><th class="carrier">{{$lang.Chosen_paczkomat}}:</th><td class="carrier">{{$aOrderInfo.mCarrierInfo}}</td></tr>
		{{/if}}
		<tr><th class="carrier">{{$lang.Payment}}:</th><td class="carrier">{{$aOrderInfo.aPayment.sName}}</td></tr>
		</table>
		</fieldset>

		
		{{if $config.gifts && $aOrderInfo.iGift == true}}
			<fieldset id="order-gift">
			<h2>{{$lang.Packing_as_gift}}</h2>
			<table class="table-styled">
			<tr><th>{{$lang.Pack_as_gift}}:</th><td>{{yesNoTxt bOption=$aOrderInfo.iGift}}</td></tr>
			<tr><th>{{$lang.Show_Client}}:</th><td>{{yesNoTxt bOption=$aOrderInfo.iShowClient}}</td></tr>
			<tr><th>{{$lang.Gift_Text}}:</th><td>{{$aOrderInfo.sGiftText}}</td></tr>
			</table>
			</fieldset>
		{{/if}}

		{{if !$aOrderInfo.sComment == null}}
			<fieldset id="order-comment">
			<h2>{{$lang.Order_comment}}</h2>
			<p>{{$aOrderInfo.sComment}}</p>
			</fieldset>
		{{/if}}
		
		</div>
		<div class="clear"></div>
  <h2>{{$lang.Ordered_products}}</h2>
	<div id="ordered-products">
		<table>
			<thead>
				<tr>
				<th class="image">{{$lang.Photo}}</th>
				<th class="name">{{$lang.Name}}</th>
				<th class="price">{{$lang.Price}}[{{$config.currency_symbol}}]</th>
				<th class="quantity">{{$lang.Quantity}}</th>
				<th class="summary">{{$lang.Summary}}[{{$config.currency_symbol}}]</th>
				</tr>
			</thead>
			<tfoot>
				<tr class="summary-product"><th colspan="4">{{$lang.Order_summary}}:</th><td id="summary-product-cost">{{$aOrderInfo.sProductsSummary}}</td></tr>
				{{if $aOrderInfo.bDiscountPanelActive}}
					<tr class="summary-product"><th colspan="4">{{$lang.Discount_coupon_value}}</th><td id="discount-value">{{$aOrderInfo.sDiscountCouponValue}}</td></tr>
					<tr class="summary-product"><th colspan="4">{{$lang.Summary_after_discount}}:</th><td id="summary-product-cost-discount">{{$aOrderInfo.sProductsSummaryDiscount}}</td></tr>
				{{/if}}
				<tr class="summary-delivery"><th colspan="4">{{$lang.Delivery_and_payment}} ({{$aOrderInfo.aCarrier.sName}}, {{$aOrderInfo.aPayment.sName}}):</th><td id="summary-delivery-cost">{{$aOrderInfo.sPaymentCarrierPrice}}</td></tr>
				{{if $aOrderInfo.iGift}}
					<tr class="summary-gift"><th colspan="4">{{$lang.Packing_as_gift}}:</th><td id="summary-gift-cost">{{$aOrder.sGift}}</td></tr>
				{{/if}}
				<tr class="summary-order"><th colspan="4">{{$lang.Summary_cost}}:</th><td id="summary-order-cost">{{$aOrderInfo.sOrderSummary}}</td></tr>
			</tfoot>
			<tbody>			
			
			{{foreach from=$aOrderInfo.aProducts item=aProduct}}
				<tr>
					<td class="image">
						{{if isset($aProduct.aDataImage)}}
							<a href="{{$aProduct.sLinkName}}"><img src="{{$config.dir_files}}{{$aProductMinSizes.MainBasket}}/{{$aProduct.aDataImage.sFileName}}" alt="{{$aProduct.aDataImage.sFileDescription}}" /></a>
						{{/if}}
					</td>
					<th class="name"><a href="{{$aProduct.sLinkName}}">{{$aProduct.sName}}</a></th>
					<td class="price">{{$aProduct.sPrice}}</td>
					<td class="quantity">{{$aProduct.iQuantity}}</td>
					<td class="summary">{{$aProduct.sSummary}} {{if isset( $aProduct.bDiscount )}}<img class="tTip discount_{{if $aProduct.bDiscount}}true{{else}}false{{/if}}" title="{{if $aProduct.bDiscount}}{{$lang.Discount_affected}}{{else}}{{$lang.Discount_not_affected}}&#10;{{$aProduct.sDiscountInfo}}{{/if}}" src="{{$config.dir_templates}}images/discount.png" />{{/if}}</td>
				</tr>
			{{/foreach}}
			
			</tbody>
		</table>
	</div>
	

<p><a class="submit submit-styled" href="{{$aPage.sLinkName}}?iOrder={{$aOrderInfo.iOrder}}&amp;a=addToBasket">{{$lang.Reorder_all_products}}</a></p>
</div>
</div>