<?php session_start();
include ('../inc/dbcon.php');
include ('../inc/functions.php');
include ('../inc/invfunctions.php');
include ('../inc/repfunctions.php');
if(isset($_SESSION["axeslogin"]) && $_SESSION["axeslogin"] == true){    
$_SESSION['cuPages']='sel_sinvlist.php';   
$cuPage='sel_sinvlist.php';    
$aid=$_SESSION['uid'];
$brid=$_SESSION['abrid'];    
}else{
header('Location:../index.php');
exit;    
}
?>

<div class="side-head">
<div class="row"> 
<div class="col-md-12">
<div class="col-md-10 text-right"></div>
<div class="col-md-2 text-right">
<button class="btn btn-flat bg-red" id="closepop"><span><i class="fa fa-times"></i></span></button>
</div>    
</div>
</div>
</div>
<div id="addsitem">
<div class="col-md-12">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">  
    





    <div class="printableArea print_label">
            <?php 
                if(isset($_POST['stiker'])){
                $id=$_POST['stiker'];
                $sql="SELECT * FROM tbl_barcode WHERE id='$id'";     
                $query=mysqli_query($con,$sql)or die(mysqli_error($con));
                $rowadd=mysqli_fetch_array($query);   
                
               
                }
                for($i=1;$i<=$rowadd['qty'];$i++){
            ?>

<style>
@media print {
body  
{ 
    /* this affects the margin on the content before sending to printer */ 
    margin: 0px;  
}
}
@page {
  size: 45mm 35mm;
  margin: 0;
  padding-top: 0;
}

.print_label {
  height: 35mm; /* should be 31.0 */
  width: 45mm; /* should be 63.5 */
}

.print_label {
  padding: 1mm;
  float: left;
  font-size: 3mm;
}
.print_label img {
    margin-top: 3px;
    margin-left: -7px;    
}    
</style>


        <div class="text-center" style="break-before: page; margin-top: 4px;margin-left: 4px;">
            <strong><?php echo $rowadd['name'];?></strong> <br><?php echo $rowadd['configure'];?>
            <br>
            <img src="../inc/barcode.php?text=<?php echo $rowadd['code'].$i;?>&amp;codetype=code128&amp;orientation=horizontal&amp;size=25&amp;print=false">
            <br>
                
            <div><?php echo $rowadd['code'].$i;?></div>

            <div style="text-align:right;">Pluget</div>
        </div>

        <?php } ?>
        
    </div>
</div>
<div class="col-md-2"></div>    
</div>    
<button class="btn btn-flat bg-teal" id="prints"><i class="fa fa-print"></i></button>
</div>    
<script type="text/javascript">
$("#prints").click(function() {    
var mode = 'iframe'; //popup
var close = mode == "popup";
var options = {
mode: mode,
popClose: close
};
$("div.printableArea").printArea(options);
});
</script>
</div>    
