IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/exams/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/exams/print_exam.blade.php

@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Download </strong>Template</h2>
            </div>
            <div class="card-body">
            @if(count($students) == 0)   
            <p> Apply filter for which class , section and subject you want to upload the marks.</p> 
            {!! Form::open(['method' => 'GET',  'action' => ['School\Exam\ExamPrintMasterController@index'], 'class' => 'form-horizontal']) !!}
                    <div class="row clearfix">
                        <div class="col-sm-2 form-control-label">
                            <label for="classname">Class</label>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group">
                                    {!! Form::select('idClass',$classes,null,['class' => 'form-control select2 show-tick ms','required'=>'required']) !!}
                            </div>
                        </div>
                         <div class="col-sm-2 form-control-label">
                            <label for="classname">Section</label>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group">
                            <div id="idSection" style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">
                            </div>
                            </div>
                        </div>
                     </div>
                     <div class="row clearfix">
                        <div class="col-sm-2 form-control-label">
                            <label for="classname">Type</label>
                        </div>
                        <div class="col-sm-2">
                            <div class="form-group">
                                {!! Form::select('idType',['S' => 'Scholastic Area','O' => 'Other Area'],null,['class' => 'form-control show-tick ms','required'=>'required']) !!}
                            </div>
                        </div>
                        <div class="col-sm-6">
                            {!! Form::submit('View Students',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
                            {!! Form::close() !!} 
                        </div>
                     </div>
                @else
                <a href="/school/exam-print/master" class="btn btn-warning">Reset Filter</a>  
                @endif
                <hr>

                @if(count($students) > 0)
                <table class="table table-hover table-bordered" id="studentTable" style="overflow: auto;">
                        <thead>
                            <th>EC No</th>
                            <th>Student Name</th>
                            <th>Class</th>
                            <th>Section</th>
                            <th>Subject Name</th>
                            <th>Subject Code</th>
                            @foreach ($tableParams as $key => $value)
                                <th>{{ $value }}</th>
                            @endforeach
                        </thead>
                        <tbody>
                            @foreach ($students as $var)
                                @php $i=0;@endphp
                                @foreach ($subjects as $key => $value)
                                <tr>
                                    <td>{{$var->ecNo}}</td>
                                    <td>@if($i==0){{$var->name}}@endif</td>
                                    <td>@if($i==0){{$var->className}}@endif</td>
                                    <td>@if($i==0){{$var->sectionName}}@endif</td>
                                    <td>{{$value}}</td>
                                    <td>{{$key}}</td>
                                    @foreach ($tableParams as $key => $value)
                                    <td></td>
                                    @endforeach
                                </tr>
                                @php $i++;@endphp
                                @endforeach
                            @endforeach
                        </tbody>
                    </table>
                <hr>
                    @endif
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(document).ready(function() {
   @if(count($students) > 0) 
   $('#studentTable').DataTable({
        responsive: true,
        dom: 'Bfrtip',
        scrollX:        true,
            scrollCollapse: true,
            fixedColumns:   {
                left: 2
            },
            buttons: [
                 'excel'
            ]
    });  
    @else
    $('#studentTable').DataTable();
    @endif
    $('select[name="idType"]').on('change', function() {
        var typeId = $(this).val();
        if(typeId == "S"){
            $('#error-layout').hide();
            $('#subject-layout').show();
        }else{
            $('#error-layout').show();
            $('#subject-layout').hide();
        }
    });
    $('select[name="idClass"]').on('change', function() {
        var classID = $(this).val();
        if(classID) {
            $.ajax({
                url: "{{url('/school/class') }}"+'/' +classID + "/sections",
                type: "GET",
                dataType: "json",
                success:function(data) {
                    $('#idSection').empty();
                    $('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><input type="checkbox" class="select-all" id="selectall"><strong>Select All</label></strong></div>');
                    $.each(data, function(key, value) {
                       $('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="sections[]" value="'+key+'" class="sectionclass"><label style="margin-right:100px;">'+value+'</label></div>');
                        
                    });
                }
            });
        }else{
            $('select[name="idSection"]').empty();
        }
    }); 
});
$(document).on('click', '.select-all', function(){
    var checkAllstd = this.checked;
        if(checkAllstd === true){
            $("input:checkbox[name='sections[]']").each(function () {
               this.checked = checkAllstd;
           });
        }else{
            $('.sectionclass').each(function () {
                this.checked = checkAllstd;
            });
        }
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7