Advertisement
Guest User

HTML

a guest
Apr 29th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.00 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Dashboard</title>
  4.  
  5. <link rel="stylesheet" href="dashstyle.css">
  6.  
  7. </head>
  8.  
  9. <body>
  10.  
  11. <div class="logo">
  12. <img src="">
  13. </div>
  14. <div class="menubar">
  15. <ul>
  16.  
  17. <li><a class="active" href="#home">Home</a></li>
  18. <li><a href="#support">Support</a></li>
  19. <li><a href="#pricing">Pricing</a></li>
  20. <li><a href="#contact">Contact</a></li>
  21. <li><a href="#about">About</a></li>
  22. </ul>
  23. </div>
  24.  
  25. <!-- <a href="logout.php" class="button">Logout</a> -->
  26.  
  27.  
  28. <br />
  29. <h1>Welcome to your dashboard</h1>
  30.  
  31.  
  32. <div class="dash_style">
  33. <div class="form_heading">Log Incidents</div>
  34.  
  35.  
  36. <form action="dashboard.php" method="post">
  37.  
  38. <div class="label"><span>Date </span><input type='date' class="datefield" name='date' /></div>
  39.  
  40. <div class="label"><span>Department </span><input type="text" class="department" name="dept" value="" /></div>
  41.  
  42. <div class="label"><span>Severity </span>
  43. <select name='seve' class="selectfield1">
  44. <option value="priority">Select</option>
  45. <option value="urgent">Urgent</option>
  46. <option value="high">High</option>
  47. <option value="medium">Medium</option>
  48. <option value="low">Low</option>
  49. </select>
  50. </div>
  51.  
  52. <div class="label"><span>Status </span>
  53. <select name='stat' class="selectfield2">
  54. <option value="status">Select</option>
  55. <option value="progress">In progress</option>
  56. <option value="assigned">Assigned</option>
  57. <option value="completed">Completed</option>
  58. <option value="Delayed">Delayed</option>
  59. </select>
  60. </div>
  61.  
  62. <div class="label"><span>Assigned To </span><input type="text" class="assignedto" name="assi" value="" /></div>
  63.  
  64. <div class="label"><span>Due By </span><input type="datetime-local" class="dueby" name="dueby"></div>
  65.  
  66. <div class="label"><span>Description </span><textarea name="desc" class="description"></textarea></div>
  67.  
  68. <div><span>&nbsp;</span><input type="submit" name="submit" value="Log Incident" /></div>
  69. </form>
  70. </div>
  71.  
  72. <div class="visual1">
  73. <?php
  74.  
  75. include("bar_chart.php");
  76.  
  77. ?>
  78. </div>
  79. <div class="h1">
  80. <h1>Incident Panel</h1>
  81. </div>
  82.  
  83.  
  84.  
  85.  
  86. <div class="panel">
  87. <table width='1200px' align='center' border='1'?>
  88. <tr bgcolor='grey'>
  89. <th>ID</th>
  90. <th>Date</th>
  91. <th>Description</th>
  92. <th>Department</th>
  93. <th>Severity</th>
  94. <th>Status</th>
  95. <th>Assigned To</th>
  96. <th>Due By</th>
  97. <th>Close Incident</th>
  98.  
  99. </tr>
  100. <tr>
  101. <?php
  102. mysql_connect("localhost", "root", "");
  103. mysql_select_db("fyp");
  104.  
  105. $inc_query = 'SELECT * FROM incidents';
  106.  
  107. $run_query = mysql_query($inc_query);
  108.  
  109.  
  110. while ($row=mysql_fetch_array($run_query)) {
  111.  
  112.  
  113. $id = $row[0];
  114. $date = $row[1];
  115. $description = $row[2];
  116. $department = $row[3];
  117. $priority = $row[4];
  118. $status = $row[5];
  119. $assigned_to = $row[6];
  120. $datetime = $row[7];
  121.  
  122. ?>
  123. <tr align='center'>
  124.  
  125. <td><?php echo $id; ?></td>
  126. <td><?php echo $date; ?></td>
  127. <td><?php echo $description; ?></td>
  128. <td><?php echo $department; ?></td>
  129. <td><?php echo $priority; ?></td>
  130. <td><?php echo $status; ?></td>
  131. <td><?php echo $assigned_to; ?></td>
  132. <td><?php echo $datetime; ?></td>
  133. <td><a href="delete.php?del=<?php echo $id;?>">Close</a></td>
  134. </tr>
  135.  
  136.  
  137. <?php } ?>
  138. </table>
  139. </div>
  140.  
  141.  
  142. </body>
  143. </html>
  144.  
  145. <?php
  146.  
  147. mysql_connect("localhost", "root", "");
  148. mysql_select_db("fyp");
  149.  
  150. if (isset($_POST['submit'])){
  151.  
  152. $inc_date = $_POST['date'];
  153. $inc_desc = $_POST['desc'];
  154. $inc_dept = $_POST['dept'];
  155. $inc_prio = $_POST['seve'];
  156. $inc_stat = $_POST['stat'];
  157. $inc_assi = $_POST['assi'];
  158. $inc_comp = $_POST['dueby'];
  159.  
  160. $query = "INSERT INTO incidents (date, description, department, severity, status, assigned_to, datetime) values ('$inc_date','$inc_desc', '$inc_dept','$inc_prio','$inc_stat','$inc_assi','$inc_comp')";
  161.  
  162. if(mysql_query($query)){
  163.  
  164. echo "<script>window.open('dashboard.php','_self')</script>";
  165. }
  166.  
  167. }
  168.  
  169.  
  170.  
  171. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement