<!DOCTYPE html>
<html>
<head>
 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">


<style>
body {
font-family: "Poppins", sans-serif;
font-weight: 400;
font-style: normal;
}
table, td, th {
  border: 1px solid;
}

table {
  width: 100%;
  border-collapse: collapse;
}

</style>
</head>
<body>
<div class="container">
    <div class="shadow-lg p-5" style="margin:10%">
        <div class="mb-3 text-center">
            <h1 class="fs-3 fw-bold">
                Rekomendasi Alternatif Makanan
            </h1>
            <p class="mt-4">
                Berdasarkan perhitungan menggunakan Sistem Pendukung Keputusan (SPK)
                menggunakan metode Simple Additive Weighting (SAW) dengan melakukan penilaian
                terhadap kriteria pada masing-masing alternatif makanan. 
            </p>
        </div>
        <div>
            <p class="mb-0">Nama : {{ $pasien->nama }} </p>
            <p>Kebutuhan Kalori : {{ $pasien->kebutuhanKalori->kebutuhan_kalori }}</p>
        </div>
        <table>
            <tr>
              <th class="p-2">Waktu</th>
              <th class="p-2">Makanan</th>
              <th class="p-2">Berat (g)</th>
              <th class="p-2">Kalori</th>
            </tr>
            @foreach ($pagi as $key1 => $detail)
            <tr>
              @if($key1 == 0)
              <td class="p-2">Pagi</td>
              @else
              <td class="p-2"></td>
              @endif
              <td class="p-2">{{ $detail->nama_makanan }}</td>
              <td class="p-2">{{ $detail->berat }}</td>
              <td class="p-2">{{ $detail->kalori }}</td>
            </tr>
            @endforeach
            @foreach ($snackpagi as $key2 => $detail)
            <tr>
              @if($key2 == 0)
              <td class="p-2">Snack Pagi</td>
              @else
              <td class="p-2"></td>
              @endif
              <td class="p-2">{{ $detail->nama_makanan }}</td>
              <td class="p-2">{{ $detail->berat }}</td>
              <td class="p-2">{{ $detail->kalori }}</td>
            </tr>
            @endforeach
            @foreach ($siang as $key3 => $detail)
            <tr>
              @if($key3 == 0)
              <td class="p-2">Siang</td>
              @else
              <td class="p-2"></td>
              @endif
              <td class="p-2">{{ $detail->nama_makanan }}</td>
              <td class="p-2">{{ $detail->berat }}</td>
              <td class="p-2">{{ $detail->kalori }}</td>
            </tr>
            @endforeach
            @foreach ($snacksiang as $key4 => $detail)
            <tr>
              @if($key4 == 0)
              <td class="p-2">Snack Siang</td>
              @else
              <td class="p-2"></td>
              @endif
              <td class="p-2">{{ $detail->nama_makanan }}</td>
              <td class="p-2">{{ $detail->berat }}</td>
              <td class="p-2">{{ $detail->kalori }}</td>
            </tr>
            @endforeach
            @foreach ($malam as $key5 => $detail)
            <tr>
              @if($key5 == 0)
              <td class="p-2">Malam</td>
              @else
              <td class="p-2"></td>
              @endif
              <td class="p-2">{{ $detail->nama_makanan }}</td>
              <td class="p-2">{{ $detail->berat }}</td>
              <td class="p-2">{{ $detail->kalori }}</td>
            </tr>
            @endforeach
        </table>
        <div class="mt-4">
          <a href="{{ route('perhitungan.index', $pasien) }}" class="text-white btn btn-warning">Kembali</a>
          <a onClick="window.print()" class="btn btn-success text-white">Download</a>
        </div>

    </div>
</div>
</body>
</html>


