Browse Source

admin for attendance

master
farhan 5 months ago
parent
commit
eefcb7a196
3 changed files with 62 additions and 0 deletions
  1. 6
    0
      app/Http/Controllers/MainController.php
  2. 54
    0
      resources/views/attendance.blade.php
  3. 2
    0
      routes/web.php

+ 6
- 0
app/Http/Controllers/MainController.php View File

@@ -59,4 +59,10 @@ class MainController extends Controller
59 59
         ]);
60 60
     }
61 61
 
62
+    public function attendance() {
63
+        $vips = RSVP::where('is_vip', true)->get();
64
+        $generals = RSVP::where('is_vip', false)->get();
65
+
66
+        return view('attendance', compact(['vips', 'generals']));
67
+    }
62 68
 }

+ 54
- 0
resources/views/attendance.blade.php View File

@@ -0,0 +1,54 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+    <title>{{config('app.name')}}</title>
8
+
9
+    @vite(['resources/css/app.css','resources/js/app.js'])
10
+</head>
11
+<body class="bg-babyblue">
12
+    <div class="section flex flex-col gap-10">
13
+        <div>
14
+            <p>VIP ({{count($vips)}})</p>
15
+            <table class="table">
16
+                <thead>
17
+                <tr>
18
+                    <th>Nama</th>
19
+                    <th>Bilangan</th>
20
+                </tr>
21
+                </thead>
22
+                <tbody>
23
+                @foreach ($vips as $vip)
24
+                <tr>
25
+                    <td>{{$vip->name}}</td>
26
+                    <td>{{$vip->member}}</td>
27
+                </tr>
28
+                @endforeach
29
+                </tbody>
30
+            </table>
31
+        </div>
32
+        
33
+        <div>
34
+            <p>General ({{count($generals)}})</p>
35
+            <table class="table">
36
+                <thead>
37
+                <tr>
38
+                    <th>Nama</th>
39
+                    <th>Bilangan</th>
40
+                </tr>
41
+                </thead>
42
+                <tbody>
43
+                @foreach ($generals as $general)
44
+                <tr>
45
+                    <td>{{$general->name}}</td>  
46
+                    <td>{{$general->member}}</td>
47
+                </tr>
48
+                @endforeach
49
+                </tbody>
50
+            </table>
51
+        </div>
52
+    </div>
53
+</body>
54
+</html>

+ 2
- 0
routes/web.php View File

@@ -18,3 +18,5 @@ Route::get('/', [MainController::class, 'main']);
18 18
 Route::post('/saveRsvp', [MainController::class, 'saveRsvp'])->name('rsvp.save');
19 19
 Route::post('/saveSpeech', [MainController::class, 'saveSpeech'])->name('speech.save');
20 20
 Route::get('/guestbook', [MainController::class, 'fetchGuestbook'])->name('guestbook.ajax');
21
+
22
+Route::get('/admin/attendance', [MainController::class, 'attendance']);

Loading…
Cancel
Save