<?php
use App\Models\CompanyData;
use App\Models\ProductUnits;
use App\Models\StoresDefaultData;
$Def=CompanyData::orderBy('id','desc')->first();
$DefStore=StoresDefaultData::orderBy('id','desc')->first();
?>
<title><?php echo e(trans('admin.BarcodeـPrinting')); ?></title>

<!doctype html>
<html lang="en">
<head>
<title> Barcodes</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
	<?php if($Set->Type == 1): ?>   
<?php if($Set->Direction == 1): ?>   
<!-- A4 Portarit -->
<style>
   
  	.btn{
		   background: #8b008bc9;
    color: white;
    width: 120px;
    padding: 8px;
    border-radius: 8px;
    outline: 0;
    cursor: pointer;
    font-size: 15px;
    margin-top: 28px;
		}
			.btn-back{
	text-decoration: none;
    background: darkgray;
    color: white;
    width: 120px;
    padding: 10px 40px;
    border-radius: 8px;
    outline: 0;
    cursor: pointer;
    font-size: 15px;
    margin-top: 28px;
		}
   .print{
     
       overflow:auto !important;
   }
    
   
   
   @media  print{
   @page  {
   size: a4;
   margin: 0;
   }
   .no-print{
   display: none;
   }
   
   .print{
       page-break-after:always;
       overflow:unset !important;
   }
   
   .only-print{
   display: block!important;
   }
   }
   /* print A4 */
   .print{
   width: 20.95cm;
   height: 29.46cm;
   display: block;
   border: 1px solid #CCC; 
   margin: 0.26cm auto; 
   padding: 0.254cm 0 0 0.254cm; 
   page-break-after:always; 
   overflow:auto;
   }
   /* print A4 portrit label */
   .print-label{
   border: 1px solid #0000003d;
   border-style: dotted;  
   width: <?php echo e($Set->Width); ?>cm; 
   height: <?php echo e($Set->Height); ?>cm; 
   margin-left: <?php echo e($Set->Margin_L); ?>cm; 
   margin-right: <?php echo e($Set->Margin_R); ?>cm;
   margin-top: <?php echo e($Set->Margin_T); ?>cm;
   margin-bottom: <?php echo e($Set->Margin_B); ?>cm; 
   padding-top: <?php echo e($Set->Padding_T); ?>cm; 
   padding-left: <?php echo e($Set->Padding_L); ?>cm; 
   padding-right: <?php echo e($Set->Padding_R); ?>cm; 
   padding-bottom: <?php echo e($Set->Padding_B); ?>cm; 
   font-size: <?php echo e($Set->Font_Size); ?>px; 
   line-height: <?php echo e($Set->Line_Height); ?>px; 
   display: inline-block;
   }
   .print-label .d-block{
   height: <?php echo e($Set->Barcode_Height); ?>cm;
   width: <?php echo e($Set->Barcode_Width); ?>cm;
   margin: auto;
   margin-top: <?php echo e($Set->Margin_T); ?>cm;
   margin-bottom: <?php echo e($Set->Margin_B); ?>cm; 
   }
</style>
<?php else: ?>
<!-- A4 Landscape -->
<style>
   @media  print{
   @page  {
   size: a4;
   margin: 0;
   }
   .no-print{
   display: none;
   }
   .only-print{
   display: block!important;
   }
  
   }
   
   /* print A4 */
   .print{
   width: 20.95cm;
   height: 29.46cm;
   display: block;
   border: 1px solid #CCC; 
   margin: 0.26cm auto; 
   padding: 0.254cm 0 0 0.254cm; 
   page-break-after:always; 
   }
   /* print A4 landscape label */
   .print-label{
   border: 1px solid #0000003d;
   border-style: dotted;  
   width: <?php echo e($Set->Width); ?>cm; 
   height: <?php echo e($Set->Height); ?>cm; 
   margin-left: <?php echo e($Set->Margin_L); ?>cm; 
   margin-right: <?php echo e($Set->Margin_R); ?>cm;
   margin-top: <?php echo e($Set->Margin_T); ?>cm;
   margin-bottom: <?php echo e($Set->Margin_B); ?>cm; 
   padding-top: <?php echo e($Set->Padding_T); ?>cm; 
   padding-left: <?php echo e($Set->Padding_L); ?>cm; 
   padding-right: <?php echo e($Set->Padding_R); ?>cm; 
   padding-bottom: <?php echo e($Set->Padding_B); ?>cm; 
   font-size: <?php echo e($Set->Font_Size); ?>px; 
   line-height: <?php echo e($Set->Line_Height); ?>px; 
   transform: rotate(90deg);
   margin-top: 28px;
   display: inline-block;
   } 
   .print-label .d-block{
   height: <?php echo e($Set->Barcode_Height); ?>cm;
   width: <?php echo e($Set->Barcode_Width); ?>cm;
   margin: auto;
   margin-top: <?php echo e($Set->Margin_T); ?>cm;
   margin-bottom: <?php echo e($Set->Margin_B); ?>cm; 
   }
</style>
<?php endif; ?>   
<?php endif; ?>
<?php if($Set->Type == 2): ?>      
<?php if($Set->Direction == 1): ?>    
<!-- Free Portarit -->
<style type="text/css">

    @media  print{
        body {
     font: 700 16px Arial, Sans-Serif;
} 
    }
		body {
			margin-top: 0.1in;
		}
		.page {
			width: 5cm;
			height: auto;
			margin-top: 0.25cm;
			margin: auto;
		}
    .label {
			width: <?php echo e($Set->Width); ?>cm; /* العرض */
			height: <?php echo e($Set->Height); ?>cm; /* الطول */
			margin-top: <?php echo e($Set->Margin_T); ?>cm;  /* هامش أعلى */
			margin-bottom: <?php echo e($Set->Margin_B); ?>cm; /* هامش أسفل */
			margin-right: <?php echo e($Set->Margin_R); ?>cm;  /* هامش يمين */
			margin-left: <?php echo e($Set->Margin_L); ?>cm; /* هامش شمال */
			padding-top: <?php echo e($Set->Padding_T); ?>cm; /* بادنج شمال */
			padding-bottom: <?php echo e($Set->Padding_B); ?>cm; /* بادنج شمال */
			padding-right: <?php echo e($Set->Padding_R); ?>cm; /* بادنج شمال */
			padding-left: <?php echo e($Set->Padding_L); ?>cm; /* بادنج شمال */
			border:<?php echo e($Set->Line_Height); ?>px solid;  /* البوردر */
			font-size: <?php echo e($Set->Font_Size); ?>px;  /* حجم الخط */
			text-align: center;  /* العرض */
			overflow: hidden;  /* العرض */
		}
    
		.barcode{
			width: <?php echo e($Set->Barcode_Width); ?>cm;
			height: <?php echo e($Set->Barcode_Height); ?>cm;
		}
		.logo{
			width: <?php echo e($Set->Width_Logo); ?>cm;
			height:  <?php echo e($Set->Height_Logo); ?>cm;
		}
		.page-break {
			clear: left;
			display:block;
			page-break-after:always;
		}

	</style>    
<?php else: ?>
<!-- Free Landscape -->
<style type="text/css">

    @media  print{
        body {
     font: 700 16px Arial, Sans-Serif;
} 
    }
		body {
			margin-top: 0.1in;
		}
		.page {
			width: 5cm;
			height: auto;
			margin-top: 0.25cm;
			margin: auto;
		}
    .label {
			width: <?php echo e($Set->Width); ?>cm; /* العرض */
			height: <?php echo e($Set->Height); ?>cm; /* الطول */
			margin-top: <?php echo e($Set->Margin_T); ?>cm;  /* هامش أعلى */
			margin-bottom: <?php echo e($Set->Margin_B); ?>cm; /* هامش أسفل */
			margin-right: <?php echo e($Set->Margin_R); ?>cm;  /* هامش يمين */
			margin-left: <?php echo e($Set->Margin_L); ?>cm; /* هامش شمال */
			padding-top: <?php echo e($Set->Padding_T); ?>cm; /* بادنج شمال */
			padding-bottom: <?php echo e($Set->Padding_B); ?>cm; /* بادنج شمال */
			padding-right: <?php echo e($Set->Padding_R); ?>cm; /* بادنج شمال */
			padding-left: <?php echo e($Set->Padding_L); ?>cm; /* بادنج شمال */
			border:<?php echo e($Set->Line_Height); ?>px solid;  /* البوردر */
			font-size: <?php echo e($Set->Font_Size); ?>px;  /* حجم الخط */
			text-align: center;  /* العرض */
			overflow: hidden;  /* العرض */
		}
    
		.barcode{
			width: <?php echo e($Set->Barcode_Width); ?>cm;
			height: <?php echo e($Set->Barcode_Height); ?>cm;
		}
		.logo{
			width: <?php echo e($Set->Width_Logo); ?>cm;
			height:  <?php echo e($Set->Height_Logo); ?>cm;
		}
		.page-break {
			clear: left;
			display:block;
			page-break-after:always;
		}
		
	
	
	</style>    
<?php endif; ?>   
<?php endif; ?>
    <style>
        @media  print{
             .btn-print ,.btn-back{
       display: none;
   }
        }
    </style>
</head>
<body>

 <div class="page" id="page">
                          
                        <?php $__currentLoopData = $Pros; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pro): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>  
                     <?php for($i=0 ; $i < $pro->Qty ; $i++): ?>          
	<div class="label">
		           <?php if($Show->Logo == 1): ?>    
                <?php if(!empty($Def->Logo)): ?>         
        <img class="logo" src="<?php echo e(URL::to($Def->Logo)); ?>"> 
                    <?php else: ?>  
    <img class="logo" src="<?php echo e(asset('Admin/img/weblogo.png')); ?>">
                      <?php endif; ?> 
                        <?php endif; ?> 
        
               <?php if(!empty($pro->Product()->first()->Brand)): ?>  
		<div>

            
 <?php echo e(app()->getLocale() == 'ar' ?$pro->Product()->first()->Brand()->first()->Name :$pro->Product()->first()->Brand()->first()->NameEn); ?>            
            
        </div> 
            <?php endif; ?>  
        
        
            <?php if($Show->Company_Name == 1): ?>  
		<div>
            <?php if(!empty($Def->Name)): ?>
           
            
             <?php echo e(app()->getLocale() == 'ar' ?$Def->Name :$Def->NameEn); ?>

                      <?php else: ?>
                       <?php echo e(trans('admin.Klar')); ?>

                      <?php endif; ?>    
        </div> 
            <?php endif; ?>  
            <?php if($Show->Product_Name == 1): ?>   
		<span>       
       
         <?php echo e(app()->getLocale() == 'ar' ?$pro->Product()->first()->P_Ar_Name :$pro->Product()->first()->P_En_Name); ?>      
                           <?php if(!empty($pro->V1)): ?>    
                           ( <?php echo e(app()->getLocale() == 'ar' ?$pro->V1()->first()->Name :$pro->V1()->first()->NameEn); ?> )
                           <?php endif; ?> 
                           <?php if(!empty($pro->V2)): ?>    
                           ( <?php echo e(app()->getLocale() == 'ar' ?$pro->V2()->first()->Name :$pro->V2()->first()->NameEn); ?> )
                           <?php endif; ?>   
        </span>
            <?php endif; ?>
        
          <?php if($Show->Group == 1): ?>
		<span> <?php echo e(app()->getLocale() == 'ar' ?$pro->Product()->first()->Group()->first()->Name :$pro->Product()->first()->Group()->first()->NameEn); ?>  </span>
        <?php endif; ?>
        
        <?php if($Show->Product_Price == 1 or $Show->Unit == 1): ?> 
		<div>
     <?php if($Show->Product_Price == 1): ?>     
        <?php  $Prooos=ProductUnits::where('Product',$pro->Product)->where('Unit',$pro->Unit)->first(); ?>    
             <?php echo e($Prooos->Price); ?>   <?php if($Show->Coin == 1): ?> <?php echo e($DefStore->Coin()->first()->Symbol); ?> <?php endif; ?>
             <?php endif; ?>  
            
             <?php if($Show->Unit == 1): ?>
            <span>
 <?php echo e(app()->getLocale() == 'ar' ?$pro->Unit()->first()->Name :$pro->Unit()->first()->NameEn); ?>             
            </span>
        <?php endif; ?>
        </div>
        <?php endif; ?>
        
             <?php
                        $x=$pro->Code;
                        $y=DNS1D::getBarcodePNG($x, 'C39');                                       
                        ?>      
        
		   <img src="data:image/png;base64,<?php echo e($y); ?>" alt="" class="barcode"> <br>
         <?php if($Show->Code == 1): ?>  
		<span style="position: absolute;text-align: center" ><?php echo e($pro->Code); ?> </span>
        <?php endif; ?>
	</div>
                          
           <?php endfor; ?>
                     <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                      
</div>
<button class="btn btn-print" onclick="window.print()"> <?php echo e(trans('admin.Print')); ?></button>
<a href="<?php echo e(url('/')); ?> " class="btn-back" > <?php echo e(trans('admin.Back')); ?></a>
</body>
</html>    
    <?php /**PATH /home/klarapps/public_html/star2.klarapps.com/resources/views/admin/Stores/UpdateBarcode.blade.php ENDPATH**/ ?>