<table align="center" style="border-spacing: 0in 0in; overflow: hidden !important;" id="">

<?php
include "config/config.php";
if(isset($_GET['product_variant_id']) && $_GET['product_variant_id']){
    $product_variant_id = $_GET['product_variant_id'];
}else{
    $product_variant_id = 0;
}

$statements = $pdo->prepare("SELECT p.*,tbl_ids_purity.short_name,
tbl_products_name.product_hsn_code, tbl_wastage.percentage
FROM `tbl_product_variants` p 
LEFT JOIN tbl_ids_purity ON tbl_ids_purity.id=p.purity
LEFT JOIN tbl_products_name ON tbl_products_name.id=p.product_name
LEFT JOIN tbl_wastage ON tbl_wastage.id=p.wastage
WHERE p.id=?");
$statements->execute(array($product_variant_id));
$resultss = $statements->fetchAll(PDO::FETCH_ASSOC);
$totalDatas = $statements->rowCount();
        
        
if(isset($_GET['quantity']) && $_GET['quantity']){
    $product_quantity = $_GET['quantity'];
}else{
    $product_quantity = 0;
}
$per_row_count = 3;
$min_width_mm = 35;
$min_height_mm = 22;
$max_height_mm = 22;


$product_id = $product_variant_id; 

if(isset($product_id)){
    $i=1; 
    for($p=0;$p<count($product_id);$p++){
        
        
        $hsn_code = $resultss[0]['hsn_code'];
        $short_name = "(".$resultss[0]['short_name'].")";
        $product_org_hsn_code = $resultss[0]['product_hsn_code'];
        $wastage_percentage = $resultss[0]['percentage'];
        
        
        $cross_weight = $resultss[0]['cross_weight'];
        $net_weight = $resultss[0]['net_weight'];
        $stone_weight = $resultss[0]['stone_weight'];
        $stone_cost = $resultss[0]['stone_cost'];
        $wastage_cost = $resultss[0]['percentage'];
        
                     
        for($c=0;$c<$product_quantity[$p];$c++){
              
            
            if($i % $per_row_count == 1 || $i==1){ 
                echo '<tr>';
            }
?>


			<td align="">
			    
			    <table style="width: 100%; min-width: <?=$min_width_mm?>mm; min-height: <?=$min_height_mm?>mm; max-height: <?=$max_height_mm?>mm; ">
			        <tr>
			            
			            
			            
			            
			            <td style="width: 60%; ">
			                
			                
		<div style="">
                    
                    
                    <div>
						<span style="display: block !important; font-size:11px">
						    <b>
						        GW: <?=$cross_weight?></br>
						        NW: <?=$net_weight?></br>
						        SW: <?=$stone_weight?></br>
						        SC: <?=$stone_cost?></br>
						        VA: <?=$wastage_cost?> %</br>
    						
    						</b>
						</span>
	                    
				    </div>
				    
				    
        </div>
        
        
        
			            </td>
			            
			            
			            
			            
			            
			            
			            <td style="width: 40%; ">
			                
			                
			                <div style="">
                    
                    
                    <div>
				
						<span style="display: block !important; font-size:11px; transform: rotate(271deg);">
						    <b>
						        OM: <?=$cross_weight?>
    						</b>
						</span>
	                    
				    </div>
				    
				    
                </div>
                
                
			            </td>
			            
			            
			            
			            
			            
			        </tr>
			    </table>
			    
                
                
                
                
		    </td>
<?php 
    if($i % $per_row_count == 0){ 
        echo '</tr>';
    }
$i++;
} } } 
?>
</table>




<style type="text/css">

@media  print{
	    
	    
	    
	table{
		page-break-after: always;
	}
		
		
		
    body{
        margin: 0px !important;
        font-family: sans-serif !important;
    }



	@page  {
		size: 4in 22mm;
		margin-top: 0in !important;
		margin-bottom: 0in !important;
		margin-left: 0in !important;
		margin-right: 0in !important;
	}
	
	
	
}
</style>

<script>
    window.print();
</script>