-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b4a781
commit 77d64b8
Showing
18 changed files
with
341 additions
and
189 deletions.
There are no files selected for viewing
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
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,30 @@ | ||
const connection = require("../db/connection"); | ||
|
||
const create = async function (bug, callback) { | ||
let sql = `INSERT INTO bugs | ||
(Title, Summary, EstimatedHours, DeliveryDate, CreatedAt, ProjectID, StatusID, SeverityID, PriorityID) | ||
VALUES | ||
("${bug.Title}", "${bug.Summary}", "${bug.EstimatedHours}", STR_TO_DATE('${bug.DeliveryDate}', '%Y-%m-%d'), | ||
STR_TO_DATE('${bug.CreatedAt}', '%Y-%m-%d'), "${bug.ProjectID}", "${bug.StatusID}", "${bug.SeverityID}", "${bug.PriorityID}")`; | ||
|
||
connection.query(sql, function (err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
return callback(result); | ||
}); | ||
}; | ||
|
||
const findAll = async function (callback) { | ||
let sql = `select * from bugs`; | ||
|
||
connection.query(sql, function (err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
return callback(result); | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
create: create, | ||
findAll: findAll, | ||
}; |
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
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
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,13 @@ | ||
const connection = require("../db/connection"); | ||
|
||
const findAll = async function (callback) { | ||
let sql = `SELECT * FROM Priority`; | ||
|
||
connection.query(sql, async function (err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
return callback(result); | ||
}); | ||
}; | ||
|
||
module.exports = { findAll: findAll }; |
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
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,13 @@ | ||
const connection = require("../db/connection"); | ||
|
||
const findAll = async function (callback) { | ||
let sql = `SELECT * FROM Severity`; | ||
|
||
connection.query(sql, async function (err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
return callback(result); | ||
}); | ||
}; | ||
|
||
module.exports = { findAll: findAll }; |
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
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,78 +1,35 @@ | ||
const mysql = require("mysql"); | ||
const HOST = "localhost" | ||
const USER = "root" | ||
const PASSWORD = "123456" | ||
const DATABASE = "trackpath" | ||
|
||
|
||
const create = async function(obj, callback) { | ||
const con = await mysql.createConnection({ | ||
host: HOST, | ||
user: USER, | ||
password:PASSWORD , | ||
database: DATABASE, | ||
}); | ||
|
||
con.connect(async function(err) { | ||
if (err) throw err; | ||
console.log("Connected!"); | ||
let sql = `INSERT INTO StatusProject (${obj.field}) VALUES ('${obj.value}')`; | ||
con.query(sql, function(err, result) { | ||
if (err) throw err; | ||
con.destroy(); | ||
console.log(sql); | ||
findByPK(result.insertId, function(result) { | ||
return callback(result); | ||
}); | ||
}); | ||
const connection = require("../db/connection"); | ||
|
||
const create = async function (obj, callback) { | ||
let sql = `INSERT INTO StatusProject (${obj.field}) VALUES ('${obj.value}')`; | ||
connection.query(sql, function (err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
findByPK(result.insertId, function (result) { | ||
return callback(result); | ||
}); | ||
}); | ||
}; | ||
|
||
const findAll = async function(callback) { | ||
const con = await mysql.createConnection({ | ||
host: HOST, | ||
user: USER, | ||
password:PASSWORD , | ||
database: DATABASE, | ||
}); | ||
|
||
con.connect(async function(err) { | ||
if (err) throw err; | ||
console.log("Connected!"); | ||
|
||
let sql = `SELECT * FROM statusproject`; | ||
|
||
con.query(sql, async function(err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
con.destroy(); | ||
return callback(result); | ||
}); | ||
}); | ||
const findAll = async function (callback) { | ||
let sql = `SELECT * FROM statusproject`; | ||
connection.query(sql, async function (err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
return callback(result); | ||
}); | ||
}; | ||
|
||
const findByPK = async function(id, callback) { | ||
const con = await mysql.createConnection({ | ||
host: HOST, | ||
user: USER, | ||
password:PASSWORD , | ||
database: DATABASE, | ||
}); | ||
|
||
con.connect(async function(err) { | ||
if (err) throw err; | ||
console.log("Connected!"); | ||
|
||
let sql = `SELECT * FROM statusproject | ||
const findByPK = async function (id, callback) { | ||
let sql = `SELECT * FROM statusproject | ||
where id=${mysql.escape(id)}`; | ||
|
||
con.query(sql, async function(err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
con.destroy(); | ||
return callback(result[0]); | ||
}); | ||
}); | ||
connection.query(sql, async function (err, result) { | ||
if (err) throw err; | ||
console.log(sql); | ||
return callback(result[0]); | ||
}); | ||
}; | ||
|
||
module.exports = { create: create, findByPK: findByPK, findAll: findAll }; | ||
module.exports = { create: create, findByPK: findByPK, findAll: findAll }; |
This file was deleted.
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 |
---|---|---|
@@ -1,22 +1,12 @@ | ||
function w3_open() { | ||
document.getElementById("main").style.marginLeft = "25%"; | ||
document.getElementById("mySidebar").style.width = "25%"; | ||
document.getElementById("mySidebar").style.display = "block"; | ||
document.getElementById("openNav").style.display = 'none'; | ||
document.getElementById("main").style.marginLeft = "25%"; | ||
document.getElementById("mySidebar").style.width = "25%"; | ||
document.getElementById("mySidebar").style.display = "block"; | ||
document.getElementById("openNav").style.display = "none"; | ||
} | ||
|
||
function w3_close() { | ||
document.getElementById("main").style.marginLeft = "0%"; | ||
document.getElementById("mySidebar").style.display = "none"; | ||
document.getElementById("openNav").style.display = "inline-block"; | ||
document.getElementById("main").style.marginLeft = "0%"; | ||
document.getElementById("mySidebar").style.display = "none"; | ||
document.getElementById("openNav").style.display = "inline-block"; | ||
} | ||
|
||
// Get the modal | ||
var modal = document.getElementById('id01'); | ||
|
||
// When the user clicks anywhere outside of the modal, close it | ||
window.onclick = function(event) { | ||
if (event.target == modal) { | ||
modal.style.display = "none"; | ||
} | ||
} |
Oops, something went wrong.