diff --git a/app/Controllers/EventController.php b/app/Controllers/EventController.php index f0b094768bc063efe97b84972a489832a8ecf0c0..5180cc0caf39f59eefc86cf70be3349ea918d8fe 100644 --- a/app/Controllers/EventController.php +++ b/app/Controllers/EventController.php @@ -1,4 +1,4 @@ -// EventController.php + <?php // app/Controllers/EventController.php diff --git a/app/Models/Event.php b/app/Models/Event.php index 405245da8f1c51bcce701a57b3c62f7e7ef38d53..58c634f635b183f70cddf4dcb86589d65a8822ad 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -11,8 +11,8 @@ class EventModel { // Check if a file is uploaded if ($gambar !== null && isset($gambar['name']) && isset($gambar['tmp_name'])) { - $uploadDirectory = __DIR__ . '/../../assets/'; - $uploadedFilePath = $uploadDirectory . $gambar['name']; + // $uploadDirectory = __DIR__ . '/../../assets/'; + $uploadedFilePath = 'assets/' . $gambar['name']; // Move the uploaded file to the desired directory if (move_uploaded_file($gambar['tmp_name'], $uploadedFilePath)) { diff --git a/app/View/login.php b/app/View/login.php new file mode 100644 index 0000000000000000000000000000000000000000..501ebe110f7c42a0438431b06b935a46e6921a78 --- /dev/null +++ b/app/View/login.php @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html lang="en"> + + <head> + <title>Login • TICKET KU</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="../../styles/auth.css"> + </head> + + <body> + <div class="login-container"> + <h1>Login</h1> + <form id="loginForm" method="post" action="../../home.php"> + <!-- Aslinya email atau username bisa(?) --> + <label for="email">Email</label> + <input type="email" id="email" name="loginEmail" required> + + <label for="password">Password</label> + <input type="password" id="password" name="loginPassword" required> + + <button type="submit" name="userAction" value="login">Login</button> + </form> + <p>Don't have an account? <a href="register.php">Register</a></p> + </div> + </body> +</html> \ No newline at end of file diff --git a/app/View/register.php b/app/View/register.php new file mode 100644 index 0000000000000000000000000000000000000000..ed6173b0f0440ad83dcf9799e89cff60c219bcd5 --- /dev/null +++ b/app/View/register.php @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html lang="en"> + + <head> + <title>Register • TICKET KU</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="../../styles/auth.css"> + </head> + + <body> + <div class="register-container"> + <h1>Register</h1> + <form id="registerForm" method="post" action="../../home.php"> + <label for="userName">Name</label> + <input type="text" id="userName" name="userName" required> + + <label for="userUsername">Username</label> + <input type="text" id="userUsername" name="userUsername" required> + + <label for="userEmail">Email</label> + <input type="email" id="userEmail" name="userEmail" required> + + <label for="userPassword">Password</label> + <input type="password" id="userPassword" name="userPassword" required> + + <label for="isAdmin" class="checkbox-label"> + Admin <input type="checkbox" id="isAdmin" name="isAdmin" value="1"> + </label> + + <button type="submit" name="userAction" value="createUser">Register</button> + </form> + <p>Already have an account? <a href="login.php">Login</a></p> + </div> + </body> +</html> \ No newline at end of file diff --git a/assets/Hero.png b/assets/Hero.png new file mode 100644 index 0000000000000000000000000000000000000000..1d4b40e03652df828e30ee66dd4d63a668a44e76 Binary files /dev/null and b/assets/Hero.png differ diff --git a/db/connect.php b/db/connect.php index 594f941f9c4e0a3ece19967fde0f18f36aecf803..2f5aa5edf9b64799905e27d463d74b6dd509904e 100644 --- a/db/connect.php +++ b/db/connect.php @@ -11,8 +11,9 @@ $sqlInit = file_get_contents(__DIR__ . '/init.sql'); $db->exec($sqlInit); - echo "Connected successfully and database initialized!<br/>"; + // echo "Connected successfully and database initialized!<br/>"; } catch (PDOException $e) { - echo "Connection failed: " . $e->getMessage(); + // echo "Connection failed: " . $e->getMessage(); } + ?> diff --git a/db/data.php b/db/data.php index 9fbefb71c2c9eefd72bfe63ef4d2f428d6e785bb..f53d8c0b0ca76a06c2870972d57fd9d4c4b10b3e 100644 --- a/db/data.php +++ b/db/data.php @@ -7,7 +7,7 @@ $sqlEvent = <<<EOF INSERT INTO events (event_stock, event_created_time, event_details, gambar) VALUES (100, '2023-09-30 10:00:00', 'Music Concert', 'assets/1.jpg'), - (50, '2023-10-05 15:30:00', 'Art Exhibition', 'assets/2.jpg'), + (50, '2023-10-05 15:30:00', 'Art Exhibition', 'assets/2.png'), (200, '2023-11-12 18:45:00', 'Sports Tournament', 'assets/3.jpg'), (75, '2023-12-03 20:00:00', 'Comedy Show', 'assets/4.jpg'), (120, '2024-01-18 14:15:00', 'Tech Conference', 'assets/5.jpg'); @@ -48,24 +48,24 @@ $db->beginTransaction(); $db->exec($sqlEvent); - echo "Successfully inserted dummy data to events table<br/>"; + // echo "Successfully inserted dummy data to events table<br/>"; $db->exec($sqlTicket); - echo "Successfully inserted dummy data to tickets table<br/>"; + // echo "Successfully inserted dummy data to tickets table<br/>"; $db->exec($sqlUser); - echo "Successfully inserted dummy data to users table<br/>"; + // echo "Successfully inserted dummy data to users table<br/>"; $db->exec($sqlPembelian); - echo "Successfully inserted dummy data to pembelian table<br/>"; + // echo "Successfully inserted dummy data to pembelian table<br/>"; $db->commit(); } catch (PDOException $e) { $db->rollBack(); - echo "Error: " . $e->getMessage(); + // echo "Error: " . $e->getMessage(); } } else { - echo "Error: Database connection not established."; + // echo "Error: Database connection not established."; } $db = null; diff --git a/db/init.php b/db/init.php index 7c8b1765be51bbba8fd2e50a73999c79a301e379..d5efdd7fbee4a7978546eb4828d86c6a208c781c 100644 --- a/db/init.php +++ b/db/init.php @@ -22,5 +22,5 @@ include 'data.php'; $db = null; -echo "Database initialization successful!"; +// echo "Database initialization successful!"; ?> diff --git a/db/reset.php b/db/reset.php index 7b19ad23a8a656e8d9b2098cf3d4f039b231eb40..1e98b7a351e2e637d0fa059e489aad7e4f08635b 100644 --- a/db/reset.php +++ b/db/reset.php @@ -7,9 +7,9 @@ $db->exec("DROP TABLE IF EXISTS events"); $db->exec("DROP TABLE IF EXISTS users"); - echo "Successfully reset the database<br/>"; + // echo "Successfully reset the database<br/>"; } catch (PDOException $e) { - echo "Error: " . $e->getMessage(); + // echo "Error: " . $e->getMessage(); } $db = null; ?> \ No newline at end of file diff --git a/display.txt b/display.txt new file mode 100644 index 0000000000000000000000000000000000000000..6bae0528557bdbb8688b272feb87a8fa34f2c9d5 --- /dev/null +++ b/display.txt @@ -0,0 +1,19 @@ + <!-- Display Events --> + <h3>Event List:</h3> + <ul> + <?php foreach ($events as $event) : ?> + <li> + <?php + echo $event['event_id'] . ': ' . $event['event_stock'] . ', ' . $event['event_created_time'] . ', ' . $event['event_details']; + echo isset($event['gambar']) ? ', Image: <img src="' . $event['gambar'] . '" alt="Event Image">' : ''; // Display the image if available + ?> + </li> + <?php endforeach; ?> + </ul> + + <h3>User List:</h3> + <ul> + <?php foreach ($users as $user) : ?> + <li><?php echo $user['user_ID'] . ': ' . $user['user_name'] . ', ' . $user['username'] . ', ' . $user['user_email'] . ', ' . $user['user_hashedPass']; ?></li> + <?php endforeach; ?> + </ul> \ No newline at end of file diff --git a/home.php b/home.php index de6a1bd80f3663ed568a4496d4586de6b7225a27..f6a7bdd2312388a6ace6ea7b4af552ace2b16aa5 100644 --- a/home.php +++ b/home.php @@ -1,7 +1,7 @@ <?php // home.php session_start(); -var_dump($_POST); +// var_dump($_POST); // require_once './app/EventController.php'; require_once './app/Controllers/PembelianController.php'; require_once './app/Controllers/TicketController.php'; @@ -22,23 +22,23 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $eventStock = $_POST['stock']; $eventCreatedTime = $_POST['createdTime']; $eventDetails = $_POST['details']; - $uploadedFilePath = $_POST['gambar']; + // $uploadedFilePath = $_POST['gambar']; // Check if the values are not empty if (!empty($eventStock) && !empty($eventCreatedTime) && !empty($eventDetails)) { var_dump($_FILES); - $uploadedFilePath = isset($_FILES['gambar']) ? $_FILES['gambar'] : null; // Check if 'gambar' is set in the files array + $uploadedFilePath = isset($_FILES['gambar']) && $_FILES['gambar']['error'] === 0 ? $_FILES['gambar'] : null; // Check if 'gambar' is set in the files array - // Check for file upload - $uploadedFile = isset($_FILES['gambar']) ? $_FILES['gambar'] : null; + // // Check for file upload + // $uploadedFile = isset($_FILES['gambar']) ? $_FILES['gambar'] : null; - var_dump($uploadedFile); // Output for debugging purposes + // var_dump($uploadedFile); // Output for debugging purposes - if ($uploadedFile !== null && $uploadedFile['error'] === 0) { - // Handle file upload - $uploadedFilePath = 'assets/' . $uploadedFile['name']; - move_uploaded_file($uploadedFile['tmp_name'], $uploadedFilePath); - } + // if ($uploadedFile !== null && $uploadedFile['error'] === 0) { + // // Handle file upload + // $uploadedFilePath = 'assets/' . $uploadedFile['name']; + // move_uploaded_file($uploadedFile['tmp_name'], $uploadedFilePath); + // } $eventController->createEvent($eventStock, $eventCreatedTime, $eventDetails, $uploadedFilePath); } else { @@ -49,19 +49,21 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $eventStock = $_POST['eventStock']; $eventCreatedTime = $_POST['eventCreatedTime']; $eventDetails = $_POST['eventDetails']; - $uploadedFilePath = $_POST['uploadedFilePath']; + var_dump($_FILES); + // $uploadedFilePath = $_POST['uploadedFilePath']; // Check if the values are not empty if (!empty($eventIdUpdate) && !empty($eventStock) && !empty($eventCreatedTime) && !empty($eventDetails)) { $uploadedFilePath = isset($_FILES['gambar']) ? $_FILES['gambar'] : null; // Check if 'gambar' is set in the files array - + + $uploadedFile = isset($_FILES['gambar']) ? $_FILES['gambar'] : null; // Check for file upload if ($uploadedFilePath !== null && $uploadedFilePath['error'] === 0) { // Handle file upload - $uploadedFilePath = 'assets/' . $uploadedFilePath['name']; - move_uploaded_file($uploadedFilePath['tmp_name'], $uploadedFilePath); + $uploadedFilePath = 'assets/' . $uploadedFile['name']; + move_uploaded_file($uploadedFile['tmp_name'], $uploadedFilePath); } - $eventController->updateEvent($eventIdUpdate, $eventStock, $eventCreatedTime, $eventDetails, $uploadedFile); + $eventController->updateEvent($eventIdUpdate, $eventStock, $eventCreatedTime, $eventDetails, $uploadedFilePath); } else { echo "Please fill in all the fields for updating an event."; } @@ -98,9 +100,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $userIdDelete = $_POST['userIdDelete']; $userController->deleteUser($userIdDelete); } elseif ($_POST['userAction'] === 'login') { - $loginUsername = $_POST['loginUsername']; + $loginEmail = $_POST['loginEmail']; $loginPassword = $_POST['loginPassword']; - echo $userController->loginByEmail($loginUsername,$loginPassword); + echo $userController->loginByEmail($loginEmail,$loginPassword); } elseif ($_POST['userAction'] === 'logout') { echo $userController->logout(); } @@ -122,114 +124,130 @@ $users = $userController->getAllUsers(); <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>CRUD Test</title> + <link rel="stylesheet" type="text/css" href="./styles/global.css"> + <link rel="stylesheet" type="text/css" href="./styles/navbar.css"> + <link rel="stylesheet" type="text/css" href="./styles/form.css"> </head> <body> - <h1>CRUD Test</h1> +<!-- Navbar --> + <div class="navbar"> + <div class="navbar-toggle" onclick="toggleMenu()">☰</div> + <ul> + <li><a href="#">Home</a></li> + <li><a href="#">Events</a></li> + <li><a href="#">Profile</a></li> + <li><a href="#">History</a></li> + <!-- Logout Button --> + <li> + <form method="post" action="home.php"> + <button type="submit" name="userAction" value="logout">Logout</button> + </form> + </li> + </ul> + </div> + <h1>EDIT DATA</h1> <!-- Event CRUD Form --> - <h2>Events</h2> - <form method="post" action="home.php"> - - <!-- Create Event --> - <form method="post" action="home.php" enctype="multipart/form-data"> - <label>Create Event:</label> - <input type="text" name="stock" placeholder="Stock"> - <input type="datetime-local" name="createdTime"> - <input type="text" name="details" placeholder="Details"> - - <!-- Drag-and-drop area for image upload --> - <div id="drop-area-create"> - <p>Drag and drop an image file here or click to select one.</p> - <input type="file" id="file-input-create" name="gambar" accept="image/*"> - </div> - - <button type="submit" name="action" value="createEvent">Create</button> - </form> - - - <!-- Update Event --> - <form method="post" action="home.php" enctype="multipart/form-data"> - <label>Update Event:</label> - <input type="text" name="eventIdUpdate" placeholder="Event ID"> - <input type="text" name="eventStock" placeholder="Stock"> - <input type="datetime-local" name="eventCreatedTime"> - <input type="text" name="eventDetails" placeholder="Details"> - - <!-- Drag-and-drop area for image upload --> - <div id="drop-area-update"> - <p>Drag and drop an image file here or click to select one.</p> - <input type="file" id="file-input-update" name="gambar" accept="image/*"> - </div> - - <button type="submit" name="action" value="updateEvent">Update</button> - </form> - <form method="post" action="home.php"> - <!-- Delete Event --> - <label>Delete Event:</label> - <input type="text" name="eventIdDelete" placeholder="Event ID"> - <button type="submit" name="action" value="deleteEvent">Delete</button> - </form> + <div class="event-form"> + <h2>Events</h2> + + <!-- Create Event --> + <form method="post" action="home.php" enctype="multipart/form-data"> + <label>Create Event:</label> + <input type="text" name="stock" placeholder="Stock"> + <input type="datetime-local" name="createdTime"> + <input type="text" name="details" placeholder="Details"> + + <!-- Drag-and-drop area for image upload --> + <div id="drop-area-create"> + <p>Drag and drop an image file here or click to select one.</p> + <input type="file" id="file-input-create" name="gambar" accept="image/*"> + </div> + + <button type="submit" name="action" value="createEvent">Create</button> + </form> + + <!-- Update Event --> + <form method="post" action="home.php" enctype="multipart/form-data"> + <label>Update Event:</label> + <input type="text" name="eventIdUpdate" placeholder="Event ID"> + <input type="text" name="eventStock" placeholder="Stock"> + <input type="datetime-local" name="eventCreatedTime"> + <input type="text" name="eventDetails" placeholder="Details"> + + <!-- Drag-and-drop area for image upload --> + <div id="drop-area-update"> + <p>Drag and drop an image file here or click to select one.</p> + <input type="file" id="file-input-update" name="gambar" accept="image/*"> + </div> + + <button type="submit" name="action" value="updateEvent">Update</button> + </form> + + <form method="post" action="home.php"> + <!-- Delete Event --> + <label>Delete Event:</label> + <input type="text" name="eventIdDelete" placeholder="Event ID"> + <button type="submit" name="action" value="deleteEvent">Delete</button> + </form> + </div> + <!-- User CRUD Form --> - <h2>Users</h2> - <form method="post" action="home.php"> + <div class="user-form"> + <h2>Users</h2> + <!-- Create User --> - <label>Create User:</label> - <input type="text" name="userName" placeholder="Name"> - <input type="text" name="userUsername" placeholder="Username"> - <input type="email" name="userEmail" placeholder="Email"> - <input type="password" name="userPassword" placeholder="Password"> - <input type="checkbox" name="isAdmin" value="1"> Admin - <button type="submit" name="userAction" value="createUser">Create</button> + <form method="post" action="home.php"> + <label>Create User:</label> + <input type="text" name="userName" placeholder="Name"> + <input type="text" name="userUsername" placeholder="Username"> + <input type="email" name="userEmail" placeholder="Email"> + <input type="password" name="userPassword" placeholder="Password"> + <input type="checkbox" name="isAdmin" value="1"> Admin + <button type="submit" name="userAction" value="createUser">Create</button> + </form> <!-- Update User --> - <label>Update User:</label> - <input type="text" name="userIdUpdate" placeholder="User ID"> - <input type="text" name="userNameUpdate" placeholder="Name"> - <input type="text" name="userUsernameUpdate" placeholder="Username"> - <input type="email" name="userEmailUpdate" placeholder="Email"> - <input type="password" name="userPasswordUpdate" placeholder="Password"> - <input type="checkbox" name="isAdminUpdate" value="1"> Admin - <button type="submit" name="userAction" value="updateUser">Update</button> + <form method="post" action="home.php"> + <label>Update User:</label> + <input type="text" name="userIdUpdate" placeholder="User ID"> + <input type="text" name="userNameUpdate" placeholder="Name"> + <input type="text" name="userUsernameUpdate" placeholder="Username"> + <input type="email" name="userEmailUpdate" placeholder="Email"> + <input type="password" name="userPasswordUpdate" placeholder="Password"> + <input type="checkbox" name="isAdminUpdate" value="1"> Admin + <button type="submit" name="userAction" value="updateUser">Update</button> + </form> <!-- Delete User --> - <label>Delete User:</label> - <input type="text" name="userIdDelete" placeholder="User ID"> - <button type="submit" name="userAction" value="deleteUser">Delete</button> - - <!-- login --> - <label>login:</label> - <input type="email" name="loginUsername" placeholder="mail"> - <input type="password" name="loginPassword" placeholder="Password"> - <button type="submit" name="userAction" value="login">login</button> - - <!-- logout --> - <label>Logout:</label> - <button type="submit" name="userAction" value="logout">logout</button> - </form> - - - <!-- Display Events --> - <h3>Event List:</h3> - <ul> - <?php foreach ($events as $event) : ?> - <li> - <?php - echo $event['event_id'] . ': ' . $event['event_stock'] . ', ' . $event['event_created_time'] . ', ' . $event['event_details']; - echo isset($event['gambar']) ? ', Image: <img src="' . $event['gambar'] . '" alt="Event Image">' : ''; // Display the image if available - ?> - </li> - <?php endforeach; ?> - </ul> - - <h3>User List:</h3> - <ul> - <?php foreach ($users as $user) : ?> - <li><?php echo $user['user_ID'] . ': ' . $user['user_name'] . ', ' . $user['username'] . ', ' . $user['user_email'] . ', ' . $user['user_hashedPass']; ?></li> - <?php endforeach; ?> - </ul> - + <form method="post" action="home.php"> + <label>Delete User:</label> + <input type="text" name="userIdDelete" placeholder="User ID"> + <button type="submit" name="userAction" value="deleteUser">Delete</button> + </form> + + <!-- Login --> + <form method="post" action="home.php"> + <label>Login:</label> + <input type="email" name="loginUsername" placeholder="Email"> + <input type="password" name="loginPassword" placeholder="Password"> + <button type="submit" name="userAction" value="login">Login</button> + </form> + </div> + + + <div class="footer"> + © <?php echo date("Y"); ?> Ticket Ku. All rights reserved. + </div> + + <script defer> + function toggleMenu() { + const navbar = document.querySelector('.navbar ul'); + navbar.classList.toggle('show'); + } + </script> </body> </html> diff --git a/index.php b/index.php index a56505e050c209d9ead2e53b21c93692521780ec..526fd204b4e603f264f56e7cafb79eeca4162490 100644 --- a/index.php +++ b/index.php @@ -1,31 +1,81 @@ +<?php + session_start(); + include './db/connect.php'; + // include './db/init.php'; +?> + <!DOCTYPE html> -<html> +<html lang="en"> <head> - <title>PHP TITLE</title> + <title>TICKET KU</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="./styles/global.css"> + <link rel="stylesheet" type="text/css" href="./styles/navbar.css"> </head> <body> - <h1>HAI HAI HAI HAI</h1> - <p>lalalalala</p> - <?php - include './db/connect.php'; + <div class="index"> + <!-- Navbar --> + <div class="navbar"> + <div class="navbar-toggle" onclick="toggleMenu()">☰</div> + <ul> + <li><a href="#">Home</a></li> + <li><a href="#">Events</a></li> + <li><a href="#">Profile</a></li> + <li><a href="#">History</a></li> + <!-- Logout Button --> + <li> + <form method="post" action="home.php"> + <button type="submit" name="userAction" value="logout">Logout</button> + </form> + </li> + </ul> + </div> + <script defer> + function toggleMenu() { + const navbar = document.querySelector('.navbar ul'); + navbar.classList.toggle('show'); + } + </script> - // Include other files and check for success or errors - include './db/init.php'; - // include './db/data.php'; - // include './db/reset.php'; - - // PHP code - $phpVersion = phpversion(); - echo "<p>PHP Version: $phpVersion</p>"; - ?> + <div class="hero"> + <img src="./assets/Hero.png" alt="Hero Image"> + <h1 class="hero-title">Ticket Ku</h1> + </div> + <div class="button"> + <li><a href="home.php">Edit</a></li> + </div> + <div class="events"> + <h2>All Events</h2> + <ul> + <?php + require_once './app/Controllers/EventController.php'; + $eventController = new EventController(); + // Get all events + $allEvents = $eventController->getAllEvents(); - <p>asdf</p> + // Loop through events and display details + foreach ($allEvents as $event) { + echo "<li>"; + echo "<strong>Event ID:</strong> " . $event['event_id'] . "<br>"; + echo "<strong>Stock:</strong> " . $event['event_stock'] . "<br>"; + echo "<strong>Created Time:</strong> " . $event['event_created_time'] . "<br>"; + echo "<strong>Details:</strong> " . $event['event_details'] . "<br>"; + echo "<strong>Image:</strong> <img src='" . $event['gambar'] . "' alt='Event Image' width='100'><br>"; + echo "</li>"; + } - <!-- Add the button to navigate to home.php --> - <a href="home.php"><button>Go to Home Page</button></a> + include './db/init.php'; + ?> + </ul> + </div> + <div class="footer"> + © 2023 Ticket Ku. All rights reserved. + </div> + </div> </body> -</html> \ No newline at end of file +</html> diff --git a/styles/auth.css b/styles/auth.css new file mode 100644 index 0000000000000000000000000000000000000000..23bb7d675891fd0f74fc7010cbe9526103293bfc --- /dev/null +++ b/styles/auth.css @@ -0,0 +1,73 @@ +body { + font-family: Arial, sans-serif; + background-color: #f8f8f8; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.login-container, .register-container { + background-color: white; + padding: 20px; + border-radius: 5px; + width: 300px; + text-align: center; +} + +.register-container { + background-color: white; + padding: 20px; + border-radius: 5px; + width: 300px; + text-align: center; +} + +label { + display: block; + margin: 10px 0 5px 0; + text-align: left; +} + +input { + width: calc(100% - 20px); + padding: 10px; + margin-bottom: 10px; + border-radius: 5px; + border: 1px solid #ccc; +} + +button { + background-color: #97A5CE; /* Green */ + border: none; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + transition-duration: 0.4s; + cursor: pointer; +} + +button:hover { + background-color: white; + color: black; + border: 1px solid #97A5CE; +} + +a { + color: #97A5CE; +} + +a:hover { + text-decoration: underline; +} + +.checkbox-label { + display: flex; + margin: 15px 0; + text-align: left; +} \ No newline at end of file diff --git a/styles/form.css b/styles/form.css new file mode 100644 index 0000000000000000000000000000000000000000..d840b003b0df8629937a47836798cdc6c973a182 --- /dev/null +++ b/styles/form.css @@ -0,0 +1,51 @@ +/* Add this to your global.css or create a new CSS file */ + +.event-form, +.user-form { + max-width: 600px; + margin: 20px auto; + padding: 20px; + border: 1px solid #ccc; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +.event-form form, +.user-form form { + margin-bottom: 20px; +} + +.event-form label, +.user-form label { + display: block; + margin-bottom: 8px; +} + +.event-form input, +.user-form input, +.event-form button, +.user-form button { + margin-bottom: 15px; +} + +.event-form #drop-area-create, +.event-form #drop-area-update, +.user-form #drop-area-create, +.user-form #drop-area-update { + margin-bottom: 15px; + padding: 10px; + border: 2px dashed #ccc; + border-radius: 8px; + text-align: center; +} + +.event-form img, +.user-form img { + max-width: 350px; + max-height: 350px; + margin-top: 10px; + border: 1px solid #ccc; + border-radius: 8px; +} + +/* Additional styling can be added based on your preference */ diff --git a/styles/global.css b/styles/global.css new file mode 100644 index 0000000000000000000000000000000000000000..427a4d88d9c894c0fa200282122bf0b830f57ead --- /dev/null +++ b/styles/global.css @@ -0,0 +1,92 @@ +body, h1, h2, h3, p, img{ + margin: 0; + padding: 0; + border: 0; +} + +body { + box-sizing: border-box; + font-family: sans-serif; +} + +.hero { + position: relative; + width: 100%; + height: 250px; + z-index: -1; +} + +.hero img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.hero-title { + text-align: center; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 100; + font-family: sans-serif; + font-size: xxx-large; +} + +.index { + text-align: center; + margin: 0 auto; /* Center the .index content horizontally */ + max-width: 800px; /* Adjust the maximum width as needed */ + padding: 20px; /* Add some padding for better spacing */ +} + +.footer { + background-color: navy; + color: white; + text-align: center; + padding: 10px; + position: absolute; + bottom: 0; + width: 100%; + height: 43px; +} + +div.index div.events { + text-align: center; + margin-top: 20px; +} + +div.index div.events li { + margin-bottom: 100px; +} + +.index .button { + position: absolute; + right: 2%; + top: 10px; +} + +.button { + background-color: rgb(255, 0, 47); + padding: 10px 24px; + border-radius: 50px; + cursor: pointer; + transition: 0.3s; + display: inline-block; /* Adjust display property for proper centering */ + text-decoration: none; + color: white; +} + +.button:hover { + background-color: rgb(255, 156, 171); + color: white; +} + +.button:active { + background-color: rgb(240, 63, 96); +} + +.events { + text-align: center; /* Center text within the .events container */ + margin-top: 20px; +} diff --git a/styles/navbar.css b/styles/navbar.css new file mode 100644 index 0000000000000000000000000000000000000000..473a9c62a683ab69eb625377f8601e86f5590bf6 --- /dev/null +++ b/styles/navbar.css @@ -0,0 +1,92 @@ +/* Navbar styles */ + +.navbar { + background-color: #333; + overflow: hidden; + position: relative; + z-index: 999999; +} + +.navbar ul { + list-style-type: none; + margin: 0; + margin-right: 30px; + padding: 0; + display: flex; + justify-content: flex-end; /* Align items to the right */ +} + +.navbar li { + text-align: center; + margin-left: 15px; /* Adjust the spacing between items */ +} + +.navbar a { + display: block; + padding: 15px; + text-decoration: none; + color: white; + transition: background-color 0.3s; +} + +.navbar a:hover { + background-color: #555; +} + +/* Adjustments for the Logout button */ +.navbar form { + margin: 0; +} + +.navbar .navbar-toggle form button { + background: none; + border: none; + padding: 15px; + text-decoration: none; + color: rgb(201, 7, 7); + cursor: pointer; + font-family: Arial, sans-serif; /* Adjust font family */ +} + +.navbar form button:hover { + background-color: #555; +} + +/* Responsive version */ +@media screen and (max-width: 600px) { + .navbar ul { + flex-direction: column; /* Stack items vertically for small screens */ + align-items: flex-end; /* Align items to the right */ + display: none; /* Hide the menu by default */ + position: absolute; + top: 60px; /* Adjust the top position to avoid overlapping with the header */ + background-color: #333; + width: 100%; + } + + .navbar ul.show { + display: flex; /* Show the menu when active */ + z-index: 9999999; + } + + .navbar li { + width: 100%; + text-align: right; /* Align text to the right in the menu */ + margin: 0; + } + + .navbar a:hover { + background-color: #555; + } + + .navbar-toggle { + display: block; + position: absolute; + top: 0; + right: 0; + padding: 15px; + cursor: pointer; + color: white; + background-color: #333; + } +}