IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/hrms/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/hrms/leave_requests.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><a href="{{url('school/add-leave-requests')}}" class="btn btn-raised btn-primary btn-round waves-effect" style="background:black;">Add New</a></strong></h2>
            </div>
            <div class="body">
                @if (\Session::has('error'))
                    <div class="alert alert-danger">
                        <p>Problem found</p>   
                        <ul>
                            <li>{!! \Session::get('error') !!}</li>
                        </ul>
                    </div>
                @endif
                {!! Form::open(['method' => 'GET',  'action' => ['School\LeaveController@leaveRequests'], 'class' => 'form-horizontal']) !!}
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">From Date</label>
                    </div>
                    <div class="col-sm-2">
                        <div class="form-group">
                            {!! Form::text('fromDate',null,['class' => 'form-control datepicker']) !!}
                            @if ($errors->has('fromDate'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('fromDate') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">To Date</label>
                    </div>
                    <div class="col-sm-2">
                        <div class="form-group">
                            {!! Form::text('toDate',null,['class' => 'form-control datepicker']) !!}
                            @if ($errors->has('toDate'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('toDate') }}</strong>
                            </label>
                            @endif
                        </div>
                    </div>
               
                     <div class="col-sm-2 form-control-label">
                        {!! Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']) !!}
                        {!! Form::close() !!}
                    </div>
                </div>
            </div>
            <div class="body table-responsive">
                <table class="table table-bordered table-striped table-hover js-basic-example dataTable">
                    <thead>
                        <tr>
                            <th>EC No.</th>
                            <th>Name</th>
                            <th>Department</th>
                            <th>Designation</th>
                            <th>From Date</th>
                            <th>To Date</th>
                            <th>Leave Type</th>
                            <th>Message</th>
                            <th>Document</th>
                            <th>Issued By</th>
                            <th colspan="2">Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($empleaves as $value)
                        @if(isset($value->employee))
                        <tr>
                            <td>{{$value->employee->enrollmentNo}}</td>
                            <td>{{$value->employee->firstName}} {{$value->employee->middleName}} {{$value->employee->lastName}}</td>
                            <td>{{$value->employee->department->departmentName}}</td>
                            <td>{{$value->employee->designation->designationName}}</td>
                            <td>{{Carbon\Carbon::parse($value->leave_from)->format("d-m-Y")}}</td>
                            <td>{{Carbon\Carbon::parse($value->leave_to)->format("d-m-Y")}}</td>
                            <td>{{$value->leave_type}}</td>
                            <td>{{$value->leave_message}}</td>
                            <td> @if(isset($value->documents)) <a href="{{url('/school/leave-document/' . $value->idLeave.'/view')}}" target="_blank">View Document</a> @else NA @endif</td>
                            <td>
                                @php $emp = \App\Employee::where('idEmployee', '=', $value->updated_by)->first(); @endphp
                                @if($emp != null) {{$emp->name}} @endif
                                @if($value->name != null) {{$value->name}} @endif
                            </td>
                            <td>@if($value->status != null) {{$value->status}} @endif</td>
                            <td>@if($value->status != null) {{$value->remarks}} @else <a class="btn btn-sm btn-success" href="{{url('/school/leave-window/'.$value->idLeave)}}" target="_blank">Update Status</a> @endif</td>
                        </tr>
                        @endif
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(document).ready(function() {
    $('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('<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: "{{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>');
                    });
                }
            });
    }
});
$(document).ready(function(){
 $('#bouncecharge').hide(); 
 $('#chqstatus').change(function() {
        var val = $(this).val();
        if((val == 'R')){
           $('#bouncecharge').show();
        }else{
           $('#bouncecharge').hide();
        }
    });
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7