Files
2026-02-17 09:29:34 -06:00

149 lines
5.3 KiB
PHP

<?php
session_start();
error_reporting(E_ERROR);
?>
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta name="generator"
content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
<!-- Created by Artisteer v4.3.0.60745 -->
<meta charset="utf-8" />
<title>New Page</title>
<meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width" />
<!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="../../style.css" media="screen" />
<!--[if lte IE 7]><link rel="stylesheet" href="style.ie7.css" media="screen" /><![endif]-->
<link rel="stylesheet" href="../../style.responsive.css" media="all" />
<script src="../../jquery.js"></script>
<script src="../../script.js"></script>
<script src="../../script.responsive.js"></script>
<style>
.art-content .art-postcontent-0 .layout-item-0 { padding-right: 10px;padding-left: 10px; }
.ie7 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
.ie6 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
tr:nth-child(even) {background: #264c1b; }
tr:nth-child(odd) {background: #1c3a13; }
</style>
</head>
<body>
<div id="art-main">
<header class="art-header">
<div class="art-shapes">
<div class="art-object1090304479"></div>
</div>
<h1 class="art-headline">
<a href="/">Producers of Raw Cane Sugar and Black Strap Molasses</a>
</h1>
</header>
<?php include("../../menugrower.php"); ?>
<div class="art-sheet clearfix">
<div class="art-layout-wrapper">
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-content">
<article class="art-post art-article">
<h2 class="art-postheader">Welcome Back</h2>
<div class="art-postcontent art-postcontent-0 clearfix">
<div class="art-content-layout-row">
<div class="art-layout-cell layout-item-0" style="width: 100%">
<P><b>Your account has been selected to test live load data from the scale. We are currently displaying your last 20 loads in the table below. This is currently in beta and is being tested by only a handfull of growers so there may be errors. Please report any errors you encounter or questions that you
may have to Corey at LASUCA. He can be reached at 394-3785 Ext 244. Thank you for any feedback that you may have.</b></P>
<br>
<center><h1><a href="index.php">Reports </a>
&nbsp
<a href="loads.php"> Load Data</a></h1></center>
<br>
<?php
$serverName = "CBM2K12\SQLEXPRESS";
$uid = "cbmclient";
$pwd = "ascbm2k";
$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd,'ReturnDatesAsStrings'=> true, "CharacterSet" => 'utf-8', "Database"=>"SugarCaneScale" );
/* 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 TOP 50 VehicleId_Fk, LoadId_Pk, CropDay, TractId_Fk, TareWt, GrossWt, Tons, FarmerId_Fk, ScaleWt, CONVERT(varchar, DateOut, 100) [TIME], SplitPercent, Parked
FROM LoadData
WHERE FarmerId_Fk
LIKE " . $_SESSION['growerid'] . "
ORDER by LoadId_Pk DESC";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
?>
<table width="100%">
<thead>
<tr>
<th>Load No</th>
<th>Vehicle</th>
<th>Tract</th>
<th>Tons</th>
<th>Tare</th>
<th>Gross</th>
<th></th>
<th>P</th>
<th>Time Out</th>
</tr>
</thead>
<?php
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
echo "<tr>";
echo"<td>".$row['LoadId_Pk']."</td>";
echo"<td>".$row['VehicleId_Fk']."</td>";
echo"<td>".$row['TractId_Fk']."</td>";
echo"<td>".$row['Tons']."</td>";
echo"<td>".$row['TareWt']."</td> ";
echo"<td>".$row['GrossWt']."</td> ";
if ($row['ScaleWt'] > 100000) {
echo"<td>".($row['ScaleWt'] - $row['GrossWt'])."</td> ";
}
else {
echo"<td>". 0 ."</td>";
}
if ($Parked == True)
echo"<td>Yes</td>";
if ($Parked == False)
echo"<td>No</td>";
echo"<td>".$row['TIME']."</td>";
echo "</tr>";
}
/* Free statement and connection resources. */
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>
</table>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</div>
</div>
<footer class="art-footer">
<div class="art-footer-inner">
<p>Copyright © 2016. Louisiana Sugar Cane Cooperative Inc. All Rights Reserved.</p>
</div>
</footer>
</div>
</div>
</body>
</html>