<!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>

	</head>
	<body>
		<div>
			<?php
				if (!empty($ventas)) {
					$par = FALSE;
					foreach ($ventas as $v){
						?>
						<div class="row labels new-labels">
							<div class="col">
								<div class="label-sale">
									<span class="logo-resizer btn btn-xs btn-primary no-print"><i class="fas fa-eye"></i></span>
									<div class="label-logo label-carrier"><img class="img-logo logo-l" src="<?php echo base_url(); ?>img/logo-labels.png"><br>
										<span style="float: right; margin-top: 1px; ?>;" class="transportista badge badge-pill">
											<?php echo $v['transportista']; ?>
										</span>
									</div>
									<div class="label-address">
										<div class="label-name"><?php echo $v['dir_nombre'] . ' ' . $v['dir_apellidos']; ?></div>
										<div>
											<?php 
												$dir = '';
												$dir .= !empty($v['rut']) ? $v['rut'] . '</br>' : '';
												$dir .= !empty($v['direccion']) ? $v['direccion'] . '</br>' : '';
												$dir .= !empty($v['comuna']) ? $v['comuna'] . '</br>' : '';
												$dir .= !empty($v['telefono']) ? $v['telefono'] . '</br>' : '';
												$dir .= !empty($v['despacho']) ? $v['despacho'] : '';
												echo $dir;
											?>
										</div>
									</div>
								</div>
							</div>
						</div>
						<?php
					}
				}
				else {
					echo 'No hay ventas en preparación';
				}
			?>
		</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>