

<?php $__env->startSection('content'); ?>
    <!--begin::App Content Header-->
    <div class="app-content-header"> <!--begin::Container-->
        <div class="container-fluid">
            <!--begin::Row-->
            <div class="row">
                <div class="col-sm-6">
                    <h3 class="mb-0">Worker Information Form</h3>
                    <button type="button" class="btn btn-info btn-sm" data-bs-toggle="modal" data-bs-target="#infoModal">
                        <i class="fas fa-info-circle"></i>
                    </button>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-end">
                        <li class="breadcrumb-item"><a href="<?php echo e(route('admin.dashboard')); ?>">Home</a></li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('form48.daily.index')); ?>">Form 4.8 List</a></li>
                        <li class="breadcrumb-item active">Worker Form</li>
                    </ol>
                </div>
            </div>
            <!--end::Row-->
        </div> <!--end::Container-->
    </div>
    <!--end::App Content Header-->

    <!-- Modal -->
<div class="modal fade" id="infoModal" tabindex="-1" aria-labelledby="infoModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="infoModalLabel">Panduan Mengisi Rekod myGAP 4-8</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <ul>
                    <li><strong>1. Nama Pekerja:</strong> Nama pekerja yang bekerja di premis termasuk pengusaha.</li>
                    <li><strong>2. Tarikh Lahir:</strong> Tarikh lahir pekerja.</li>
                    <li><strong>3. No. Kad Pengenalan/ Passport/ Visa:</strong> Nombor Kad Pengenalan, Passport atau visa pekerja dikepilkan bersama.</li>
                    <li><strong>4. Jantina:</strong> Jantina pekerja seperti lelaki/ perempuan.</li>
                    <li><strong>5. Negara Asal:</strong> Negara asal pekerja.</li>
                    <li><strong>6. Rekod Latihan Pekerja:</strong>
                        <ul>
                            <li><strong>Tarikh:</strong> Tarikh latihan dijalankan.</li>
                            <li><strong>Jenis Latihan:</strong> Latihan yang dijalankan seperti pengendalian racun perosak, jentera, amalan kultura.</li>
                            <li><strong>Penganjur & Penceramah:</strong> Badan/ Pusat/ agensi yang menganjurkan latihan dan nama penceramah.</li>
                        </ul>
                    </li>
                    <li><strong>7. Rekod Pemeriksaan Kesihatan Pekerja:</strong>
                        <ul>
                            <li><strong>Tarikh:</strong> Tarikh pemeriksaan kesihatan dijalankan.</li>
                            <li><strong>Nama Klinik/ Hospital:</strong> Nama klinik/ hospital tempat pemeriksaan kesihatan.</li>
                            <li><strong>Justifikasi Pemeriksaan:</strong> Tujuan pemeriksaan dijalankan seperti demam, batuk.</li>
                            <li><strong>Rawatan Yang Diperolehi:</strong> Rawatan yang diberikan oleh klinik/ hospital seperti x-ray, ubat-ubatan, pergigian.</li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
<!-- End Modal -->


    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">Fill Worker Information</h3>
                    
                </div>

                <div class="card-body">
                    <form action="<?php echo e(route('form48.daily.store')); ?>" method="POST">
                        <?php echo csrf_field(); ?>
                        <!-- Worker Details -->
                        <div class="form-group mb-4">
                            <label for="nama_pekerja">(a)Nama Pekerja:</label>
                            <input type="text" name="nama_pekerja" id="nama_pekerja" class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="tarikh_lahir">(b) Tarikh Lahir:</label>
                            <input type="date" name="tarikh_lahir" id="tarikh_lahir" class="form-control" required>
                        </div>

                        <div class="form-group mb-4">
                            <label for="no_ic_passport">(c) No. Kad Pengenalan / Passport / Visa:</label>
                            <input type="text" name="no_ic_passport" id="no_ic_passport" class="form-control" required>
                            
                        </div>

                        <div class="form-group mb-4">
                            <label for="jantina">(d) Jantina:</label>
                            <select class="form-select" name="jantina" id="jantina" class="form-control" required>
                                <option value="Lelaki">Lelaki</option>
                                <option value="Perempuan">Perempuan</option>
                            </select>
                        </div>

                        <div class="form-group mb-4">
                            <label for="negara_asal">(e) Negara Asal:</label>
                            <input type="text" name="negara_asal" id="negara_asal" class="form-control" required>
                        </div>

                        <!-- Training Records Section -->
                        <h4>Rekod Latihan Pekerja</h4>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>(f)Tarikh</th>
                                    <th>(g)Jenis Latihan</th>
                                    <th>(h)Penganjur & Penceramah</th>
                                    <th>(i)Actions</th>
                                </tr>
                            </thead>
                            <tbody id="training-records">
                                <tr>
                                    <td><input type="date" name="training_date[]" class="form-control"></td>
                                    <td><input type="text" name="jenis_latihan[]" class="form-control"></td>
                                    <td><input type="text" name="penganjur_penceramah[]" class="form-control"></td>
                                    <td><button type="button" class="btn btn-danger remove-training">Remove</button></td>
                                </tr>
                            </tbody>
                        </table>
                        <button type="button" class="btn btn-secondary" id="add-training">Add Training Record</button>

                        <!-- Health Check-up Section -->
                        <h4>Rekod Pemeriksaan Kesihatan Pekerja</h4>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>(j) Tarikh</th>
                                    <th>(k)Nama Klinik / Hospital</th>
                                    <th>(l)Justifikasi Pemeriksaan</th>
                                    <th>(m)Rawatan Yang Diperolehi</th>
                                    <th>(in)Actions</th>
                                </tr>
                            </thead>
                            <tbody id="health-checkup-records">
                                <tr>
                                    <td><input type="date" name="health_date[]" class="form-control"></td>
                                    <td><input type="text" name="nama_klinik_hospital[]" class="form-control"></td>
                                    <td><input type="text" name="justifikasi_pemeriksaan[]" class="form-control"></td>
                                    <td><input type="text" name="rawatan_diperolehi[]" class="form-control"></td>
                                    <td><button type="button" class="btn btn-danger remove-health-checkup">Remove</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <button type="button" class="btn btn-secondary" id="add-health-checkup">Add Health Check-up
                            Record</button>

                        <div class="card-footer mt-4">
                            <button type="submit" class="btn btn-success">Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Add more training records
        document.getElementById('add-training').addEventListener('click', function() {
            let newRow = `
        <tr>
            <td><input type="date" name="training_date[]" class="form-control"></td>
            <td><input type="text" name="jenis_latihan[]" class="form-control"></td>
            <td><input type="text" name="penganjur_penceramah[]" class="form-control"></td>
            <td><button type="button" class="btn btn-danger remove-training">Remove</button></td>
        </tr>`;
            document.getElementById('training-records').insertAdjacentHTML('beforeend', newRow);
        });

        // Remove training record
        document.addEventListener('click', function(e) {
            if (e.target && e.target.classList.contains('remove-training')) {
                e.target.closest('tr').remove();
            }
        });

        // Add more health check-up records
        document.getElementById('add-health-checkup').addEventListener('click', function() {
            let newRow = `
        <tr>
            <td><input type="date" name="health_date[]" class="form-control"></td>
            <td><input type="text" name="nama_klinik_hospital[]" class="form-control"></td>
            <td><input type="text" name="justifikasi_pemeriksaan[]" class="form-control"></td>
            <td><input type="text" name="rawatan_diperolehi[]" class="form-control"></td>
            <td><button type="button" class="btn btn-danger remove-health-checkup">Remove</button></td>
        </tr>`;
            document.getElementById('health-checkup-records').insertAdjacentHTML('beforeend', newRow);
        });

        // Remove health check-up record
        document.addEventListener('click', function(e) {
            if (e.target && e.target.classList.contains('remove-health-checkup')) {
                e.target.closest('tr').remove();
            }
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\FMIS_fypsystem\resources\views/form/form_48/create48.blade.php ENDPATH**/ ?>