<?php $__env->startSection('title', 'Admin Panel'); ?>


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

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

    <div class="page-content">
        <section id="category-one">

            <div class="category-one">
                <div class="container">
                    <div class="row">
                        <div class="col-md-9 col-sm-12">
                            <div class="table-section">
                                <h3 class="title clearfix">All <span>Questions</span>
                                    <a href="<?php echo e(url('/new/ticket')); ?>" class="pull-right">Add new</a>
                                </h3>
                                <div class="table-responsive">
                                    <table class="table table-lead ticket-table">
                                        <thead>
                                        <tr>
                                            <th class="heading">Token #</th>
                                            <th class="heading">Title</th>
                                            <th class="heading">Department</th>
                                            <th class="heading">Date</th>
                                            <th class="heading">Status</th>
                                            <th class="heading">action</th>
                                        </tr>
                                        </thead>
                                        <tbody>

                                        <?php $__currentLoopData = $tickets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ticket): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr id="<?php echo e($ticket->id); ?>">
                                                <td><?php echo e($ticket->token_no); ?></td>
                                                <td><?php echo e($ticket->subject); ?></td>
                                                <td><?php echo e($ticket->department_id); ?></td>
                                                <td><?php echo e($ticket->created_at); ?></td>
                                                <td><?php echo e($ticket->status); ?></td>
                                                <td>

                                                    <a href="<?php echo e(asset('/edit/tickets')); ?>/<?php echo e($ticket->id); ?>" class="eye"><i class="fa fa-pencil"></i></a>
                                                    <a href="#" class="eye delete-btn" data-id="<?php echo e($ticket->id); ?>"><i class="fa fa-trash"></i></a>
                                                </td>

                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="second-heading-area">
                            <div class="col-md-3 ">
                                <div class="all-category">
                                    <h1>All Categories</h1>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="catege-one">
                                            <ul>
                                                <li><a href="#">Trading For Money<span class="number-box">47</span></a></li>
                                                <li><a href="#">Vault Keys Giveaway<span class="number-box">47</span></a></li>
                                                <li><a href="#">Misc Guns Location<span class="number-box">47</span></a></li>
                                                <li><a href="#">Looking For Players<span class="number-box">45</span></a></li>
                                                <li><a href="#">Stupid Bugs & Solves<span class="number-box">45</span></a></li>
                                                <li><a href="#">Video and Audio Drivers<span class="number-box">45</span></a></li>
                                                <li><a href="#" >2K Official Forums<span class="number-box">45</span></a></li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="col-md-12  margin-bottom">
                                        <div class="forum-statistics">
                                            <h1>Forum Statistics</h1>
                                        </div>
                                        <div class="row margin-off">
                                            <div class="forum-box">
                                                <div class="col-md-4 col-padding-off">
                                                    <div class="forum-sms">
                                                        <img src="../assets/dist/images/speech-bubble-2.png" alt="Nothing">
                                                        <p>Threads</p>
                                                        <h1>35,206</h1>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 col-padding-off">
                                                    <div class="forum-details">
                                                        <img src="../assets/dist/images/posts.png" alt="Nothing">
                                                        <p>Posts</p>
                                                        <h1>12,958</h1>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 col-padding-off">
                                                    <div class="forum-details">
                                                        <img src="../assets/dist/images/members.png" alt="Nothing">
                                                        <p>Members</p>
                                                        <h1>24,703</h1>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="second-catege">
                            <div class="col-md-3 second-heading-area">
                                <div class="all-category">
                                    <h1>My Activity Threads</h1>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="catege-two">
                                            <ul>
                                                <li><a href="#" class="media-body">
                                                        Lorem Ipsum is simply dummy
                                                        text of the printing
                                                    </a>
                                                    <span class="number-box">47</span>
                                                </li>
                                                <li><a href="#" class="media-body">
                                                        Lorem Ipsum is simply dummy
                                                        text of the printing
                                                    </a>
                                                    <span class="number-box">47</span>
                                                </li>
                                                <li><a href="#" class="media-body">
                                                        Lorem Ipsum is simply dummy
                                                        text of the printing
                                                    </a>
                                                    <span class="number-box">47</span>
                                                </li>
                                                <li><a href="#" class="media-body">
                                                        Lorem Ipsum is simply dummy
                                                        text of the printing
                                                    </a>
                                                    <span class="number-box">47</span>
                                                </li>
                                                <li><a href="#" class="media-body">
                                                        Lorem Ipsum is simply dummy
                                                        text of the printing
                                                    </a>
                                                    <span class="number-box">47</span>
                                                </li>

                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </section>
    </div>


<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script>
        $(document).ready(function () {
            $(".delete-btn").on('click', function () {
                var id = $(this).attr('data-id');
                swal({
                        title: "Are you sure?",
                        type: "warning",
                        showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        confirmButtonText: "Yes, delete it!",
                        cancelButtonText: "No, cancel!",
                        closeOnConfirm: false,
                        closeOnCancel: true
                    },
                    function(isConfirm){
                        if (isConfirm) {
                            $.ajax({
                                type: 'POST',
                                url: '<?php echo e(url('/delete/tickets')); ?>'+"/"+id,
                                data:{
                                    id:id,
                                    '_token': '<?php echo e(csrf_token()); ?>'
                                },
                                success: function (data) {
                                    $('.ticket-table tr#'+id+'').hide();
                                    swal("Deleted!", "Your imaginary file has been deleted.", "success");

                                }
                            })
                        } else {
                            swal("Cancelled", "Your imaginary file is safe :)", "error");
                        }
                    });
            });
        });
    </script>

<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.tickets', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>