Notes
Notes - notes.io |
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Manager</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: rgb(8, 99, 99);
margin: 0;
padding: 0;
display: flex;
}
#sidebar {
width: 250px;
height: 100vh;
background-color: #9fb8c4d0;
color: #fff;
padding-top: 20px;
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}
#content {
flex: 1;
padding: 20px;
}
a {
text-decoration: none;
color: #080808;
padding: 10px;
display: block;
}
a:hover {
background-color: #fdf9f9;
}
</style>
</head>
<body>
<div id="event-container"></div>
<div id="sidebar">
<a href="#" onclick="showContent('upcomingEvents')">Upcoming Events</a>
<a href="#" onclick="showContent('manageEvents')">Manage My Events</a>
<a href="#" onclick="showContent('createEvent')">Create New Event</a>
<a href="#" onclick="showContent('trackEvents')">Track My Events</a>
<a href="#" onclick="showContent('appointments')">Appointments</a>
<a href="#" onclick="logout()">Logout</a>
</div>
<div id="content">
<!-- Content will be dynamically changed based on button click -->
<h2 id= username></h2>
<p>Select an option from the sidebar.</p>
</div>
<script>
const apiUrl = "https://localhost:7114/api/Evensht"
document.addEventListener('DOMContentLoaded', function () {
// Get the username parameter from the URL
const urlParams = new URLSearchParams(window.location.search);
const username = urlParams.get('username');
// Display the username on the page
const usernameElement = document.getElementById('username');
if (usernameElement) {
usernameElement.textContent = `Welcome, ${username}!`;
}
});
function showContent(contentType) {
const contentDiv = document.getElementById('content');
// Clear previous content
contentDiv.innerHTML = '';
// Show different content based on button click
switch (contentType) {
case 'upcomingEvents':
contentDiv.innerHTML = '<h2>Upcoming Events</h2><p>List of upcoming events goes here.</p>';
dispalyupcomingEvents();
break;
case 'manageEvents':
contentDiv.innerHTML = '<h2>Manage My Events</h2><p>Your managed events go here.</p>';
break;
case 'createEvent':
contentDiv.innerHTML = '<h2>Create New Event</h2><p>Create a new event form goes here.</p>';
break;
case 'trackEvents':
contentDiv.innerHTML = '<h2>Track My Events</h2><p>Track your events details go here.</p>';
break;
case 'appointments':
contentDiv.innerHTML = '<h2>My joined Events</h2><p>.</p>';
break;
default:
contentDiv.innerHTML = '<h2>Welcome to Event Manager!</h2><p>Select an option from the sidebar.</p>';
}
}
function logout(){
alert('Logged out successfully!');
window.location.href="eventmanage.html";
}
function displayUpcomingEvents() {
fetch('https://localhost:7114/api/Evensht/upcoming')
.then(response => {
if (!response.ok) {
throw new Error(`Failed to fetch upcoming events: ${response.status} - ${response.statusText}`);
}
return response.json();
})
.then(upcomingEvents => {
const eventsContainer = document.getElementById('eventsContainer');
eventsContainer.innerHTML = '';
upcomingEvents.forEach(event => {
const eventDiv = document.createElement('div');
eventDiv.classList.add('event-container');
eventDiv.innerHTML = `<h3>${event.name}</h3><p><strong>Date:</strong>${event.date}</p><p><strong>Description :</strong>${event.description}</p><p><strong>Location:</strong${event.location}</p>-`;
// Add a Join button with an onclick event to dynamically obtain the event name
const joinButton = document.createElement('button');
joinButton.textContent = 'Join Event';
joinButton.onclick = function () {
joinEvent(event.name);
};
eventDiv.appendChild(joinButton);
eventsContainer.appendChild(eventDiv);
});
})
.catch(error => {
alert(`Error fetching upcoming events: ${error.message}`);
});
}
</script>
</body>
</html>
|
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team