<?php
$title = "Job Role Description";
include ( 'includes/header.php' );
?>
</head>
<body>
<div id="container">
<?php
/*
VIEW.PHP
Displays all data from 'jobs' table
*/
// connect to the database
include('connect-db.php');
// get results from database
$result = mysql_query("SELECT ID, ref, role, division, location, salary, description FROM jobs WHERE division='IT' ORDER BY id DESC")
or die(mysql_error());
$id = '';
if(isset($_POST['ID'])){ $id = $_POST['ID']; }
// display data in table
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_array( $result )) {
// echo out the contents of each row into a table
echo "<table border='1' cellpadding='10' class='jobpagetable'>";
echo "<tr><th class='jobpage'>Ref</th><td>". $row['ref'] . "</td></tr>";
echo '<tr></tr><tr></tr>';
echo "<tr><th class='jobs'>Role</th><td>" . $row['role'] . '</td></tr>';
echo '<tr></tr><tr></tr>';
echo "<tr><th class='jobs'>Division</th><td>" . $row['division'] . '</td></tr>';
echo '<tr></tr><tr></tr>';
echo "<tr><th class='jobs'>Location</th><td>" . $row['location'] . '</td></tr>';
echo '<tr></tr><tr></tr>';
echo "<tr><th class='jobs'>Salary</th><td>" . $row['salary'] . '</td></tr>';
echo '<tr></tr><tr></tr>';
echo "<tr><th class='jobs'>Description</th><td>" . $row['description'] . '</td></tr>';
echo '<tr></tr><tr></tr>';
echo "<td><a class='applylinks' href='apply.php?id=" .$row['ID']."'>Apply</a></td>";
echo "</tr>";
}
// close table>
echo "</table>";
?>
</div>
</body>
</html>