<table align="center" style="border-spacing: {{$barcode_details->col_distance * 1}}in {{$barcode_details->row_distance * 1}}in; overflow: hidden !important;">
@foreach($page_products as $page_product)

	@if($loop->index % $barcode_details->stickers_in_one_row == 0)
		<!-- create a new row -->
		<tr>
		<!-- <columns column-count="{{$barcode_details->stickers_in_one_row}}" column-gap="{{$barcode_details->col_distance*1}}"> -->
	@endif
		<td align="left" valign="center">
		    
			<div style="overflow: hidden !important;display: flex; flex-wrap: wrap;align-content: center;min-width: 22mm !important; max-height:25mm !important;justify-content: left;padding-left:10px; ">
				<b style="font-weight:bold;writing-mode: vertical-lr;font-size:10px;font-weight:900;text-align:center;">
				    
				    <?php $page_product->last_purchased_price=str_replace(",","",$page_product->last_purchased_price);
				    
				    
				//  $page_product->last_purchased_price=935;

    $array  = array_map('intval', str_split((int)$page_product->last_purchased_price));
    
    $s=1;
    
    /*$cs=count($array);
    $cs=$cs-1;*/
    $cs=1;
    foreach($array as $a){
        //echo $a;
        
        if($s==$cs){ //echo "".rand(10,100)."";
        }
        
        $s++;
    }
    /*if(count($array)>0){
        $temp='';$digits=2;
        for ($i = 0; $i < $digits; $i++) {
            $temp .= rand(0, 9);
        }
        echo "<u>".$temp."</u>";
    }*/
    
   
				    
			//	print_r($page_product);    
				    ?>
				    <!--{{(int)$page_product->last_purchased_price}}--></b>
				    
				    
				    <?php $rd='0';
				    if($barcode_details->stickers_in_one_row==2){
				        $rd=45;
				    }else{
				        $rd=35;
				    }
				    ?>

				<div style="width:<?=$rd?>mm;">

					{{-- Business Name --}}
					<!-- @if(!empty($print['business_name']))
						<b style="padding-top:7px  !important;display: block !important;font-weight:700; font-size: 11px">{{strtoupper($business_name)}}</b>
					@endif -->
                   

					{{-- Product Name --}}
					@if(!empty($print['name']))
						<span style="display: block !important; font-size: 9px;text-align:left;font-weight:900;">
						
						<?php 
						$li=30;
						
						if($barcode_details->stickers_in_one_row==2){
						    $li=20;
						}
						
						if(strlen($page_product->product_actual_name)<$li){
						    echo $page_product->product_actual_name;
						}else{
						    echo substr($page_product->product_actual_name, 0, $li);
						}
						
						?>
						
						
						
					@if(!empty($page_product['product_custom_field3']))		&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-weight:bold;;font-size:8px;font-weight:900;">D: {{$page_product['product_custom_field3']}}</b> @endif

							@if(!empty($print['lot_number']) && !empty($page_product->lot_number))
								<span style="font-size: {{12*$factor}}px">
									 ({{$page_product->lot_number}})
								</span>
							@endif
						</span>
					@endif

					

					{{-- Price --}}
					@if(!empty($print['price']))
					
					
				<!--	<span style="font-size: {{$print['price_size']}}px;">
						<b>
						@if($print['price_type'] == 'inclusive')
							{{session('currency')['symbol'] ?? ''}}
							
							
						<?php 	$price=str_replace(",","",$page_product->sell_price_inc_tax); 
						$prices=0;
						if(isset($page_product->product_custom_field1) && $page_product->product_custom_field1!=0){
           $prices =($price*$page_product->product_custom_field1)/100;
        }    	
						?>
						{{@num_format($price-$prices)}}
						@else
							{{session('currency')['symbol'] ?? ''}}
							
						<?php	$price=str_replace(",","",$page_product->default_sell_price);
						$prices=0;
        if(isset($page_product->product_custom_field1) && $page_product->product_custom_field1!=0){
           $prices =($price*$page_product->product_custom_field1)/100;
        }
        
        
        
						?>
						{{@num_format($price-$prices)}}
						@endif</b>
					</span>-->
					@endif
					@if(!empty($print['exp_date']) && !empty($page_product->exp_date))
						<br>
						<span style="font-size: {{$print['exp_date_size']}}px;font-weight:900;">
							<b>@lang('product.exp_date'):</b>
							{{$page_product->exp_date}}
						</span>
						@if($barcode_details->is_continuous)
						<br>
						@endif
					@endif

					@if(!empty($print['packing_date']) && !empty($page_product->packing_date))
						<span style="font-size: {{$print['packing_date_size']}}px">
							<b>@lang('lang_v1.packing_date'):</b>
							{{$page_product->packing_date}}
						</span>
					@endif

					{{-- Barcode --}}
					<img style="font-weight:900;max-width:70% !important;height: {{$barcode_details->height*0.24}}in !important; display: block;" src="data:image/png;base64,{{DNS1D::getBarcodePNG($page_product->sub_sku, $page_product->barcode_type, 3,30, array(0, 0, 0), false)}}">
					<span style="font-size: 8px !important;font-weight:900;">
						{{$page_product->sub_sku}}
					</span>
			<br><span style="font-size: 14px;font-weight:900;"><!--{{$print['price_size']}}-->
						<!--@lang('lang_v1.price'):-->
						<b>	
						<?php 
						if($page_product->weight=='fixed'){
            $prices=$page_product->product_custom_field1;
        }
						?>


<?php //print_r($page_product);?>
						
						@if($print['price_type'] == 'inclusive')
						    <!--{{session('currency')['symbol'] ?? ''}}-->
						    @if($page_product->sell_price_inc_tax!=($price-$prices))
						    <b style="font-size:14px;">MRP.{{@number_format($page_product->sell_price_inc_tax,0)}}</b><br>
						    @endif
						    
						    
						   <span style="font-size:14px;"> 

						   
						@if($page_product->sell_price_inc_tax!=($price-$prices))   Price. @else MRP. @endif
						   
						   
						   {{number_format(($price-$prices),0)}}</span>
						@else
							<!--{{session('currency')['symbol'] ?? ''}}-->MRP.{{@num_format($page_product->default_sell_price)}}
						@endif</b>
					</span>
					
				</div>
				<b style="font-weight:bold;writing-mode: vertical-rl;font-size:12px;">
				    {{-- Variation --}}
					@if(!empty($print['variations']) && $page_product->is_dummy != 1)
						<span style="display: block !important; font-size: {{$print['variations_size']}}px">
							<!--{{$page_product->product_variation_name}}:<b>{{$page_product->variation_name}}</b>-->
						</span>
					@endif
				    </b>
				    @if(!empty($page_product['product_custom_field2']))
	                    <b style="font-weight:bold;font-size:8px;font-weight:900;writing-mode: vertical-lr;text-align:center;">Size : {{$page_product['product_custom_field2']}}</b>
                    @endif
			</div>
<div>
    
</div>
	    
		
		
		</td>
	@if($loop->iteration % $barcode_details->stickers_in_one_row == 0)
		</tr>
	@endif
@endforeach
</table>

<style type="text/css">
body{
    margin:0px !important;
    font-family: sans-serif !important;
}
	td{
	/*border: 1px dotted lightgray;*/
	}
	@media print{
		
		table{
			page-break-after: always;
		}

		
		@page {
		/*size: {{$paper_width}}in {{$paper_height}}in;*/
	size: {{$paper_width}}in 20mm;
		margin-top: {{$margin_top}}in !important;
		margin-bottom: {{$margin_top}}in !important;
		margin-left: 3mm !important;
		margin-right: 3mm !important;
	}
	}
</style>