IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/students/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/students/viewtimetable.blade.php

@extends('students.student_layout')
@section('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>
                            @foreach($periods as $var)
                            <th>{{$var->periodName}} <br> {{$var->fromTime}} <br>{{$var->toTime}}</th>
                            @endforeach
                        </tr>
                    </thead>
                    <tbody>
                        @foreach(weekdays() as $key=>$value)
                        <tr>
                            <th style="background-color: #ffa60d;color:white;">{{$value}}</th>
                            @foreach($periods as $var)
                                <?php $timetable = \App\Timetable::where('idPeriod','=',$var->idPeriod)->where('idWeekday','=',$key)->first() ?>
                                @if($var->isLunchBreak == 'N')
                                <td style="border-right: 1px solid #dee2e6;">
                                    <span><strong>{{$timetable->subject->subjectName or ''}}</strong></span><br>
                                    <span><strong>{{$timetable->teacher->firstName or ''}}</strong></span>
                                </td>
                                @else
                                <td style="background-color: #ffa60d;"></td>
                                @endif
                            @endforeach
                    </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
            {!! Form::close() !!}
        </div>
    </div>
</div>
@stop
@section('script')
<script>
    $(document).ready(function () {
        $('select[name="idClass"]').on('change', function () {
            var classID = $(this).val();
            if (classID) {
                $.ajax({
                    url: "{{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: "{{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>
@stop

Copyright © 2021 - 2025 IMMREX7