<?php $__env->startSection('title', 'Buat Jurnal Baru'); ?>
<?php $__env->startSection('page-title', 'Buat Jurnal Baru'); ?>

<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-header">
        <h5 class="card-title mb-0"><i class="fas fa-plus me-2"></i>Tambah Jurnal Baru</h5>
    </div>
    
    <div class="card-body">
        <form action="<?php echo e(route('jurnal.store')); ?>" method="POST">
            <?php echo csrf_field(); ?>
            
            <div class="mb-3">
                <label class="form-label">Tanggal <span class="text-danger">*</span></label>
                <input type="date" 
                       name="tanggal" 
                       class="form-control <?php $__errorArgs = ['tanggal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                       value="<?php echo e(old('tanggal')); ?>" 
                       required>
                <?php $__errorArgs = ['tanggal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="mb-3">
                <label class="form-label">Perencanaan Kegiatan <span class="text-danger">*</span></label>
                <textarea name="perencanaan_kegiatan" 
                          class="form-control <?php $__errorArgs = ['perencanaan_kegiatan'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                          rows="4" 
                          placeholder="Tuliskan rencana kegiatan yang akan dilakukan..."
                          required><?php echo e(old('perencanaan_kegiatan')); ?></textarea>
                <?php $__errorArgs = ['perencanaan_kegiatan'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="mb-3">
                <label class="form-label">Pelaksanaan Kegiatan <span class="text-danger">*</span></label>
                <textarea name="pelaksanaan_kegiatan" 
                          class="form-control <?php $__errorArgs = ['pelaksanaan_kegiatan'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                          rows="4" 
                          placeholder="Tuliskan kegiatan yang telah dilaksanakan..."
                          required><?php echo e(old('pelaksanaan_kegiatan')); ?></textarea>
                <?php $__errorArgs = ['pelaksanaan_kegiatan'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

        </form>
    </div>
    
    <div class="card-footer">
        <button type="button" class="btn btn-secondary" onclick="window.location='<?php echo e(route('jurnal')); ?>'">Batal</button>
        <button type="submit" form="jurnal-form" class="btn btn-primary">Simpan</button>
    </div>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
document.addEventListener('DOMContentLoaded', function() {
    // Set tanggal hari ini sebagai default
    const tanggalInput = document.querySelector('input[name="tanggal"]');
    const today = new Date().toISOString().split('T')[0];
    if (!tanggalInput.value) {
        tanggalInput.value = today;
    }
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.siswa', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\presensi-magang\resources\views/siswa/jurnal/create.blade.php ENDPATH**/ ?>