IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>View Timetable</strong></h2>
</div>
<div class="body table-responsive">
<table class="table">
<thead style="background-color: #00d6f3;color:white;">
<tr>
<th>DAY/TIME</th>
<?php $__currentLoopData = $periods; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<th><?php echo e($var->periodName); ?> <br> <?php echo e($var->fromTime); ?> <br><?php echo e($var->toTime); ?></th>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = weekdays(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<th style="background-color: #ffa60d;color:white;"><?php echo e($value); ?></th>
<?php $__currentLoopData = $periods; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php $timetable = \App\Timetable::where('idPeriod','=',$var->idPeriod)->where('idWeekday','=',$key)->first() ?>
<?php if($var->isLunchBreak == 'N'): ?>
<td style="border-right: 1px solid #dee2e6;">
<span><strong><?php echo e(isset($timetable->subject->subjectName) ? $timetable->subject->subjectName : ''); ?></strong></span><br>
<span><strong><?php echo e(isset($timetable->teacher->firstName) ? $timetable->teacher->firstName : ''); ?></strong></span>
</td>
<?php else: ?>
<td style="background-color: #ffa60d;"></td>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<?php echo Form::close(); ?>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).ready(function () {
$('select[name="idClass"]').on('change', function () {
var classID = $(this).val();
if (classID) {
$.ajax({
url: "<?php echo e(url('/teacher/class')); ?>" + '/' + classID + "/sections",
type: "GET",
dataType: "json",
success: function (data) {
$('#idSection').empty();
$('#idSection').append('<option value="">--Select--</option>');
$.each(data, function (key, value) {
$('#idSection').append('<option value="' + key + '">' + value + '</option>');
});
}
});
} else {
$('select[name="idSection"]').empty();
}
});
var cur_class = $('select[name="idClass"]').val();
if (cur_class) {
$.ajax({
url: "<?php echo e(url('/teacher/class')); ?>" + '/' + cur_class + "/sections",
type: "GET",
dataType: "json",
success: function (data) {
$('#idSection').empty();
$('#idSection').append('<option value="">--Select--</option>');
$.each(data, function (key, value) {
$('#idSection').append('<option value="' + key + '">' + value + '</option>');
});
}
});
}
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('students.student_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -