@extends('admin/layouts/default') {{-- Page title --}} @section('title') Student Cafe Kiosk @parent @stop {{-- Header Styles --}} @section('header_styles') @stop @section('content')
{{-- Top Header Section --}}

CAFETERIA

00:00:00
@php $valida = DB::table('students')->where('id', $m_name)->where('std_status', 0)->count(); @endphp @if($valida < 1) @else @php $currenttime = date('H:i:s'); $mnu = DB::table('time_tables') ->where('strt_time', '<=', $currenttime) ->where('end_time', '>=', $currenttime) ->first(); @endphp @if(!$mnu) @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) @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 @endif {{-- Main Student Display --}}
STUDENT IMAGE

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