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/reports.blade.php

@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12">
        <!--<div class="card">-->
        <div class="body">
            <button class="btn btn-raised btn-warning btn-round waves-effect" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">Advance Search</button>
            <div class="collapse" id="collapseExample">
                <div class="well">
                    <div class="row clearfix">
                        <div class="col-lg-12 col-md-12 col-sm-12">
                            <div class="card">
                                <div class="header">
                                    <h2><strong>Advance Search</strong></h2>
                                </div>
                                <div class="body">
                                    {!! Form::open(['method' => 'GET',  'action' => ['School\Exam\AddMarksController@reports'], 'class' => 'form-horizontal']) !!}
                                    <div class="row clearfix">
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <label for="classname"><strong>Select Class</strong></label><br>
                                                {!! Form::select('idClass',[''=>'--Select--']+$classes,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">
                                            <div class="form-group">
                                                <label for="classname"><strong>Select Section</strong></label><br>
                                                <input type="checkbox" id="idSectionAll" name="idSectionAll" value="selectall">
                                                <label for="idSectionAll" style="color:green"> Select All </label><br>
                                                <select name="sections[]" multiple="multiple" id="idSection">
                                                </select>

                                                @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">
                                            <div class="form-group">
                                                <label for="exams"><strong>Select Exam</strong></label><br>
                                                <select name="idExam" id="idExam" class="form-control show-tick ms">
                                                </select>
                                                @if ($errors->has('idExam'))
                                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                    <strong>{{ $errors->first('idExam') }}</strong>
                                                </label>
                                                @endif
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <label for="classname"><strong>Select Subject</strong></label><br>
                                                <input type="checkbox" id="idSubjectAll" name="idSubjectAll" value="selectall">
                                                <label for="idSubjectAll" style="color:green"> Select All </label><br>
                                                
                                                <select name="subjects[]" multiple="multiple" id="idSubject" required>
                                                </select>
                                                @if ($errors->has('idSubject'))
                                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                    <strong>{{ $errors->first('idSubject') }}</strong>
                                                </label>
                                                @endif
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row clearfix">
                                        <div class="col-sm-8 offset-sm-2">
                                            {!! Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
                                            {!! Form::close() !!} 
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--</div>-->
    </div>
</div>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Marks Report</strong></h2>
            </div>
            <div class="body table-responsive">
                <table class="table table-bordered table-striped table-hover dataTable" id="tableexp">
                <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>EC No</th>
                            <th>Name</th>
                            <th>Class</th>
                            <th>Section</th>
                            @if(isset($subjects))
                            @foreach($subjects as $key=>$value)
                            <th colspan="4">{{$value}}</th>
                            @endforeach
                            @endif
                            <th>Action</th>
                        </tr>
                        <tr>
                            <td colspan="5"></td>
                            @if(isset($subjects))
                            @foreach($subjects as $key=>$value)
                            <td>Theory</td>
                            <td>Pratical</td>
                            <td>Marks Obtained</td>
                            <td>Total Marks</td>
                            @endforeach
                            @endif
                            <td></td>
                        </tr>
                    </thead>
                    <tbody>
                        
                        <?php $i = 1; ?>
                        @foreach($students as $value)
                        <tr>
                            <td scope="row">{{$i}}</td>
                            <td>{{$value->ecNo}}</td>
                            <td>{{$value->name}}</td>
                            <td>@if(isset($value->classM)) {{$value->classM->className}} @endif</td>
                            <td>@if(isset($value->section)) {{$value->section->sectionName}} @endif</td>
                            @if(isset($subjects))
                            @foreach($subjects as $id=>$subject)
                            @php
                            $result = \App\ExamSheet::where('exam_marksheet.idSubject',$id)->where('exam_marksheet.idStudent',$value->idStudent)->where('exam_marksheet.idSchool',$value->idSchool)->where('exam_marksheet.idFinancialYear', $value->idFinancialYear)->where('idExam',$idExam)->first();  
                            @endphp
                            
                            @if($result != null)
                                @if($result->status == "A")
                                    <td style="background: red;color: white;">Absent</td>
                                    <td style="background: red;color: white;">Absent</td>
                                    <td style="background: red;color: white;">Absent</td>
                                @else
                                    @if(isset($result->marks))
                                    <td>{{$result->marks}}</td>
                                    @else
                                    <td>NA</td>
                                    @endif
                                    @if(isset($result->pratical))
                                    <td>{{$result->pratical}}</td>
                                    @else
                                        @if(isset($praticalArr[$id]))
                                        <td>NA</td>
                                        @else 
                                        <td>NA</td>
                                        @endif
                                    @endif

                                    @if(isset($result->total))
                                    <td>{{$result->total}}</td>
                                    @else
                                    @if(isset($result->grade))
                                    <td>{{$result->grade}}</td>
                                    @else
                                    <td>NA</td>
                                    @endif
                                    @endif
                                @endif    
                            @else
                            <td></td>
                            <td></td>
                            <td></td>
                            @endif

                            @if(isset($totalArr[$id]))
                            <td>{{$totalArr[$id]}}</td>
                            @else 
                            <td> - </td>
                            @endif
                            @endforeach
                            @endif
                            <td><a href="{{url('school/marks/exam-result/'.$idExam.'/view?student='.$value->idStudent)}}" target="_blank">View Detail Result</a></td>
                        </tr>
                        <?php $i++; ?>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(document).ready(function() { 
    $(function () {
        $('#tableexp').DataTable({
        
            dom: 'Bfrtip',
            scrollY:        "500px",
            scrollX:        true,
            scrollCollapse: true,
            fixedColumns:   {
                left: 1
            },
            buttons: [
                {
                     extend: 'csv', footer: true, text: 'Export to Excel',title:'Student MarkSheet Report',
                }
                
            ]
        });
    });
    $('#idSection').multiselect({
		        listWidth: 200,
		        cssEven: false,
		        cssOdd: false,
		    });
    $('#idSubject').multiselect({
		        listWidth: 200,
		        cssEven: false,
		        cssOdd: false,
		    });        
    var idSection = [];  
    var classID = ""  
    $('select[name="idClass"]').on('change', function() {
        classID = $(this).val();
        $.ajax({
                url: "{{url('school/class') }}"+'/' +classID + "/sections",
                type: "GET",
                dataType: "json",
                success:function(data) {
                    idSection = [];    
                    $('#idSectionAll').prop('checked', false);
                    $('#idSection_checklist ul').empty();
                    $.each(data, function(key, value) {
                       $('#idSection_checklist ul').append('<li tabindex="0" class=""><input type="checkbox" value="'+key+'" name="idSection[]" id="idSection_'+key+'"><label for="idSection_'+key+'" class="leaveRoomForCheckbox">'+value+'</label></li>');
                    });
                    $('#idSection_checklist ul li input[type=checkbox]').each(function(e) {
                        $(this).change(function(k) {
                            if(this.checked)
                            idSection.push($(this).val());
                            else {
                                var id = $(this).val();
                                idSection = idSection.filter(function(item) {
                                    return item !== id
                                });
                            }

                            $.ajax({
                                url: "{{url('/school/class') }}"+'/' +classID + "/sections"+'/' +idSection + "/exams",
                                type: "GET",
                                dataType: "json",
                                success:function(data) {
                                    $('#idExam').empty();
                                    $.each(data, function(key, value) {
                                        var option = $("<option />");
                                        option.html(value);
                                        option.val(key);
                                        $('#idExam').append(option);
                                    });
                                    
                                }
                            }); 

                        });
                    });
                }
            }); 

            $.ajax({
                url: "{{url('/school/class') }}"+'/' +classID + "/subjects",
                type: "GET",
                dataType: "json",
                success:function(data) {
                    $('#idSubjectAll').prop('checked', false);
                    $('#idSubject_checklist ul').empty();
                    subjects = data;
                    $.each(data, function(key, value) {
                       $('#idSubject_checklist ul').append('<li tabindex="0" class=""><input type="checkbox" value="'+key+'" name="idSubject[]" id="idSubject_'+key+'"><label for="idSubject_'+key+'" class="leaveRoomForCheckbox">'+value+'</label></li>');
                    });
                }
            });        
    });

    $("button[data-id=idSection").hide();
    $('#idSectionAll').change(function() {
        if(this.checked) {
            $("#idSection_checklist").addClass('checklistHighlighted');
            $("#idSection_checklist ul").children().addClass('checked');
            $("#idSection_checklist ul li input[type=checkbox]").each(function(e) {
                $(this).prop('checked', true);
                idSection.push($(this).val());
            });
            if(classID != ""){
                $.ajax({
                                url: "{{url('/school/class') }}"+'/' +classID + "/sections"+'/' +idSection + "/exams",
                                type: "GET",
                                dataType: "json",
                                success:function(data) {
                                    $('#idExam').empty();
                                    $.each(data, function(key, value) {
                                        var option = $("<option />");
                                        option.html(value);
                                        option.val(key);
                                        $('#idExam').append(option);
                                    });
                                    
                                }
                            });
            }
        }else{
            $("#idSection_checklist").removeClass('checklistHighlighted');
            $("#idSection_checklist ul").children().removeClass('checked');
            $("#idSection_checklist ul li input[type=checkbox]").each(function(e) {
                $(this).prop('checked', false);
                var id = $(this).val();
                                idSection = idSection.filter(function(item) {
                                    return item !== id
                                });
            });
        }   
    });

    $('#idSubjectAll').change(function() {
        if(this.checked) {
            $("#idSubject_checklist").addClass('checklistHighlighted');
            $("#idSubject_checklist ul").children().addClass('checked');
            $("#idSubject_checklist ul li input[type=checkbox]").each(function(e) {
                $(this).prop('checked', true);
            });
        }else{
            $("#idSubject_checklist").removeClass('checklistHighlighted');
            $("#idSubject_checklist ul").children().removeClass('checked');
            $("#idSubject_checklist ul li input[type=checkbox]").each(function(e) {
                $(this).prop('checked', false);
            });
        }   
    });

    $("button[data-id=idSection").hide();
    $("button[data-id=idSubject").hide();
    $("#idSection_actionButtons").hide(); 
    $("#idSubject_actionButtons").hide();
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7