forked from CSI-KJSCE/appointment_to_examiner
Email css, faculty consolidated-table
This commit is contained in:
@@ -242,6 +242,7 @@ const ConsolidatedTable = () => {
|
||||
<div style={styles.tableContainer}>
|
||||
{currentTeachers.map((teacher, index) => {
|
||||
const teacherData = data.filter((row) => row.Name === teacher);
|
||||
console.log(teacherData);
|
||||
return (
|
||||
<div key={index} style={{ marginBottom: "20px" }}>
|
||||
<div
|
||||
@@ -288,10 +289,11 @@ const ConsolidatedTable = () => {
|
||||
<thead>
|
||||
<tr>
|
||||
<th style={styles.th}>Semester</th>
|
||||
<th style={styles.th}>Program</th>
|
||||
<th style={styles.th}>Course Code</th>
|
||||
<th style={styles.th}>Course Name</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}>Name</th>
|
||||
<th style={styles.th}>Affiliation/College</th>
|
||||
@@ -309,10 +311,11 @@ const ConsolidatedTable = () => {
|
||||
{teacherData.map((row, idx) => (
|
||||
<tr key={idx}>
|
||||
<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.courseName}</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.Name}</td>
|
||||
<td style={styles.td}>{row.affiliation}</td>
|
||||
|
||||
@@ -183,10 +183,14 @@ export const sendEmail = async (formData) => {
|
||||
export const createExcelBook = (teacherData, teacher) => {
|
||||
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
|
||||
const headerInfo = [
|
||||
["Somaiya Vidyavihar University"],
|
||||
["K. J. SOMAIYA COLLEGE OF ENGINEERING"],
|
||||
[`Examination: ${examPeriod} ${academicYear}`],
|
||||
[
|
||||
"Appointment of Internal Examiners for Paper Setting / OR/PR/Assessment/Reassessment",
|
||||
],
|
||||
@@ -199,6 +203,7 @@ export const createExcelBook = (teacherData, teacher) => {
|
||||
[
|
||||
"Sr No",
|
||||
"Semester",
|
||||
"Program",
|
||||
"Course Code",
|
||||
"Course Name",
|
||||
"Exam Type",
|
||||
@@ -220,10 +225,11 @@ export const createExcelBook = (teacherData, teacher) => {
|
||||
const dataRows = teacherData.map((row, index) => [
|
||||
index + 1,
|
||||
row.semester,
|
||||
row.program,
|
||||
row.courseCode,
|
||||
row.courseName,
|
||||
row.examType,
|
||||
row.year,
|
||||
Math.ceil(row.semester/2),
|
||||
row.marks,
|
||||
row.Name,
|
||||
row.affiliation,
|
||||
|
||||
@@ -23,7 +23,9 @@ router.get("/consolidated-table", async (req, res) => {
|
||||
courseName: appointment.courseName,
|
||||
semester: "",
|
||||
examType: "",
|
||||
year: "",
|
||||
academicYear: appointment.academicYear, // Added from appointment
|
||||
examPeriod: appointment.examPeriod, // Added from appointment
|
||||
program: "",
|
||||
marks: "100+25", // Dummy value, replace with actual logic
|
||||
affiliation: "KJSCE", // Replace with actual value
|
||||
qualification: "M.E.", // Replace with actual value
|
||||
@@ -40,7 +42,7 @@ router.get("/consolidated-table", async (req, res) => {
|
||||
if (course) {
|
||||
data.semester = course.semester;
|
||||
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,
|
||||
courseName: data.courseName,
|
||||
examType: data.examType,
|
||||
year: data.year,
|
||||
academicYear: data.academicYear,
|
||||
examPeriod : data.examPeriod,
|
||||
program : data.program,
|
||||
marks: data.marks,
|
||||
Name: data.facultyName,
|
||||
affiliation: data.affiliation,
|
||||
|
||||
@@ -38,17 +38,27 @@ router.post("/", upload.single("file"), async (req, res) => {
|
||||
|
||||
// Email options
|
||||
const mailOptions = {
|
||||
from: "swdc.ate@gmail.com", // Replace with your email
|
||||
from: "SWDC Admin <swdc.ate@gmail.com>", // Replace with your email
|
||||
to: recipientEmail,
|
||||
subject: `Excel File for ${teacher}`,
|
||||
text: `Attached is the Excel file for ${teacher}.`,
|
||||
subject: `Examination Appointments 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: [
|
||||
{
|
||||
filename: fileName,
|
||||
path: req.file.path, // Use the uploaded file's path
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
try {
|
||||
// Send email
|
||||
|
||||
Reference in New Issue
Block a user