Admin Panel
-
-
-
- diff --git a/react/.gitignore b/.gitignore similarity index 100% rename from react/.gitignore rename to .gitignore diff --git a/admin.html b/admin.html deleted file mode 100644 index 7723211..0000000 --- a/admin.html +++ /dev/null @@ -1,85 +0,0 @@ - - -
- - -Book and view appointments with ease
-Meet our team of experienced healthcare professionals
-Book and manage appointments with ease.
-Efficiently manage patient records and history.
-Access our comprehensive list of healthcare professionals.
-Powerful tools for hospital administration.
-Efficiently manage patient records and information
-Name | -Age | -Gender | -Contact | -Actions | -
---|
Specialty: ${doctor.specialty}
-Patients: ${doctor.patients}
- `; - doctorList.appendChild(card); - }); - - // Add this at the end of the function - doctorList.style.animation = 'fadeIn 0.5s'; - } - - // Appointment form submission - const appointmentForm = document.getElementById("appointment-form"); - if (appointmentForm) { - appointmentForm.addEventListener("submit", function (e) { - e.preventDefault(); - const patientName = document.getElementById("patient-name").value; - const appointmentDate = document.getElementById("appointment-date").value; - const doctorId = document.getElementById("doctor-select").value; - const notes = document.getElementById("appointment-notes").value; - - const appointment = { - id: appointments.length + 1, - patientName, - appointmentDate, - doctorId: parseInt(doctorId), - notes, - }; - - appointments.push(appointment); - updateAppointmentList(); - updateDoctorPatients(appointment.doctorId); - this.reset(); - showNotification('Appointment booked successfully!'); - }); - } - - // Update appointment list - function updateAppointmentList() { - const appointmentList = document.getElementById("upcoming-appointments"); - appointmentList.innerHTML = ""; - appointments.forEach((appointment) => { - const li = document.createElement("li"); - const doctor = doctors.find((d) => d.id === appointment.doctorId); - li.textContent = `${appointment.patientName} - ${appointment.appointmentDate} with ${doctor.name}`; - appointmentList.appendChild(li); - }); - } - - // Update doctor's patient count - function updateDoctorPatients(doctorId) { - const doctor = doctors.find((d) => d.id === doctorId); - if (doctor) { - doctor.patients++; - populateDoctorList(); - } - } - - // Patient form submission - const patientForm = document.getElementById("patient-form"); - if (patientForm) { - patientForm.addEventListener("submit", function (e) { - e.preventDefault(); - const name = document.getElementById("new-patient-name").value; - const age = document.getElementById("new-patient-age").value; - const gender = document.getElementById("new-patient-gender").value; - const contact = document.getElementById("new-patient-contact").value; - - const newPatient = { - id: patients.length + 1, - name, - age: parseInt(age), - gender, - contact, - }; - - patients.push(newPatient); - populatePatients(); - this.reset(); - showNotification('Patient added successfully!'); - }); - } - - // Admin login form submission - const adminLoginForm = document.getElementById("admin-login"); - if (adminLoginForm) { - adminLoginForm.addEventListener("submit", function (e) { - e.preventDefault(); - const username = document.getElementById("admin-username").value; - const password = document.getElementById("admin-password").value; - - // Simple check (replace with actual authentication) - if (username === "admin" && password === "password") { - document.getElementById("admin-login").style.display = "none"; - document.getElementById("admin-dashboard").style.display = "block"; - } else { - showNotification("Invalid credentials", "error"); - } - }); - } - - // Generate PDF report - document - .getElementById("generate-report") - .addEventListener("click", function () { - const { jsPDF } = window.jspdf; - const doc = new jsPDF(); - - doc.text("Hospital Management System Report", 10, 10); - doc.text(`Total Patients: ${patients.length}`, 10, 20); - doc.text(`Total Doctors: ${doctors.length}`, 10, 30); - doc.text(`Total Appointments: ${appointments.length}`, 10, 40); - - doc.save("hospital_report.pdf"); - }); - - // Initialize - populateDoctors(); - populatePatients(); - populateDoctorList(); -}); - -// Edit patient function (to be implemented) -function editPatient(patientId) { - alert(`Edit patient with ID: ${patientId}`); - // Implement edit functionality -} - -// Delete patient function -function deletePatient(patientId) { - if (confirm("Are you sure you want to delete this patient?")) { - patients = patients.filter((patient) => patient.id !== patientId); - populatePatients(); - } -} - -// Add this new function for visual feedback -function showNotification(message, type = 'success') { - const notification = document.createElement('div'); - notification.textContent = message; - notification.className = `notification ${type}`; - document.body.appendChild(notification); - - setTimeout(() => { - notification.style.opacity = '0'; - setTimeout(() => { - document.body.removeChild(notification); - }, 500); - }, 3000); -} \ No newline at end of file diff --git a/react/src/App.css b/src/App.css similarity index 100% rename from react/src/App.css rename to src/App.css diff --git a/react/src/App.jsx b/src/App.jsx similarity index 100% rename from react/src/App.jsx rename to src/App.jsx diff --git a/react/src/assets/react.svg b/src/assets/react.svg similarity index 100% rename from react/src/assets/react.svg rename to src/assets/react.svg diff --git a/react/src/components/Admin.jsx b/src/components/Admin.jsx similarity index 100% rename from react/src/components/Admin.jsx rename to src/components/Admin.jsx diff --git a/react/src/components/Appointments.jsx b/src/components/Appointments.jsx similarity index 100% rename from react/src/components/Appointments.jsx rename to src/components/Appointments.jsx diff --git a/react/src/components/Doctors.jsx b/src/components/Doctors.jsx similarity index 100% rename from react/src/components/Doctors.jsx rename to src/components/Doctors.jsx diff --git a/react/src/components/Footer.jsx b/src/components/Footer.jsx similarity index 100% rename from react/src/components/Footer.jsx rename to src/components/Footer.jsx diff --git a/react/src/components/Header.jsx b/src/components/Header.jsx similarity index 100% rename from react/src/components/Header.jsx rename to src/components/Header.jsx diff --git a/react/src/components/Home.jsx b/src/components/Home.jsx similarity index 100% rename from react/src/components/Home.jsx rename to src/components/Home.jsx diff --git a/react/src/components/Patients.jsx b/src/components/Patients.jsx similarity index 100% rename from react/src/components/Patients.jsx rename to src/components/Patients.jsx diff --git a/react/src/hooks/useMediaQuery.jsx b/src/hooks/useMediaQuery.jsx similarity index 100% rename from react/src/hooks/useMediaQuery.jsx rename to src/hooks/useMediaQuery.jsx diff --git a/react/src/index.css b/src/index.css similarity index 100% rename from react/src/index.css rename to src/index.css diff --git a/react/src/main.jsx b/src/main.jsx similarity index 100% rename from react/src/main.jsx rename to src/main.jsx diff --git a/style.css b/style.css deleted file mode 100644 index d38c470..0000000 --- a/style.css +++ /dev/null @@ -1,208 +0,0 @@ -/* styles.css */ -:root { - --primary-color: #3498db; - --secondary-color: #2ecc71; - --text-color: #333; - --background-color: #f4f4f4; - --card-background: #ffffff; -} - -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -body { - font-family: 'Arial', sans-serif; - line-height: 1.6; - color: var(--text-color); - background-color: var(--background-color); -} - -header { - background-color: var(--primary-color); - color: white; - padding: 1rem; - position: sticky; - top: 0; - z-index: 100; -} - -nav { - display: flex; - justify-content: space-between; - align-items: center; -} - -.logo { - display: flex; - align-items: center; - font-size: 1.5rem; - font-weight: bold; -} - -.logo i { - font-size: 2rem; - margin-right: 10px; -} - -nav ul { - display: flex; - list-style: none; -} - -nav ul li { - margin-left: 20px; -} - -nav ul li a { - color: white; - text-decoration: none; - transition: color 0.3s ease; -} - -nav ul li a:hover, nav ul li a.active { - color: var(--secondary-color); -} - -main { - max-width: 1200px; - margin: 0 auto; - padding: 20px; -} - -section { - background-color: var(--card-background); - margin-bottom: 30px; - padding: 20px; - border-radius: 5px; - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); -} - -h1, h2, h3 { - margin-bottom: 15px; -} - -.btn { - display: inline-block; - background-color: var(--primary-color); - color: white; - padding: 10px 20px; - border: none; - border-radius: 5px; - cursor: pointer; - transition: background-color 0.3s ease; - text-decoration: none; -} - -.btn:hover { - background-color: var(--secondary-color); -} - -form { - display: flex; - flex-direction: column; - max-width: 400px; - margin-bottom: 20px; -} - -input, select, textarea { - margin-bottom: 10px; - padding: 10px; - border: 1px solid #ddd; - border-radius: 4px; -} - -table { - width: 100%; - border-collapse: collapse; - margin-top: 20px; -} - -table th, table td { - border: 1px solid #ddd; - padding: 12px; - text-align: left; -} - -table th { - background-color: var(--primary-color); - color: white; -} - -#doctor-grid, .feature-grid, .stat-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); - gap: 20px; -} - -.doctor-card, .feature-card, .stat-card { - background-color: var(--card-background); - border: 1px solid #ddd; - border-radius: 5px; - padding: 15px; - text-align: center; - transition: box-shadow 0.3s ease; -} - -.doctor-card:hover, .feature-card:hover, .stat-card:hover { - box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); -} - -.doctor-card img, .feature-card i, .stat-card i { - width: 100px; - height: 100px; - object-fit: cover; - border-radius: 50%; - margin-bottom: 10px; -} - -.feature-card i, .stat-card i { - font-size: 3rem; - color: var(--primary-color); -} - -footer { - background-color: var(--primary-color); - color: white; - text-align: center; - padding: 10px; - position: fixed; - bottom: 0; - width: 100%; -} - -#hero, #appointments-hero, #patients-hero, #doctors-hero, #admin-hero { - background-image: url('path/to/hero-image.jpg'); - background-size: cover; - background-position: center; - color: white; - text-align: center; - padding: 100px 0; - margin-bottom: 30px; -} - -.hero-content { - background-color: rgba(0, 0, 0, 0.5); - padding: 20px; - border-radius: 5px; -} - -@media (max-width: 768px) { - nav { - flex-direction: column; - } - - nav ul { - margin-top: 10px; - } - - nav ul li { - margin: 0 10px; - } - - form { - max-width: 100%; - } -} \ No newline at end of file diff --git a/react/tailwind.config.js b/tailwind.config.js similarity index 100% rename from react/tailwind.config.js rename to tailwind.config.js diff --git a/react/vite.config.js b/vite.config.js similarity index 100% rename from react/vite.config.js rename to vite.config.js