<?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('courses.index')); ?>">Courses</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('courses.store')); ?> <?php else: ?> <?php echo e(route('courses.update', $course->id)); ?> <?php endif; ?>">
    <?php echo csrf_field(); ?>
    <?php if($action == 'edit'): ?> <?php echo method_field('PUT'); ?> <?php endif; ?>
    <div class="form-group">

        <label for="name">Name*</label>
        <div class="form-row">
            <div class="col-md-6 mb-4">
                <input type="text" class="form-control <?php $__errorArgs = ['name'];
$__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); ?>" name="name" id="name" aria-describedby="basic-addon3" placeholder="Course Name" maxlength="100" <?php if(isset($course->name)): ?> value="<?php echo e($course->name); ?>" <?php else: ?> value="<?php echo e(old('name')); ?>" <?php endif; ?>>
                <?php $__errorArgs = ['name'];
$__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('name')); ?>

                </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="Y" <?php if(@isset($course->term) && 'Y' === $course->term): ?> selected <?php endif; ?>>Full Year</option>
                    <option value="F" <?php if(@isset($course->term) && 'F' === $course->term): ?> selected <?php endif; ?>>Fall</option>
                    <option value="S" <?php if(@isset($course->term) && 'S' === $course->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="department_id">Department*</label>
        <div class="form-row">
            <div class="col-md-4 mb-4">
                <select name="department_id" id="department_id" class="form-select <?php $__errorArgs = ['department_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 = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $department): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($department->id); ?>" <?php if(@isset($course->department_id) && $department->id === $course->department_id): ?> selected <?php endif; ?>><?php echo e($department->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['department_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('department_id')); ?>

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

        <label for="teacher_id">Teacher*</label>
        <div class="form-row">
            <div class="col-md-4 mb-4">
                <select name="teacher_id" id="teacher_id" class="form-select <?php $__errorArgs = ['teacher_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 = $teachers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $teacher): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($teacher->id); ?>" <?php if(@isset($course->teacher_id) && $teacher->id === $course->teacher_id): ?> selected <?php endif; ?>><?php echo e($teacher->last_name . ', ' . $teacher->first_name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
                <?php $__errorArgs = ['teacher_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('teacher_id')); ?>

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

        <label for="enrollment_max">Enrollment Max*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <input type="text" class="form-control <?php $__errorArgs = ['enrollment_max'];
$__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); ?>" name="enrollment_max" id="enrollment_max" aria-describedby="basic-addon3" placeholder="Enrollment Max" maxlength="2" <?php if(isset($course->enrollment_max)): ?> value="<?php echo e($course->enrollment_max); ?>" <?php else: ?> value="<?php echo e(old('enrollment_max')); ?>" <?php endif; ?>>
                <?php $__errorArgs = ['enrollment_max'];
$__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('enrollment_max')); ?>

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

        <label for="course_code">Course Code</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <input type="text" class="form-control <?php $__errorArgs = ['course_code'];
$__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); ?>" name="course_code" id="course_code" aria-describedby="basic-addon3" placeholder="Course Code" maxlength="10" <?php if(isset($course->course_code)): ?> value="<?php echo e($course->course_code); ?>" <?php else: ?> value="<?php echo e(old('course_code')); ?>" <?php endif; ?>>
                <?php $__errorArgs = ['course_code'];
$__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('course_code')); ?>

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

        <label for="minimum_grade">Minimum Grade*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="minimum_grade" id="minimum_grade" class="form-select <?php $__errorArgs = ['minimum_grade'];
$__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="12" <?php if(@isset($course->minimum_grade) && 12 === $course->minimum_grade): ?> selected <?php endif; ?>>12</option>
                    <option value="11" <?php if(@isset($course->minimum_grade) && 11 === $course->minimum_grade): ?> selected <?php endif; ?>>11</option>
                    <option value="10" <?php if(@isset($course->minimum_grade) && 10 === $course->minimum_grade): ?> selected <?php endif; ?>>10</option>
                    <option value="9" <?php if(@isset($course->minimum_grade) && 9 === $course->minimum_grade): ?> selected <?php endif; ?>>9</option>
                </select>
                <?php $__errorArgs = ['minimum_grade'];
$__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('minimum_grade')); ?>

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

        <label for="delivery">Delivery*</label>
        <div class="form-row">
            <div class="col-md-2 mb-4">
                <select name="delivery" id="delivery" class="form-select <?php $__errorArgs = ['delivery'];
$__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="I" <?php if(@isset($course->delivery) && 'I' === $course->delivery): ?> selected <?php endif; ?>>ITV</option>
                    <option value="O" <?php if(@isset($course->delivery) && 'O' === $course->delivery): ?> selected <?php endif; ?>>Online</option>
                </select>
                <?php $__errorArgs = ['delivery'];
$__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('delivery')); ?>

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

        <label for="dual_credit">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="Y" <?php if(@isset($course->dual_credit) && 'Y' === $course->dual_credit): ?> selected <?php endif; ?>>Yes</option>
                    <option value="N" <?php if(@isset($course->dual_credit) && 'N' === $course->dual_credit): ?> selected <?php endif; ?>>No</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>

        <label for="description">Description*</label>
        <div class="form-row">
            <div class="col-md-12 mb-4">
                <textarea class="form-control" aria-label="With textarea" id="description" name="description" placeholder="Class description..."><?php if(isset($course->description)): ?> <?php echo e($course->description); ?> <?php else: ?> <?php echo e(old('description')); ?> <?php endif; ?></textarea>
                <?php $__errorArgs = ['description'];
$__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('description')); ?>

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

        <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'); ?>

<?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 /home/psjybwmy/public_html/registration/resources/views/admin/courses/form.blade.php ENDPATH**/ ?>