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


<!-- BEGIN PAGE CSS -->
<?php $__env->startSection('page-css'); ?>
    <style>
        .toggle-code-snippet { margin-bottom: 0px; }
        body.dark .toggle-code-snippet { margin-bottom: 0px; }
    </style>
    <link rel="stylesheet" href="/cork/src/plugins/css/dark/table/datatable/dt-global_style.css">
<?php $__env->stopSection(); ?>
<!-- END PAGE CSS -->

<!-- BREADCRUMB -->
<?php $__env->startSection('breadcrumb'); ?>
<div class="page-meta">
    <nav class="breadcrumb-style-one" aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li>
            <li class="breadcrumb-item"><a href="<?php echo e(route('enrollments.index')); ?>">Enrollments</a></li>
            <li class="breadcrumb-item active" aria-current="page"><?php echo e($title); ?></li>
        </ol>
    </nav>
</div>
<!-- /BREADCRUMB -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<form method="post" action="<?php if($action == 'create'): ?><?php echo e(route('enrollments.store')); ?> <?php else: ?> <?php echo e(route('enrollments.update', $enrollment->id)); ?> <?php endif; ?>">
    <?php echo csrf_field(); ?>
    <?php if($action == 'edit'): ?> <?php echo method_field('PUT'); ?> <?php endif; ?>
    <div class="form-group">
        <label for="year_id">School Year*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="year_id" id="year_id" class="form-select <?php $__errorArgs = ['year_id'];
$__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); ?>">
                    <?php $__currentLoopData = $years; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $year): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($year->id); ?>" <?php if(@isset($enrollment->year_id) && $year->id === $enrollment->year_id): ?> selected <?php endif; ?>><?php echo e($year->year); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['year_id'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('year_id')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>
        <label for="term">Term*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="term" id="term" class="form-select <?php $__errorArgs = ['term'];
$__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); ?>">
                    <option value="A" <?php if(@isset($enrollment->term) && $year->id === $enrollment->term): ?> selected <?php endif; ?>>All</option>
                    <option value="Y" <?php if(@isset($enrollment->term) && $year->id === $enrollment->term): ?> selected <?php endif; ?>>Full Year</option>
                    <option value="F" <?php if(@isset($enrollment->term) && $year->id === $enrollment->term): ?> selected <?php endif; ?>>Fall</option>
                    <option value="S" <?php if(@isset($enrollment->term) && $year->id === $enrollment->term): ?> selected <?php endif; ?>>Spring</option>
                </select>
                <?php $__errorArgs = ['term'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('term')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>
        <label for="student_id">Student*</label>
        <div class="form-row">
            <div class="col-md-4 mb-4">
                <select name="student_id" id="student_id" class="form-select <?php $__errorArgs = ['student_id'];
$__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); ?>">
                    <?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $student): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($student->id); ?>" <?php if(@isset($enrollment->student_id) && $student->id === $enrollment->student_id): ?> selected <?php endif; ?>><?php echo e($student->last_name . ', ' . $student->first_name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['student_id'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('student_id')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>

        <label for="section_id">Course*</label>
        <div class="form-row">
            <div class="col-md-8 mb-4">
                    <span id="updatedSectionList">
                        <?php echo $__env->make('admin.sections.sections-by-term', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    </span>
                </select>
                <?php $__errorArgs = ['section_id'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('section_id')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>

        <label for="dual_credit">Taking for Dual Credit?*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="dual_credit" id="dual_credit" class="form-select <?php $__errorArgs = ['dual_credit'];
$__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); ?>">
                    <option value="0" <?php if(@isset($enrollment->dual_credit) && 0 === $enrollment->dual_credit): ?> selected <?php endif; ?>>No</option>
                    <option value="1" <?php if(@isset($enrollment->dual_credit) && 1 === $enrollment->dual_credit): ?> selected <?php endif; ?>>Yes</option>
\
                </select>
                <?php $__errorArgs = ['dual_credit'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('dual_credit')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>
        <?php if(auth()->user()->role_id == 1): ?>

        <label for="status">Status*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="status" id="status" class="form-select <?php $__errorArgs = ['status'];
$__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); ?>">
                    <option value="A" <?php if(@isset($enrollment->status) && 'A' === $enrollment->status): ?> selected <?php endif; ?>>Approved</option>
                    <option value="D" <?php if(@isset($enrollment->status) && 'D' === $enrollment->status): ?> selected <?php endif; ?>>Denied</option>
                    <option value="R" <?php if(@isset($enrollment->status) && 'R' === $enrollment->status): ?> selected <?php endif; ?>>Dropped</option>
                    <option value="W" <?php if(@isset($enrollment->status) && 'W' === $enrollment->status): ?> selected <?php endif; ?>>Waitlist</option>
                </select>
                <?php $__errorArgs = ['status'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('status')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>

        <label for="lms_updated">LMS Updated?*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="lms_updated" id="lms_updated" class="form-select <?php $__errorArgs = ['lms_updated'];
$__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); ?>">
                    <option value="0" <?php if(@isset($enrollment->lms_updated) && 0 === $enrollment->lms_updated): ?> selected <?php endif; ?>>No</option>
                    <option value="1" <?php if(@isset($enrollment->lms_updated) && 1 === $enrollment->lms_updated): ?> selected <?php endif; ?>>Yes</option>
                </select>
                <?php $__errorArgs = ['lms_updated'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('lms_updated')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>

        <label for="ps_updated">PowerSchool Updated?*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="ps_updated" id="ps_updated" class="form-select <?php $__errorArgs = ['ps_updated'];
$__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); ?>">
                    <option value="0" <?php if(@isset($enrollment->ps_updated) && 0 === $enrollment->ps_updated): ?> selected <?php endif; ?>>No</option>
                    <option value="1" <?php if(@isset($enrollment->ps_updated) && 1 === $enrollment->ps_updated): ?> selected <?php endif; ?>>Yes</option>
                </select>
                <?php $__errorArgs = ['ps_updated'];
$__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" style="display: block !important;">
                    <?php echo e($errors->first('ps_updated')); ?>

                </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
        </div>
        <?php endif; ?>

        <div class="form-row">
            <button type="submit" class="mt-4 btn btn-primary">Submit</button>
            <button type="button" class="mt-4 ml-4 btn btn-secondary" onclick="window.history.go(-1); return false;">Cancel</button>
        </div>
    </div>
</form>
<?php $__env->stopSection(); ?>
<!--  BEGIN PAGE SCRIPTS FILE  -->
<?php $__env->startSection('page-js'); ?>
<script>
    $('#term').on('change', function(event) {
        $("#updatedSectionList").load('/admin/sections/sections-by-term/' + document.getElementById("term").value );
    });
</script>
<?php $__env->stopSection(); ?>
<!--  END PAGE SCRIPTS FILE  -->

<?php echo $__env->make('layouts.cork', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\jason_horner\Dropbox\laravel\10\registration\resources\views/admin/enrollments/form.blade.php ENDPATH**/ ?>