<?php
    $controller = 'Production';
    $action = 'label';
    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>
<body style="margin:0px;padding:0px"><?php
/* INFORMACION EMPRESA */
#Cuando envio impresion desde boton en listado AperturaCierreCaja.php utilizando javascript printOpening();
$empresa = new CompanyEntity();
$empresa->setOptions($empresa->getById(1)); 

$nombreEmpresa  = $empresa->getName();
$direccion      = $empresa->getAddress();
$ciudadEstadoZC = $empresa->getCity().', '.$empresa->getState().' '.$empresa->getZipCode();
$telefono       = $empresa->getPhone();  

/* SPECIAL REQUISITION INFORMATION */
$entity = new ProductionEntity();
$entity->setOptions($entity->getById($_GET['idReq']));
?>
<style>
    /*
    .numberCircle {
    //border-radius: 50%;
    //box-sizing: initial;
    //width: 15px;
    //height: 15px;
    //padding: 2px;

    //background: #000;
    //border: 2px solid #000;
    //color: #fff;
    text-align: center;

    font: 20px Arial, sans-serif;
}*/
</style>
<div id="printArea">        
<?php 
    $barCode = new BarCode();
    for($i=1;  $i<=$_GET['copies']; $i++){
        $barCode->setBarCode(array(
            'filepath'=>PATH_TEMP_DOCS.'/barcodes/'.$entity->getCodeProduct().'.png',
            'text'=>$entity->getCodeProduct(),
            'print'=>true));      ?> 
        <div style="font-family: Arial,Helvetica Neue,Helvetica,sans-serif;padding-top:10px;">
            <div style="float: left;width: 23%;">
                <img src="../../public/img/logo_label.png" width="100%"  height="100%"  style="margin-top: 5px;">
            </div> 
            <div style="float: left;text-align: left;font-size: 14px;">
                <div style="padding: 0px;margin-left: 5px">
                    <h4 style="font-size: 10px;margin-bottom: 0px;padding-bottom: 0px"><b><?php echo $entity->getProductName(); ?></b></h4>                
                    <h4 style="font-size: 10px;margin-top: 0px;padding-top: 0px;margin-bottom: 0px;padding-bottom: 0px"><b><?php echo $entity->getSizeName(); ?></b></h4>              
                    <div class="numberCircle" style="margin-top: 5px;float: left"><?php echo $entity->getDayCode(); ?></div>
                    <img src="/app/resources/docs/temp/barcodes/<?php echo $entity->getCodeProduct()?>.png" />
                </div> 
            </div>  
        </div>  
        <div style="clear:both;"></div>
<?php }?>
</div>   
<script type="text/javascript">
     window.onafterprint = function(){
        parent.window.location.reload(true);
        //parent.getElementsByName('production').[0].submit();
     };
    self.print();
</script>
</body>
</html>