





<?php $__env->startSection('content'); ?>


<style>



</style>

<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">
                            My Bookings
                        </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="align-middle">#</th>
                                        <th class="align-middle">Invoice #</th>
                                        <th class="align-middle pr-7">Show Date</th>
                                        <th class="align-middle">Amount</th>
                                        <th class="align-middle">Status</th>
                                        <th class="no-sort"></th>
                                    </tr>
                                </thead>

                               
                                    <?php 
                                    $i=0; 

                                    ?>
                                    <?php $__currentLoopData = $invoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php 
                                        $i++; 
                                        $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;
                                        $invoicemd5=md5($invoice->id);
                                    ?>
                                    <tr class="btn-reveal-trigger">
                                        <td class="py-2"><?php echo e($i); ?></td><td class="py-2"><?php echo e($invoice_number); ?><br><small><?php echo e(date('d-m-Y', strtotime($invoice_date))); ?></small></td><td class="py-2"><?php echo e(date('d-m-Y', strtotime($invoice->show_date))); ?></td><td class="py-2"><i class='fa fa-rupee'></i>&nbsp;<?php echo e($invoice->amount); ?></td>
                                        <?php if($invoice->status==0): ?>
                                            <td><span class="badge light badge-warning">Pending</span></td>
                                        <?php elseif($invoice->status==1): ?>
                                            <td><span class="badge light badge-success">Paid</span></td>
                                        <?php else: ?>
                                            <td><span class="badge light badge-warning">Cancelled</span></td>
                                        <?php endif; ?>
                                        <td class="py-2 text-right">
                                            <?php if($invoice->status==1): ?>
                                            <div class="dropdown text-sans-serif"><button class="btn btn-primary tp-btn-light sharp" type="button" id="order-dropdown-0" data-toggle="dropdown" data-boundary="viewport" aria-haspopup="true" aria-expanded="false"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18px" height="18px" viewBox="0 0 24 24" version="1.1"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><rect x="0" y="0" width="24" height="24"></rect><circle fill="#000000" cx="5" cy="12" r="2"></circle><circle fill="#000000" cx="12" cy="12" r="2"></circle><circle fill="#000000" cx="19" cy="12" r="2"></circle></g></svg></span></button>
                                                <div class="dropdown-menu dropdown-menu-right border py-0" aria-labelledby="order-dropdown-0">
                                                    <div class="py-2"><a class="dropdown-item" href="<?php echo url('/user/invoice/');; ?>/<?php echo e($invoice->id); ?>/<?php echo e($invoicemd5); ?>" >Get Ticket</a>
                                                        
                                                        <a class="dropdown-item" href="<?php echo url('/user/cancel-landing/');; ?>/<?php echo e($invoice->id); ?>/<?php echo e($invoicemd5); ?>" >Cancel Ticket</a>
                                                       
                                                    </div>
                                                     
                                                </div>
                                            </div>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                    
                                   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </table>
                            </div>
                        </div>
                       
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>






<script>
function cancelticket(invoice_id)
{
    //alert(invoice_id);
    //return;
    var csrf = "<?php echo e(csrf_token()); ?>";
    $.ajax({
      type: "POST",
      url: "<?php echo e(url('user/cancel-ticket')); ?>",
      dataType : 'json',
      data: {_token: csrf, invoice_id: invoice_id},
      success: function( result ) {
        if(result.statusCode == 200){

            }
        }
    });
}
</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/ksstmorg/resources/views/tickets/my_bookings.blade.php ENDPATH**/ ?>