<!doctype html>
<html lang="es">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="Ventas.">
		<meta name="author" content="Edu FX">

		<title><?php echo !empty($title) ? $title : 'Ventas DeMente Games: ';?></title>

		<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/solid.css" integrity="sha384-ioUrHig76ITq4aEJ67dHzTvqjsAP/7IzgwE7lgJcg2r7BRNGYSK0LwSmROzYtgzs" crossorigin="anonymous">
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/fontawesome.css" integrity="sha384-sri+NftO+0hcisDKgr287Y/1LVnInHJ1l+XC7+FOabmTTIK0HnE2ID+xxvJ21c5J" crossorigin="anonymous">

		<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/jquery-ui.css">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/style.css">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/print.css"/>

		<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>

		<style>
			@media print{@page {size: landscape}}
		</style>

	</head>
	<body>
		<div class="page">
			<div class="price-list">
				<?php
					if (!empty($precios)) {
	//					$par = FALSE;
						foreach ($precios as $p){
							$hp = '';
							if ($p['ps_price']['precio'] > 99999){
								$hp = 'high-price';
							}

							?>
								<div class="price-wrapper">
									<div class="price">
										<?php
										if ($p['ps_price']['descuento'] == 0) {
											?>
												<div class="price-value-wrapper">
													<div class="price-value <?php  echo $hp;?>">
														<span class="sign">$</span> <?php echo clp($p['ps_price']['precio']);?>
													</div>
												</div>
										<?php 
											}
											else {
												?>
												<div class="sale-value-wrapper">
													<div class="normal-price-value">
														<span class="sign">Normal $</span> <?php echo clp($p['ps_price']['precio_normal']);?>
													</div>
													<div class="price-value">
														<span class="sign">$</span> <?php echo clp($p['ps_price']['precio']);?>
													</div>
												</div>
											<?php
											}
										?>
										<div class="price-nombre-wrapper">
											<div class="price-nombre">
												<?php echo $p['nombre'];?>
											</div>
										</div>
									</div>
								</div>
							<?php
						}
					}
					else {
						echo 'No hay ventas en preparación';
					}
				?>
			</div>
		</div>
		<script src="<?php echo base_url(); ?>js/jquery-ui.min.js"></script>
		<script src="<?php echo base_url(); ?>js/functions.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
		<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>


		<script>
			$(document).ready(function(){

				$('.logo-resizer').on('click', function(e) {
					var img = $(this).next().find('img');
					if (img.hasClass('logo-l')) {
						img.removeClass('logo-l').addClass('logo-m');
					}
					else if(img.hasClass('logo-m')) {
						img.removeClass('logo-m').addClass('logo-s');
					}
					else if(img.hasClass('logo-s')) {
						img.removeClass('logo-s').addClass('logo-h');
					}
					else if(img.hasClass('logo-h')) {
						img.removeClass('logo-h').addClass('logo-l');
					}

				});
			});

		</script>
	</body>
</html>