diff --git a/add_club.php b/add_club.php new file mode 100644 index 0000000..57f1c64 --- /dev/null +++ b/add_club.php @@ -0,0 +1,112 @@ +prepare( + 'INSERT INTO clubs (name, address, number, neighborhood, city, description) VALUES (?, ?, ?, ?, ?, ?)' + ); + $stmt->execute([$club_name, $address, $number, $neighborhood, $city, $description]); + $success_message = 'Club \'' . htmlspecialchars($club_name) . '\' has been added successfully!'; + } catch (PDOException $e) { + $error_message = 'Database error: ' . $e->getMessage(); + } + } +} +?> + + + + + + Add New Club - PicklePRO + + + + + + +
+
+
+
+
+

Add a New Club

+
+
+ +
+ + +
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + Back to Dashboard +
+
+
+
+
+
+
+ + + + diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..db69168 --- /dev/null +++ b/admin.php @@ -0,0 +1,43 @@ + + + + + + + Admin Dashboard - PicklePRO + + + + + + +
+
+
+
+
+

Welcome, !

+

This is your admin dashboard. From here, you can manage clubs, tournaments, and users.

+ Add New Club +
+
+
+
+
+ + + + diff --git a/auth_check.php b/auth_check.php new file mode 100644 index 0000000..d6f1758 --- /dev/null +++ b/auth_check.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..8561a84 --- /dev/null +++ b/login.php @@ -0,0 +1,82 @@ +prepare('SELECT * FROM users WHERE username = ?'); + $stmt->execute([$username]); + $user = $stmt->fetch(); + + if ($user && password_verify($password, $user['password'])) { + $_SESSION['user_id'] = $user['id']; + $_SESSION['username'] = $user['username']; + $_SESSION['role'] = $user['role']; + + // Redirect based on role + if ($user['role'] === 'superadmin') { + header('Location: admin.php'); + exit; + } else { + // Redirect to a general user dashboard if needed + header('Location: index.php'); + exit; + } + } else { + $error = 'Invalid username or password.'; + } + } catch (PDOException $e) { + $error = 'Database error: ' . $e->getMessage(); + } + } +} +?> + + + + + + Login - PicklePRO + + + + +
+
+
+
+
+

PicklePRO Login

+ +
+ +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+
+
+ + + diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..d92fc3f --- /dev/null +++ b/logout.php @@ -0,0 +1,21 @@ + \ No newline at end of file