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

<style>
.dropdown-menu a:hover{ background: #007bff;color:#fff;}
</style>
<div class="main-panel">
    <div class="content">
            <div class="panel-header">
                <div class="page-inner py-5 text-white"  style="background:#313232">
                    <div class="d-flex align-items-left align-items-md-center flex-column flex-md-row">
                        <div><div class="page-header">
                            <h4 class="page-title text-white">Survey Requests</h4>
                            <ul class="breadcrumbs">
                                    <li class="nav-home">

                                    
                                        <a class="text-white" href="">
                                            <i class="flaticon-home"></i>
                                        </a>
                                    </li>
                                    <li class="separator">
                                        <i class="flaticon-right-arrow"></i>
                                    </li>
                                    <li class="nav-item">
                                        <a class="text-white" href="">Survey Requests</a>
                                    </li>
                                </ul>
                        </div></div>
                        <div class="ml-md-auto py-2 py-md-0">
                            <!-- <a href="<?php echo e(route('admin-dashboard')); ?>" class="btn btn-white btn-border btn-round mr-2"><i class="fas fa-arrow-circle-left"></i> Back</a> -->
                            <form action="<?php echo e(route('request')); ?>" method="post">
                            <?php echo csrf_field(); ?>
                            <!-- <button  class="btn btn-white btn-round"><i class="fa fa-plus"></i> Make Request </button> -->
                            </form>
                        </div>
                    </div>
                </div>
            <div id="app">
            <div class="page-category">
                <div class="page-inner mt--5">
                    <div class="row mt--2">
                            <div class="col-md-12">
                                <div class="card full-height">
                                    <div class="card-body">
               

                                    <div class="text-right mb-3 border-bottom pb-3">
                                    <div class="card-title pull-left">Request Details
                                    
                              <!--<a href="#" data-toggle="modal" data-target="#sendsmstoClient" id="show-modal" class="btn btn-success btn-round"><strong></strong>Add SMS Message</strong></a>-->
                                    
                                    
                                    
                                    </div>
                                       <?php echo $__env->make('fcviews.partials.filter-topups', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                                   
                                    <div class="card-title pull-left"></div>
                                  
                                        <!--<a class="btn btn-success btn-border btn-round btn-sm" data-toggle="collapse" data-target="#filter-panel">-->
                                        <!--    <i class="fas fa-filter"></i> Filter-->
                                        <!--</a>-->
                                   
							
                                    </div>
                                        <?php if($errors->any()): ?>
                                            <div class="alert alert-danger alert-dismissible" role="alert">
                                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                            <strong>Error! </strong>There were some errors with inputs.
                                            <ul>
                                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <li><?php echo e($error); ?></li>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </ul>
                                            </div>

                                        <?php endif; ?>
                                        <?php echo $__env->make('layouts.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                        <?php if(!$requests->count()): ?>
                                        <?php echo $__env->make('layouts.nodata', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                        <?php else: ?>
                                        
                                        <div class="table-responsive">
                                        <table  id="table" class="display table table-striped table-hover">
                                            <thead>
                                            <tr>
                                                <th>ID#</th>
                                                <th>Organization</th>
                                                <th>Requested on</th>
                                                <th>Status</th>
                                                <th>Actions</th>
                                                </tr>
                                            </thead>
                                            <tfoot>
                                                <tr>
                                                <th>ID#</th>
                                                <th>Organization</th>
                                                <th>Requested on</th>
                                                <th>Status</th>
                                                <th>Actions</th>
                                                </tr>
                                            </tfoot>
                                            <tbody>
                                            <?php $__currentLoopData = $requests; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $request): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                            <td><?php echo e($request->id); ?></td>
                                            <td><?php echo e($request->surveyOrg->name ?? ''); ?></td>
                                            <td><?php echo e($request->created_at); ?></td>
                                            <td><?php if($request->status == 1): ?>
                                            <span class="badge badge-success">Accepted</span>
                                            <?php elseif($request->status == 0): ?>
                                            <span class="badge badge-warning">Pending</span>
                                            <?php elseif($request->status == 2): ?>
                                            <span class="badge badge-danger">Rejected</span>
                                            <span class="badge badge-danger"><b>Reason:</b><?php echo e($request->reason); ?></span>
                                            <?php endif; ?>
                                            </td>
                                            <td>
                                            <div class="form-button-action" role="group" aria-label="Actions">
                                           
                                         <!--<a href="#" data-target="#view-<?php echo e($request->id); ?>" data-toggle="modal" id="show-modal"> <button class="btn btn-primary btn-sm" data-toggle="tooltip"  data-original-title="Edit"><i class="fa fa-edit"></i> </button></a>-->

                                            <form action="<?php echo e(route('approve-survey')); ?>" method="post">
                                            <?php echo csrf_field(); ?>
                                                <input type="hidden" name="id" value="<?php echo e($request->id); ?>">
                                                <button type="submit" data-toggle="tooltip" class="btn btn-success btn-sm" data-toggle="tooltip"  data-original-title="Enable Survey"><i class="fa fa-check"></i> </button>
                                            </form>
                                                <button type="button" data-toggle="modal" data-target="#reject-<?php echo e($request->id); ?>" class="btn btn-danger btn-sm"  data-original-title="Disable Survey"><i class="fas fa-ban"></i> </button>
                                            </div>
                                            </td>
                                            </tr>
                                            <!-- reject modal -->
                                            <div class="modal fade" id="reject-<?php echo e($request->id); ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
                                                <div class="modal-dialog modal-dialog-centered" role="document">
                                                    <div class="modal-content">
                                                        <div class="modal-header">
                                                            <h5 class="modal-title" id="exampleModalLongTitle">Disable Survey for [<?php echo e($request->surveyOrg->name ?? ''); ?>]</h5>
                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                                <span aria-hidden="true">&times;</span>
                                                            </button>
                                                        </div>
                                                        <div class="modal-body panel-default bg-light">
                                                            <disable-survey :request="<?php echo e(json_encode($request->id)); ?>"/>   
                                                        </div>
                                                        
                                                    </div>
                                                </div>
                                            </div>
                                        <!-- end reject modal -->
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </tbody>
                                        </table>
                                         
                                        <?php endif; ?>
                                    </div>
                                    <!-- Create modal -->
                                    <div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
                                        <div class="modal-dialog modal-dialog-centered" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title" id="exampleModalLongTitle">Request Survey </h5>
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                        <span aria-hidden="true">&times;</span>
                                                    </button>
                                                </div>
                                               <!-- <div class="modal-body panel-default bg-light">
                                                    <request_component/>
                                                </div>-->
                                                
                                            </div>
                                        </div>
                                    </div>
                                <!-- end Create modal -->
                                
                                
                                
                                
                                
                                
                                 <!--  Type SMS -->              
                                        <div class="modal fade" id="sendsmstoClient" tabindex="-1" role="dialog" aria-hidden="true">
                                            <div class="modal-dialog" role="document">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                    <h4>Send SMS To Contacts</h4>
                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                            <span aria-hidden="true">&times;</span>
                                                        </button>
                                                    </div>
                                                    
                                            
                                                    
                                                    
                                                    
                                                    <form action="<?php echo e(route('ivrreason')); ?>" method="post" enctype="multipart/form-data">
                                                        <?php echo csrf_field(); ?>
                                                        <div class="modal-body bg-light">
                                                         
                                                            <div class="col form-group">
                                                
                                      <textarea name="comment" value="" class="form-control"required="" placeholder="Enter Message..."></textarea>
         
                                                                
                                                                
                                                            </div>
                                                        </div>
                                                        <div class="modal-footer">
                                                            <button type="submit" class="btn btn-success btn-round btn-md"><i class="fa fa-check"></i> Send SMS</button>
                                                            <button type="button" class="btn btn-danger btn-round btn-md" data-dismiss="modal">Close</button>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                        <!-- / import -->    
                                    
                                      
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
<script src='https://code.jquery.com/jquery-3.2.0.min.js'></script>
<script src='https://unpkg.com/popper.js@1.11.1'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js'></script>
    <?php $__env->stopSection(); ?>

<?php echo $__env->make('fcviews.layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\xamppv8\htdocs\Accounts\resources\views/fcviews/survey-request/view.blade.php ENDPATH**/ ?>