From 361ed358f1097c072fb20b0e3708780406c8d8f5 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 18 Mar 2019 18:59:16 -0600 Subject: [PATCH] Add dashboard cards: total volunteers per day, shirt sizes --- langs/en/labels.json | 1 + pages/home.php | 86 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/langs/en/labels.json b/langs/en/labels.json index 29225c0..c1b24a2 100644 --- a/langs/en/labels.json +++ b/langs/en/labels.json @@ -29,6 +29,7 @@ "ZIP Code": "ZIP Code", "ZIP": "ZIP", "Shirt": "Shirt", + "Shirts": "Shirts", "Total": "Total", "Yes": "Yes", "No": "No", diff --git a/pages/home.php b/pages/home.php index 8f73352..d15e4d1 100644 --- a/pages/home.php +++ b/pages/home.php @@ -35,6 +35,84 @@ +
+
+
+

get("Adults") ?>

+

+

+ select("adults", "days"); + $days = ["Tu" => 0, "We" => 0, "Th" => 0, "Fr" => 0]; + foreach ($daystrs as $str) { + $arr = str_split($str, 2); + foreach ($arr as $day) { + $days[$day] += 1; + } + } + + foreach ($days as $day => $count) { + ?> + + +

+
+
+ +
+
+

get("Youth") ?>

+

+

+ select("youth", "days"); + $days = ["Tu" => 0, "We" => 0, "Th" => 0, "Fr" => 0]; + foreach ($daystrs as $str) { + $arr = str_split($str, 2); + foreach ($arr as $day) { + $days[$day] += 1; + } + } + + foreach ($days as $day => $count) { + ?> + + +

+
+
+
+ +
+
+
+

get("Shirts") ?>

+

+

+ select("people", "shirt"); + $shirts = ["YS" => 0, "YM" => 0, "YL" => 0, "AS" => 0, "AM" => 0, "AL" => 0, "AX" => 0, "A2" => 0]; + foreach ($shirtcount as $str) { + $shirts[$str] += 1; + } + + foreach ($shirts as $shirt => $count) { + ?> + + +

+
+
+
+
@@ -48,9 +126,6 @@ echo number_format($total, 2); ?>
-
@@ -65,8 +140,5 @@ echo number_format($total, 2); ?>
-
- + \ No newline at end of file