Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
- <link href="static/css/myCss.css" rel="stylesheet">
- <meta charset="UTF-8">
- <link href="static/css/bootstrap.min.css" rel="stylesheet" media="screen">
- <link href="static/css/customIndex.css" rel="stylesheet">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link href="static/css/bootstrap-responsive.css" rel="stylesheet">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
- <title>Index</title>
- </head>
- <body>
- <% include templates/navbar.ejs%>
- <table class="table table-striped">
- <tr>
- <th> Project ID </th>
- <th> Request_Date </th>
- <th> Region </th>
- <th> Project_Location </th>
- <th> Requested_By </th>
- <th> Project_Responsibility </th>
- <th> Facility_Classification </th>
- <th> Project_Type </th>
- <th> Expected_Start_Date </th>
- <th> Expected_End_Date </th>
- <th> Work_Areas </th>
- <th> Conference_Rooms </th>
- <th> IDF_MDF </th>
- <th> Pantries </th>
- <th> Critical_Infrastructure </th>
- <th> Building_Support_Areas </th>
- <th> Data_Centers </th>
- <th> Other_Areas </th>
- <th> Project_Manager </th>
- <th> Project_Owner </th>
- <th> Project_Sponsor </th>
- <th> Functional_Currency </th>
- <th> Approval_Status </th>
- <th> CIP_NCIP </th>
- <th> Capital_Expense </th>
- <th> Approval </th>
- </tr>
- <% for (var i = 0; i < list.length; /* I save the data in a variable 'quotation', I don't know how you named your variable */ i++) { %>
- <form method ="post" action = "/approveproject">
- <tr>
- <td name ="project_id"><%= list[i].Project_ID %></td>
- <td><%= list[i].Request_Date %></td>
- <td><%= list[i].Region %></td>
- <td><%= list[i].Project_Location %></td>
- <td><%= list[i].Requested_By%></td>
- <td><%= list[i].Project_Responsibility%></td>
- <td><%= list[i].Facility_Classification%></td>
- <td><%= list[i].Project_Type%></td>
- <td><%= list[i].Expected_Start_Date%></td>
- <td><%= list[i].Expected_End_Date%></td>
- <td><%= list[i].Work_Areas%></td>
- <td><%= list[i].Conference_Rooms%></td>
- <td><%= list[i].IDF_MDF%></td>
- <td><%= list[i].Pantries%></td>
- <td><%= list[i].Critical_Infrastructure%></td>
- <td><%= list[i].Building_Support_Areas%></td>
- <td><%= list[i].Data_Centers%></td>
- <td><%= list[i].Other_Areas%></td>
- <td><%= list[i].Project_Manager%></td>
- <td><%= list[i].Project_Owner%></td>
- <td><%= list[i].Project_Sponsor%></td>
- <td><%= list[i].Functional_Currency%></td>
- <td><%= list[i].Approval_Status%></td>
- <td>
- <div class="form-group">
- <input type="radio" class="form-check-input" name="cip_noncip" value="CIP" checked> CIP <br>
- <input type="radio" class="form-check-input" name="cip_noncip" value="NON-CIP"> NON-CIP
- </div>
- </td>
- <td>
- <div class="form-group">
- <input type="radio" class="form-check-input" name="capital_expensed" value="Capital" checked> Capital <br>
- <input type="radio" class="form-check-input" name="capital_expensed" value="Expensed"> Expensed
- </div>
- </td>
- <td>
- <input type="submit" value="Approve" class = "btn btn-primary">
- </td>
- </tr>
- </form>
- <% } %>
- </table>
- </body>
- </html>
- var express = require('express');
- var router = express.Router();
- var sql = require('mssql');
- const config = {
- user: 'sa',
- password: 'password',
- server: 'localhost\SQLEXPRESS', // You can use 'localhost\instance' to connect to named instance
- database: 'pcgdb',
- options: {
- encrypt: false // Use this if you're on Windows Azure
- }
- };
- router.get('/', function(req, res, next) {
- sql.connect(config).then(() => {
- return sql.query`select * from projects where Approval_Status ='Not yet approved'`
- }).then(result => {
- console.log(result);
- res.render('approveProject', {list: result} )
- }).catch(err => {
- console.log(err)
- })
- });
- router.post('/', function(req, res, next) {
- console.log(req.body.project_id)
- })
- module.exports = router;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement