81 lines
2.1 KiB
PHP
81 lines
2.1 KiB
PHP
<?php
|
|
|
|
$serverName = "OPTIMUS\SQLEXPRESS";
|
|
$uid = "crw";
|
|
$pwd = "rp02751";
|
|
$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd,'ReturnDatesAsStrings'=> true, "CharacterSet" => 'utf-8', "Database"=>"Lasuca_MillData" );
|
|
|
|
/* 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 MaterialInfo ORDER by TareDate DESC";
|
|
|
|
$stmt = sqlsrv_query( $conn, $sql );
|
|
if( $stmt === false) {
|
|
die( print_r( sqlsrv_errors(), true) );
|
|
}
|
|
$tonsin = 0;
|
|
?>
|
|
<!--
|
|
<table style="margin: 0px auto;">
|
|
<tr>
|
|
<th>
|
|
<form method="POST" action="">
|
|
<label for="option"></label>
|
|
<select name="option" id="option">
|
|
<option>CR Number</option>
|
|
<option>Tare date</option>
|
|
</select>
|
|
<input type="submit" value="Search" />
|
|
</form>
|
|
</th>
|
|
</tr>
|
|
</table>
|
|
-->
|
|
<table id="table" style="margin: 1px auto; border: 2px solid black; border-collapse: collapse; width=850px;" class="stat">
|
|
<thead>
|
|
<tr style="margin: 1px auto; border: 1px solid black; border-collapse: collapse; align: left;">
|
|
<th>CR number</th>
|
|
<th>Material</th>
|
|
<th>Gross</th>
|
|
<th>Tare</th>
|
|
<th>Gross Date</th>
|
|
<th>Tare Date</th>
|
|
<th>Hauler</th>
|
|
<th>Truck Number</th>
|
|
<th>Ship From</th>
|
|
<th>Ship To</th>
|
|
</tr>
|
|
</thead>
|
|
<?php
|
|
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) )
|
|
{
|
|
echo "<tr>";
|
|
echo "<td width=100><b>".$row ['ControlNumber']."</b></td>";
|
|
echo "<td width=100>".$row ['Material']."</td>";
|
|
echo "<td width=100>".$row ['GrossWeight']."</td>";
|
|
echo "<td width=100>".$row ['TareWeight']." </td>";
|
|
echo "<td width=175>".$row ['GrossDate']." </td>";
|
|
echo "<td width=175>".$row ['TareDate']." </td>";
|
|
echo "<td width=100>".$row ['Hauler']." </td>";
|
|
echo "<td width=100>".$row ['TruckNumber']." </td>";
|
|
echo "<td width=100>".$row ['ShipFrom']." </td>";
|
|
echo "<td width=100>".$row ['ShipTo']." </td>";
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
//end
|
|
|
|
?>
|
|
</table>
|
|
<?php echo $tonsin; ?>
|
|
<?
|
|
$db = null;
|
|
?>
|