<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <link rel="stylesheet" href="<?php echo e(asset('vendor/bootstrap/dist/css/bootstrap.min.css')); ?>">
        <style type="text/css">
            @import  url("https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800");
            @import  url("https://fonts.googleapis.com/css?family=Open+Sans:400,600,700");
            @import  url("https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700");
            @import  url("https://fonts.googleapis.com/css?family=Roboto:400,500,700");
            @import  url("https://fonts.googleapis.com/css?family=Nunito:400,600,700");
        </style>
    </head>
    <body>
        <?php
            $ticket_date_crt = date("d-M-Y", strtotime($ticket_date));
        ?>
        <span style="text-align: center;"><u><b><?php echo e($org_name); ?></b></u><br></span>
        <span style="text-align: center;"><u><b>DETAILED FACILITY REPORT FOR THE SHOW DATE <?php echo e($ticket_date_crt); ?></b></u><br></span>
        <table width="100%" style="font-size: 70%;" class="table" border="1">
            <thead class="thead-info">
                <tr>
                    <th>Sl No</th>
                    <th>Date</th>
                    <th>Organisation Name</th>
                    <th>Facility Name</th>
                    <th>Ticket Number</th>
                    <th># of Adults</th>
                    <th># of Children</th>
                    <th>Amount</th>
                    <th>Mode of Payment</th>
                </tr>
            </thead>
            <tbody>
                <?php
                    $n = 0;
                    $invoice_date= "";
                    $invoice_month="";
                    $invoice_year = "";
                    $invoice_no = "";
                    $org_code ="";
                    $nextyear ="";
                    $invoice_number ="";
                    $ticket_number ="";
                    $payment_method = "";
                    $total_adult_count = 0;
                    $total_child_count = 0;
                    $total_amount = 0;
                ?>
                <?php $__currentLoopData = $detailed_report_arr[$ticket_date]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tickets): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $invoice_date = $tickets->invoice->invoice_date;
                        $invoice_month = date('m',strtotime($invoice_date));
                        $invoice_year = date('Y',strtotime($invoice_date));
                        $invoice_no = $tickets->invoice->invoice_no;
                        $org_code = $tickets->invoice->organisation->short_code;
                        if($invoice_month<4)
                            $invoice_year--;
                        $nextyear = $invoice_year+1;

                        $invoice_number = $org_code.'/'.$invoice_no.'/'.$invoice_year.'-'.$nextyear;

                        $ticket_number = $org_code.'/'.$tickets->facility->short_code.'/'.$tickets->ticket_no.'/'.$invoice_year.'-'.$nextyear;
                        $ticket_no = $ticket_number;
                        $adult_count = $tickets->noof_adult;
                        $child_count = $tickets->noof_child;
                        $totalamount = $tickets->amount;
                        if($tickets->invoice->payment_method)
                        {
                            $payment_method = $tickets->invoice->paymentmethod->method;
                        }       
                        if($ticket_no!="")
                        {
                            $n++;
                            ?>
                            <tr>
                                <td><?php echo e($n); ?></td>
                                <td><?php echo e(date("d-M-Y", strtotime($ticket_date))); ?></td>
                                <td><?php echo e($tickets->facility->organisation->organisation_name); ?></td>
                                <td><?php echo e($tickets->facility->facility_name); ?></td>
                                <td style="text-align: center;"><?php echo e($ticket_number); ?></td>
                                <td style="text-align: center;">
                                    <?php echo e($tickets->noof_adult); ?>

                                    <?php
                                        $total_adult_count += $tickets->noof_adult;
                                    ?>
                                </td>
                                <td style="text-align: center;">
                                    <?php echo e($tickets->noof_child); ?>

                                    <?php
                                        $total_child_count += $tickets->noof_child;
                                    ?>
                                </td>
                                <td style="text-align: center;"><i class='fa fa-rupee'></i>
                                    <?php echo e($tickets->amount); ?>

                                    <?php
                                        $total_amount += $tickets->amount;
                                    ?>
                                </td>
                                <td style="text-align: center;"><?php echo e($payment_method); ?></td>
                            </tr>
                            <?php
                        }
                    ?>                
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
            <tfoot class="tfoot-info">
                <tr>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th align="right"><?php echo e($total_adult_count); ?></th>
                    <th align="right"><?php echo e($total_child_count); ?></th>
                    <th align="right"><?php echo e($total_amount); ?></th>
                    <th>&nbsp;</th>
                </tr>
            </tfoot>
        </table>
    </body>
</html><?php /**PATH /var/www/html/ksstmprod/resources/views/Reports/download_detailed_report_pdf.blade.php ENDPATH**/ ?>