-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddCompanyTest.js
37 lines (31 loc) · 928 Bytes
/
addCompanyTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var bodyParser = require("body-parser");
var urlEncodedParser = bodyParser.urlencoded({extended: false});
var path = require("path");
var express = require("express");
var app = express();
var mysql = require("mysql");
module.exports =
{
addTest : function(req, res, connection, companyID)
{
var body = req.body;
var insertVals =
{
CompanyID : companyID,
Name : body.testname,
TestDate: body.testdate,
TestTime: body.testtime,
Location: body.testlocation,
Details: body.otherdetails,
CutOffGPA: body.cutoffgpa
}
connection.query("INSERT INTO TEST SET ?", insertVals, function(err, result) {
if(err) throw err;
else
{
console.log("SUCCESS" + result);
res.redirect('/dashboard');
}
});
}
}