Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Dashboard</title>
- <link rel="stylesheet" href="dashstyle.css">
- </head>
- <body>
- <div class="logo">
- <img src="">
- </div>
- <div class="menubar">
- <ul>
- <li><a class="active" href="#home">Home</a></li>
- <li><a href="#support">Support</a></li>
- <li><a href="#pricing">Pricing</a></li>
- <li><a href="#contact">Contact</a></li>
- <li><a href="#about">About</a></li>
- </ul>
- </div>
- <!-- <a href="logout.php" class="button">Logout</a> -->
- <br />
- <h1>Welcome to your dashboard</h1>
- <div class="dash_style">
- <div class="form_heading">Log Incidents</div>
- <form action="dashboard.php" method="post">
- <div class="label"><span>Date </span><input type='date' class="datefield" name='date' /></div>
- <div class="label"><span>Department </span><input type="text" class="department" name="dept" value="" /></div>
- <div class="label"><span>Severity </span>
- <select name='seve' class="selectfield1">
- <option value="priority">Select</option>
- <option value="urgent">Urgent</option>
- <option value="high">High</option>
- <option value="medium">Medium</option>
- <option value="low">Low</option>
- </select>
- </div>
- <div class="label"><span>Status </span>
- <select name='stat' class="selectfield2">
- <option value="status">Select</option>
- <option value="progress">In progress</option>
- <option value="assigned">Assigned</option>
- <option value="completed">Completed</option>
- <option value="Delayed">Delayed</option>
- </select>
- </div>
- <div class="label"><span>Assigned To </span><input type="text" class="assignedto" name="assi" value="" /></div>
- <div class="label"><span>Due By </span><input type="datetime-local" class="dueby" name="dueby"></div>
- <div class="label"><span>Description </span><textarea name="desc" class="description"></textarea></div>
- <div><span> </span><input type="submit" name="submit" value="Log Incident" /></div>
- </form>
- </div>
- <div class="visual1">
- <?php
- include("bar_chart.php");
- ?>
- </div>
- <div class="h1">
- <h1>Incident Panel</h1>
- </div>
- <div class="panel">
- <table width='1200px' align='center' border='1'?>
- <tr bgcolor='grey'>
- <th>ID</th>
- <th>Date</th>
- <th>Description</th>
- <th>Department</th>
- <th>Severity</th>
- <th>Status</th>
- <th>Assigned To</th>
- <th>Due By</th>
- <th>Close Incident</th>
- </tr>
- <tr>
- <?php
- mysql_connect("localhost", "root", "");
- mysql_select_db("fyp");
- $inc_query = 'SELECT * FROM incidents';
- $run_query = mysql_query($inc_query);
- while ($row=mysql_fetch_array($run_query)) {
- $id = $row[0];
- $date = $row[1];
- $description = $row[2];
- $department = $row[3];
- $priority = $row[4];
- $status = $row[5];
- $assigned_to = $row[6];
- $datetime = $row[7];
- ?>
- <tr align='center'>
- <td><?php echo $id; ?></td>
- <td><?php echo $date; ?></td>
- <td><?php echo $description; ?></td>
- <td><?php echo $department; ?></td>
- <td><?php echo $priority; ?></td>
- <td><?php echo $status; ?></td>
- <td><?php echo $assigned_to; ?></td>
- <td><?php echo $datetime; ?></td>
- <td><a href="delete.php?del=<?php echo $id;?>">Close</a></td>
- </tr>
- <?php } ?>
- </table>
- </div>
- </body>
- </html>
- <?php
- mysql_connect("localhost", "root", "");
- mysql_select_db("fyp");
- if (isset($_POST['submit'])){
- $inc_date = $_POST['date'];
- $inc_desc = $_POST['desc'];
- $inc_dept = $_POST['dept'];
- $inc_prio = $_POST['seve'];
- $inc_stat = $_POST['stat'];
- $inc_assi = $_POST['assi'];
- $inc_comp = $_POST['dueby'];
- $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')";
- if(mysql_query($query)){
- echo "<script>window.open('dashboard.php','_self')</script>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement