IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/reports/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/reports/salary_pt.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>Salary Report</strong></h2>
                                </div>
                                <div class="body">
                                    {!! Form::open(['method' => 'GET',  'action' => ['School\SalaryReportController@ptReport'], 'class' => 'form-horizontal']) !!}
                                    <div class="row clearfix">
                                        <div class="col-sm-2 form-control-label required">
                                            <label for="classname">Department</label>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                {!! Form::select('idDepartment',$departments,null,['class' => 'form-control show-tick ms select2']) !!}
                                                @if ($errors->has('idDepartment'))
                                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                    <strong>{{ $errors->first('idDepartment') }}</strong>
                                                </label>
                                                @endif
                                                <span id='depterror'></span>
                                            </div>
                                        </div>
                                        <div class="col-sm-2 form-control-label">
                                            <label for="classname">Designation</label>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <div id="idDesignation" style="border:1px solid #ccc; width:200px; height: 110px; overflow-y: scroll;">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row clearfix">
                                        <div class="col-sm-2 form-control-label">
                                            <label for="classname">EC No.</label>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <div id="idEmployee" style="border:1px solid #ccc; width:250px; height: 140px; overflow-y: scroll;">

                                                </div>
                                                
                                            </div>
                                        </div>
                                        <div class="col-sm-2 form-control-label required">
                                            <label for="classname">Month</label>
                                        </div>
                                        <div class="col-sm-3">
                                             {!! Form::select('idMonth',getMonths(),null,['class' => 'form-control show-tick ms','required'=>'required']) !!}
                                             @if ($errors->has('idMonth'))
                                             <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                 <strong>{{ $errors->first('idMonth') }}</strong>
                                             </label>
                                             @endif
                                         </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>Employee PT Report </strong></h2>
            </div>
            <div class="body table-responsive">
                <table class="table table-bordered table-striped table-hover dataTable js-basic-example">
                    <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>Enrollment No</th>
                            <th>Name</th>
                            <th>Department</th>
                            <th>Designation</th>
                            <th>Month</th>
                            <th>PT Amount</th>
                        </tr>
                    </thead>
                    <tbody>
                        @if(isset($empsalaries) && isset($month))
                        <?php $i = 1; ?>
                        @foreach($empsalaries as $value)
                        <tr>
                            <th scope="row">{{$i}}</th>
                            <td>{{$value->enrollmentNo}}</td>
                            <td>{{$value->firstName}} {{$value->middleName}}  {{$value->lastName}}</td>
                            <td>{{$value->departmentName}}</td>
                            <td>{{$value->designationName}}</td>
                            <td>{{$month->monthName}}</td>
                            <th>{{$value->pt_data}}</th>
                        </tr>
                        <?php $i++; ?>
                        @endforeach
                        @else
                        <tr>
                            <th colspan="9" style="color:red;">Please Select Month To View the PT Report</th>
                        </tr>
                        @endif
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(document).ready(function() {
    $('select[name="idDepartment"]').on('change', function() {
        var departmentID = $(this).val();
        if(departmentID) {
            $.ajax({
                url: "{{url('/school/departments') }}"+'/' +departmentID + "/designations",
                type: "GET",
                dataType: "json",
                success:function(data) {
                    $('#idDesignation').empty();
                    $('#idDesignation').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-all" id="selectall"></div>');
                    $.each(data, function(key, value) {
                       $('#idDesignation').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;">'+value+'</label><input type="checkbox" name="designations[]" value="'+key+'" class="designationclass"></div>');
                        
                    });
                }
            });
        }else{
            $('select[name="idDesignation"]').empty();
        }
    });
});
$(document).on('click', '.select-all', function(){
    var checkAll = this.checked;
        if(checkAll === true){
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
            var designationIds = [];
            $("input:checkbox[name='designations[]']:checked").each(function () {
                designationIds.push($(this).val());
            });
            if (designationIds.length > 0) {
                    $.ajax({
                        url: "{{url('/school/designations') }}"+'/' +designationIds + "/employees",
                        type: "GET",
                        dataType: "json",
                        success:function(data) {
                            $('#idEmployee').empty();
                            $('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-allstd" id="selectallstd"></div>');
                            $.each(data, function(key, value) {
                               $('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:50px;">'+value+'</label><input type="checkbox" name="employees[]" value="'+key+'" class="empallselect"></div>');

                            });
                        }
                    });
                }
        }else{
            $('#idEmployee').empty();
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
        }
        
    
});
$(document).on('click', '.designationclass', function(){
    var designationIds = [];
        $("input:checkbox[name='designations[]']:checked").each(function () {
            designationIds.push($(this).val());
        });
        if (designationIds.length > 0) {
                $.ajax({
                        url: "{{url('/school/designations') }}"+'/' +designationIds + "/employees",
                        type: "GET",
                        dataType: "json",
                        success:function(data) {
                            $('#idEmployee').empty();
                            $('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-allstd" id="selectallstd"></div>');
                            $.each(data, function(key, value) {
                               $('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:50px;">'+value+'</label><input type="checkbox" name="employees[]" value="'+key+'" class="empallselect"></div>');

                            });
                        }
                    });
            }else{
                $('#idEmployee').empty();
            }
});
$(document).on('click', '.select-allstd', function(){
    var checkAllstd = this.checked;
        if(checkAllstd === true){
            $("input:checkbox[name='employees[]']").each(function () {
               this.checked = checkAllstd;
           });
        }else{
            $('.empallselect').each(function () {
                this.checked = checkAllstd;
            });
        }
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7