IMMREX7
@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>List Of Registered Students </strong></h2>
</div>
<div class="body table-responsive">
{!! Form::open(['method' => 'GET', 'action' => ['School\RegisteredStudentController@index'], 'class' => 'form-horizontal']) !!}
<div class="row clearfix">
<div class="col-sm-1 form-control-label">
<label for="classname">From Date</label>
</div>
<div class="col-sm-2">
<div class="form-group">
{!! Form::text('fromDate',null,['class' => 'form-control datepicker']) !!}
</div>
</div>
<div class="col-sm-1 form-control-label">
<label for="classname">To Date</label>
</div>
<div class="col-sm-2">
<div class="form-group">
{!! Form::text('toDate',null,['class' => 'form-control datepicker']) !!}
</div>
</div>
<div class="col-sm-2">
{!! Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
</div>
</div>
{!! Form::close() !!}
<br>
<table class="table table-bordered table-striped table-hover dataTable js-basic-example" id='tableexp'>
<thead>
<tr>
<th>S. No.</th>
<th>Date</th>
<th>Registration No.</th>
<th>Name</th>
<th>Admission For Class</th>
<th>Contact No</th>
<th>DOB</th>
<th>Gender</th>
<th>Payment Status</th>
<th>Status</th>
<th>Documents</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
@foreach($students as $value)
<tr>
<th scope="row">{{$i}}</th>
<th>{{Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $value->created_at)->format('d-M-Y')}}</th>
<td>{{$value->registrationNo}}</td>
<td>{{$value->firstName}} {{$value->middleName}} {{$value->lastName}}</td>
<td>{{$value->className}}</td>
<td>{{$value->contactPersonMobile}}</td>
<td>{{$value->studentDob}}</td>
<td>{{$value->gender}}</td>
<td>
<form method="post" id='paymentform{{$value->idRegistration}}}'>
{!! Form::select('paymentSTatus',['Pending'=>'Pending','Paid'=>'Paid'],$value->paymentStatus,['class' => 'form-control show-tick ms','required'=>'required','id'=>'payst'.$value->idRegistration]) !!}
@if(isset($value->paymentMode))
{!! Form::select('payMode',['Cash'=>'Cash','Online'=>'Online','Bank Transfer'=>'Bank Transfer'],$value->paymentMode,['class' => 'form-control show-tick ms','required'=>'required','id'=>'paymd'.$value->idRegistration]) !!}
@else
{!! Form::select('payMode',['Cash'=>'Cash','Online'=>'Online','Bank Transfer'=>'Bank Transfer'],null,['class' => 'form-control show-tick ms','required'=>'required','id'=>'paymd'.$value->idRegistration]) !!}
@endif
@if(isset($value->receiptNo))
{!! Form::text('receipt',$value->receiptNo,['class' => 'form-control','required'=>'required','placeholder'=>'Receipt Number','id'=>'receipt'.$value->idRegistration]) !!}
@else
{!! Form::text('receipt',null,['class' => 'form-control','required'=>'required','placeholder'=>'Receipt Number','id'=>'receipt'.$value->idRegistration]) !!}
@endif
<button type="button" id="paymentbtn{{$value->idRegistration}}" onclick="savePaymentStatus({{$value->idRegistration}})" class="btn btn-raised btn-success">UPDATE</button>
</form>
<span id="paysuccessmsg{{$value->idRegistration}}" style="color:green;"></span>
</td>
<td>@if($value->admitted == 'Y') Admitted @else @if($value->admitted == 'R') <b style="color:red">Rejected</b> <br>{{$value->remarks}} @else Not-Admiited @endif @endif</td>
<th><a href="{{url('school/registration/'.$value->idRegistration.'/documents')}}" target="_blank">View</a></th>
<td>
@php $sections = [''=>'Section'] + \App\Section::where('idClass','=',$value->idClass)->get()->pluck('sectionName','idSection')->toArray();@endphp
@if($value->admitted == 'N')
<a href="{{url('school/registered-students/'.$value->idRegistration)}}" class="btn btn-raised btn-success">Edit</a>
<a href="#" id="admit{{$value->idRegistration}}" onclick="showForm({{$value->idRegistration}});" class="btn btn-raised btn-success">ADMIT</a>
<a href="#" id="reject{{$value->idRegistration}}" onclick="rejForm({{$value->idRegistration}});" class="btn btn-raised btn-warning">REJECT</a>
@if(Auth::user()->idSchool == 25)
<a href="{{url('school/form/admission/print/'.$value->idRegistration)}}" class="btn btn-raised btn-success">Print/View</a>
@endif
@endif
<div id='adissionform{{$value->idRegistration}}' style="display: none;background:#fff;width:200px;">
<form method="post" id='admform{{$value->idRegistration}}}'>
{!! Form::select('idSection',$sections,null,['class' => 'form-control show-tick ms','required'=>'required','id'=>'section'.$value->idRegistration]) !!}
<br>
{!! Form::text('ecNo',null,['class' => 'form-control','required'=>'required','placeholder'=>'EC No','id'=>'ecno'.$value->idRegistration]) !!}
<button type="button" id="submitbtn{{$value->idRegistration}}" onclick="saveData({{$value->idRegistration}})" class="btn btn-raised btn-success">ADMIT</button>
</form>
<span id="successmsg{{$value->idRegistration}}" style="color:green;"></span>
</div>
<div id='rejectform{{$value->idRegistration}}' style="display: none;background:#fff;width:200px;">
<form method="post" id='rjform{{$value->idRegistration}}}'>
{!! Form::text('remarks',null,['class' => 'form-control','required'=>'required','placeholder'=>'Remarks','id'=>'remarks'.$value->idRegistration]) !!}
<button type="button" id="rejectbtn{{$value->idRegistration}}" onclick="rejectData({{$value->idRegistration}})" class="btn btn-raised btn-success">Reject</button>
</form>
<span id="rejmsg{{$value->idRegistration}}" style="color:green;"></span>
</div>
</td>
</tr>
<?php $i++; ?>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@stop
@section('script')
<script>
$(function () {
$("#tableexp").dataTable().fnDestroy();
$('#tableexp').DataTable({
dom: 'Bfrtip',
buttons: [
{ extend: 'csv', text: 'Export to Excel',title:'Student List',
/*exportOptions: {
columns: [13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74]
}*/
}
]
});
});
function savePaymentStatus(regid){
var pstatus = $("#payst"+regid).val();
var payMode = $("#paymd"+regid).val();
var payReceipt = $("#receipt"+regid).val();
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "POST",
url: "{{url('/school/update-regpaystatus/') }}",
data: {idRegistration:regid,paymentStatus:pstatus,receipt:payReceipt,mode:payMode},
dataType: 'json',
success: function (data) {
if (data[Object.keys(data)[0]] === 'SUCCESS') {
//True Case i.e. passed validation
$('#paysuccessmsg' + regid).empty();
$('#paysuccessmsg'+ regid).append('<span>Payment Status Updated !!</span>');
} else { //False Case: With error msg
$("#msg").html(data); //$msg is the id of empty msg
}
},
error: function (data) {
var errors = data.responseJSON.errors;
$('#errormsg' + patid).empty();
errorate = '<span class="help-block"><strong>' + errors['uhidno'] + '</strong></span>';
$('#errormsg' + patid).html(errorate);
}
});
}
function showForm(regid){
$('#adissionform'+regid).show();
$('#admit'+regid).hide();
$('#reject'+regid).hide();
}
function rejForm(regid){
$('#rejectform'+regid).show();
$('#reject'+regid).hide();
$('#admit'+regid).hide();
}
function saveData(regid) {
var section = $("#section"+regid).val();
var ecno = $("#ecno"+regid).val();
console.log(section);
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "POST",
url: "{{url('/school/registered-students/') }}",
data: {idRegistration:regid,idSection:section,ecNo:ecno},
dataType: 'json',
success: function (data) {
if (data[Object.keys(data)[0]] === 'SUCCESS') {
//True Case i.e. passed validation
$('#successmsg' + regid).empty();
$('#submitbtn'+regid).hide();
$('#successmsg'+ regid).append('<span>Data Saved Successfully !!</span>');
} else { //False Case: With error msg
$("#msg").html(data); //$msg is the id of empty msg
}
},
error: function (data) {
var errors = data.responseJSON.errors;
$('#errormsg' + patid).empty();
errorate = '<span class="help-block"><strong>' + errors['uhidno'] + '</strong></span>';
$('#errormsg' + patid).html(errorate);
}
});
}
function rejectData(regid) {
var remarks = $("#remarks"+regid).val();
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "POST",
url: "{{url('/school/reject-students/') }}",
data: {idRegistration:regid,remarks:remarks},
dataType: 'json',
success: function (data) {
if (data[Object.keys(data)[0]] === 'SUCCESS') {
//True Case i.e. passed validation
$('#rejmsg' + regid).empty();
$('#rejectbtn'+regid).hide();
$('#rejmsg'+ regid).append('<span>Data Saved Successfully !!</span>');
} else { //False Case: With error msg
$("#msg").html(data); //$msg is the id of empty msg
}
},
error: function (data) {
var errors = data.responseJSON.errors;
$('#errormsg' + patid).empty();
errorate = '<span class="help-block"><strong>' + errors['uhidno'] + '</strong></span>';
$('#errormsg' + patid).html(errorate);
}
});
}
</script>
@stop
Copyright © 2021 -