Commit eb857f79 authored by Deep Dey's avatar Deep Dey

refactor: format code

parent 03fcc196
......@@ -2,27 +2,32 @@ body {
background-color: #f4f4f4;
font-family: "Arial", sans-serif;
color: #333;
}
.navbar {
}
.navbar {
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.navbar-brand {
}
.navbar-brand {
font-weight: bold;
color: #333;
}
.container {
}
.container {
margin-top: 20px;
}
.filter-container {
}
.filter-container {
background: #f8f9fa;
padding: 20px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
border-radius: 10px;
height: calc(100vh - 80px);
overflow-y: auto;
}
.details-container {
}
.details-container {
background: #fff;
padding: 20px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
......@@ -30,28 +35,33 @@ body {
height: calc(100vh - 80px);
overflow-y: auto;
position: relative;
}
.filter-box {
}
.filter-box {
margin-bottom: 20px;
}
.filter-label {
}
.filter-label {
font-weight: bold;
}
.book-appointment-box {
}
.book-appointment-box {
position: absolute;
top: 10px;
right: 20px;
z-index: 100;
}
.navbar-filter {
}
.navbar-filter {
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
border-radius: 10px;
padding: 10px;
margin-bottom: 20px;
}
.navbar-filter select,
.navbar-filter input {
}
.navbar-filter select,
.navbar-filter input {
width: 100%;
margin-bottom: 10px;
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ body {
background-color: #f4f4f4;
font-family: 'Arial', sans-serif;
}
.login-container {
max-width: 400px;
width: 100%;
......@@ -15,19 +16,23 @@ body {
border-radius: 10px;
text-align: center;
}
.login-container h2 {
margin-bottom: 20px;
color: #333;
}
.login-container .form-group {
margin-bottom: 20px;
}
.login-container .form-control {
height: 45px;
border-radius: 5px;
box-shadow: none;
border-color: #ddd;
}
.login-container .btn {
height: 45px;
border-radius: 5px;
......@@ -38,9 +43,11 @@ body {
cursor: pointer;
transition: background 0.3s;
}
.login-container .btn:hover {
background: #4cae4c;
}
.error-message {
color: red;
display: none;
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
......@@ -7,6 +8,7 @@
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/dashboard.css" />
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#">Dashboard</a>
......@@ -63,7 +65,8 @@
</div>
</div>
<div class="modal fade" id="appointmentModal" tabindex="-1" role="dialog" aria-labelledby="appointmentModalLabel" aria-hidden="true">
<div class="modal fade" id="appointmentModal" tabindex="-1" role="dialog" aria-labelledby="appointmentModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
......@@ -94,4 +97,5 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="js/dashboard.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -2,68 +2,68 @@ $(document).ready(function () {
var studentData = [
{
id: 1,
school: "La Martiniere for Boys",
date: "2005-06-12",
name: "John Doe",
parent: "Jane Doe",
dob: "2003-12-10"
school: 'La Martiniere for Boys',
date: '2005-06-12',
name: 'John Doe',
parent: 'Jane Doe',
dob: '2003-12-10',
},
{
id: 2,
school: "La Martiniere for Girls",
date: "2007-09-18",
name: "arnab",
parent: "Bob Smith",
dob: "2003-12-10"
school: 'La Martiniere for Girls',
date: '2007-09-18',
name: 'arnab',
parent: 'Bob Smith',
dob: '2003-12-10',
},
{
id: 3,
school: "La Martiniere for Boys",
date: "2007-09-20",
name: "arnab1",
parent: "Bob Smith",
dob: "2003-12-10"
school: 'La Martiniere for Boys',
date: '2007-09-20',
name: 'arnab1',
parent: 'Bob Smith',
dob: '2003-12-10',
},
{
id: 4,
school: "La Martiniere for Boys",
date: "2007-09-21",
name: "arnab2",
parent: "Bob Smith",
dob: "2003-12-10"
school: 'La Martiniere for Boys',
date: '2007-09-21',
name: 'arnab2',
parent: 'Bob Smith',
dob: '2003-12-10',
},
{
id: 5,
school: "La Martiniere for Girls",
date: "2007-09-15",
name: "arnab3",
parent: "Bob Smith",
dob: "2003-12-10"
school: 'La Martiniere for Girls',
date: '2007-09-15',
name: 'arnab3',
parent: 'Bob Smith',
dob: '2003-12-10',
},
{
id: 6,
school: "La Martiniere for Boys",
date: "2007-09-22",
name: "arnab6",
parent: "Bob Smith",
dob: "2003-12-10"
school: 'La Martiniere for Boys',
date: '2007-09-22',
name: 'arnab6',
parent: 'Bob Smith',
dob: '2003-12-10',
},
{
id: 7,
school: "La Martiniere for Girls",
date: "2007-09-15",
name: "arnab4",
parent: "Bob Smith",
dob: "2003-12-10"
school: 'La Martiniere for Girls',
date: '2007-09-15',
name: 'arnab4',
parent: 'Bob Smith',
dob: '2003-12-10',
},
{
id: 8,
school: "La Martiniere for Girls",
date: "2007-09-05",
name: "arnab5",
parent: "Bob Smith",
dob: "2003-12-10"
}
school: 'La Martiniere for Girls',
date: '2007-09-05',
name: 'arnab5',
parent: 'Bob Smith',
dob: '2003-12-10',
},
];
function displayFilteredStudents(schoolFilter, dateFilter, timeFilter) {
......@@ -75,62 +75,65 @@ $(document).ready(function () {
);
});
var outputHtml = "";
var outputHtml = '';
filteredData.forEach(function (student) {
outputHtml += "<tr>";
outputHtml += '<td><input type="checkbox" class="student-checkbox" data-id="' + student.id + '"></td>';
outputHtml += "<td>" + student.id + "</td>";
outputHtml += "<td>" + student.dob + "</td>";
outputHtml += "<td>" + student.name + "</td>";
outputHtml += "<td>" + student.parent + "</td>";
outputHtml += "</tr>";
outputHtml += '<tr>';
outputHtml +=
'<td><input type="checkbox" class="student-checkbox" data-id="' +
student.id +
'"></td>';
outputHtml += '<td>' + student.id + '</td>';
outputHtml += '<td>' + student.dob + '</td>';
outputHtml += '<td>' + student.name + '</td>';
outputHtml += '<td>' + student.parent + '</td>';
outputHtml += '</tr>';
});
$("#output").html(outputHtml);
$('#output').html(outputHtml);
}
// Initial display of all students
displayFilteredStudents(null, null, null);
// Apply filters button click event
$("#applyFilters").click(function () {
var schoolFilter = $("#schoolFilter").val();
var dateFilter = $("#dateFilter").val();
var timeFilter = $("#timeFilter").val();
$('#applyFilters').click(function () {
var schoolFilter = $('#schoolFilter').val();
var dateFilter = $('#dateFilter').val();
var timeFilter = $('#timeFilter').val();
displayFilteredStudents(schoolFilter, dateFilter, timeFilter);
});
// Reset filters button click event
$("#resetFilters").click(function () {
$("#schoolFilter").val("");
$("#dateFilter").val("");
$("#timeFilter").val("");
$('#resetFilters').click(function () {
$('#schoolFilter').val('');
$('#dateFilter').val('');
$('#timeFilter').val('');
displayFilteredStudents(null, null, null);
});
// Book appointment button click event
$("#bookAppointmentBtn").click(function () {
$('#bookAppointmentBtn').click(function () {
var checkedValues = [];
$(".student-checkbox:checked").each(function () {
checkedValues.push($(this).data("id"));
$('.student-checkbox:checked').each(function () {
checkedValues.push($(this).data('id'));
});
console.log(checkedValues);
$('#studentIdForAppointment').val(checkedValues.toString());
$("#appointmentModal").modal("show");
$('#appointmentModal').modal('show');
});
// Appointment form submission event
$("#appointmentForm").submit(function (event) {
$('#appointmentForm').submit(function (event) {
event.preventDefault();
var studentId = $("#studentIdForAppointment").val();
var appointmentDate = $("#appointmentDate").val();
var appointmentTime = $("#appointmentTime").val();
console.log("Booking Appointment for Student ID:", studentId);
console.log("Appointment Date:", appointmentDate);
console.log("Appointment Time:", appointmentTime);
var studentId = $('#studentIdForAppointment').val();
var appointmentDate = $('#appointmentDate').val();
var appointmentTime = $('#appointmentTime').val();
console.log('Booking Appointment for Student ID:', studentId);
console.log('Appointment Date:', appointmentDate);
console.log('Appointment Time:', appointmentTime);
// Perform further actions here like sending data to the backend
$("#appointmentModal").modal("hide");
alert("Appointment booked successfully for Student ID: " + studentId);
$('#appointmentModal').modal('hide');
alert('Appointment booked successfully for Student ID: ' + studentId);
});
});
$(document).ready(function() {
$('#loginForm').on('submit', function(event) {
$(document).ready(function () {
$('#loginForm').on('submit', function (event) {
event.preventDefault();
var userID = $('#userid').val();
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
......@@ -7,15 +8,17 @@
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/login.css">
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form id="loginForm">
<div class="form-group">
<input type="text" class="form-control" id="userid" name="userid" placeholder="Enter User ID" required>
<input type="text" class="form-control" id="userid" name="userid" placeholder="Enter userID" required>
</div>
<div class="form-group">
<input type="password" class="form-control" id="password" name="password" placeholder="Enter Password" required>
<input type="password" class="form-control" id="password" name="password" placeholder="Enter Password"
required>
</div>
<div class="error-message" id="errorMessage">Invalid User ID or Password</div>
<button type="submit" class="btn btn-primary btn-block">Login</button>
......@@ -25,4 +28,5 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="js/login.js"></script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment