

<?php $__env->startSection('title', 'Data Tracer Study'); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-content">
        <nav class="page-breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Dashboard</a></li>
                <li class="breadcrumb-item active" aria-current="page">Data Tracer Study</li>
            </ol>
        </nav>

        <?php if(session('success')): ?>
            <div class="alert alert-success alert-dismissible fade show" role="alert">
                <?php echo e(session('success')); ?>

                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <?php endif; ?>

        <?php if(session('error')): ?>
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <?php echo e(session('error')); ?>

                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <?php endif; ?>

        <div class="row">
            <div class="col-md-12 grid-margin stretch-card">
                <div class="card">
                    <div class="card-body">
                        <form method="GET" action="<?php echo e(route('tracer.index')); ?>" class="mb-3">
                            <div class="row g-2 align-items-end">
                                <div class="col-md-3">
                                    <label class="form-label">Tanggal Awal</label>
                                    <input type="date" name="start_date" class="form-control" value="<?php echo e(request('start_date')); ?>">
                                </div>
                                <div class="col-md-3">
                                    <label class="form-label">Tanggal Akhir</label>
                                    <input type="date" name="end_date" class="form-control" value="<?php echo e(request('end_date')); ?>">
                                </div>
                                <div class="col-md-3">
                                    <button type="submit" class="btn btn-primary btn-sm w-100">
                                        <i class="fa fa-filter"></i> Filter
                                    </button>
                                </div>
                            </div>
                            <div class="row mt-2">
                                <div class="col-md-6">
                                    <div class="input-group">
                                        <input type="text" name="search" class="form-control" placeholder="Cari Nama, Jurusan, Email, No HP, atau Instansi" value="<?php echo e(request('search')); ?>">
                                        <button type="submit" class="btn btn-primary btn-sm">
                                            <i class="fa fa-search"></i> Cari
                                        </button>
                                        <?php if(request('search') || request('start_date') || request('end_date')): ?>
                                            <a href="<?php echo e(route('tracer.index')); ?>" class="btn btn-secondary btn-sm">
                                                <i class="fa fa-refresh"></i> Reset
                                            </a>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </form>

                        <div class="table-responsive">
                            <table class="table table-hover" id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th>No</th>
                                        <th>Tanggal</th>
                                        <th>Nama</th>
                                        <th>Jurusan</th>
                                        <th>Instansi</th>
                                        <th>Memiliki Sertifikat</th>
                                        <th>Email</th>
                                        <th>No HP</th>
                                        <th>Aksi</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__empty_1 = true; $__currentLoopData = $tracers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $tracer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                        <tr>
                                            <td><?php echo e($index + $tracers->firstItem()); ?></td>
                                            <td><?php echo e(\Carbon\Carbon::parse($tracer->created_at)->format('d/m/Y H:i')); ?></td>
                                            <td><?php echo e($tracer->nama); ?></td>
                                            <td><?php echo e($tracer->jurusan); ?></td>
                                            <td><?php echo e($tracer->nama_instansi ?? '-'); ?></td>
                                            <td>
                                                <span class="badge bg-<?php echo e($tracer->memiliki_sertifikat == 'Ya' ? 'success' : 'secondary'); ?>">
                                                    <?php echo e($tracer->memiliki_sertifikat); ?>

                                                </span>
                                            </td>
                                            <td><?php echo e($tracer->email_pribadi); ?></td>
                                            <td>
                                                <a href="https://wa.me/<?php echo e(preg_replace('/^0/', '62', $tracer->no_hp)); ?>" target="_blank" class="text-success">
                                                    <i class="fa fa-whatsapp"></i> <?php echo e($tracer->no_hp); ?>

                                                </a>
                                            </td>
                                            <td>
                                                <a href="<?php echo e(route('tracer.show', $tracer->tracer_id)); ?>" class="btn btn-primary btn-sm">
                                                    <i class="fa fa-info"></i>
                                                </a>
                                                <form action="<?php echo e(route('tracer.destroy', $tracer->tracer_id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Yakin hapus data ini?')">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn btn-danger btn-sm">
                                                        <i class="fa fa-trash"></i>
                                                    </button>
                                                </form>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                        <tr>
                                            <td colspan="9" class="text-center">Belum ada data tracer study</td>
                                        </tr>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                        </div>

                        <div class="row mt-3">
                            <div class="col-md-6">
                                <form method="GET" action="<?php echo e(route('tracer.export')); ?>" class="d-inline" id="exportForm">
                                    <input type="hidden" name="start_date" value="<?php echo e(request('start_date')); ?>">
                                    <input type="hidden" name="end_date" value="<?php echo e(request('end_date')); ?>">
                                    <button type="submit" class="btn btn-success btn-sm">
                                        <i class="fa fa-download"></i> Export to Excel
                                    </button>
                                </form>
                            </div>
                            <div class="col-md-6">
                                <div class="d-flex justify-content-end">
                                    <?php echo e($tracers->appends(request()->query())->links()); ?>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('dashboard.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/edunesiaserver/public_html/K2/WEB_KAMPUS/WEB_TEMPLATE/Ijo-IjoTua/resources/views/admin/tracer/index.blade.php ENDPATH**/ ?>