





<?php $__env->startSection('content'); ?>


<style>



</style>
<?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;

    if($invoice->status==1)
        $invoice_status = 'Paid';
    else if($invoice->status==0)
        $invoice_status = 'Pending';
    else
        $invoice_status = 'Cancelled';

    //get adults and child count from tickets
    foreach($invoice->tickets as $ticket)
    {
        $adultCount = $ticket->noof_adult;
        $childCount = $ticket->noof_child;
    }

    $totalCount = $adultCount+$childCount;

    $secretkey='KSSTM'.$invoice_number.$invoice_date;
    $secretmd5 = md5($secretkey);

    $qr_string=$invoice_number.'~'.$invoice_date.'~'.'Adult:'.$adultCount.'~'.'Child:'.$childCount.'~'.$invoice_status.'~'.'Secret:'.$secretmd5;

?>
<form action="<?php echo url('/user/cancel-ticket'); ?>" method="post">
    <input type="hidden" name="invoice_id" id="invoice_id" value="<?php echo e($invoice->id); ?>">
    <?php echo e(csrf_field()); ?>

<div class="container-fluid">
    <div class="row" id="checkoutdiv">
        <div class="col-xl-12">
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header">
                           Cancel Ticket<span><a href="<?php echo url('/policy_cancel'); ?>" style="color: blue;" target="_blank"><u>Cancellation Policy</u></a></span>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-sm table-responsive-lg mb-0" style="font-size:90%">
                                    <thead>
                                        <tr>
                                            <th class="center">#</th>
                                            <th>Ticket#</th>
                                            <th>Facility</th>
                                            <th class="right">Show Time</th>
                                            <th class="right">Ticket Amount</th>
                                            <th class="right">Refund Amount</th>
                                        </tr>
                                    </thead>

                               
                                    <?php 
                                    $i=0; 
                                    $totalrefund = 0;
                                    ?>
                                    <?php $__currentLoopData = $invoice->tickets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ticket): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php $i++; ?>
                                    <tr>
                                        <td class="center"><?php echo e($i); ?></td>
                                        <td class="left strong"><?php echo e($org_code); ?>/<?php echo e($ticket->facility->short_code); ?>/<?php echo e($ticket->ticket_no); ?>/<?php echo e($invoice_year); ?>-<?php echo e($nextyear); ?></td>
                                        <td class="left"><?php echo e($ticket->facility->facility_name); ?></td>
                                        <td class="right"><?php echo e($ticket->showtime->from_time); ?>&nbsp;-&nbsp;<?php echo e($ticket->showtime->to_time); ?></td>
                                        <td class="right"><i class='fa fa-rupee'></i>&nbsp;<?php echo e($ticket->amount); ?></td>

                                        <td class="right"><i class='fa fa-rupee'></i>&nbsp;<?php echo e($refundticket[$ticket->id]); ?></td>
                                    </tr>
                                    <?php $totalrefund += $refundticket[$ticket->id]; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                    <tfoot>
                                        <tr><td colspan="6"><strong><h4>Total Refund Amount:<i class='fa fa-rupee'></i>&nbsp;<?php echo e($totalrefund); ?></h4></strong></td></tr>

                                        <tr><td colspan="6" align="right"><button class="btn btn-primary btn-xs" type="submit">Confirm Cancellation</button></td></tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                       
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</form>





<script>

</script>

<?php $__env->stopSection(); ?>			
<?php echo $__env->make('layout.public', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/ksstmprod/resources/views/tickets/cancel_landing.blade.php ENDPATH**/ ?>