-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from abhiram2600/master
Table for student
- Loading branch information
Showing
87 changed files
with
6,971 additions
and
796 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
var PizZip = require('pizzip'); | ||
var Docxtemplater = require('docxtemplater'); | ||
var express = require('express'); | ||
var bodyParser =require('body-parser'); | ||
var app = express(); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
|
||
|
||
module.exports = { | ||
|
||
generateLetterIndividual: function generateLetterIndividual() | ||
{ | ||
var content = fs.readFileSync(path.resolve(__dirname, './LetterTemplate/NOT_ATTENDING_CLASSES_NOTICE.docx'), 'binary'); | ||
var zip = new PizZip(content); | ||
|
||
var docx=new Docxtemplater(); | ||
var json = fs.readFileSync('details.json').toString(); | ||
var jsondata = JSON.parse(json); | ||
try{ | ||
|
||
docx.loadZip(zip); | ||
docx.setData( | ||
{ | ||
|
||
department:jsondata.department, | ||
date:jsondata.date, | ||
subject: jsondata.subject, | ||
respects: jsondata.respects, | ||
your_name: jsondata.your_name, | ||
year: jsondata.year, | ||
section: jsondata.section, | ||
roll_no: jsondata.roll_no, | ||
reason: jsondata.reason, | ||
start_date:jsondata.start_date, | ||
end_date:jsondata.end_date, | ||
hod_name: jsondata.hod_name, | ||
faculty_name: jsondata.faculty_name, | ||
faculty: jsondata.faculty | ||
|
||
} | ||
); | ||
docx.render(); //this will generate the template. | ||
var buffer= docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
//timestamp for the output filename | ||
var currentDate = new Date(); | ||
var timeStamp = currentDate.getTime(); | ||
var filename = 'aknowledgeabsence'; | ||
fs.writeFileSync(`./LetterGenerated/${filename}.docx`,buffer); | ||
console.log('Letter Generated'); | ||
docx.render(); | ||
buffer = docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
} | ||
catch(error) | ||
{ | ||
errorHandler(error); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
var PizZip = require('pizzip'); | ||
var Docxtemplater = require('docxtemplater'); | ||
var express = require('express'); | ||
var bodyParser =require('body-parser'); | ||
var app = express(); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
|
||
|
||
module.exports = { | ||
|
||
generateLetterIndividual: function generateLetterIndividual() | ||
{ | ||
var content = fs.readFileSync(path.resolve(__dirname, './LetterTemplate/ALLOW_FOR_LAB_EXAM.docx'), 'binary'); | ||
var zip = new PizZip(content); | ||
|
||
var docx=new Docxtemplater(); | ||
var json = fs.readFileSync('details.json').toString(); | ||
var jsondata = JSON.parse(json); | ||
try{ | ||
|
||
docx.loadZip(zip); | ||
docx.setData( | ||
{ | ||
|
||
department:jsondata.department, | ||
date:jsondata.date, | ||
subject: jsondata.subject, | ||
respects: jsondata.respects, | ||
your_name: jsondata.your_name, | ||
year: jsondata.year, | ||
section: jsondata.section, | ||
roll_no: jsondata.roll_no, | ||
reason: jsondata.reason, | ||
exam:jsondata.exam, | ||
hod_name: jsondata.hod_name, | ||
faculty_name: jsondata.faculty_name, | ||
faculty: jsondata.faculty | ||
|
||
} | ||
); | ||
docx.render(); //this will generate the template. | ||
var buffer= docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
//timestamp for the output filename | ||
var currentDate = new Date(); | ||
var timeStamp = currentDate.getTime(); | ||
var filename = 'allowtolabexam'; | ||
fs.writeFileSync(`./LetterGenerated/${filename}.docx`,buffer); | ||
console.log('Letter Generated'); | ||
docx.render(); | ||
buffer = docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
} | ||
catch(error) | ||
{ | ||
errorHandler(error); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,16 @@ | ||
{ | ||
"designation": "Head of Department", | ||
"department": "Department of Computer Science and Engineering", | ||
"subject": "Permission for Event Conduction", | ||
"date": "2020-06-14", | ||
"subject": "Corona Lol", | ||
"date": "2020-06-17", | ||
"respects": "Sir", | ||
"team_name": "Robotic Club", | ||
"event_name": "fcdfhfb", | ||
"fromdate": "2020-06-15", | ||
"todate": "2020-06-17", | ||
"start_hour": "8", | ||
"start_min": "30", | ||
"start_meridian": "AM", | ||
"end_hour": "10", | ||
"end_min": "20", | ||
"end_meridian": "PM", | ||
"letter_body": "This is an workshop for 1st year Students.", | ||
"studentdetails": [ | ||
{ | ||
"Name": "Aaris", | ||
"Roll": "18P61A05D7" | ||
}, | ||
{ | ||
"Name": "Yash", | ||
"Roll": "18P61A05C2" | ||
} | ||
] | ||
"your_name": "Ebola", | ||
"year": "First", | ||
"section": "A", | ||
"roll_no": "1", | ||
"reason": "its good", | ||
"start_date": "2020-06-17", | ||
"end_date": "2020-06-18", | ||
"hod_name": "aids", | ||
"faculty_name": "thope", | ||
"faculty": "Principal" | ||
} |
Binary file renamed
BIN
+99 KB
.../LetterGenerated/Final_attendance_OC.docx → ...NGSTUDIO_attendance_oc_1592389368828.docx
Binary file not shown.
Binary file added
BIN
+96.1 KB
backend/generateTemplateLetters/CODINGSTUDIO_attendance_oc_1592487078544.docx
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
var PizZip = require('pizzip'); | ||
var Docxtemplater = require('docxtemplater'); | ||
var express = require('express'); | ||
var bodyParser =require('body-parser'); | ||
var app = express(); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
|
||
|
||
module.exports = { | ||
|
||
generateLetterIndividual: function generateLetterIndividual() | ||
{ | ||
var content = fs.readFileSync(path.resolve(__dirname, './LetterTemplate/HALFDAY_LEAVE.docx'), 'binary'); | ||
var zip = new PizZip(content); | ||
|
||
var docx=new Docxtemplater(); | ||
var json = fs.readFileSync('details.json').toString(); | ||
var jsondata = JSON.parse(json); | ||
try{ | ||
|
||
docx.loadZip(zip); | ||
docx.setData( | ||
{ | ||
|
||
department:jsondata.department, | ||
date:jsondata.date, | ||
subject: jsondata.subject, | ||
respects: jsondata.respects, | ||
your_name: jsondata.your_name, | ||
year: jsondata.year, | ||
section: jsondata.section, | ||
roll_no: jsondata.roll_no, | ||
reason: jsondata.reason, | ||
hod_name: jsondata.hod_name, | ||
faculty_name: jsondata.faculty_name, | ||
faculty: jsondata.faculty | ||
|
||
} | ||
); | ||
docx.render(); //this will generate the template. | ||
var buffer= docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
//timestamp for the output filename | ||
var currentDate = new Date(); | ||
var timeStamp = currentDate.getTime(); | ||
var filename = 'halfdayleave'; | ||
fs.writeFileSync(`./LetterGenerated/${filename}.docx`,buffer); | ||
console.log('Letter Generated'); | ||
docx.render(); | ||
buffer = docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
} | ||
catch(error) | ||
{ | ||
errorHandler(error); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
var PizZip = require('pizzip'); | ||
var Docxtemplater = require('docxtemplater'); | ||
var express = require('express'); | ||
var bodyParser =require('body-parser'); | ||
var app = express(); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var urlencodedParser = bodyParser.urlencoded({ extended: true}); | ||
|
||
|
||
module.exports = { | ||
|
||
generateLetterIndividual: function generateLetterIndividual() | ||
{ | ||
var content = fs.readFileSync(path.resolve(__dirname, './LetterTemplate/HOSTEL_LEAVE.docx'), 'binary'); | ||
var zip = new PizZip(content); | ||
|
||
var docx=new Docxtemplater(); | ||
var json = fs.readFileSync('details.json').toString(); | ||
var jsondata = JSON.parse(json); | ||
try{ | ||
|
||
docx.loadZip(zip); | ||
docx.setData( | ||
{ | ||
|
||
department:jsondata.department, | ||
date:jsondata.date, | ||
subject: jsondata.subject, | ||
respects: jsondata.respects, | ||
your_name: jsondata.your_name, | ||
year: jsondata.year, | ||
section: jsondata.section, | ||
roll_no: jsondata.roll_no, | ||
reason: jsondata.reason, | ||
hod_name: jsondata.hod_name, | ||
faculty_name: jsondata.faculty_name, | ||
faculty: jsondata.faculty | ||
|
||
} | ||
); | ||
docx.render(); //this will generate the template. | ||
var buffer= docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
//timestamp for the output filename | ||
var currentDate = new Date(); | ||
var timeStamp = currentDate.getTime(); | ||
var filename = 'hostelleave'; | ||
fs.writeFileSync(`./LetterGenerated/${filename}.docx`,buffer); | ||
console.log('Letter Generated'); | ||
docx.render(); | ||
buffer = docx.getZip().generate({type:"nodebuffer"}); | ||
|
||
} | ||
catch(error) | ||
{ | ||
errorHandler(error); | ||
} | ||
} | ||
}; |
Oops, something went wrong.