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


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

	$(document).ready(function () {

		<?php if( isset( $this->removeSuccess ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(admin_order_remove_success); ?>");
		<?php } ?>
		
		$(".removeCategory").click(function(){
		
			var link = $(this).attr('link');
			var name = $(this).attr('name');
			alertify.set({ buttonFocus: "none", labels: {ok: "<?php echo @Lib_Lang::translate(admin_confirm_accept); ?>", cancel: "<?php echo @Lib_Lang::translate(admin_confirm_cancel); ?>"}});
			alertify.confirm("<?php echo @Lib_Lang::translate(admin_confirm_remove_category); ?> "+name+"?<br /><?php echo @Lib_Lang::translate(admin_confirm_remove_categorydesc); ?>", function (e) {
				if (e) {
					window.location.href = link;
				} else {
					return false;
				}
			});
		
		});
		
	});

</script>

<div class="container">		

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

	
	<div class="row">
		<div class="col-xs-3 col-sm-3 col-md-3">
			<h3><?php echo @Lib_Lang::translate(admin_order_list_top); ?></h3>
		</div>
		<div class="col-xs-9 col-sm-9 col-md-9 text-right">
		
		</div>
	</div>

	
<div class="col-xs-12 col-sm-12 col-md-12">		
<?php echo $this->render('admin/module_page.phtml'); ?>
<table class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th><?php echo @Lib_Lang::translate(admin_order_list_lp); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_order_list_ordernr); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_order_list_client); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_order_list_price); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_order_list_ins); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_order_list_status); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_order_status_2); ?></th>
			<th></th>
		</tr>
	</thead>
	<tbody>
	<?php $i=$this->escape($this->page); foreach ($this->dataTable as $key => $val): $i=$i+1;?>
		<tr>
			<td><?php echo$i; ?></td>
			<td><?php echo$val['order_id']; ?></td>
			<td>
				<?php echo$val['client_firstname']; ?> <?php echo$val['client_secondname']; ?><br />
				<?php echo$val['client_address']; ?><br /><?php echo$val['client_zipcode']; ?> <?php echo$val['client_city']; ?>, <?php echo$val['client_country']; ?><br /><?php echo$val['client_phone']; ?><br />
				<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'loginclient', 'id' => $val['client_id']), 'default', true); ?>" class="btn btn-success btn-xs"><i class='fa fa-edit'></i> <?php echo @Lib_Lang::translate(admin_client_list_loginbutton); ?></a>
			</td>
			<td><?php echo number_format($val['order_price'], 2, ',', ' '); ?> zł</td>
			<td><?php echo$val['order_ins']; ?></td>
			<td><?php echo @Lib_Lang::consta(order_status_.$val['order_status']); ?></td>
			<td><?php echo Lib_Lang::consta(order_status_2_.$val['order_status_2']); ?></td>

			<td class="text-center">
			
				<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'orderedit', 'id' => $val['order_id']), 'default', true); ?>" class="btn btn-primary btn-xs"><i class='fa fa-edit'></i> <?php echo @Lib_Lang::translate(admin_order_list_editbutton); ?></a>

				<a href="<?php echo @$this->url(array('controller' => 'admin', 'action' => 'export', 'id' => $val['order_id']), 'default', true); ?>" class="btn btn-default btn-xs"><i class='fa fa-file-excel-o'></i> <?php echo @Lib_Lang::translate(admin_order_list_exportbutton); ?></a>
				
			</td>
		</tr>	
	<?php endforeach; ?>
	</tbody>
</table>	
<?php echo $this->render('admin/module_page.phtml'); ?>
</div>		
	
		
	<div class="row"><hr /></div>
	
</div>

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