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

<section class="content-header">
    <h1>
        <?php echo e(__("Call Logs")); ?>

    </h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <!-- Custom Tabs -->
            <div class="nav-tabs-custom">
                <div class="tab-content">
                    <div class="flex-row justify-end" style="display: flex; justify-content: space-between;">
                        <form action="" method="GET" style="display: flex;">
                            <input type="date" value="<?php echo e(request()->from_date); ?>" name="from_date" class="form-control" style="width: 150px;">
                            &nbsp;
                            
                            <input type="date" value="<?php echo e(request()->to_date); ?>" name="to_date" class="form-control" style="width: 150px;">
                            &nbsp;
                            
                            <select name="type">
                                <option value="">All Calls</option>
                                <option <?= request()->type == '1' ? 'selected' : 0 ?> value="1">Incoming Calls</option>
                                <option <?= request()->type == '2' ? 'selected' : 0 ?> value="2">Outgoing Calls</option>
                                <option <?= request()->type == '3' ? 'selected' : 0 ?> value="3">Missed Calls</option>
                                <option <?= request()->type == '5' ? 'selected' : 0 ?> value="5">Rejected Calls</option>
                                <option <?= request()->type == '7' ? 'selected' : 0 ?> value="7">Answered Calls</option>
                            </select>
                            &nbsp;
                            <select name="user_id" class="select2" style="width:150px">
                                <option value="">All Users</option>
                                <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option <?=request()->user_id==$user->id?'selected':0?> value="<?php echo e($user->id); ?>"><?php echo e($user->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                            &nbsp;
                            <?php if(request()->all): ?>
                            <div style="display: flex;  margin-left:16px; margin-right:16px;margin-top:5px">
                            <input checked type="checkbox" name="all" id="all" style="height: 20px;width: 20px;">
                             <label style="margin-left: 5px;margin-top: 2px;font-size: 16px;" for="all">Show all pages</label>
                            </div>
                            <?php else: ?>
                            <div style="display: flex;  margin-left:16px; margin-right:16px;margin-top:5px">
                            <input  type="checkbox" name="all" id="all" style="height: 20px;width: 20px;">
                             <label style="margin-left: 5px;margin-top: 2px;font-size: 16px;" for="all">Show all pages</label>
                            </div>
                            <?php endif; ?>
                            &nbsp;
                            <button type="submit" class="btn btn-success"><?php echo e(__("Show Data")); ?></button>
                        </form>

                        &nbsp;
                        &nbsp;
                        &nbsp;
                        <a href="<?php echo e(route('call_log.delete_all')); ?>" class="btn btn-danger" onclick="return confirm('Are you sure ?')">Delete All</a>

                    </div>
                    <br>
                    <div class="tab-pane active table-responsive" id="tab_1">
                        <table class="exportTable table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th><?php echo e(__("Sr.No.")); ?></th>
                                    <th><?php echo e(__("Date & Time")); ?></th>
                                    <th><?php echo e(__("User")); ?></th>
                                    <th><?php echo e(__("Name")); ?></th>
                                    <th><?php echo e(__("Number")); ?></th>
                                    <th><?php echo e(__("Call Type")); ?></th>

                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $call_logs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($serial++); ?></td>
                                    <td><?php echo e(date('d M Y h:i a',strtotime($log->date))); ?></td>
                                    <td><?php echo e($log->user->name); ?></td>
                                    <td><?php echo e($log->name); ?></td>
                                    <td><?php echo e($log->number); ?></td>
                                    <td>
                                        <?php
                                        try {
                                            echo $call_types[$log->type];
                                        } catch (\Exception $e) {
                                        }
                                        ?>
                                    </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                        <?php echo e($call_logs->links()); ?>

                    </div>


                    <!-- /.tab-pane -->
                </div>
                <!-- /.tab-content -->
            </div>
            <!-- nav-tabs-custom -->
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->

</section>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /opt/lampp81/htdocs/call_logs/resources/views/dashboard.blade.php ENDPATH**/ ?>