Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. var express = require('express');
  2. var router = express.Router();
  3. var sql = require ('mssql');
  4.  
  5.  
  6. router.get('/', function(req, res, next) {
  7. res.render('newProject');
  8. });
  9.  
  10.  
  11. const config = {
  12. user: 'sa',
  13. password: 'password',
  14. server: 'localhost\SQLEXPRESS', // You can use 'localhost\instance' to connect to named instance
  15. database: 'pcgdb',
  16.  
  17. options: {
  18. encrypt: false // Use this if you're on Windows Azure
  19. }
  20. };
  21.  
  22.  
  23. sql.connect(config).then(() => {
  24. return sql.query`select Project_Type_Desc from Project_Type`
  25. }).then(result => {
  26. console.log(result)
  27. }).catch(err => {
  28. console.log(err)
  29. })
  30.  
  31.  
  32.  
  33. module.exports = router;
  34.  
  35. <!DOCTYPE html>
  36. <html lang="en">
  37.  
  38. <head>
  39. <meta charset="UTF-8">
  40. <title>PCG WEB APP</title>
  41. </head>
  42.  
  43. <body>
  44. <h1>Please input a new project</h1>
  45. <form class="form-horizontal" role="form" style="width: 50%;">
  46. <label for="sel1">Region : </label>
  47. <select class="form-control" id="sel1">
  48. <option>EMEA</option>
  49. <option>APAC</option>
  50. <option>AMER</option>
  51. </select>
  52. Country :
  53. <input type="text" name="coutry"><br>
  54. City:
  55. <input type="text" name="city"><br>
  56. Requested By :
  57. <input type="text" name="request_by"><br>
  58. Project Responsibility:
  59. <input type="text" name="project_responsibility"><br>
  60. Facility Classification:
  61. <input type="radio" name="facilityclassification" value="new" checked> New
  62. <input type="radio" name="facilityclassification" value="existing"> Existing<br>
  63. <label for="sel1">Project Type : </label>
  64. <select class="form-control" id="sel1">
  65. <option>Densification</option>
  66. <option>Renovation</option>
  67. <option>Expansion/Contraction of Office</option>
  68. <option>Infrastructure Upgrades</option>
  69. <option>Existing Office Relocation</option>
  70. <option>New Location</option>
  71. </select>
  72. Expected Start Date :
  73. <input type="date" name="start_date"><br>
  74. Expected End Date :
  75. <input type="date" name="end_date"><br>
  76. Brief description of scope of work:
  77. <input type="text" name="description"><br>
  78. Project manager :
  79. <input type="text" name="manager"><br>
  80. Project Owner :
  81. <input type="text" name="owner"><br>
  82. Project Sponser :
  83. <input type="text" name="sponser"><br>
  84. Functional Currency :
  85. <input type="text" name="currency"><br>
  86. <input type="submit" value="Submit" class = "btn btn-primary">
  87. </form>
  88. </div>
  89. </body>
  90. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement