@extends('admin/layouts/default')
{{-- Page title --}}
@section('title')
Student Cafe Kiosk
@parent
@stop
{{-- Header Styles --}}
@section('header_styles')
@stop
@section('content')
{{-- Top Header Section --}}
@php
$valida = DB::table('students')->where('id', $m_name)->where('std_status', 0)->count();
@endphp
@if($valida < 1)
⚠️ ACCESS DENIED: STUDENT NOT REGISTERED
@else
@php
$currenttime = date('H:i:s');
$mnu = DB::table('time_tables')
->where('strt_time', '<=', $currenttime)
->where('end_time', '>=', $currenttime)
->first();
@endphp
@if(!$mnu)
ይቅርታ አሁን ምንም አይነት አገልግሎት መስጠት አይቻልም (No Active Meal Session)
@else
@php
$value1 = $mnu->mnu_name;
$todayDate = date("Y-m-d");
$id = $m_name;
$alreadyServed = DB::table('mealcards')
->where('std_id', $id)
->where($value1, 1)
->where('date', $todayDate)
->count();
$isRegisteredForToday = DB::table('mealcards')
->where('std_id', $id)
->where('date', $todayDate)
->count();
// Check for photo with .JPG or .jpg extension
$photoPathJPG = public_path('uploads/students/stud_photo/' . $photo . '.JPG');
$photoPathjpg = public_path('uploads/students/stud_photo/' . $photo . '.jpg');
if (file_exists($photoPathJPG)) {
$photoUrl = url('/') . '/uploads/students/stud_photo/' . $photo . '.JPG';
} elseif (file_exists($photoPathjpg)) {
$photoUrl = url('/') . '/uploads/students/stud_photo/' . $photo . '.jpg';
} else {
// Fallback to default image if neither exists
$photoUrl = url('/') . '/uploads/students/stud_photo/default.jpg';
}
@endphp
@if($alreadyServed >= 1)
❌ ይቅርታ. ተጠቅመዋል እናመሰግናለን!! (ALREADY SERVED)
@else
@php
if($isRegisteredForToday > 0) {
DB::table('mealcards')->where('std_id', $id)->where('date', $todayDate)->update([$value1 => 1]);
} else {
DB::table('mealcards')->insert([
'std_id' => $id,
'std_fname' => $std_fname,
'std_lname' => $std_mname,
'date' => $todayDate,
$value1 => 1
]);
}
@endphp
✅ እንኳን ደህና መጡ መልካም {{ $value1 }} (VALID CARD)
@endif
{{-- Main Student Display --}}
Student Information
| Registration ID |
{{ $id }} |
| Full Name |
{{ $std_fname }} {{ $std_mname }} |
| Gender |
{{ $sex }} |
| Academic Unit |
{{ $college }} |
| Department |
{{ $department }} |
| Year / Batch |
Batch {{ $batch }} |
| Current Meal |
{{ $value1 }} |
@endif
@endif
@stop
@section('footer_scripts')
@stop