Sebastian Vendt před 5 měsíci
rodič
revize
7ec7e15394
2 změnil soubory, kde provedl 37 přidání a 7 odebrání
  1. 3 3
      index.php
  2. 34 4
      submit_activities.php

+ 3 - 3
index.php

@@ -45,10 +45,10 @@ if (!$activities) {
             font-family: Arial, sans-serif;
             padding: 20px;
         }
-        .category-item {
+        .activity-item {
             margin: 5px 0;
         }
-        .category-item input {
+        .activity-item input {
             margin-right: 10px;
         }
     </style>
@@ -60,7 +60,7 @@ if (!$activities) {
         <?php foreach ($activities as $activity): ?>
             <div class="activity-item">
                 <input type="checkbox" name="activity_ids" value="<?php echo htmlspecialchars($activity['activityID']); ?>">
-                <label for="category_<?php echo htmlspecialchars($activity['activityID']); ?>">
+                <label for="activity_<?php echo htmlspecialchars($activity['activityID']); ?>">
                     <?php echo htmlspecialchars($activity['activityName']); ?>
                 </label>
             </div>

+ 34 - 4
submit_activities.php

@@ -46,14 +46,44 @@ $stmt = $pdo->prepare($sql);
 $stmt->execute($itemIDs);
 $items = $stmt->fetchAll();
 
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Your packing list</title>
+    <style>
+        body {
+            font-family: Arial, sans-serif;
+            padding: 20px;
+        }
+        .item-item {
+            margin: 5px 0;
+        }
+        .item-item input {
+            margin-right: 10px;
+        }
+    </style>
+</head>
+<body>
+
+<h1>You need</h1>
+<?php
 // Display results as HTML with checkboxes
-echo "<form method='post' action='process_selection.php'>";
+echo "<form method='post' action='index.php'>";
 echo "<ul>";
 foreach ($items as $item) {
-    echo "<li><input type='checkbox' name='selected_items[]' value='" . htmlspecialchars($item['itemID']) . "'> " . htmlspecialchars($item['itemName']) . "</li>";
+    echo "
+	<div class='item-item'>
+	<input type='checkbox' name='selected_items' value='" . htmlspecialchars($item['itemID']) . "'>
+	<label for=selected_items_" . htmlspecialchars($item['itemID']) . ">" 
+	. htmlspecialchars($item['itemName']
+	. "</label></div>";
 }
 echo "</ul>";
-echo "<button type='submit'>Submit</button>";
 echo "</form>";
-
 ?>
+
+</body>
+</html>