<?php $__env->startSection('styles'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('/admin/css/sweetalert.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagetitle'); ?>
	Events <small>overview</small>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('crumbs'); ?>
	<li class="active">
		<i class="fa fa-file-text-o"></i> Event List
	</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagecontents'); ?>

    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title pull-left"><i class="fa fa-th fa-fw"></i> Event Panel</h3>
                    <p class="pull-right">
                    	<a href="<?php echo e(url('admin/events/create')); ?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> Add An Event</a>
                    </p>
                    <div class="clearfix"></div>
                </div>
                <div class="panel-body products">
                    <?php if(sizeof($activeeventlist) == 0): ?>
                        <div class="alert alert-info">Event list is currently empty. </div>
                    <?php else: ?>
                        <!-- Nav tabs -->
                        <ul class="nav nav-tabs" role="tablist">
                            <li role="presentation" class="active"><a href="#active" aria-controls="active" role="tab" data-toggle="tab">Active</a></li>
                            <li role="presentation"><a href="#inactive" aria-controls="inactive" role="tab" data-toggle="tab">Inactive</a></li>
                        </ul>

                        <!-- Tab panes -->
                        <div class="tab-content">
                            <div role="tabpanel" class="tab-pane active" id="active">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-hover table-striped">
                                        <thead>
                                            <tr>
                                                <th>Event ID</th>
                                                <th>Barcode</th>
                                                <th>Image</th>
                                                <th>Event Name</th>
                                                <th>Date</th>
                                                <th>Amount</th>
                                                <th>Actions</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php foreach($activeeventlist as $key => $event): ?>
                                                <tr id="<?php echo e($event->id); ?>">
                                                    <td><?php echo e($event->event_id); ?></td>
                                                    <td><?php echo DNS1D::getBarcodeSVG($event->barcode, "PHARMA2T"); ?><br/>
                                                            <?php echo e($event->barcode); ?>

                                                    </td>
                                                    <td class="thumb"><img src="<?php echo e(asset('/uploads/events/md')); ?>/<?php echo e($event->image); ?>" alt=""></td>
                                                    <td><?php echo e($event->event_title); ?></td>
                                                    <td><?php echo e($event->event_date); ?></td>
                                                    <td class="text-right">&dollar;<?php echo e(money_format('%i', $event->price)); ?></td>
                                                    <td class="text-center">
                                                        <div class="btn-group">
                                                            <button class="btn btn-warning btn-sm activeTriggerBtn" 
                                                                data-intent="delete"
                                                                data-id="<?php echo e($event->id); ?>"
                                                                data-barcode="<?php echo e($event->barcode); ?>"
                                                                data-eventid="<?php echo e($event->event_id); ?>"
                                                                data-img="<?php echo e($event->image); ?>"
                                                                data-name="<?php echo e($event->event_title); ?>"
                                                                data-date="<?php echo e($event->event_date); ?>"
                                                                data-amount="<?php echo e($event->price); ?>"
                                                            ><i class="fa fa-trash"></i></button>
                                                            <a href="<?php echo e(url('/admin/events/')); ?>/<?php echo e($event->id); ?>/edit" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a>
                                                        </div>
                                                    </td>
                                            </tr>
                                            <?php endforeach; ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <!-- IN ACTIVE PRODUCTS -->
                            <div role="tabpanel" class="tab-pane" id="inactive">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-hover table-striped">
                                        <thead>
                                            <tr>
                                                <th>Event ID</th>
                                                <th>Barcode</th>
                                                <th>Image</th>
                                                <th>Event Name</th>
                                                <th>Event Date</th>
                                                <th>Amount</th>
                                                <th>Actions</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php foreach($inactiveeventlist as $key => $ia): ?>
                                                <tr id="<?php echo e($ia->id); ?>">
                                                    <td><?php echo e($ia->product_id); ?></td>
                                                    <td><?php echo DNS1D::getBarcodeSVG($event->barcode, "PHARMA2T"); ?><br/>
                                                            <?php echo e($event->barcode); ?>

                                                    </td>
                                                    <td class="thumb"><img src="<?php echo e(asset('/uploads/events/md')); ?>/<?php echo e($ia->image); ?>" alt=""></td>
                                                    <td><?php echo e($ia->event_title); ?></td>
                                                    <td><?php echo e($event->date); ?></td>
                                                    <td class="text-right">&dollar;<?php echo e(money_format('%i', $ia->price)); ?></td>
                                                    <td class="text-center">
                                                        <button class="btn btn-primary btn-sm activeTriggerBtn" 
                                                            data-intent="put" 
                                                            data-eventid="<?php echo e($ia->event_id); ?>"
                                                            data-img="<?php echo e($ia->image); ?>"
                                                            data-barcode="<?php echo e($ia->barcode); ?>"
                                                            data-name="<?php echo e($ia->event_title); ?>"
                                                            data-amount="<?php echo e($ia->price); ?>"
                                                            data-id="<?php echo e($ia->id); ?>"><i class="fa fa-undo"></i> Set to active</button>
                                                        
                                                    </td>
                                            </tr>
                                            <?php endforeach; ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <?php echo $activeeventlist->render(); ?>

                        </div>  
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>

    <form action=""><input name="token" type="hidden" value="<?php echo e(csrf_token()); ?>"></form>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script type="text/javascript" src="<?php echo e(asset('/admin/js/sweetalert.min.js')); ?>"></script>
    <script type="text/javascript" src="<?php echo e(asset('/admin/js/min/events-min.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.masters.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>