<?php $controller = 'POS';
    $action = 'print';
    include $_SERVER["DOCUMENT_ROOT"].'/app/include/bootstrap.php';?>
<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link href="<?php echo ROOT_HOST?>/public/bootstrap/css/bootstrap.min.css" rel="stylesheet">     
</head><?php
#INFORMACION EMPRESA 
$empresa = new EmpresaEntity();
$empresa->setOptions($empresa->getById(1)); 

$nombreEmpresa  = $empresa->getNombre();
$direccion      = $empresa->getDireccion;
$ciudadEstadoZC = $empresa->getCiudad().', '.$empresa->getEstado().' '.$empresa->getCodigoPostal();
$telefono       = $empresa->getTelefono();  

#INFORMACION DE CAJA
$entity = new AperturaCierreCajaEntity();
$entity->setOptions($entity->getById($_GET['idResumen']));
$data = $entity->getOptions();
$caja = $entity->getCajaName();
$cajero = $entity->getUsuarioName();

#Resumen de las ventas
 $VentaResumen = new VentaEntity();
 $idRegister =  $_GET['idResumen'];
 
 $posAjax = new PosAjax();
 $string = $posAjax->getDataVenta(array('idRegister'=>$idRegister));
 
 $string = $string['string'];
?>
<div id="printArea" style="margin:auto;font-size: 12px">
    <div style="margin: 30px;margin-bottom: 10px">
            <img src="../../public/img/logo_login.png" width="50%">
    </div>  
    <div style="text-align: center">
        <h4><?php echo $nombreEmpresa;?></h4>
        <p class="m-a-0"><?php echo $direccion; ?></p>
        <p class="m-a-0"><?php echo $ciudadEstadoZC; ?></p>
        <p class="m-a-0"><?php echo $telefono;?></p>
    </div> 
    <div class="text-center m-t-1">    
        <p class="m-a-0">Caja #: <?php echo $caja?></p> 
        <p class="m-a-0">Hecho por: <?php echo $cajero;?></p>
    </div> 
    <br>
    
  <?php echo $string; ?>
</div>
    <script type="text/javascript">
        self.print();
    </script>
    <?php //if(isset($_GET['back'])){echo "<script>setTimeout(document.location = '{$_GET['back']}',500);</script>";}?>
</body>
</html>