Skip to content

Commit

Permalink
ss added
Browse files Browse the repository at this point in the history
  • Loading branch information
G-nizam-A committed Jan 17, 2024
1 parent ab37e06 commit 87d5a70
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions public/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ document.addEventListener("DOMContentLoaded", () => {
});

const totalMarks = data.length * 100;
const obtainedMarks = data.reduce(
(sum, subject) => sum + subject.marks_obtained,
0
);
const obtainedMarks = data.reduce((sum, subject) => sum + subject.marks_obtained,0);

const percentage = (obtainedMarks / totalMarks) * 100;

display[3].textContent = obtainedMarks + "/" + totalMarks;
Expand Down
4 changes: 1 addition & 3 deletions public/students.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ document.addEventListener("DOMContentLoaded", () => {
const addStudents = document.getElementById("addStudents");
const allStudents = document.querySelector("tbody");

// const getPostForm = document.getElementById("getPostForm");
// const singlePost = document.getElementById("singlePost");
const updateForm = document.getElementById("updateForm");

// Function to fetch and display all students
Expand All @@ -17,7 +15,7 @@ document.addEventListener("DOMContentLoaded", () => {
}
const data = await response.json();
allStudents.innerHTML = "";

data.forEach((student) => {
const tbody = document.createElement("tr");
tbody.innerHTML += `<tr><td>${scount}</td><td>${student.usn}</td><td>${student.sname}
Expand Down
2 changes: 1 addition & 1 deletion public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

body {
background: #f6f6f9;
overflow: hidden;
/* overflow: hidden; */
}

html,
Expand Down
Binary file added screenshots/ss1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/ss2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/ss3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/ss4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/ss5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ app.post('/students/add', (req, res) => {
res.json({ message: 'Data inserted successfully' });
});
});

app.post('/subjects/add', (req, res) => {
const { subject_code, subject_name, department } = req.body;
pool.query('INSERT INTO subjects (subject_code, subject_name, department) VALUES (?, ?, ?)', [subject_code, subject_name, department], (err, results) => {
Expand Down

0 comments on commit 87d5a70

Please sign in to comment.