IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/f2e513271078e3cb0a24e58cd4b527ff7793b52f.php

<?php $__env->startSection('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">Add New Entry</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>Employee Loan</strong></h2>
                                </div>
                                <div class="body">
                                 <?php echo Form::open(['url' => 'school/salary-loan', '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">
                                                <?php echo Form::select('idDepartment',$departments,null,['class' => 'form-control show-tick ms select2']); ?>

                                                <?php if($errors->has('idDepartment')): ?>
                                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                    <strong><?php echo e($errors->first('idDepartment')); ?></strong>
                                                </label>
                                                <?php 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">
                                            <label for="classname">Total Loan Amount</label>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <?php echo Form::number('loan_amount',null,['class' => 'form-control', 'required'=>'required']); ?>

                                                <?php if($errors->has('loan_amount')): ?>
                                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                    <strong><?php echo e($errors->first('loan_amount')); ?></strong>
                                                </label>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row clearfix">
                                        <div class="col-sm-2 form-control-label">
                                            <label for="classname">Monthly Deduction</label>
                                        </div>
                                        <div class="col-sm-3">
                                            <div class="form-group">
                                                <?php echo Form::number('monthly_emi',null,['class' => 'form-control', 'required'=>'required']); ?>

                                                <?php if($errors->has('monthly_emi')): ?>
                                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                    <strong><?php echo e($errors->first('monthly_emi')); ?></strong>
                                                </label>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row clearfix">
                                        <div class="col-sm-8 offset-sm-2">
                                            <?php echo Form::submit('Submit',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>

                                            <?php echo 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 Loan</strong></h2>
            </div>
            <div class="body table-responsive">
                <div class="row clearfix" style="margin-bottom:30px;">
                    <div class="col-sm-12">
                        <div class="row clearfix">
                            <table class="table table-bordered table-striped table-hover js-basic-example dataTable">
                                <thead>
                                    <tr>
                                        <th>S. No</th>
                                        <th>Name</th>
                                        <th>Department</th>
                                        <th>Designation</th>
                                        <th>EC No.</th>
                                        <th>Loan<br>Amount</th>
                                        <th>Monthly<br>Amount</th>
                                        <th>Paid<br>Amount</th>
                                        <th>Balance<br>Amount</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $i =1; ?>
                                    <?php $__currentLoopData = $loan; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo e($i); ?></td>
                                            <td><?php echo e($value->employee->name); ?></td>
                                            <td><?php echo e($value->department->departmentName); ?></td>
                                            <td><?php echo e($value->designation->designationName); ?></td>
                                            <td><?php echo e(isset($value->employee->enrollmentNo) ? $value->employee->enrollmentNo : ''); ?></td>
                                            <td><?php echo e($value->loan_amount); ?></td>
                                            <td><?php echo e($value->monthly_emi); ?></td>
                                            <td><?php echo e($value->loan_paid); ?></td>
                                            <td><?php echo e($value->loan_amount - $value->loan_paid); ?></td>
                                            <td><button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($value->id); ?>" data-type="confirm">DELETE</button></td>
                                        </tr>
                                        <?php $i++; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
    $(document).on('click', '.js-sweetalert', function (e) {
    $.ajaxSetup({
        headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    e.preventDefault();
    var id = $(this).data('id');
    swal({
            title: "Are you sure?",
            text: "Are You sure you want to delete this data",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, delete it!",
            closeOnConfirm: true
        },
        function() {
         //   console.log('here');
            $.ajax({
                type: "DELETE",
                url: "<?php echo e(url('/school/salary-loan/')); ?>" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Data has been successfully deleted", 
                    type: "success"
                },function() {
                    location.reload();
                });
            })
            .error(function(data) {
              swal("Oops", "We couldn't connect to the server!", "error");
            });
            return false;
        });
    });
$('.selectAll').on('click', function () {
       var checkAll = this.checked;
       if(checkAll === true){
            $('input[type=checkbox]').each(function () {
                 this.checked = checkAll;
            });
        }else{
           $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });   
        }
});
$(document).ready(function() {
    $('#print_data').hide();
    $('select[name="idDepartment"]').on('change', function() {
        var departmentID = $(this).val();
        if(departmentID) {
            $.ajax({
                url: "<?php echo e(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();
        }
    });
    fetchEmployees(0);
});
$(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: "<?php echo e(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: "<?php echo e(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>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7