IMMREX7

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

@extends('superadmin.layout')
@section('content')
<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Edit </strong> Section</h2>
            </div>
            <div class="body">
                @if(isset($schoolName))
                {!! Form::open(['url' => 'admin/section-update', 'class' => 'form-horizontal']) !!}
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">School Name</label>
                    </div>
                    <div class="col-sm-4">
                        <div class="form-group">
                           {!! Form::select('schoolName', $schoolName, null, ['class' => 'form-control show-tick ms select2', 'required' => 'required']) !!}
                            @if ($errors->has('schoolName'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('schoolName') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
                    <div class="col-sm-3 form-control-label required">
                        <label for="classname">Class</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           {!! Form::select('idClass', [], null, ['class' => 'form-control show-tick ms select2', 'required' => 'required']) !!}
                            @if ($errors->has('idClass'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idClass') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
                    <div class="col-sm-3 form-control-label required">
                        <label for="classname">Section</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           {!! Form::select('idSection', [], null, ['class' => 'form-control show-tick ms select2', 'required' => 'required']) !!}
                            @if ($errors->has('idSection'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idSection') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
                    <div class="col-sm-3 form-control-label required">
                        <label for="classname">Student</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           {!! Form::select('idStudent', [], null, ['class' => 'form-control show-tick ms select2', 'required' => 'required']) !!}
                            @if ($errors->has('idStudent'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idStudent') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
                    <div class="col-sm-3 form-control-label required">
                        <label for="classname">Changed Class</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           {!! Form::select('idChangeClass', [], null, ['class' => 'form-control show-tick ms select2', 'required' => 'required']) !!}
                            @if ($errors->has('idChangeClass'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idChangeClass') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
                    <div class="col-sm-3 form-control-label required">
                        <label for="classname">Changed Section</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           {!! Form::select('idChangeSection', [], null, ['class' => 'form-control show-tick ms select2', 'required' => 'required']) !!}
                            @if ($errors->has('idChangeSection'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idChangeSection') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
                    @endif
                    @if(isset($transaction))
                    {!! Form::open(['url' => 'admin/section-update/'.$student->idStudent, 'class' => 'form-horizontal']) !!}
                    <input name="_method" type="hidden" value="PUT">
                    @php
                    $cClass = DB::table('classes')->select('idClass','className')->where('idClass',$student->idClass)->first();
                    $cSection = DB::table('sections')->select('idSection','sectionName')->where('idSection',$student->idSection)->first();
                    @endphp
                    <fieldset id="payfee">
                        <input class="form-control" type="hidden"  value="{{$student->idStudent}}" name="idStudent">
                        <input class="form-control" type="hidden"  value="{{$updateClass->idClass}}" name="idClass">
                        <input class="form-control" type="hidden"  value="{{$updateSection->idSection}}" name="idSection">
                        <p class="form-control-static" style="font-weight: bold">Current Student Details</p>
                        <table class="table">
                                <thead>
                                    <tr>
                                        <th>EC No</th>
                                        <th>Student Name</th>
                                        <th>Class</th>
                                        <th>Section</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>{{ $student->firstName }}</td>
                                        <td>{{ $student->ecNo }}</td>
                                        <td>{{ $cClass->className }}</td>
                                        <td>{{ $cSection->sectionName }}</td>
                                    </tr>
                                </tbody>
                            </table>
                    <p class="form-control-static" style="font-weight: bold">Transfer Details</p>
                            <table class="table">
                                <thead>
                                    <tr>
                                        <th>Class</th>
                                        <th>Section</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>{{ $updateClass->className }}</td>
                                        <td>{{ $updateSection->sectionName }}</td>
                                    </tr>
                                </tbody>
                            </table>
                        <p class="form-control-static" style="font-weight: bold">Payment Transfer</p>
                        <div class="row clearfix" >
                            <div class="col-sm-12 form-control-label">
                                <label>Please update the payment information in case of section transfer otherwise section update will not be reflected</label>
                            </div>
                            <table class="table">
                                <thead>
                                    <tr>
                                        <th>Current Header</th>
                                        <th>Transfer Header</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $k = 0;?>
                                    @foreach($paidfees as $paidfee)
                                    <?php
                                        $feehead = DB::table('feeheads')->where('idFeehead',$paidfee->idFeehead)->first();
                                        $k++;
                                    ?>
                                    @if(isset($feehead))
                                    <tr>
                                        <td>
                                            <input class="form-control" type="hidden"  name = "feeheader[{{$k}}][type]" value="full">
                                            <input class="form-control" type="hidden"  name = "feeheader[{{$k}}][old]" value="{{$feehead->idFeehead}}">
                                            <input class="form-control" type="text"  value="{{$feehead->feeheadName}}" readonly>
                                        </td>
                                        <td>
                                            <select name='feeheader[{{$k}}][new]' class="form-control show-tick ms select2">
                                                <option value="">--- Select ---</option>
                                                @foreach ($ufeeheaders as $key => $value)
                                               <option value="{{ $key }}" @if( $feehead->feeheadName == $value) selected @endif>{{ $value }}</option>
                                                @endforeach
                                            </select>
                                        </td>
                                    </tr>
                                    @endif
                                    @endforeach
                                    @foreach($lesserfees as $paidfee)
                                    <?php
                                        $feehead = DB::table('feeheads')->where('idFeehead',$paidfee->idFeehead)->first();
                                        $k++;
                                    ?>
                                    @if(isset($feehead))
                                    <tr>
                                        <td>
                                            <input class="form-control" type="hidden"  name = "feeheader[{{$k}}][type]" value="less">
                                            <input class="form-control" type="hidden"  name = "feeheader[{{$k}}][old]" value="{{$feehead->idFeehead}}">
                                            <input class="form-control" type="text"  value="{{$feehead->feeheadName}}" readonly>
                                        </td>
                                        <td>
                                            <select name='feeheader[{{$k}}][new]' class="form-control show-tick ms select2">
                                                <option value="">--- Select ---</option>
                                                @foreach ($ufeeheaders as $key => $value)
                                               <option value="{{ $key }}" @if( $feehead->feeheadName == $value) selected @endif>{{ $value }}</option>
                                                @endforeach
                                            </select>
                                        </td>
                                    </tr>
                                    @endif
                                    @endforeach
                                    <input class="form-control" type="hidden"  value="{{$k}}" id="feeNumber">
                                </tbody>
                            </table>
                        </div>
                    </fieldset>
                    @endif
                    <div class="col-sm-3">
                        {!! Form::submit('SAVE', ['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
                        {!! Form::close() !!} 
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(document).ready(function() {

    $('select[name="schoolName"]').on('change', function () {
        var classID = $(this).val();
        if (classID) {
            $.ajax({
                url: "{{url('/admin/section-update') }}" + '?id=' + classID + '&name=classes',
                type: "GET",
                dataType: "json",
                success: function (data) {
                    $('select[name="idClass"]').empty();
                    $('select[name="idClass"]').append('<option value="">--- Select ---</option>');
                    $.each(data, function (key, value) {
                        $('select[name="idClass"]').append('<option value="' + key + '">' + value + '</option>');
                    });

                    $('select[name="idChangeClass"]').empty();
                    $('select[name="idChangeClass"]').append('<option value="">--- Select ---</option>');
                    $.each(data, function (key, value) {
                        $('select[name="idChangeClass"]').append('<option value="' + key + '">' + value + '</option>');
                    });
                }
            });
        } else {
            $('select[name="idClass"]').empty();
            $('select[name="idChangeClass"]').empty();
        }
    });

    $('select[name="idClass"]').on('change', function () {
        var classID = $(this).val();
        if (classID) {
            $.ajax({
                url: "{{url('/admin/section-update') }}" + '?id=' + classID + '&name=section',
                type: "GET",
                dataType: "json",
                success: function (data) {
                    $('select[name="idSection"]').empty();
                    $('select[name="idSection"]').append('<option value="">--- Select ---</option>');
                    $.each(data, function (key, value) {
                        $('select[name="idSection"]').append('<option value="' + key + '">' + value + '</option>');
                    });

                    $('select[name="idChangeSection"]').empty();
                    $('select[name="idChangeSection"]').append('<option value="">--- Select ---</option>');
                    $.each(data, function (key, value) {
                        $('select[name="idChangeSection"]').append('<option value="' + key + '">' + value + '</option>');
                    });
                }
            });
        } else {
            $('select[name="idSection"]').empty();
            $('select[name="idChangeSection"]').empty();
        }
    });

    $('select[name="idSection"]').on('change', function () {
        var classID = $(this).val();
        if (classID) {
            $.ajax({
                url: "{{url('/admin/section-update') }}" + '?id=' + classID + '&name=student',
                type: "GET",
                dataType: "json",
                success: function (data) {
                    $('select[name="idStudent"]').empty();
                    $('select[name="idStudent"]').append('<option value="">--- Select ---</option>');
                    $.each(data, function (key, value) {
                        $('select[name="idStudent"]').append('<option value="' + key + '">' + value + '</option>');
                    });
                }
            });
        } else {
            $('select[name="idStudent"]').empty();
        }
    });
});
    
</script>
@stop

Copyright © 2021 - 2025 IMMREX7