Email css, faculty consolidated-table

This commit is contained in:
Harshitha Shetty
2025-01-29 02:52:43 +05:30
parent fbba4028cb
commit 2c1f7bec7b
4 changed files with 37 additions and 14 deletions

View File

@@ -242,6 +242,7 @@ const ConsolidatedTable = () => {
<div style={styles.tableContainer}> <div style={styles.tableContainer}>
{currentTeachers.map((teacher, index) => { {currentTeachers.map((teacher, index) => {
const teacherData = data.filter((row) => row.Name === teacher); const teacherData = data.filter((row) => row.Name === teacher);
console.log(teacherData);
return ( return (
<div key={index} style={{ marginBottom: "20px" }}> <div key={index} style={{ marginBottom: "20px" }}>
<div <div
@@ -288,10 +289,11 @@ const ConsolidatedTable = () => {
<thead> <thead>
<tr> <tr>
<th style={styles.th}>Semester</th> <th style={styles.th}>Semester</th>
<th style={styles.th}>Program</th>
<th style={styles.th}>Course Code</th> <th style={styles.th}>Course Code</th>
<th style={styles.th}>Course Name</th> <th style={styles.th}>Course Name</th>
<th style={styles.th}>Exam Type</th> <th style={styles.th}>Exam Type</th>
<th style={styles.th}>Year</th> <th style={styles.th}>Exam Period</th>
<th style={styles.th}>Marks</th> <th style={styles.th}>Marks</th>
<th style={styles.th}>Name</th> <th style={styles.th}>Name</th>
<th style={styles.th}>Affiliation/College</th> <th style={styles.th}>Affiliation/College</th>
@@ -309,10 +311,11 @@ const ConsolidatedTable = () => {
{teacherData.map((row, idx) => ( {teacherData.map((row, idx) => (
<tr key={idx}> <tr key={idx}>
<td style={styles.td}>{row.semester}</td> <td style={styles.td}>{row.semester}</td>
<td style={styles.td}>{row.program}</td>
<td style={styles.td}>{row.courseCode}</td> <td style={styles.td}>{row.courseCode}</td>
<td style={styles.td}>{row.courseName}</td> <td style={styles.td}>{row.courseName}</td>
<td style={styles.td}>{row.examType}</td> <td style={styles.td}>{row.examType}</td>
<td style={styles.td}>{row.year}</td> <td style={styles.td}>{row.examPeriod +" "+ row.academicYear}</td>
<td style={styles.td}>{row.marks}</td> <td style={styles.td}>{row.marks}</td>
<td style={styles.td}>{row.Name}</td> <td style={styles.td}>{row.Name}</td>
<td style={styles.td}>{row.affiliation}</td> <td style={styles.td}>{row.affiliation}</td>

View File

@@ -183,10 +183,14 @@ export const sendEmail = async (formData) => {
export const createExcelBook = (teacherData, teacher) => { export const createExcelBook = (teacherData, teacher) => {
const workbook = XLSX.utils.book_new(); const workbook = XLSX.utils.book_new();
// Extract academicYear and examPeriod from the first entry in the teacherData array
const { academicYear, examPeriod } = teacherData[0] || {};
// Define header information // Define header information
const headerInfo = [ const headerInfo = [
["Somaiya Vidyavihar University"], ["Somaiya Vidyavihar University"],
["K. J. SOMAIYA COLLEGE OF ENGINEERING"], ["K. J. SOMAIYA COLLEGE OF ENGINEERING"],
[`Examination: ${examPeriod} ${academicYear}`],
[ [
"Appointment of Internal Examiners for Paper Setting / OR/PR/Assessment/Reassessment", "Appointment of Internal Examiners for Paper Setting / OR/PR/Assessment/Reassessment",
], ],
@@ -199,6 +203,7 @@ export const createExcelBook = (teacherData, teacher) => {
[ [
"Sr No", "Sr No",
"Semester", "Semester",
"Program",
"Course Code", "Course Code",
"Course Name", "Course Name",
"Exam Type", "Exam Type",
@@ -220,10 +225,11 @@ export const createExcelBook = (teacherData, teacher) => {
const dataRows = teacherData.map((row, index) => [ const dataRows = teacherData.map((row, index) => [
index + 1, index + 1,
row.semester, row.semester,
row.program,
row.courseCode, row.courseCode,
row.courseName, row.courseName,
row.examType, row.examType,
row.year, Math.ceil(row.semester/2),
row.marks, row.marks,
row.Name, row.Name,
row.affiliation, row.affiliation,

View File

@@ -23,7 +23,9 @@ router.get("/consolidated-table", async (req, res) => {
courseName: appointment.courseName, courseName: appointment.courseName,
semester: "", semester: "",
examType: "", examType: "",
year: "", academicYear: appointment.academicYear, // Added from appointment
examPeriod: appointment.examPeriod, // Added from appointment
program: "",
marks: "100+25", // Dummy value, replace with actual logic marks: "100+25", // Dummy value, replace with actual logic
affiliation: "KJSCE", // Replace with actual value affiliation: "KJSCE", // Replace with actual value
qualification: "M.E.", // Replace with actual value qualification: "M.E.", // Replace with actual value
@@ -40,7 +42,7 @@ router.get("/consolidated-table", async (req, res) => {
if (course) { if (course) {
data.semester = course.semester; data.semester = course.semester;
data.examType = course.scheme; data.examType = course.scheme;
data.year = course.program; data.program = course.program;
} }
}); });
@@ -51,7 +53,9 @@ router.get("/consolidated-table", async (req, res) => {
courseCode: data.courseId, courseCode: data.courseId,
courseName: data.courseName, courseName: data.courseName,
examType: data.examType, examType: data.examType,
year: data.year, academicYear: data.academicYear,
examPeriod : data.examPeriod,
program : data.program,
marks: data.marks, marks: data.marks,
Name: data.facultyName, Name: data.facultyName,
affiliation: data.affiliation, affiliation: data.affiliation,

View File

@@ -38,17 +38,27 @@ router.post("/", upload.single("file"), async (req, res) => {
// Email options // Email options
const mailOptions = { const mailOptions = {
from: "swdc.ate@gmail.com", // Replace with your email from: "SWDC Admin <swdc.ate@gmail.com>", // Replace with your email
to: recipientEmail, to: recipientEmail,
subject: `Excel File for ${teacher}`, subject: `Examination Appointments for ${teacher}`,
text: `Attached is the Excel file for ${teacher}.`, text: `Dear Sir/Madam,
Please find attached the Excel sheet regarding various appointments for the May-June 2024 Examination. Kindly find the tick mark (√) for the respective appointments.
Note: Kindly download the Excel sheet to view the hidden columns referring to the Scheme and other information.
If you have any queries, please contact the H.O.D or the Examination In-charge.
Your cooperation regarding the upcoming examination duties is highly solicited.`,
attachments: [ attachments: [
{ {
filename: fileName, filename: fileName,
path: req.file.path, // Use the uploaded file's path path: req.file.path, // Use the uploaded file's path
}, },
], ],
}; };
try { try {
// Send email // Send email