IMMREX7
@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
{!! Form::open(['method' => 'GET', 'action' => ['School\CreditNoteController@printCreditNote'],'target' => '_blank', 'class' => 'form-horizontal']) !!}
<div class="header">
<h2><strong>Credit Notes</strong></h2>
<br>
{!! Form::submit('Print',['class' => 'btn btn-raised btn-success btn-round waves-effect']) !!}
<br>
@if ($errors->has('student'))
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong>{{ $errors->first('student') }}</strong>
</label>
@endif
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover dataTable js-basic-example">
<thead>
<tr>
<th>Select TO Print</th>
<th>Ec No.</th>
<th>Name</th>
<th>Father </th>
<th>Mobile</th>
<th>Class</th>
<th>Section</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
@foreach($creditnotes as $var)
@if($var->student->isActive == 'Y')
<tr>
<td><input type="checkbox" value="{{$var->idNotes}}" name='notes[]'></td>
<td>{{$var->student->ecNo}}</td>
<td>{{$var->student->firstName}} {{$var->student->middleName}} {{$var->student->lastName}}</td>
<td>{{$var->student->father_fname}} {{$var->student->father_lname or ''}}</td>
<td>{{$var->student->father_mobile}}</td>
<td>{{$var->student->classM->className}}</td>
<td>{{$var->student->section->sectionName}}</td>
</tr>
<?php $i++; ?>
@endif
@endforeach
</tbody>
</table>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@stop
@section('script')
<script>
$(document).on('click', '.class_ids', function(){
//var checkAll = this.checked;
var classIds = [];
$("input:checkbox[name='classes[]']:checked").each(function () {
classIds.push($(this).val());
});
if (classIds.length > 0) {
$.ajax({
url: "{{url('/school/schclass') }}"+'/' +classIds + "/sections",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSection').empty();
$('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><input type="checkbox" class="select-all" id="selectall"><label><strong>Select All</label></strong></div>');
$.each(data, function(key, value) {
$('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="sections[]" value="'+key+'" class="sectionclass"><label>'+value+'</label></div>');
});
}
});
}
});
$(document).on('click', '.select-all', function(){
var checkAll = this.checked;
if(checkAll === true){
$('.sectionclass').each(function () {
this.checked = checkAll;
});
}else{
$('.sectionclass').each(function () {
this.checked = checkAll;
});
}
});
</script>
@stop
Copyright © 2021 -