-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/ManaS066/sih-hospital_
- Loading branch information
Showing
3 changed files
with
247 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
235 changes: 235 additions & 0 deletions
235
Government of NCT of Delhi/templates/super admin dash.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Super Admin Dashboard</title> | ||
<link rel="stylesheet" href="../static/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="../static/css/style.css"> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #FFF3C7; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.navbar { | ||
background-color: #00637f !important; | ||
padding: 10px; | ||
color: white; | ||
} | ||
|
||
.sidebar { | ||
width: 250px; | ||
background-color: #343a40; | ||
position: fixed; | ||
height: 100%; | ||
color: #fff; | ||
padding-top: 20px; | ||
overflow-y: auto; | ||
} | ||
|
||
.sidebar a { | ||
padding: 15px; | ||
text-decoration: none; | ||
color: #fff; | ||
display: block; | ||
transition: 0.3s; | ||
} | ||
|
||
.sidebar a:hover { | ||
background-color: #575757; | ||
} | ||
|
||
.main-content { | ||
margin-left: 250px; | ||
padding: 20px; | ||
} | ||
|
||
.card { | ||
background-color: #FFF8E3; | ||
border-radius: 5px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
margin-bottom: 20px; | ||
padding: 20px; | ||
text-align: center; | ||
} | ||
|
||
.card h3 { | ||
margin-top: 0; | ||
color: #2c3e50; | ||
} | ||
|
||
.card p { | ||
font-size: 18px; | ||
color: #333; | ||
} | ||
|
||
.footer { | ||
background-color: #00637f; | ||
color: #fff; | ||
text-align: center; | ||
padding: 10px; | ||
position: fixed; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
|
||
@media (max-width: 768px) { | ||
.sidebar { | ||
width: 100%; | ||
height: auto; | ||
position: relative; | ||
} | ||
|
||
.main-content { | ||
margin-left: 0; | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div class="navbar navbar-expand-lg navbar-dark"> | ||
<a class="navbar-brand" href="#"> | ||
<img src="../static/images/delhi.png" alt="Delhi Logo" class="rounded-circle" width="40" height="40"> | ||
</a> | ||
<h3 class="text-light">Government of NCT of Delhi</h3> | ||
</div> | ||
|
||
<div class="sidebar"> | ||
<a href="#">Dashboard</a> | ||
<a href="#" id="add-hospital-link">Add Hospital</a> | ||
<a href="#" id="check-hospital-status-link">Check Hospital Status</a> | ||
<a href="#" id="order-medicine-link">Order Medicine</a> | ||
<a href="/admin/manage_appointment" id="appointment-link">Appointments</a> | ||
<a href="#" id="feedback-link">Feedback</a> | ||
<a href="#" id="blood-bank-status-link">Blood Bank Status</a> | ||
<a href="/">Logout</a> | ||
</div> | ||
|
||
<div class="main-content"> | ||
<h2>Super Admin Dashboard</h2> | ||
|
||
<!-- Add Hospital Section --> | ||
|
||
<div id="add-hospital-section" class="card"> | ||
<h3>Add Hospital</h3> | ||
<form method="POST" action="/superadmin/addHospital"> | ||
<label for="hospitalName">Hospital Name:</label> | ||
<input type="text" id="hospitalName" name="hospitalName" required><br> | ||
<label for="hospitalmail">Hospital email ID:</label> | ||
<input type="text" id="hospitalmail" name="hospitalmail" required><br> | ||
<label for="hospitalpass">Password:</label> | ||
<input type="text" id="hospitalpass" name="hospitalpass" required><br> | ||
<button type="submit">Add Hospital</button> | ||
</form> | ||
|
||
<p id="hospital-message"></p> | ||
</div> | ||
|
||
<!-- Check Hospital Status Section --> | ||
<div id="check-hospital-status-section" class="card" style="display: none;"> | ||
<h3>Check Hospital Status</h3><br> | ||
<form method="POST" action="/superadmin/checkHospitalStatus"> | ||
<label for="hname">Hospital Name:</label> | ||
<input type="text" name="hname" id="hname"> | ||
<button type="submit" id="check-hospital-status">View Status</button> | ||
<div id="hospital-status" class="status"></div> | ||
</form> | ||
</div> | ||
|
||
|
||
<!-- Order Medicine Section --> | ||
<div id="order-medicine-section" class="card" style="display: none;"> | ||
<h3>Order Medicine</h3> | ||
<form id="order-medicine-form"> | ||
<label for="medicineName">Medicine Name:</label> | ||
<input type="text" id="medicineName" name="medicineName" required> | ||
<label for="quantity">Quantity:</label> | ||
<input type="number" id="quantity" name="quantity" required> | ||
<button type="submit">Place Order</button> | ||
</form> | ||
<p id="order-message"></p> | ||
</div> | ||
|
||
|
||
<div id="appointment-section" class="card" style="display: none;"> | ||
<h3>Appointment</h3> | ||
<button id="view-appointment">View Appointment</button> | ||
<div id="appointment-list"></div> | ||
</div> | ||
<!-- Feedback Section --> | ||
<div id="feedback-section" class="card" style="display: none;"> | ||
<h3>Feedback</h3> | ||
<button id="view-feedback">View Feedback</button> | ||
<div id="feedback-list"></div> | ||
</div> | ||
|
||
<!-- Blood Bank Status Section --> | ||
<div id="blood-bank-status-section" class="card" style="display: none;"> | ||
<h3>Blood Bank Status</h3> | ||
<button id="view-blood-bank-status">View Blood Bank Status</button> | ||
<div id="blood-bank-status"></div> | ||
</div> | ||
</div> | ||
|
||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | ||
<script> | ||
// Toggle visibility of sections | ||
function showSection(sectionId) { | ||
const sections = ['add-hospital-section', 'check-hospital-status-section', 'order-medicine-section', 'feedback-section', 'blood-bank-status-section']; | ||
sections.forEach(id => { | ||
document.getElementById(id).style.display = id === sectionId ? 'block' : 'none'; | ||
}); | ||
} | ||
|
||
|
||
// Order Medicine Form Submission | ||
document.getElementById('order-medicine-form').addEventListener('submit', async (event) => { | ||
event.preventDefault(); | ||
const medicineName = document.getElementById('medicineName').value; | ||
const quantity = document.getElementById('quantity').value; | ||
const response = await fetch('/order-medicine', { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify({ medicineName, quantity }) | ||
}); | ||
const message = await response.text(); | ||
document.getElementById('order-message').textContent = message; | ||
}); | ||
|
||
// View Feedback Button | ||
document.getElementById('view-feedback').addEventListener('click', async () => { | ||
const response = await fetch('/get-feedback'); | ||
const feedback = await response.json(); | ||
const feedbackList = document.getElementById('feedback-list'); | ||
feedbackList.innerHTML = feedback.map(fb => `<p>${fb}</p>`).join(''); | ||
}); | ||
|
||
// View Blood Bank Status Button | ||
document.getElementById('view-blood-bank-status').addEventListener('click', async () => { | ||
const response = await fetch('/get-blood-bank-status'); | ||
const status = await response.json(); | ||
document.getElementById('blood-bank-status').innerHTML = JSON.stringify(status, null, 2); | ||
}); | ||
|
||
// Sidebar Links | ||
document.getElementById('add-hospital-link').addEventListener('click', () => showSection('add-hospital-section')); | ||
document.getElementById('check-hospital-status-link').addEventListener('click', () => showSection('check-hospital-status-section')); | ||
document.getElementById('order-medicine-link').addEventListener('click', () => showSection('order-medicine-section')); | ||
document.getElementById('feedback-link').addEventListener('click', () => showSection('feedback-section')); | ||
document.getElementById('blood-bank-status-link').addEventListener('click', () => showSection('blood-bank-status-section')); | ||
|
||
// Default section to show | ||
showSection('add-hospital-section'); | ||
</script> | ||
</body> | ||
|
||
</html> |