49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
$serverName = "SQLSERVER";
|
|
$uid = "crw";
|
|
$pwd = "rp02751";
|
|
$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd,'ReturnDatesAsStrings'=> true, "CharacterSet" => 'utf-8', "Database"=>"TruckTracking" );
|
|
|
|
/* Connect using SQL Server Authentication. */
|
|
$conn = sqlsrv_connect( $serverName, $connectionInfo);
|
|
if( $conn === false )
|
|
{
|
|
echo "Unable to connect.</br>";
|
|
die( print_r( sqlsrv_errors(), true));
|
|
}
|
|
|
|
$sql = "SELECT * FROM DumpHistory ORDER by ScanDate DESC";
|
|
|
|
$stmt = sqlsrv_query( $conn, $sql );
|
|
if( $stmt === false) {
|
|
die( print_r( sqlsrv_errors(), true) );
|
|
}
|
|
?>
|
|
|
|
<html>
|
|
<head>
|
|
<title>RFID Truck Log</title>
|
|
</head>
|
|
<body>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Load Number</th>
|
|
<th>Vehicle ID</th>
|
|
<th>Dump Location</th>
|
|
<th>Scan Date</th>
|
|
<th>Net Weight</th>
|
|
<th>Crop Day</th>
|
|
</tr>
|
|
</thead>
|
|
<?php while ($array=sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) {
|
|
echo "<td>".$array['LoadNo']."</td>";
|
|
echo "<td>".$array['VehicleId']."</td>";
|
|
echo "<td>".$array['DumpLocation']."</td>";
|
|
echo "<td>".$array['ScanDate']."</td>";
|
|
echo "<td>".$array['NetWt']."</td>";
|
|
echo "<td>".$array['CropDay']."</td>";
|
|
} ?>
|
|
</table>
|
|
</body>
|