diff --git a/add_club.php b/add_club.php index 09943aa..2815c65 100644 --- a/add_club.php +++ b/add_club.php @@ -11,6 +11,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $number = $_POST['number'] ?? ''; $neighborhood = $_POST['neighborhood'] ?? ''; $city = $_POST['city'] ?? ''; + $phone = $_POST['phone'] ?? ''; + $email = $_POST['email'] ?? ''; $description = $_POST['description'] ?? ''; if (empty($club_name) || empty($address) || empty($city)) { @@ -19,9 +21,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { try { $pdo = db(); $stmt = $pdo->prepare( - 'INSERT INTO clubs (name, address, number, neighborhood, city, description) VALUES (?, ?, ?, ?, ?, ?)' + 'INSERT INTO clubs (name, address, number, neighborhood, city, phone, email, description) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' ); - $stmt->execute([$club_name, $address, $number, $neighborhood, $city, $description]); + $stmt->execute([$club_name, $address, $number, $neighborhood, $city, $phone, $email, $description]); $success_message = 'Club \'' . htmlspecialchars($club_name) . '\' has been added successfully!'; } catch (PDOException $e) { $error_message = 'Database error: ' . $e->getMessage(); @@ -92,13 +94,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { +
+
+ + +
+
+ + +
+
- Back to Dashboard + Back to Club List
diff --git a/db/setup.php b/db/setup.php index c16c8d3..0294f39 100644 --- a/db/setup.php +++ b/db/setup.php @@ -34,6 +34,8 @@ try { `number` VARCHAR(50), `neighborhood` VARCHAR(100), `city` VARCHAR(100) NOT NULL, + `phone` VARCHAR(100) NULL, + `email` VARCHAR(100) NULL, `description` TEXT, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/index.php b/index.php index 3c594a5..a0274b0 100644 --- a/index.php +++ b/index.php @@ -91,31 +91,39 @@
Clubes Parceiros
- + query('SELECT name, description FROM clubs ORDER BY name'); + $clubs = $stmt->fetchAll(PDO::FETCH_ASSOC); + ?> + 0): ?>