<!DOCTYPE html>
<html style="height:100%;">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><?php echo e(config('dz.name')); ?> | <?php echo $__env->yieldContent('title', $page_title ?? ''); ?></title>
<meta name="description" content="<?php echo $__env->yieldContent('page_description', $page_description ?? ''); ?>"/>
<!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="<?php echo e(asset('images/favicon.png')); ?>">

<head>
    <title>KSSTM Ticket</title>
</head>

<style type="text/css">
    body{
        font-family: 'Calibri', sans-serif;

    }
    .m-0{
        margin: 0px;
    }
    .p-0{
        padding: 0px;
    }
    .pt-5{
        padding-top:5px;
    }
    .mt-10{
        margin-top:5px;
    }
    .text-center{
        text-align:center !important;
    }
    .w-100{
        width: 100%;
    }
    .w-90{
        width: 90%;
    }
    .w-95{
        width: 95%;
    }
    .w-50{
        width:50%;   
    }
    .w-25{
        width:25%;   
    }
    .w-75{
        width:75%;   
    }
    .w-85{
        width:85%;   
    }
    .w-80{
        width:80%;   
    }
    .w-20{
        width:20%;   
    }
    .w-15{
        width:15%;   
    }
    .logo img{
        width:45px;
        height:45px;
        padding-top:30px;
    }
    .logo span{
        margin-left:8px;
        top:19px;
        position: absolute;
        font-weight: bold;
        font-size:25px;
    }
    .gray-color{
        color:#5D5D5D;
    }
    .text-bold{
        font-weight: bold;
    }
    .border{
        border:1px solid black;
    }
    table tr,th,td{
        border-collapse:collapse;
        padding:7px 8px;
    }
    table tr th{
        background: #F4F4F4;
        font-size:12px;
    }
    table tr td{
        font-size:11px;
    }
    table{
        border-collapse:collapse;
    }
    .box-text p{
        line-height:10px;
    }
    .float-left{
        float:left;
    }
    .total-part{
        font-size:22px;
        line-height:12px;
    }
    .total-right p{
        padding-right:20px;
    }
</style>
<style>
    p+p {
        page-break-before: always;
    }
    td { padding: 10 10 10 10 !important; }


    hr {
      border-top: solid 1px #000 !important;
    }
    body {
        background-color: white;
        color: black;
    }
    @media  print {
        html, body {
            height: auto;    
        }
    }
    .show {
        display: block;
      }

      .hide {
        display: none;
      }
</style>
<link href="<?php echo e(asset('css/style.css')); ?>" rel="stylesheet">
<script src="<?php echo e(asset('js/plugins-init/jquery.min.js')); ?>" type="text/javascript"></script>
<body>
    <div class="card card-body">
        <div class="card-header" style="background-color: #c7addf;">
            <div class="col-12" style="text-align: center;">
                <a href="#" class="brand-logo">
                    <img class="logo-abbr" width="80" src="<?php echo e(asset('images/logo_ksstm.png')); ?>" alt="">
                </a>
            
                <label style="text-align: left;"><b><h2>KSSTM TICKETING APPLICATION :: SELF SERVICE KIOSK</h2></b></label>
            </div>
        </div>        
        <div class="content-body" style="margin-left: 5rem !important; text-align: center;">
            <?php   
            $timenowplus5min = strtotime($timenow." +5minutes");
            ?>
            <script>
                var timenow_str = <?php echo e($timenowplus5min); ?>;
            </script>

            <div class="container-fluid">
                <div class="row">
                    <div class="col-xl-12">
                        <div class="card">
                            <div class="card-body">
                              <div class="table-responsive">
                                <table class="table table-lg table-responsive-lg">
                                    <thead>
                                        <tr>
                                            <th class="align-middle" style="height: 50px; font-size: 36px !important;">#</th>
                                            <th class="align-middle" style=" font-size: 36px !important;">Invoice #</th>
                                            <th class="align-middle pr-7" style="text-align: center; font-size: 36px !important;">Show Date</th>
                                            <th style=" font-size: 36px !important;">Amount</th>
                                            <th class="align-middle" style="text-align: center; font-size: 36px !important;"></th>
                                        </tr>
                                    </thead>
                                    <?php 
                                      $n=0;
                                    ?>
                                    <?php if(isset($invoices)): ?>
                                      <?php $__currentLoopData = $invoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php  
                                          $n++;                            
                                          $invoice_id = $invoice->id;
                                          $invoicemd5=md5($invoice_id);
                                        ?>
                                        <tr class="btn-reveal-trigger">
                                            <td class="py-2" style="height: 50px; font-size: 36px !important;"><?php echo e($n); ?></td>
                                            <td class="py-2" style=" font-size: 36px !important;">
                                                <?php
                                                    $invoice_date = $invoice->invoice_date;
                                                    $invoice_month = date('m',strtotime($invoice_date));
                                                    $invoice_year = date('Y',strtotime($invoice_date));
                                                    $invoice_no = $invoice->invoice_no;
                                                    $org_code = $invoice->organisation->short_code;
                                                    if($invoice_month<4)
                                                        $invoice_year--;
                                                    $nextyear = $invoice_year+1;
                                                    $invoice_number = $org_code.'/'.$invoice_no.'/'.$invoice_year.'-'.$nextyear;
                                                ?>
                                                <?php echo e($invoice_number); ?>

                                            </td>
                                            <td class="py-2" style="text-align: center; font-size: 36px !important;">
                                              <?php if(isset($invoice->show_date)): ?>
                                                <?php echo e(date("d-M-Y", strtotime($invoice->show_date))); ?>

                                              <?php endif; ?>
                                            </td>
                                            <td style="text-align: center; font-size: 36px !important;"><i class='fa fa-rupee'></i><?php echo e($invoice->amount); ?></td>
                                            <td class="py-2" style="text-align: center; font-size: 36px !important;">
                                                <?php if($invoice->verify_status==1): ?>
                                                    <?php  echo "Already taken print out."; ?>
                                                <?php else: ?>
                                                    <a href="<?php echo e(URL::to('/print_tickets_general')); ?>/<?php echo e($invoice_id); ?>/<?php echo e($invoicemd5); ?>" target="_blank"><i class='fa fa-print'></i></a>
                                                <?php endif; ?>
                                            </td>
                                        </tr>
                                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>
                                </table>
                              </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        ///////time checking //////////////////////////////////////////////
        window.onload = function() 
        {
            var interval = setInterval(() => 
            {
                //console.log(new Date().toLocaleTimeString()); 
                const d = new Date();
                let time = Math.floor(d.getTime()/1000);
                //console.log(time);
                console.log(timenow_str);
                if(time>=timenow_str)
                {
                    if (navigator.userAgent.indexOf("Firefox") > 0) {
                        window.location = "<?php echo e(URL::to('getTicket_general')); ?>";
                    }
                    window.location.href = "<?php echo e(URL::to('getTicket_general')); ?>";
                }
            }, 1000);

        }
    </script>
</body>
</html>         <?php /**PATH /var/www/html/ksstmprod/resources/views/getTickets.blade.php ENDPATH**/ ?>