

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




<div class="card mb-4">
    <div class="card-header">
        <div class="d-flex">
            <div class="mr-auto p-2 align-self-center"><h4>Support Tickets</h4></div>
                      
        </div>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-hover">
                <thead>
                    <tr>
                        <!--th>SLNO.</th-->
                        <th>User</th>
                        <th>Email</th>
                        <th>Department</th>
                        <th>Subject</th>
                        <th>Message</th>  
                        <th>Status</th>
                        <th>Closed</th>                   
                        <th>Actions</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $Bookings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($Booking->user->name); ?></td>
                        <td><?php echo e($Booking->user->email); ?></td>
                        <td><?php echo e($Booking->supportdepartment->title); ?></td>
                        <td><?php echo e($Booking->subject); ?></td>                       
                        <td><?php echo e($Booking->message); ?></td>
                        <td><?php echo e($Booking->status); ?></td>
                        <td>
                            <?php if($Booking->isClosed==0): ?>
                                Not Closed
                            <?php else: ?>
                                Closed 
                            <?php endif; ?>    
                        </td>
                        <td style="width: 150px;">
                            <form method="POST" action="<?php echo e(route('ticketUpdate',$Booking->id)); ?>">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('post'); ?>
                                
                                <button type="submit" class="btn btn-secondary"><i class="fas fa-check"></i> Completed</button>
                            </form>    
                        </td>
                        <td style="width: 150px;"><button class="btn btn-info" data-toggle="modal" onclick="openmail('<?php echo e($Booking->user->email); ?>')"><i class="far fa-comment-dots"></i> Replay</button></td>   
                                          
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="card-footer">
        <div class="d-flex justify-content-end font-weight-bold"><h5>Total: <?php echo e($Bookings->count()); ?> </h5></div>        
    </div>
</div>

<script>
    function openmail(Email) {
        document.getElementById("clientemail").value=Email;
      $('#modalEmail').modal('show');
      //JersyView("");
}
</script>


<!-- MODAL POP UP -->
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" id="modalEmail" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title"><i class="far fa-comment-dots"></i> Replay</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
            </button>
        </div>

        <form method="post" action="<?php echo e(route('sendbasicemail')); ?>">
        <?php echo csrf_field(); ?>
        
        <div class="modal-body">
        
            <div class="form-group">
                <label for="clientemail">Email address</label>
                <input type="email" class="form-control" id="clientemail" name="clientemail" placeholder="<?php echo e($Booking->user->email); ?>" value="<?php echo e($Booking->user->email); ?>">
            </div>
            <div class="form-group">
                <label for="subject">Subject</label>
                <input type="text" class="form-control" id="subject" name="txtsubject" placeholder="<?php echo e($Booking->subject); ?>" value="<?php echo e($Booking->subject); ?>">
            </div>
            <div class="form-group">
                <label for="exampleFormControlTextarea1">Message</label>
                <textarea class="form-control" name="emailtxt" id="emailtxt" rows="4"></textarea>
            </div>
       
        </div>

        <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            <button type="submit" class="btn btn-primary">Send</button>
        </div>
        
        </form>

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

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminapp', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/exouzia1/public_html/tailor/resources/views/SupportTeam/index.blade.php ENDPATH**/ ?>