Skip to content

Commit

Permalink
user app, appointment , bed status app basic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ManaS066 committed Sep 5, 2024
1 parent 920d4a1 commit 05aa37d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 48 deletions.
63 changes: 32 additions & 31 deletions Government of NCT of Delhi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ def status():
available_ventilators = total_ventilators - occupied_ventilators

return render_template('bed_status.html',
hospitals = hospital_names,
no_hospital=no_of_hospital,
doctor=total_doctor,
patient=active_patient,
Expand All @@ -881,37 +882,37 @@ def status():
available_ventilators=available_ventilators)


@app.route('/select_hs', methods=['GET', 'POST'])
@login_required('user')
def select():
if request.method == 'POST':
hospital_name = request.form['hname']
print(hospital_name)
if not hospital_name:
return "Hospital name is missing", 400 # Bad Request

data = hospital_data_collection.find_one(
{'hospital_name': hospital_name})

print(data)
if data:
total_general_beds = data.get('number_of_general_beds', 0)
occupied_general_beds = data.get('occupied_general', 0)
total_icu_beds = data.get('number_of_icu_beds', 0)
occupied_icu_beds = data.get('occupied_icu', 0)
total_ventilators = data.get('number_of_ventilators', 0)
occupied_ventilators = data.get('occupied_ventilator', 0)

# Calculate available beds
available_beds = total_general_beds - occupied_general_beds
available_icu_beds = total_icu_beds - occupied_icu_beds
available_ventilator = total_ventilators - occupied_ventilators
return render_template('bed_status.html', available_beds=available_beds, available_icu_beds=available_icu_beds, available_ventilators=available_ventilator, total_general_beds=total_general_beds, total_icu_beds=total_icu_beds, total_ventilators=total_ventilators)
else:
return "No hospital found"
hospitals = hospital_data_collection.find()
hospital_names = [hospital['hospital_name'] for hospital in hospitals]
return render_template('select_hs_for_beds.html', hospitals=hospital_names)
# @app.route('/select_hs', methods=['GET', 'POST'])
# @login_required('user')
# def select():
# if request.method == 'POST':
# hospital_name = request.form['hname']
# print(hospital_name)
# if not hospital_name:
# return "Hospital name is missing", 400 # Bad Request

# data = hospital_data_collection.find_one(
# {'hospital_name': hospital_name})

# print(data)
# if data:
# total_general_beds = data.get('number_of_general_beds', 0)
# occupied_general_beds = data.get('occupied_general', 0)
# total_icu_beds = data.get('number_of_icu_beds', 0)
# occupied_icu_beds = data.get('occupied_icu', 0)
# total_ventilators = data.get('number_of_ventilators', 0)
# occupied_ventilators = data.get('occupied_ventilator', 0)

# # Calculate available beds
# available_beds = total_general_beds - occupied_general_beds
# available_icu_beds = total_icu_beds - occupied_icu_beds
# available_ventilator = total_ventilators - occupied_ventilators
# return render_template('bed_status.html', available_beds=available_beds, available_icu_beds=available_icu_beds, available_ventilators=available_ventilator, total_general_beds=total_general_beds, total_icu_beds=total_icu_beds, total_ventilators=total_ventilators)
# else:
# return "No hospital found"
# hospitals = hospital_data_collection.find()
# hospital_names = [hospital['hospital_name'] for hospital in hospitals]
# return render_template('select_hs_for_beds.html', hospitals=hospital_names)


@app.route("/superadmin_login", methods=['GET', 'POST'])
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 7 additions & 12 deletions Government of NCT of Delhi/templates/appointment.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="stylesheet" href="../static/css/appointment.css" />
<style>
body {
background-image: url("../static/images/appointment.avif");
background-image: url("../static/images/appintment\ \(2\).jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
Expand All @@ -19,14 +19,14 @@
/* Appointment Box Hover Effect */
.form-data {
transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
background-color: #ffaa008c;
background-color: #ffffffa5;
border: 2px solid transparent;
}

.form-data:hover {
transform: scale(1.02);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
border-color: #dd00ffc9;
border-color: #f1b5fac9;
/* Highlighted border color */
}

Expand Down Expand Up @@ -59,14 +59,14 @@
</a>
<h3 class="mehran">Government of NCT of Delhi</h3>
<div class="collapse navbar-collapse" id="navbarColor01">
<!-- <ul class="navbar-nav ms-auto justify-content-end navbar1">
<ul class="navbar-nav ms-auto justify-content-end navbar1">
<li class="nav-item mr-3">
<a class="nav-link text-light" href="/">Home</a>
<a class="nav-link text-light" href="/user_app">User Dashboard</a>
</li>
<li class="nav-item mr-3">
<a class="nav-link text-light" href="/templates/user login.html">Login</a>
<a class="nav-link text-light" href="/user_logout">Logout</a>
</li>
</ul> -->
</ul>
</div>
</div>
</nav>
Expand Down Expand Up @@ -134,11 +134,6 @@ <h2>Book Appointment</h2>
<option value="" disabled selected>Select a time slot</option>
<option value="08:00 - 09:00">08:00 - 09:00</option>
<option value="09:00 - 10:00">09:00 - 10:00</option>
<!-- <option value="" disabled selected>
Select a time slot
</option> -->
<!-- <option value="08:00 - 09:00">08:00 - 09:00</option>
<option value="09:00 - 10:00">09:00 - 10:00</option> -->
<option value="10:00 - 11:00">10:00 - 11:00</option>
<option value="11:00 - 12:00">11:00 - 12:00</option>
<option value="12:00 - 13:00">12:00 - 13:00</option>
Expand Down
3 changes: 3 additions & 0 deletions Government of NCT of Delhi/templates/bed_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,21 @@ <h2>Bed Availability Dashboard</h2>
<!-- General Beds Card -->
<div class="card">
<h3>General Beds</h3>
<br>
<p id="general-beds">{{ available_beds }}/{{ total_general_beds }}</p>
</div>

<!-- Ventilator Beds Card -->
<div class="card">
<h3>Ventilator Beds</h3>
<br>
<p id="ventilator-beds">{{ available_ventilators }}/{{ total_ventilators }}</p>
</div>

<!-- ICU Beds Card -->
<div class="card">
<h3>ICU Beds</h3>
<br>
<p id="icu-beds">{{ available_icu_beds }}/{{ total_icu_beds }}</p>
</div>
</div>
Expand Down
16 changes: 11 additions & 5 deletions Government of NCT of Delhi/templates/user_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}

.card {
background-color: #fff8e36d;
background-color: #ffffffc8;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
Expand Down Expand Up @@ -92,6 +92,7 @@
table {
width: 95%;
margin: 20px auto;
border-radius: 50%;
border-collapse: collapse;
}

Expand All @@ -100,11 +101,16 @@
border: 1px solid #dddddd;
text-align: left;
padding: 10px;

}

th {
background-color: #f2f2f2;
}

.queue_number{
color : #ff0055;
}
</style>
</head>

Expand All @@ -130,7 +136,7 @@ <h3 class="text-light">Government of NCT of Delhi</h3>
<a class="nav-link text-light" href="/appointment">Appointment</a>
</li>
<li class="nav-item mr-3">
<a class="nav-link text-light" href="/select_hs"
<a class="nav-link text-light" href="/bed_status"
>Bed Availability</a
>
</li>
Expand Down Expand Up @@ -169,8 +175,8 @@ <h1 style="color: #00ff22c0">
>
<h3>My Appointments</h3>
<p>View your upcoming and past appointments.</p>
<table>
<tr>
<table >
<tr >
<th>Name</th>
<th>Email</th>
<th>Number</th>
Expand All @@ -191,7 +197,7 @@ <h3>My Appointments</h3>
<td>{{ contact.time_slot }}</td>
<td>{{ contact.speciality }}</td>
<td>{{ contact.disease_description }}</td>
<td>{{ contact.queue_number}}</td>
<td class="queue_number">{{ contact.queue_number}}</td>
</tr>
{% endfor %}
</table>
Expand Down

0 comments on commit 05aa37d

Please sign in to comment.