IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/north/feeheads/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/north/feeheads/index.blade.php

@extends('schools.school_layout')
@section('content')
<div id="loader"></div>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="alert alert-success" role="alert" id="success_msg">
            </div>
            <div class="header">
                <button class="btn btn-raised btn-danger btn-round waves-effect" type="button" id="reload_page" style="float:right;">Clear Form</button>
                <h2><strong>@if(isset($feehead))Edit @else  Add @endif</strong> Fee Header</h2>
                
            </div>
            <div class="body">
                @if(isset($feehead))
                {!! Form::model($feehead, ['method' => 'PATCH', 'action' => ['School\NorthFeeHeaderController@update', $feehead->idFeehead], 'class' => 'form-horizontal']) !!}
                @else
                {!! Form::open(['url' => 'school/north/feeheads', 'class' => 'form-horizontal','id'=>'feehead_form']) !!}
                @endif
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Select Class</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            {!! Form::select('idClass',$classes,null,['class' => 'form-control show-tick ms select2']) !!}
                            @if ($errors->has('idClass'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idClass') }}</strong>
                            </label>
                            @endif
                            <span id='classerror'></span>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Select Section</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            @if(isset($feehead))
                            {!! Form::select('idSection',$section,null,['class' => 'form-control show-tick ms select2']) !!}
                            @else
                            <div id="idSection" style="border:1px solid #ccc; width:200px; height: 110px; overflow-y: scroll;">
                                
                            </div>
                            @if ($errors->has('idSection'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idSection') }}</strong>
                            </label>
                            @endif
                            <span id='sectionerror'></span>
                            @endif
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Student Category</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            @if(isset($feehead))
                             <div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="studentCategory" value="{{$feehead->studentCategory}}" class="categoryclass" checked disabled>
                                <label> {{$feehead->studentCategory}} </label>
                                </div>
                           @else 
                             
                            <div id="idCategory" style="border:1px solid #ccc; width:200px; height: 110px; overflow-y: scroll;">
                                <div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="studentCategory[]" value="All" class="categoryclass">
                                <label> All </label>
                                </div>
                              
                            @foreach($categories as $var)
                                 <div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="studentCategory[]" value="{{$var}}" class="categoryclass"><label> {{$var}} </label></div>
                            @endforeach
                        
                                </div>
                           @endif
                           
                            @if ($errors->has('studentCategory'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('studentCategory') }}</strong>
                            </label>
                            @endif
                             <span id='categoryerror'></span>
                        </div>
                    </div>
                     <div class="col-sm-2 form-control-label required">
                        <label for="classname">EC No.</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            @if(isset($feehead))
                            {!! Form::select('idStudent',$student,null,['class' => 'form-control show-tick ms']) !!}
                            @else
                                <div class="form-group">
                                {!! Form::text('search_ecno',null,['class' => 'form-control','placeholder'=>'Search EC No.']) !!}
                                <span id='search_error'></span>
                                </div>
                            <span style="color:red; font-size: 12px;">Please don't select this list if you want to save a structure on entire class or section.</span>
                            <div id="idStudent" style="border:1px solid #ccc; width:250px; height: 140px; overflow-y: scroll;">
                                
                            </div>
                            @if ($errors->has('ecNO'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('ecNO') }}</strong>
                            </label>
                            @endif
                            @endif
                        </div>
                    </div>
                </div>
                
                
                
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Demand Name</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            {!! Form::text('demandName',null,['class' => 'form-control']) !!}
                            <span id='feeheaderror'></span>
                        </div>
                    </div>
                    
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Amount</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <input name="amount" class="form-control" value="0" readonly/>
                            @if ($errors->has('amount'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('amount') }}</strong>
                            </label>
                            @endif
                            <span id='amounterror'></span>
                        </div>
                    </div>
                </div>
                
                
                <div class="row clearfix">
                     <div class="col-sm-8 offset-sm-2">
                    <table class="table" id="header_table">
                    <thead>
                        <tr>
                            <th></th>
                            <th>Header Name</th>
                            <th>Amount</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody  id="optional_list">
                      
                        <?php $i =1;?>
                        <tr>
                            <td class="sno">{{$i}}</td>
                            <td>
                                {!! Form::select('header[1][idHeader]',$heads,null,['class' => 'form-control show-tick ms','required'=>'required']) !!}
                                <span id="headererror1"></span>
                            </td>
                            <td>
                                {!! Form::number('header[1][amountName]',null,['class' => 'form-control','required'=>'required','id'=>"amount_1"]) !!}
                                <span id="amounterror1"></span>
                            </td>
                       </tr>
                        <?php $i++ ; ?>
                    </tbody>
                    <tr>
                            <td colspan="4" style="text-align: right"><input type="button" class="add-row btn btn-sm btn-success" value="Add Row"></td>
                        </tr>
                </table>
                   </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">
                            {!! 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
                            <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">
                            {!! 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
                            <span id='todate_error'></span>
                        </div>
                    </div>
                </div>
                
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="finename">Select Fine</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            {!! Form::select('idFine',['flat'=>'Flat Fine','per'=>'Fine Per Day'],null,['class' => 'form-control show-tick ms select2']) !!}
                            @if ($errors->has('idFine'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idFine') }}</strong>
                            </label>
                            @endif
                            <span id='fineerror'></span>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label required">
                        <label for="finename">FeeHeader Type</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            {!! Form::select('idType',$htypes,null,['class' => 'form-control show-tick ms select2']) !!}
                            @if ($errors->has('idType'))
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong>{{ $errors->first('idType') }}</strong>
                            </label>
                            @endif
                            <span id='typeerror'></span>
                        </div>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-8 offset-sm-2">
                        @if(isset($feehead))
                        {!! Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
                        @else
                        {!! Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']) !!}
                        @endif
                        {!! 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 Fee Demands</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>Class</th>
                            <th>Ec No</th>
                            <th>Section</th>
                            <th>Category</th>
                            <th>Demand</th>
                            <th>Amount</th>
                            <th>Date</th>
                            <th>Fine</th>
                            <th>Description</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 1;?>
                        @foreach($feeheads as $value)
                        <tr>
                            <td>{{$i}}</td>
                            <td>{{$value->classM->className}}</td>
                            <td>{{$value->student->ecNo or ''}}</td>
                            <td>{{$value->section->sectionName or ''}}</td>
                            <td>{{$value->studentCategory}}</td>
                            <td>{{$value->demandName}}</td>
                            <td>{{$value->amount}}</td>
                            <td>{{$value->fromDate}} To {{$value->toDate}}</td>
                            @if($value->fine == 'per')
                            <td>Fine Per Day</td>
                            @else
                            <td>Flat Fine</td>
                            @endif
                            <td>
                                <table  class="table-bordered">
                                    <thead>
                                        <tr>
                                            <th>Header Name</th>
                                            <th>Amount</th>
                                        </tr>
                                    </thead>
                                    <tboday>
                                      <?php 
                                            $description = \App\NorthFeeHead::where('isParent','=',$value->idFeehead)->get();?>
                                            @foreach($description as $headers)
                                                <tr>
                                                    <td>{{$headers->header->headerName or ''}}</td>
                                                    <td>{{$headers->amount}}</td>
                                                </tr>
                                            @endforeach
                                    </tboday>
                                </table>
                            </td>
                            <td>
                                <button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="{{$value->idFeehead}}" data-type="confirm">DELETE</button>
                                <a href="{{ url('school/north/feeheads/' . $value->idFeehead . '/edit') }}"  class="btn btn-raised btn-info waves-effect btn-round">Edit </a>
                            </td>
                        </tr>
                         <?php $i++; ?>
                        @endforeach
                    </tbody>
                    <tfoot>
                        <tr>
                            <th>S. No.</th>
                            <th>Class</th>
                            <th>Ec No</th>
                            <th>Section</th>
                            <th>Category</th>
                            <th>Demand</th>
                            <th>Amount</th>
                            <th>Date</th>
                            <th>Fine</th>
                            <th>Description</th>
                            <th>Action</th>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
@include('schools.north.feeheads.feehead_script')
<script>
$(document).ready(function() {
    $("#success_msg").hide();
    var i = $('.sno:last').text();
    $(".add-row").click(function(){
        i++;  
        var markup = '<tr><td class="sno">'+i+'</td>\
                <td><select name="header['+i+'][idHeader]" class = "form-control show-tick ms">@foreach($heads as $key=>$value)<option value="{{$key}}">{{$value}}</option>@endforeach</select><span id="headererror'+i+'"></span></td>\n\
                <td><input class="form-control" type="number" name="header['+i+'][amountName]" required="required" id="amount_'+i+'"><span id="amounterror'+i+'"></span></td>\n\
                <td style="text-align:right;vertical-align: middle;"><input type="button" class="btn btn-sm btn-danger" value="Delete" id="remove_row"></td></tr>';
            
            $("#optional_list").append(markup);
    });
    
    $('#optional_list').on('click', 'input[type="button"]', function () {
        $(this).closest('tr').remove();
        i = $('.sno:last').text();
        var totalAmount=0;
        $("#optional_list tr").each(function() {
          // Within tr we find the last td child element and get content
          $(this).find("td").find("input").each(function() {
                if(this.value !='Delete' && this.id !='' && this.value!='')
                 totalAmount=parseInt(totalAmount)+parseInt(this.value);
            });
        });
        $( "input[name='amount']" ).val(totalAmount);
        
    });
    $('#reload_page').on('click',function(){
       location.reload(); 
    });
   
    $("input[name='search_ecno']").on('input',function(e){
            var search_val=this.value;
             $('#idStudent > div').map(function() {
                    if($(this).text() != 'Select All'){
                        var res = $(this).text().split("(");    
                        var val = res[1].substring(0, 8);
                        if(val.toLowerCase().indexOf(search_val) >= 0) {
                            $(this).closest('.checkbox-inline').css('display', 'block');
                        }else  $(this).closest('.checkbox-inline').css('display', 'none');
                    }
                    
                });
    });
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7