<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

header('Content-Type: text/html');
header('Cache-Control: no-cache');

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
$username = $_SESSION["username_" . $dbname];
mysqli_select_db($conn, $zdb);
include("includes/linkshead.php");
?>
<style>
    table{
        width:100%;
    }
    .itembd{
        border-top: 0px;
        border-right: 1px;
        border-left: 1px;
        border-bottom: 1px;
        border-width: 1px;
        border-style:solid;
        border-color: black;
    }
    .bold{
        font-weight: bold;
    }
    .thicker {
        font-weight: 900;
    }
    .f14 {
        font-size: 12px;
    }
    .f15 {
        font-size: 15px;
    }
    .f17 {
        font-size: 17px;
    }
    .f19 {
        font-size: 19px;
    }
    table td {
        font-size: 11px;
    }
    .lpadd{
        padding-left:5px;   
    }
    .rpadd{
        padding-right:5px;   
    }


    @media print
    {    
        .noprint
        {
            display: none !important;
        }
    }
    .subpage {
        width: 80mm;
        min-height: auto;
        padding: 1mm;
        background-color: white;
    }

    body{
        font-family: 'Sans-serif', Arial Verdana;
    }
    .black{
        color:black;
    }
</style>
</head>
<body onload="">
    <!-- Default box -->
    <div id="result">
    </div>
    <script>
        if (typeof (EventSource) !== "undefined") {
            var source = new EventSource("printsentkot.php");
            source.onmessage = function (event) {
                document.getElementById("result").innerHTML = event.data + "<br>";
//                document.getElementById("result1").innerHTML += event.time + "<br>";
                if (event.data.length > 10) {
                    window.print();
                }
            };
        } else {
            document.getElementById("result").innerHTML = "Sorry, your browser does not support server-sent events...";
        }

    </script></body>
</html>