<?php echo $this->render('module/header.phtml'); ?>

<script type="text/javascript" language="javascript">

	$(document).ready(function () {
	
	});

</script>

<style>
.rowOrder{
	margin-bottom:10px;
}
</style>

<div class="conBox">
<div class="container widthDiv" style="padding-top:15px;">
	<div class="row rowOrder">
		<div class="col-xs-12 categoryBox" style="padding-bottom:15px;">
		
		
		<div class="col-xs-8">
		<h1 style="margin:0;font-size:26px;"><?php echo @Lib_Lang::translate(front_account_youraccount_history_top); ?></h1>		
		</div>
		<div class="col-xs-4">
			<a href="<?php echo @$this->url(array('controller' => 'account', 'action' => 'historyorder'), 'default', true); ?>" class="form-control" style="text-align:center;"><?php echo @Lib_Lang::translate(front_account_youraccount_history_top); ?></a>
		</div>


		
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_id); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo$this->rowOrder['order_id']; ?></div>
	</div>
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_client_data_send); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">
		
				<?php echo$this->rowOrder['order_send_client_firstname']; ?> <?php echo$this->rowOrder['order_send_client_secondname']; ?><br />
				<?php echo$this->rowOrder['order_send_client_address']; ?><br /><?php echo$this->rowOrder['order_send_client_zipcode']; ?> <?php echo$this->rowOrder['order_send_client_city']; ?>, <?php echo$this->rowOrder['order_send_client_country']; ?><br /><?php echo$this->rowOrder['order_send_client_phone']; ?>
		
		</div>
	</div>
	
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_ins); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo$this->rowOrder['order_ins']; ?></div>
	</div>
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_price_product); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo number_format($this->rowOrder['order_price_product'], 2, ',', ' '); ?> zł</div>
	</div>
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_price_packr); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">
			<?php echo@Lib_Lang::consta(type_pack_.$this->rowOrder['order_id_pack']);?>
		</div>
	</div>
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_price_pack); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo number_format($this->rowOrder['order_price_pack'], 2, ',', ' '); ?> zł</div>
	</div>
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_price_transportr); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">
			<?php echo@Lib_Lang::consta(type_transport_.$this->rowOrder['order_id_transport']);?>
		</div>
	</div>
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_price_transport); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo number_format($this->rowOrder['order_price_transport'], 2, ',', ' '); ?> zł</div>
	</div>
	
	<?php if($this->rowOrder['order_id_leadtime'] != 0){ ?>
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_price_leadtime); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo @Lib_Lang::consta(type_leadtime_.$this->rowOrder['order_id_leadtime']); ?> <?php echo number_format($this->rowOrder['order_price_leadtime'], 2, ',', ' '); ?> zł</div>
	</div>
	<?php } ?>
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right"><?php echo @Lib_Lang::translate(admin_order_price); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo number_format($this->rowOrder['order_price'], 2, ',', ' '); ?> zł</div>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_order_status); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">
				<?php /*if($this->rowOrder['order_status'] == 0) echo @Lib_Lang::translate(order_status_0); ?>
				<?php if($this->rowOrder['order_status'] == 1) echo @Lib_Lang::translate(order_status_1); ?>
				<?php if($this->rowOrder['order_status'] == 2) echo @Lib_Lang::translate(order_status_2); ?>
				<?php if($this->rowOrder['order_status'] == 9) echo @Lib_Lang::translate(order_status_9);*/ ?>
				<?php echo @Lib_Lang::consta(order_status_.$this->rowOrder['order_status']); ?>
		</div>
		
	</div>
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(front_order_list_status_pay); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">
				<?php 
				if( $this->rowOrder['order_pay'] == 1 ){
					echo @Lib_Lang::translate(front_order_list_status_pay_1);
					if( $this->rowOrder['order_pay_date'] != '0000-00-00 00:00:00' ) echo' ('.$this->rowOrder['order_pay_date'].')';
				}else{
					echo @Lib_Lang::translate(front_order_list_status_pay_0);				
				}
			?>
		</div>
		
	</div>
	
			
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_order_datasend); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php if( $this->rowOrder['order_datasend']!='0000-00-00' ) echo $this->rowOrder['order_datasend']; ?></div>
	</div>
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_order_nr); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo $this->rowOrder['order_nr']; ?></div>
	</div>
	
	<div class="row rowOrder" style="color:red">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_order_infoshop); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8"><?php echo $this->rowOrder['order_infoshop']; ?></div>
	</div>	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_order_file); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">
		
			<?php 
				$i = 0;
				foreach( $this->dataOrderFile as $fileDocKey => $fileDocVal ){
				$i++;
			?>
			
			<?php echo $i; ?>. <a href="<?php echo @$this->url(array('controller' => 'account', 'action' => 'orderfileopen', 'id' => $fileDocVal['order_file_id']), null, true); ?>" target="_blank"><?php echo $fileDocVal['order_file_filename']; ?></a><br />
			
			<?php			
				}
			?>
		
		</div>
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="row rowOrder">
		<div class="col-xs-12 col-sm-4 col-md-4 text-right formLabelMarginTop"><?php echo @Lib_Lang::translate(admin_order_product); ?></div>
		<div class="col-xs-12 col-sm-8 col-md-8">

	<table class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th><?php echo ''; ?></th>
			<th><?php echo @Lib_Lang::translate(admin_orderproduct_info); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_orderproduct_count); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_orderproduct_price); ?></th>
		</tr>
	</thead>
	<tbody>
	<?php $i = 0; foreach ($this->dataProductOrder as $key => $val): $i++; ?>
		<tr>
			<td>
				<?php echo$i; ?>.
			</td>
			<td>
				<?php echo @Lib_Lang::consta(product_name_.$val['product_id']); ?>
				
				<?php if( $val['product_shop'] == 0 ){ ?>
				
					<script type="text/javascript" language="javascript">
						$(document).ready(function () {
							
							$("#produkt<?php echo $val['order_product_id']; ?>").load("<?php echo $this->url(array('controller' => 'account', 'action' => 'ordereditproduct'), 'default', true); ?>",{product_id: '<?php echo$val['product_id']; ?>', order_product_id: '<?php echo$val['order_product_id']; ?>'}, function(){});
	
						});
					</script>
					<div id="produkt<?php echo $val['order_product_id']; ?>"></div>
				
				<?php } ?>
			</td>
			<td><?php echo $val['order_product_amount']; ?> x <b><?php echo number_format($val['order_product_price'], 2, ',', ' '); ?></b> zł</td>
			<td><?php echo number_format($val['order_product_amount']*$val['order_product_price'], 2, ',', ' '); ?></td>
		</tr>	
	<?php endforeach; ?>
	</tbody>
	</table>

	
		</div>
	</div>
		
		
		
		
		</div>
	</div>
</div>
</div>

<?php echo $this->render('module/footer.phtml'); ?>

