@extends('layouts.admissions') @section('content')
@if (count($errors) > 0)
@endif
{{csrf_field()}}
@if(!empty($filtered)) @else @endif @php function latestpayment($reg) { $res = \DB::table('payment') ->where('Mpesa_Account', '=', $reg) ->orderBy('Date_received', 'DESC') ->select('Date_received') ->first(); if (!$res) { return "Check payment"; } else { return $res->Date_received; } } @endphp
@if(!empty($students))
@foreach($students as $key) @endforeach
# RegNo Name NationalID Email Gender Campus Joining Date Acad.Year Phone Alt. Phone County Subcounty Constituency Date paid Enrolled On Action
{{$i++}} {{$key->reg_num}} {{$key->first_name . " " . $key->middle_name . " " . $key->last_name}} {{$key->id_number}} {{$key->email}} {{$key->gender}} {{$key->name}} {{$key->joining_date}} {{$key->year . "-" . $key->intake}} {{$key->phone}} {{$key->altphone}} {{$key->county}} {{$key->subcounty}} {{$key->const}} {{latestpayment($key->reg_num)}} {{$key->enrolled_on}} View payment
@else
No Data Available
@endif
@stop