Code: Select all
<html>
<head>
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta content="minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no" name="viewport" />
<link href="css/style.css" type="text/css" rel="stylesheet" />
<script src="javascript/functions.js" type="text/javascript"></script>
<link rel="apple-touch-icon" href="homescreen.png"/>
<link href="startup.png" rel="apple-touch-startup-image" />
</head>
<div id="topbar">
<div id="title">Duty <?php echo $_REQUEST[duty_number]?></div>
</div>
<?php
//Test if it is a shared client
if (!empty($_SERVER['HTTP_CLIENT_IP'])){
$ip=$_SERVER['HTTP_CLIENT_IP'];
//Is it a proxy address
}elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip=$_SERVER['REMOTE_ADDR'];
}
$con = mysql_connect("","","");
mysql_select_db("ARRIVA_DUTIES", $con);
$sql="INSERT INTO tbl_requests (request_ip, request_type, request_value, request_referer)
VALUES
('$ip', 'Duty', '$_REQUEST[duty_number]', '$_SERVER[HTTP_REFERER]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con)
?>
<?php
$con = mysql_connect("","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ARRIVA_DUTIES", $con);
$result = mysql_query("SELECT duty_type, duty_start, duty_finish, duty_paytime FROM tbl_duties WHERE duty_number = '$_REQUEST[duty_number]'");
while($row = mysql_fetch_array($result))
{
echo "<div align='center'><table border='0' width='90%' cellpadding='1' cellspacing='2'>";
echo "<tr>
<td> <b>Duty Type</b></td>";
echo "<td>";
echo $row[0];
echo "</td>";
echo "</tr>";
echo "<tr>
<td> <b>Duty Start Time</b></td>";
echo "<td>";
echo $row[1];
echo "</td>";
echo "</tr>";
echo "<tr>
<td> <b>Duty Finish Time</b></td>";
echo "<td>";
echo $row[2];
echo "</td>";
echo "</tr>";
echo "<tr>
<td> <b>Duty Pay Time</b></td>";
echo "<td>";
echo $row[3];
echo "</td>";
echo "</tr>";
echo "</table><br>";
}
echo "<p align='center'>If you see no results, you have entered an invalid value.<br>If you know the information here is incorrect, please report the problem using the link at the bottom of this page.</p>";
echo "</div>";
mysql_close($con);
?>
<ul class="pageitem">
<li class="button">
<input type="submit" value="Back" onclick='javascript:history.go(-1)'"/>
</li>
</ul>
<br>
<div id='footer'>
Developed by Mike Ashfield<br>
<a href='/problem.php'>Report a problem</a>
</div>