<?php 
include('authentication.php');
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <style>
            * {
    font-size: 12px;
    font-family: 'Times New Roman';
}

td,
th,
tr,
table {
    border-top: 1px solid black;
    border-collapse: collapse;
    width:350px;
     max-width: 350px;
}

td.description,
th.description {
    width: 200px;
    max-width: 200px;
}

td.quantity,
th.quantity {
    width: 200px;
    max-width: 200px;
    word-break: break-all;
}

td.price,
th.price {
    width: 200px;
    max-width: 200px;
    word-break: break-all;
}

.centeblack {
    text-align: center;
    align-content: center;
}

.ticket {
    width: 400px;
    max-width: 400px;
     padding-left: 40px;
     padding-right: 40px;
     padding-top: 105px;
}
.as{
    margin-top:10px;
}
span{
    font-size: 22px;
    font-weight: bold;
}

ss{
      font-size: 20px;
    font-weight: bold;
}




img {
}

th{
    border:1px;
    solid: black;
}

.center {
          display: block;
          margin-left: auto;
          margin-right: auto;
          width: 50%;
        }

@media print {
    .hidden-print,
    .hidden-print * {
        display: none !important;
    }
   
}

        </style>
        <title></title>
    </head>
    <body>
        <?php
        $seesion_ids = $_SESSION['seesion_ids'];
        foreach($seesion_ids as $sa){
           ?>
           
            <?php
        $id = $sa;
      
        $ref = "MRPSticker/$id/";
                        $fetchdata = $database->getReference($ref)->getValue();
                        
                        $mattress_pricing = $fetchdata['mattress_pricing'];
                    
         $ref = "MattressPricing/$mattress_pricing/";
                        $mattress_pricingdata = $database->getReference($ref)->getValue();       
                        
                        $mattress = $mattress_pricingdata['mattress'];
                        
        $ref = "Mattress/$mattress/";
                        $mattress = $database->getReference($ref)->getValue();                       
       
        ?>
        <div class="ticket" >
            
           
            <span>Serial No. : <?=$fetchdata['serial_number']?> </span><br>
            <hr>
            <span>Product Name : <?=$mattress['name']?></span>
            <hr>
            <span>Product Code : <?=$mattress_pricingdata['size']?>*<?=$mattress_pricingdata['thickness']?></span>
            <hr>
            <span>Size (cm) : <?php 
            
            $s = explode("*",$mattress_pricingdata['size']);
            
            echo($s[0]*2.54);echo('*');echo($s[1]*2.54);echo('*');echo(number_format($mattress_pricingdata['thickness']/10,1));
            ?></span>
            <hr>
           
            <span>MRP (Rs): <?=$mattress_pricingdata['price']?> </span>
            <hr>
            <span>Warranty : <?=$mattress_pricingdata['warrenty']?> Years</span>
            <hr>
            <span>MFG.DT : <?=date('d/m/Y', $mattress_pricingdata['created_at']/1000);?> </span>
            <hr>
            <span class="center" style="margin-left:120px;">Scan QR Code</span>      
              <div>
            
           <img class="center" src="https://chart.googleapis.com/chart?cht=qr&chl=app.featherfresh.in/warrenty.php?serial_number=<?=$fetchdata['serial_number']?>&chs=120x120&chld=L|0" />
            </div>
            <hr>
            <span class="centeblack">MFG Address : Sham Foam Pvt Ltd. <br> Vill Rajpura , NH-34 Ambala 133104 Haryana</span>
            <hr>
            <span class="centeblack" >Email : support@featherfresh.in</span>
            
            
        </div>
           
           <?php
        }
        
        ?>
       
        <button id="btnPrint" class="hidden-print">Print</button>
        <script>
            const $btnPrint = document.querySelector("#btnPrint");
$btnPrint.addEventListener("click", () => {
    window.print();
});
        </script>
    </body>
</html>





