IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/7ab14426cbb75e2ab2f7036f7e7b76740cb6d177.php

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>List Of Visitors</strong></h2>
            </div>
            <div class="body table-responsive">
                <?php echo Form::open(['method' => 'GET',  'action' => ['School\VisitorController@index'], 'class' => 'form-horizontal']); ?>

                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label">
                        <label for="classname">From Date</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           <?php echo Form::text('fromDate',null,['class' => 'form-control datepicker']); ?>

                        </div>
                    </div>
                    <div class="col-sm-1 form-control-label">
                        <label for="classname">To Date</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           <?php echo Form::text('toDate',null,['class' => 'form-control datepicker']); ?>

                        </div>
                    </div>
                     <div class="col-sm-2">
                        <?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>

                        <?php echo Form::close(); ?> 
                    </div>
                </div>
                <table class="table table-bordered table-striped table-hover  dataTable" id='tableexp'>
                    <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>Name</th>
                            <th>Visitor No</th>
                            <th>Image</th>
                            <th>Visiting</th>
                            <th>In Time</th>
                            <th>Out Time</th>
                            <th>OTP</th>
                            <th>Address</th>
                            <th>Mobile</th>
                            <th>Email</th>
                            <th>Purpose</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 1; ?>
                        <?php $__currentLoopData = $visitors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <th scope="row"><?php echo e($i); ?></th>
                            <td><?php echo e($value->firstName); ?>  <?php echo e($value->lastName); ?></td>
                            <td><?php echo e($value->visitorNo); ?></td>
                            <td><img src = "<?php echo e($value->visitorImage); ?>" width="100" height="100"></td>
                            <?php $employee = \App\Employee::where('idEmployee',$value->idEmployee)->first(); ?>
                            <td><?php if($employee != null): ?> <?php echo e($employee->name); ?> <?php endif; ?></td>                            
                            <td><?php echo e($value->created_at); ?></td>
                            <td><?php echo e($value->outTime); ?></td>
                            <td><?php echo e($value->otp); ?></td>
                            <td><?php echo e($value->address); ?></td>
                            <td><?php echo e($value->mobile); ?></td>
                            <td><?php echo e($value->email); ?></td>
                            <td><?php echo e($value->purpose); ?></td>
                            <td>
                                <?php if($value->verified == 'N'): ?>
                                <a href="<?php echo e(url('school/visitors/' . $value->idVisitor . '/verifyotp')); ?>"  class="btn btn-raised btn-info waves-effect btn-round"></i>Verify</a>
                                <?php else: ?>
                                <span class="btn btn-sm btn-success">Verified</span>
                                <a href="<?php echo e(url('school/visitors/' . $value->idVisitor . '/pass')); ?>"  target="_blank" class="btn btn-raised btn-warning waves-effect btn-round"><i class="zmdi zmdi-print"></i> Print </a>
                                
                                <?php endif; ?>
                                <a href="<?php echo e(url('school/visitors/' . $value->idVisitor . '/out')); ?>"  class="btn btn-raised btn-success waves-effect btn-round"></i>Out </a>
                                <a href="<?php echo e(url('school/visitors/' . $value->idVisitor . '/edit')); ?>"  class="btn btn-raised btn-info waves-effect btn-round">Edit </a>
                                <button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($value->idVisitor); ?>" data-type="confirm">DELETE</button>
                            </td>
                        </tr>
                        <?php $i++; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).on('click', '.js-sweetalert', function (e) {
    $.ajaxSetup({
        headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    e.preventDefault();
    var id = $(this).data('id');
    swal({
            title: "Are you sure?",
            text: "Are You sure you want to delete this Visitor!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, delete it!",
            closeOnConfirm: true
        },
        function() {
         //   console.log('here');
            $.ajax({
                type: "DELETE",
                url: "<?php echo e(url('/school/visitors/')); ?>" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Visitor has been successfully deleted", 
                    type: "success"
                },function() {
                    location.reload();
                });
            })
            .error(function(data) {
              swal("Oops", "We couldn't connect to the server!", "error");
            });
            return false;
    });
});
$(function () {
    $('#tableexp').DataTable({
      
        dom: 'Bfrtip',
         scrollY:        "500px",
        scrollX:        true,
        scrollCollapse: true,
        fixedColumns:   {
            left: 1
        },
        buttons: [
            { extend: 'csv', text: 'Export to Excel',title:'Visitors List',
                exportOptions: {
                    columns: [0,1,2,3,4,5,6,7,8,9]
                }}
            
        ]
    });
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7