IMMREX7

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

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Add Transport Feehead</strong> </h2>
            </div>
            <div class="body">
                <?php if(isset($feehead)): ?>
                <?php echo Form::model($feehead, ['method' => 'PATCH', 'action' => ['School\BusFeeheadController@update', $feehead->idBusFeehead], 'class' => 'form-horizontal']); ?>

                <?php else: ?>
                <?php echo Form::open(['url' => 'school/busfeehead', 'class' => 'form-horizontal','id'=>'feehead_form']); ?>

                <?php endif; ?>

                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Select Route</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::select('idRoute',$busroutes,null,['class' => 'form-control show-tick ms','required'=>'required']); ?>

                            <?php if($errors->has('idRoute')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('idRoute')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Select Stop</label>
                    </div>
                    <div class="col-sm-3">
                    <div class="form-group">
                        <?php if(isset($feehead)): ?>
                        
                        <?php echo Form::select('idStop',$stops,null,['class' => 'form-control show-tick ms']); ?>

                       <?php else: ?>
                        <div id="idStop" style="border:1px solid #ccc; width:300px; height: 110px; overflow-y: scroll;">

                        </div>
                        <?php if($errors->has('idStop')): ?>
                        <label id="minmaxlength-error" class="error" for="minmaxlength">
                            <strong><?php echo e($errors->first('idStop')); ?></strong>
                        </label>
                        <?php endif; ?>
                        <span id='sectionerror'></span>
                        <?php endif; ?>
                    </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Fee Header Name</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::text('feeheadName',null,['class' => 'form-control']); ?>

                            <?php if($errors->has('feeheadName')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('feeheadName')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='feeheaderror'></span>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Fee ID</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php if(auth()->user()->idSchool == 25 || auth()->user()->idSchool == 163): ?>
                            <?php echo Form::select('feeheadLabel',['' => 'Not Applicable','Plan A' => 'Plan A','Plan B' => 'Plan B','Plan C' => 'Plan C',],null,['class' => 'form-control show-tick ms select2']); ?>

                            <?php else: ?>
                            <?php echo Form::select('feeheadLabel',['' => 'Not Applicable','Plan A' => 'Installment','Plan B' => 'Six Month Installment'],null,['class' => 'form-control show-tick ms select2']); ?>

                            <?php endif; ?>
                            <span id='feeheaderror'></span>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">From Date</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::text('fromDate',null,['class' => 'form-control datepicker']); ?>

                            <?php if($errors->has('fromDate')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('fromDate')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='fdate_error'></span>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">To Date</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::text('toDate',null,['class' => 'form-control datepicker']); ?>

                            <?php if($errors->has('toDate')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('toDate')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='todate_error'></span>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Amount</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::text('amount',null,['class' => 'form-control','onkeypress'=>'return onlyNumbersandSpecialChar(event)']); ?>

                            <?php if($errors->has('amount')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('amount')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='amounterror'></span>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label">
                        <input type="radio" name="fines" value="per" class="fineradio"> <label for="classname">Fine Per Day</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::text('fine',null,['class' => 'form-control','onkeypress'=>'return onlyNumbersandSpecialChar(event)']); ?>

                            <?php if($errors->has('fine')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('fine')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='fineerror'></span>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                     <div class="col-sm-2 form-control-label">
                        <label for="classname">Description</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::textarea('description',null,['class' => 'form-control','size'=>'30x2']); ?>

                            <?php if($errors->has('description')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('description')); ?></strong>
                            </label>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label">
                         <input type="radio" name="fines" value="flat" class="fineradio"> 
                        <label for="classname">Flat Fine</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::text('flatFine',null,['class' => 'form-control','onkeypress'=>'return onlyNumbersandSpecialChar(event)']); ?>

                            <?php if($errors->has('flatFine')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('flatFine')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='flatfineerror'></span>
                        </div>
                    </div>
                </div>

                <div class="row clearfix">
                    <div class="col-sm-8 offset-sm-2">
                        <?php if(isset($feehead)): ?>
                        <?php echo Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>

                        <?php else: ?>
                        <?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']); ?>

                        <?php endif; ?>
                        <?php echo Form::close(); ?> 
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>List Of Transport Fee Header</strong></h2>
            </div>
            <div class="body table-responsive">
                <?php echo Form::open(['method' => 'GET',  'action' => ['School\BusFeeheadController@index'], 'class' => 'form-horizontal']); ?>

                <div class="row clearfix">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-2 form-control-label">
                        <label for="classname">Financial Year</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                           <?php echo Form::select('idFinancialYear',fys(),null,['class' => 'form-control show-tick ms']); ?>

                        </div>
                    </div>
                    <div class="col-sm-2">
                        <?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>

                    </div>
                </div>
                <?php echo Form::close(); ?> 
                <br>
                <table class="table table-bordered table-striped table-hover js-exportable-fee dataTable">
                    <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>Fee Header</th>
                            <th>Route</th>
                            <th>Stop</th>
                            <th>Amount</th>
                            <th>Date</th>
                            <th>Fine Per Day</th>
                            <th>Flat Fine</th>
                            <th>Description</th>
                            <th>Created By</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 1; ?>
                        <?php $__currentLoopData = $feeheads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <th scope="row"><?php echo e($i); ?></th>
                            <td><?php echo e($value->feeheadName); ?></td>
                            <td><?php echo e($value->route->routeName); ?></td>
                            <td><?php echo e($value->stop->stopName); ?></td>
                            <td><?php echo e($value->amount); ?></td>
                            <td><?php echo e($value->fromDate); ?> To <?php echo e($value->toDate); ?></td>
                            <td><?php echo e($value->fine); ?></td>
                            <td><?php echo e($value->flatFine); ?></td>
                            <th><?php echo e($value->description); ?></th>
                            <th><?php echo e($value->name); ?></th>
                            <td>
                                <a href="<?php echo e(url('school/busfeehead/' . $value->idBusFeehead . '/edit')); ?>"  class="btn btn-raised btn-info waves-effect btn-round">Edit </a>
                                <button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($value->idBusFeehead); ?>" data-type="confirm">DELETE</button>
                            </td>
                        </tr>
                        <?php $i++; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).on('change', '.fineradio', function() {
    if (this.value == 'flat') {
        $('input[type=text][name=flatFine]').show();
        $('input[type=text][name=fine]').hide();
    }
    else if (this.value == 'per') {
        $('input[type=text][name=fine]').show();
        $('input[type=text][name=flatFine]').hide();
    }
});
$(document).ready(function() {
    $('.js-exportable-fee').DataTable({
            dom: 'Bfrtip',
            scrollY:        "500px",
            scrollX:        true,
            scrollCollapse: true,
            fixedColumns:   {
                left: 1
            },
            buttons: [
                { extend: 'csv', text: 'Export to Excel',title:'Bus Feehead List',
                    exportOptions: {
                        columns: [0,1,2,3,4,5,6,7,8,9]
                    }
                }
            ]
     });
    $('select[name="idRoute"]').on('change', function() {
        var routeID = $(this).val();
        if(routeID) {
            $.ajax({
                url: "<?php echo e(url('/school/routes')); ?>"+'/' +routeID + "/stops",
                type: "GET",
                dataType: "json",
                success:function(data) {
                    $('#idStop').empty();
                    $('#idStop').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) {
                       $('#idStop').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;">'+value+'</label><input type="checkbox" name="stops[]" value="'+key+'" class="sectionclass"></div>');
                        
                    });
                }
            });
        }else{
            $('select[name="idStop"]').empty();
        }
    });
});
$(document).on('click', '.select-all', function(){
    var checkAll = this.checked;
        if(checkAll === true){
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
            var sectionIds = [];
            $("input:checkbox[name='stops[]']:checked").each(function () {
                sectionIds.push($(this).val());
            });
        }else{
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
        }
    });
    // Delete Feehead
$(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 feeheader!",
            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/busfeehead/')); ?>" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Feehead has been successfully deleted", 
                    type: "success"
                },function() {
                    location.reload();
                });
            })
            .error(function(data) {
              swal("Oops", "We couldn't connect to the server!", "error");
            });
            return false;
    });
});

// Saving form data
$('#feehead_form').on('submit',function(e){
    $.ajaxSetup({
    header:$('meta[name="_token"]').attr('content')
});
 var formData =  new FormData($('#feehead_form')[0]);
 $("#submit-btn").prop('disabled', true);
    $.ajax({
        type:"POST",
        url: "<?php echo e(url('school/busfeehead')); ?>",
        processData: false,
        contentType: false,
        data:formData,
        dataType: 'json',
        success:function(data){
            if( data[Object.keys(data)[0]] === 'SUCCESS' ){
                $("#submit-btn").prop('disabled', true);
                window.location = "<?php echo e(url('school/busfeehead')); ?>";
            }
            else {                  //False Case: With error msg
            $("#msg").html(data);   //$msg is the id of empty msg
            }

        },

        error: function(data){
                    if( data.status === 422 ) {
                        $("#submit-btn").prop('disabled', false);
                        var errors = data.responseJSON.errors;
                        var errorHtml = '<div class="alert alert-danger"><ul>';
                           $('#formerrors').html(errorHtml);
                                
                                if(errors['idStop']=== undefined){
                                    $( '#sectionerror' ).empty();
                                }else{
                                   errorname = '<span class="help-block"><strong>'+errors['idStop']+'</strong></span>';
                                   $( '#sectionerror' ).html( errorname );
                                }
                                if(errors['feeheadName']=== undefined){
                                    $( '#feeheaderror' ).empty();
                                }else{
                                   errorname = '<span class="help-block"><strong>'+errors['feeheadName']+'</strong></span>';
                                   $( '#feeheaderror' ).html( errorname );
                                }
                                if(errors['fromDate']=== undefined){
                                    $( '#fdate_error' ).empty();
                                }else{
                                   errorname = '<span class="help-block"><strong>'+errors['fromDate']+'</strong></span>';
                                   $( '#fdate_error' ).html( errorname );
                                }
                                if(errors['toDate']=== undefined){
                                    $( '#todate_error' ).empty();
                                }else{
                                   errorname = '<span class="help-block"><strong>'+errors['toDate']+'</strong></span>';
                                   $( '#todate_error' ).html( errorname );
                                }
                                if(errors['amount']=== undefined){
                                    $( '#amounterror' ).empty();
                                }else{
                                   errorname = '<span class="help-block"><strong>'+errors['amount']+'</strong></span>';
                                   $( '#amounterror' ).html( errorname );
                                }
                                if(errors['fine']=== undefined){
                                    $( '#fineerror' ).empty();
                                }else{
                                   errorname = '<span class="help-block"><strong>'+errors['fine']+'</strong></span>';
                                   $( '#fineerror' ).html( errorname );
                                }
                                
                    }
            }
    });
    return false;
});
</script>
<?php $__env->stopSection(); ?>

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

Copyright © 2021 - 2025 IMMREX7