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


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

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

</script>

<div class="container">		

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

	
	<div class="row">
		<div class="col-xs-6 col-sm-6 col-md-6">
			<h3><?php echo @Lib_Lang::translate(admin_voucher_list_top); ?></h3>
		</div>
		<div class="col-xs-6 col-sm-6 col-md-6 text-right">
		
		<form method="post">
		<?php echo @Lib_Lang::translate(admin_voucher_gen); ?>
		<input name="i" type="number" step="1" min="1" max="500" value="10" style="text-align:center;" />
		<?php echo @Lib_Lang::translate(admin_voucher_gen_2); ?>
		<input name="r" type="number" step="0.1" min="0" max="100" value="5" style="text-align:center;" />%
		<input name="gen" type="submit" value="<?php echo @Lib_Lang::translate(admin_voucher_genb); ?>" />
		</form>
		
		</div>
	</div>

	
<div class="col-xs-12 col-sm-12 col-md-12">		

<?php

	if( $this->codes ){
		echo '<b>'.@Lib_Lang::translate(admin_voucher_gennc).' ('.$this->r.'%)</b><br />'; 
		echo str_replace(', ','<br />',$this->codes);
	}

?>

<?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_voucher_list_lp); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_voucher_list_code); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_voucher_list_ins); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_voucher_list_rabate); ?></th>
			<th><?php echo @Lib_Lang::translate(admin_voucher_list_utilization); ?></th>
			<th></th>
		</tr>
	</thead>
	<tbody>
	<?php $i=$this->escape($this->page); foreach ($this->dataVoucher as $key => $val): $i=$i+1;?>
		<tr>
			<td><?php echo $i.'.'; ?></td>
			<td><?php echo $this->escape($val['voucher_id'].'-'.$val['voucher_code']); ?></td>
			<td><?php echo $this->escape($val['voucher_date_ins']); ?></td>
			<td><?php echo $this->escape($val['voucher_rabate']); ?>%</td>
			<td><?php if( $val['voucher_date_utilization'] != '0000-00-00 00:00:00' ) echo $this->escape($val['voucher_date_utilization']); ?></td>
			<td class="text-center">
			</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'); ?>