<html>
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>GT4</title>
        <style type="text/css">
          @media print {  
  @page {
    size: 100mm 200mm landscape; /* landscape */
    /* you can also specify margins here: */
    margin: 0mm;
    margin-right:0mm; /* for compatibility with both A4 and Letter */
  }
}
        </style>
    </head>
    <!--script src="../views/default/assets/js/jquery.js"></script-->


    {literal}
    <script>
        function printBillByBill() {
            var noOfBills = document.getElementById('noOfBills').value;
            for ($i = 1; $i <= noOfBills; $i++)
            {
                if ($i == noOfBills)
                {
                    setTimeout(function () {
                        var billnameid = document.getElementById('billnameid').value;
                        window.location = 'sellbillController.php?do=addsellBill&billnameid=' + billnameid;
                    }, 10);
                }
                else
                {
                    printThisBil($i);
                }

            }

        }
        function printThisBil($i) {
            setTimeout(function () {
                printDiv('bill' + $i);
            }, 10);
        }
        function printDiv(el) {

            var restorepage = document.body.innerHTML;
            var printcontent = document.getElementById(el).innerHTML;
            document.body.innerHTML = printcontent;
            print_Custom('mycustomheader');
            document.body.innerHTML = restorepage;
        }
    </script>
    <style>
        .td td
        {
            border-right-widtd: 1px;
            border-bottom-widtd: 1px;
            border-left-widtd: 0px;
            border-top-style: none;
            border-right-style: dotted;
            border-bottom-style: solid;
            border-left-style: none;
            border-bottom-color: #999;
            font-size: 15px;
            border-right-color: #999;
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 11px;
        }
    </style>
    {/literal}


    <body onLoad="printBillByBill();">
        <input type="hidden" id='noOfBills' value="{$noOfBills}"/>
        <input type="hidden" id='billnameid' value="{$billnameid}"/>

        {for $foo=1 to {$noOfBills}}
        <div id='bill{$foo}'>{$bill{$foo}}</div>
        {/for}
    </body>