IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/57b5f77e8dae9468f91036419c534ad7ec8b5d55.php

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Add Timetable</strong></h2>
                <a href="<?php echo e(url('school/viewtimetable')); ?>" style="float: right" class="btn btn-sm btn-success">View Timetable</a>
            </div>
            <div class="body table-responsive">
                 <?php echo Form::open(['method' => 'GET',  'action' => ['School\TimetableController@index'], 'class' => 'form-horizontal']); ?>

                <div class="row clearfix">
                    <div class="col-sm-1 form-control-label">
                        <label for="classname">Class</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::select('idClass',$classes,null,['class' => 'form-control show-tick ms select2']); ?>

                            <?php if($errors->has('idClass')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('idClass')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="col-sm-1 form-control-label">
                        <label for="classname">Section</label>
                    </div>
                    <div class="col-sm-3">
                         <?php  if(isset($_GET['idSection'])){
                               $sec =  $_GET['idSection']; 
                                
                                echo '<input type="hidden" value='.$sec.' id="testsec">'; }?>
                        <div class="form-group">
                            <select id='idSection' name='idSection' class="form-control show-tick ms"></select>
                            <?php if($errors->has('idSection')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('idSection')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="col-sm-4 form-control-label">
                        <?php echo Form::submit('SET TIMETABLE',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']); ?>

                        <?php echo Form::close(); ?>

                        <?php echo Form::open(['url' => 'school/timetable', 'class' => 'form-horizontal']); ?>

                        <?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-success btn-round waves-effect','id'=>'submit-btn']); ?>

                    </div>
                </div>

                <table class="table">
                    <thead style="background-color: #00d6f3;color:white;">
                    </thead>
                    <tbody>
                        <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>
                        <?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(); ?>
                                <input type="hidden" name='periods[<?php echo e($key); ?>][<?php echo e($var->idPeriod); ?>][idWeekday]' value="<?php echo e($key); ?>">
                                <?php if($var->isLunchBreak == 'N'): ?>
                                <td style="border:1px solid #dee2e6;">
                                    <div class="form-group">
                                        <?php echo Form::select('periods['.$key.']['.$var->idPeriod.'][idSubject]',$subjects,null,['class' => 'form-control show-tick ms select2']); ?>

                                        <?php if($errors->has('periods.*')): ?>
                                            <div class="help-block">
                                                    <?php echo e($errors->first('periods.*idSubject')); ?>

                                              </div>
                                       <?php endif; ?>
                                    </div>
                                    <div class="form-group">
                                        <?php echo Form::select('periods['.$key.']['.$var->idPeriod.'][idEmployee]',$teachers,null,['class' => 'form-control show-tick ms select2']); ?>

                                        <?php if($errors->has('periods.*')): ?>
                                            <div class="help-block">
                                                    <?php echo e($errors->first('periods.*idEmployee')); ?>

                                              </div>
                                        <?php endif; ?>
                                    </div>
                                </td>
                                <?php else: ?>
                                <td style="background-color: #ffa60d;">
                                    <input type="hidden" name='periods[<?php echo e($key); ?>][<?php echo e($var->idPeriod); ?>][idSubject]'>
                                    <input type="hidden" name='periods[<?php echo e($key); ?>][<?php echo e($var->idPeriod); ?>][idEmployee]'>
                                </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('/school/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('/school/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>');
                    });
                }
            });
    }
});
jQuery(document).ready(function() {
         setTimeout(function() {
            var j = $('#testsec').val();
            console.log(j);
            $('select[name="idSection"] option[value="' + j + '"]').attr("selected","selected");
        }, 1000);
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7