<title>Hospital Management System</title>
<style>
body{font-family:Arial,sans-serif;background:#f4f4f4;margin:0;padding:20px;color:#222}
.dark{background:#121212;color:#fff}
.card{max-width:1000px;margin:auto;background:#fff;padding:20px;border-radius:12px;box-shadow:0 2px 10px rgba(0,0,0,.2)}
.dark .card{background:#1e1e1e}
input,button,select{padding:10px;margin:5px 0;width:100%;box-sizing:border-box}
button{cursor:pointer}
table{width:100%;border-collapse:collapse;margin-top:10px}
th,td{border:1px solid #ccc;padding:8px;text-align:left}
.hidden{display:none}
.actions button{width:auto;margin-right:5px}
</style>
🌙 Dark/Light
🏥 Hospital Dashboard
Admin: Moon
Logout
Patient Management
Add Patient
| ID | Name | Disease | Age | Mobile | Action |
Appointment Booking
Dr. Monowar Hussain (Gastrologist)
Dr. Ahmed (Cardiologist)
Dr. Sharma (Neurologist)
Dr. Khan (Orthopedic)
Dr. Das (Pediatrician)
Dr. Roy (Dermatologist)
Dr. Ali (ENT Specialist)
Dr. Bora (Gynecologist)
Dr. Paul (Urologist)
Book Appointment
Reception Contact
Reception Number: 9101724149
Billing
Generate Bill
Print Bill
<script>
let patients=[];
let patientCounter=1001;
function login(){
let u=document.getElementById('username').value;
let p=document.getElementById('password').value;
if(u==='Moon' && p==='Moon1234'){
document.getElementById('loginPage').classList.add('hidden');
document.getElementById('dashboard').classList.remove('hidden');
} else {
document.getElementById('loginMsg').innerText='Invalid ID or Password';
}
}
function toggleTheme(){document.body.classList.toggle('dark');}
function addPatient(){
let name=document.getElementById('patientName').value;
let disease=document.getElementById('patientDisease').value;
if(name && disease){
let age=document.getElementById('patientAge').value;
let mobile=document.getElementById('patientMobile').value;
patients.push({id:patientCounter++,name,disease,age,mobile});
renderPatients();
}
}
function renderPatients(){
let table=document.getElementById('patientTable');
table.innerHTML='';
patients.forEach((p,index)=>{
table.innerHTML += `
${p.id}
${p.name}
${p.disease}
${p.age}
${p.mobile}
Print
Save PDF
Delete
`;
});
}
function printPatient(index){
let p=patients[index];
let win=window.open('','','width=700,height=700');
win.document.write(`
Patient Record
| ID | Name | Disease | Age | Mobile |
| ${p.id} | ${p.name} | ${p.disease} | ${p.age} | ${p.mobile} |
`);
win.document.close();
win.print();
}
function savePatientPDF(index){
alert('Choose Save as PDF in print dialog');
printPatient(index);
}
function deletePatient(index){patients.splice(index,1);renderPatients();}
function searchPatient(){
let q=document.getElementById('searchPatient').value.toLowerCase();
document.querySelectorAll('#patientTable tr').forEach(row=>{
row.style.display=row.innerText.toLowerCase().includes(q)?'':'none';
});
}
function bookAppointment(){
let doctor=document.getElementById('doctorName').value;
let date=document.getElementById('appointmentDate').value;
document.getElementById('appointmentMsg').innerText=Appointment booked with ${doctor} on ${date};
}
function generateBill(){
let patient=document.getElementById('billPatient').value;
let amount=document.getElementById('billAmount').value;
document.getElementById('billOutput').innerHTML=Bill for <b>${patient}</b><br>Total: ₹${amount};
}
function printBill(){window.print();}
function logout(){location.reload();}
setInterval(()=>{document.getElementById('clock').innerText=new Date().toLocaleString();},1000);
</script>
Hospital Login
Login🏥 Hospital Dashboard
Admin: Moon
LogoutPatient Management
Add PatientAppointment Booking
Dr. Monowar Hussain (Gastrologist) Dr. Ahmed (Cardiologist) Dr. Sharma (Neurologist) Dr. Khan (Orthopedic) Dr. Das (Pediatrician) Dr. Roy (Dermatologist) Dr. Ali (ENT Specialist) Dr. Bora (Gynecologist) Dr. Paul (Urologist) Book AppointmentReception Contact
Reception Number: 9101724149
Billing
Generate Bill Print Billfunction login(){
let u=document.getElementById('username').value;
let p=document.getElementById('password').value;
if(u==='Moon' && p==='Moon1234'){
document.getElementById('loginPage').classList.add('hidden');
document.getElementById('dashboard').classList.remove('hidden');
} else {
document.getElementById('loginMsg').innerText='Invalid ID or Password';
}
}
function toggleTheme(){document.body.classList.toggle('dark');}
function addPatient(){
let name=document.getElementById('patientName').value;
let disease=document.getElementById('patientDisease').value;
if(name && disease){
let age=document.getElementById('patientAge').value;
let mobile=document.getElementById('patientMobile').value;
patients.push({id:patientCounter++,name,disease,age,mobile});
renderPatients();
}
}
function renderPatients(){
${p.id} ${p.name} ${p.disease} ${p.age} ${p.mobile} Print Save PDF Delete `; }); }let table=document.getElementById('patientTable');
table.innerHTML='';
patients.forEach((p,index)=>{
table.innerHTML += `
function printPatient(index){
let p=patients[index];
let win=window.open('','','width=700,height=700');
win.document.write(`
Patient Record
function savePatientPDF(index){
alert('Choose Save as PDF in print dialog');
printPatient(index);
}
function deletePatient(index){patients.splice(index,1);renderPatients();}
function searchPatient(){
let q=document.getElementById('searchPatient').value.toLowerCase();
document.querySelectorAll('#patientTable tr').forEach(row=>{
row.style.display=row.innerText.toLowerCase().includes(q)?'':'none';
});
}
function bookAppointment(){
let doctor=document.getElementById('doctorName').value;
let date=document.getElementById('appointmentDate').value;
document.getElementById('appointmentMsg').innerText=
Appointment booked with ${doctor} on ${date};}
function generateBill(){
let patient=document.getElementById('billPatient').value;
let amount=document.getElementById('billAmount').value;
document.getElementById('billOutput').innerHTML=
Bill for <b>${patient}</b><br>Total: ₹${amount};}
function printBill(){window.print();}
function logout(){location.reload();}
setInterval(()=>{document.getElementById('clock').innerText=new Date().toLocaleString();},1000);
</script>