add all files

This commit is contained in:
Rucus
2026-02-17 09:29:34 -06:00
parent b8c8d67c67
commit 782d203799
21925 changed files with 2433086 additions and 0 deletions

BIN
lasuca/farmdata/Thumbs.db Normal file

Binary file not shown.

View File

@@ -0,0 +1,35 @@
<?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 DISTINCT CropDay FROM LoadData ORDER BY CropDay DESC";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
echo "<select name='cropday' id='cropday'>";
echo '<option selected disabled value="">Crop Day...</option>';
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
echo "<option value='" . $row['CropDay'] . "' >" . $row['CropDay'] . "</option>";
}
echo "</select>";
//end
?>
<?
$db = null;
?>

View File

@@ -0,0 +1,22 @@
<?php
$dbName = "G:\CBM\SC\data\D_SCALE.mdb";
if (!file_exists($dbName)) {
die("Could not find database file.");
}
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
//select data from db
$day = "SELECT DISTINCT `Crop Day` FROM `Load Data` ORDER BY `Crop Day` DESC";
$cd = $db->query($day);
//end
echo "<select name='cropday'>";
echo '<option selected disabled value="">Crop Day...</option>';
while ($row = $cd->fetch()) {
echo "<option value='" . $row['Crop Day'] . "' >" . $row['Crop Day'] . "</option>";
}
echo "</select>";

View File

@@ -0,0 +1,3 @@
<div class="footer">
<p>Copyright © 2015, Louisiana Sugarcane Cooperative, Inc</p>
</div>

View File

@@ -0,0 +1,34 @@
<?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 DISTINCT AccountName FROM Tract";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
echo "<select name='grower' id='grower'>";
echo '<option selected disabled value="">Select Farmer...</option>';
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
echo "<option value='" . $row['AccountName'] . "' >" . $row['AccountName'] . "</option>";
}
echo "</select>";
//end
?>
<?
$db = null;
?>

View File

@@ -0,0 +1,21 @@
<?php
$dbName = "G:\CBM\SC\data\D_SCALE.mdb";
if (!file_exists($dbName)) {
die("Could not find database file.");
}
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
//select data from db
$grower = "SELECT DISTINCT farmer FROM INSCALE";
$cows = $db->query($grower);
//end
echo "<select name='term'>";
echo '<option selected disabled value="">Select Farmer...</option>';
while ($row = $cows->fetch()) {
echo "<option value='" . $row['farmer'] . "' >" . $row['farmer'] . "</option>";
}
echo "</select>";

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

513
lasuca/farmdata/index.php Normal file
View File

@@ -0,0 +1,513 @@
<?php
// phpcs:ignoreFile
if (!function_exists('sqlsrv_query')) {
define('FARMDATA_SQLSRV_STUB', true);
function sqlsrv_query($conn, $sql, $params = array(), $options = array())
{
return false;
}
function sqlsrv_fetch_array($stmt, $fetchType)
{
return false;
}
function sqlsrv_free_stmt($stmt)
{
return false;
}
function sqlsrv_connect($serverName, $connectionInfo)
{
return false;
}
function sqlsrv_close($conn)
{
return true;
}
}
function farmdata_env($key, $fallback = null)
{
$value = getenv($key);
if ($value === false || $value === null || $value === '') {
return $fallback;
}
return $value;
}
function farmdata_fetch_column($conn, $sql, $params = array())
{
$results = array();
if (!function_exists('sqlsrv_query')) {
return $results;
}
$stmt = sqlsrv_query($conn, $sql, $params);
if ($stmt === false) {
return $results;
}
$fetchNumeric = defined('SQLSRV_FETCH_NUMERIC') ? constant('SQLSRV_FETCH_NUMERIC') : 2;
while ($row = sqlsrv_fetch_array($stmt, $fetchNumeric)) {
if (!isset($row[0])) {
continue;
}
$value = trim((string) $row[0]);
if ($value === '') {
continue;
}
$results[] = $value;
}
if (function_exists('sqlsrv_free_stmt')) {
sqlsrv_free_stmt($stmt);
}
return $results;
}
function farmdata_format_number($value, $decimals = 0)
{
if (!is_numeric($value)) {
return '—';
}
return number_format((float) $value, $decimals);
}
function farmdata_h($value)
{
return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8');
}
$filters = array(
'grower' => isset($_GET['grower']) ? trim((string) $_GET['grower']) : '',
'cropday' => isset($_GET['cropday']) ? trim((string) $_GET['cropday']) : '',
'vehicle' => isset($_GET['vehicle']) ? trim((string) $_GET['vehicle']) : '',
'tract' => isset($_GET['tract']) ? trim((string) $_GET['tract']) : '',
'load' => isset($_GET['load']) ? trim((string) $_GET['load']) : '',
'overload' => isset($_GET['overload']) && $_GET['overload'] === '1',
);
$serverName = farmdata_env('SQLSRV_HOST', 'CBM2K12\\SQLEXPRESS');
$connectionInfo = array(
'UID' => farmdata_env('SQLSRV_USERNAME', 'cbmclient'),
'PWD' => farmdata_env('SQLSRV_PASSWORD', 'ascbm2k'),
'ReturnDatesAsStrings' => true,
'CharacterSet' => 'UTF-8',
'Database' => farmdata_env('SQLSRV_DATABASE', 'SugarCaneScale'),
);
$conn = null;
$connectionError = null;
$growerOptions = array();
$cropDayOptions = array();
$vehicleSuggestions = array();
$tractSuggestions = array();
$loadSuggestions = array();
$latestCropDay = null;
$latestCropDayTons = null;
$overallTons = null;
$rows = array();
$resultTotals = array(
'tons' => 0.0,
'gross' => 0.0,
'tare' => 0.0,
);
if (defined('FARMDATA_SQLSRV_STUB') || !function_exists('sqlsrv_connect')) {
$connectionError = 'The SQL Server driver is not available on this server.';
} else {
$conn = @sqlsrv_connect($serverName, $connectionInfo);
if ($conn === false) {
$connectionError = 'Unable to connect to the load data database at this time.';
} else {
$growerOptions = farmdata_fetch_column(
$conn,
"SELECT DISTINCT AccountName FROM Tract WHERE AccountName IS NOT NULL AND AccountName <> '' ORDER BY AccountName ASC"
);
$cropDayOptions = farmdata_fetch_column(
$conn,
"SELECT DISTINCT CropDay FROM LoadData WHERE CropDay IS NOT NULL ORDER BY CropDay DESC"
);
$vehicleSuggestions = farmdata_fetch_column(
$conn,
"SELECT DISTINCT TOP 75 VehicleId_Fk FROM LoadData WHERE VehicleId_Fk IS NOT NULL AND VehicleId_Fk <> '' ORDER BY VehicleId_Fk ASC"
);
$tractSuggestions = farmdata_fetch_column(
$conn,
"SELECT DISTINCT TOP 75 TractId_Fk FROM LoadData WHERE TractId_Fk IS NOT NULL AND TractId_Fk <> '' ORDER BY TractId_Fk ASC"
);
$loadSuggestions = farmdata_fetch_column(
$conn,
"SELECT DISTINCT TOP 50 LoadId_Pk FROM LoadData WHERE LoadId_Pk IS NOT NULL ORDER BY LoadId_Pk DESC"
);
$latestStmt = sqlsrv_query(
$conn,
'SELECT TOP 1 CropDay, SUM(Tons) AS total_tons FROM LoadData WHERE CropDay IS NOT NULL GROUP BY CropDay ORDER BY CropDay DESC'
);
if ($latestStmt !== false) {
$fetchAssoc = defined('SQLSRV_FETCH_ASSOC') ? constant('SQLSRV_FETCH_ASSOC') : 2;
$latestRow = sqlsrv_fetch_array($latestStmt, $fetchAssoc);
if ($latestRow) {
$latestCropDay = $latestRow['CropDay'];
$latestCropDayTons = isset($latestRow['total_tons']) ? (float) $latestRow['total_tons'] : null;
}
if (function_exists('sqlsrv_free_stmt')) {
sqlsrv_free_stmt($latestStmt);
}
}
$overallStmt = sqlsrv_query(
$conn,
'SELECT SUM(Tons) AS total_tons FROM LoadData'
);
if ($overallStmt !== false) {
$fetchAssoc = isset($fetchAssoc) ? $fetchAssoc : (defined('SQLSRV_FETCH_ASSOC') ? constant('SQLSRV_FETCH_ASSOC') : 2);
$overallRow = sqlsrv_fetch_array($overallStmt, $fetchAssoc);
if ($overallRow && isset($overallRow['total_tons'])) {
$overallTons = (float) $overallRow['total_tons'];
}
if (function_exists('sqlsrv_free_stmt')) {
sqlsrv_free_stmt($overallStmt);
}
}
$query = "SELECT TOP 500
ld.LoadId_Pk,
ld.CropDay,
ld.VehicleId_Fk,
ld.TractId_Fk,
ld.TareWt,
ld.GrossWt,
ld.Tons,
ld.FarmerId_Fk,
CONVERT(varchar(20), ld.DateOut, 100) AS TimeOutFormatted,
ld.Parked,
t.AccountName
FROM LoadData ld
LEFT JOIN (
SELECT AccountId_Pk, MAX(AccountName) AS AccountName
FROM Tract
WHERE AccountName IS NOT NULL AND AccountName <> ''
GROUP BY AccountId_Pk
) t ON ld.FarmerId_Fk = t.AccountId_Pk";
$conditions = array();
$params = array();
if ($filters['grower'] !== '') {
$conditions[] = 't.AccountName = ?';
$params[] = $filters['grower'];
}
if ($filters['cropday'] !== '') {
$conditions[] = 'ld.CropDay = ?';
$params[] = $filters['cropday'];
}
if ($filters['vehicle'] !== '') {
$conditions[] = 'ld.VehicleId_Fk LIKE ?';
$params[] = $filters['vehicle'] . '%';
}
if ($filters['tract'] !== '') {
$conditions[] = 'ld.TractId_Fk LIKE ?';
$params[] = $filters['tract'] . '%';
}
if ($filters['load'] !== '') {
$conditions[] = 'ld.LoadId_Pk = ?';
$params[] = (int) $filters['load'];
}
if ($filters['overload']) {
$conditions[] = 'ld.GrossWt >= ?';
$params[] = 100000;
}
if (!empty($conditions)) {
$query .= ' WHERE ' . implode(' AND ', $conditions);
}
$query .= ' ORDER BY ld.DateOut DESC, ld.LoadId_Pk DESC';
$cursorType = defined('SQLSRV_CURSOR_KEYSET') ? constant('SQLSRV_CURSOR_KEYSET') : 1;
$loadStmt = sqlsrv_query($conn, $query, $params, array('Scrollable' => $cursorType));
if ($loadStmt === false) {
$connectionError = 'Unable to retrieve load data right now.';
} else {
$fetchAssoc = defined('SQLSRV_FETCH_ASSOC') ? constant('SQLSRV_FETCH_ASSOC') : 2;
while ($row = sqlsrv_fetch_array($loadStmt, $fetchAssoc)) {
$tons = isset($row['Tons']) && is_numeric($row['Tons']) ? (float) $row['Tons'] : null;
$tare = isset($row['TareWt']) && is_numeric($row['TareWt']) ? (float) $row['TareWt'] : null;
$gross = isset($row['GrossWt']) && is_numeric($row['GrossWt']) ? (float) $row['GrossWt'] : null;
$parkedRaw = isset($row['Parked']) ? trim((string) $row['Parked']) : '';
$parked = in_array(strtoupper($parkedRaw), array('1', 'Y', 'YES', 'TRUE'), true);
if ($tons !== null) {
$resultTotals['tons'] += $tons;
}
if ($tare !== null) {
$resultTotals['tare'] += $tare;
}
if ($gross !== null) {
$resultTotals['gross'] += $gross;
}
$rows[] = array(
'load_id' => isset($row['LoadId_Pk']) ? (int) $row['LoadId_Pk'] : null,
'crop_day' => isset($row['CropDay']) ? $row['CropDay'] : '',
'vehicle' => isset($row['VehicleId_Fk']) ? trim((string) $row['VehicleId_Fk']) : '',
'tract' => isset($row['TractId_Fk']) ? trim((string) $row['TractId_Fk']) : '',
'grower' => isset($row['AccountName']) ? trim((string) $row['AccountName']) : '',
'tons' => $tons,
'tare' => $tare,
'gross' => $gross,
'time_out' => isset($row['TimeOutFormatted']) ? trim((string) $row['TimeOutFormatted']) : '',
'parked' => $parked,
);
}
if (function_exists('sqlsrv_free_stmt')) {
sqlsrv_free_stmt($loadStmt);
}
}
if (function_exists('sqlsrv_close')) {
sqlsrv_close($conn);
}
}
}
$resultCount = count($rows);
$pageTitle = 'Load Data Explorer';
$metaDescription = 'Search LASUCA load data by grower, crop day, vehicle, or tract.';
$activeNav = 'production';
$extraStyles = array('/new/css/farmdata.css');
$extraScripts = array('/new/js/scripts.js');
$rootDir = __DIR__;
require $rootDir . '/../inc/theme-header.php';
?>
<main>
<header class="hero hero-sub farmdata-hero">
<div class="container">
<span class="badge">Live load data</span>
<h1 class="mt-3">Search cane deliveries and scale tickets.</h1>
<p class="lead">
Filter the latest loads by grower, crop day, vehicle, or tract. Results update instantly and include live
tonnage, tare, and gross weight totals so you can track activity at a glance.
</p>
</div>
</header>
<section class="page-section py-5">
<div class="container">
<?php if ($connectionError !== null): ?>
<div class="alert alert-warning" role="alert">
<?php echo farmdata_h($connectionError); ?>
</div>
<?php endif; ?>
<div class="farmdata-search-card">
<form method="get" action="index.php" class="row g-4 align-items-end">
<div class="col-12 col-md-6 col-xl-3">
<label for="grower" class="form-label">Grower</label>
<select class="form-select" id="grower" name="grower">
<option value="">All growers</option>
<?php foreach ($growerOptions as $option): ?>
<option value="<?php echo farmdata_h($option); ?>"<?php echo $filters['grower'] === $option ? ' selected' : ''; ?>>
<?php echo farmdata_h($option); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div class="col-12 col-md-6 col-xl-3">
<label for="cropday" class="form-label">Crop day</label>
<select class="form-select" id="cropday" name="cropday">
<option value="">All crop days</option>
<?php foreach ($cropDayOptions as $option): ?>
<option value="<?php echo farmdata_h($option); ?>"<?php echo $filters['cropday'] === $option ? ' selected' : ''; ?>>
<?php echo farmdata_h($option); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div class="col-12 col-md-6 col-xl-3">
<label for="vehicle" class="form-label">Vehicle</label>
<input
type="text"
class="form-control"
id="vehicle"
name="vehicle"
list="vehicleOptions"
value="<?php echo farmdata_h($filters['vehicle']); ?>"
placeholder="e.g. V9901"
/>
<datalist id="vehicleOptions">
<?php foreach ($vehicleSuggestions as $option): ?>
<option value="<?php echo farmdata_h($option); ?>"></option>
<?php endforeach; ?>
</datalist>
</div>
<div class="col-12 col-md-6 col-xl-3">
<label for="tract" class="form-label">Tract</label>
<input
type="text"
class="form-control"
id="tract"
name="tract"
list="tractOptions"
value="<?php echo farmdata_h($filters['tract']); ?>"
placeholder="Tract ID"
/>
<datalist id="tractOptions">
<?php foreach ($tractSuggestions as $option): ?>
<option value="<?php echo farmdata_h($option); ?>"></option>
<?php endforeach; ?>
</datalist>
</div>
<div class="col-12 col-md-6 col-xl-3">
<label for="load" class="form-label">Load #</label>
<input
type="number"
class="form-control"
id="load"
name="load"
list="loadOptions"
value="<?php echo farmdata_h($filters['load']); ?>"
placeholder="Exact load number"
min="1"
/>
<datalist id="loadOptions">
<?php foreach ($loadSuggestions as $option): ?>
<option value="<?php echo farmdata_h($option); ?>"></option>
<?php endforeach; ?>
</datalist>
</div>
<div class="col-12 col-md-6 col-xl-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="1" id="overload" name="overload"<?php echo $filters['overload'] ? ' checked' : ''; ?> />
<label class="form-check-label" for="overload">Show overloads (gross ≥ 100,000)</label>
</div>
</div>
<div class="col-12 col-md-6 col-xl-3 ms-auto">
<button type="submit" class="btn btn-success w-100">Search loads</button>
</div>
<div class="col-12 col-md-6 col-xl-3">
<a class="btn btn-outline-secondary w-100" href="/farmdata/index.php">Reset filters</a>
</div>
</form>
</div>
<div class="farmdata-metrics">
<div class="farmdata-metric">
<h4>Loads returned</h4>
<p><?php echo farmdata_h(number_format($resultCount)); ?> matching records</p>
</div>
<div class="farmdata-metric">
<h4>Result tons</h4>
<p><?php echo farmdata_h(farmdata_format_number($resultTotals['tons'], 2)); ?> total tons</p>
</div>
<div class="farmdata-metric">
<h4>Latest crop day</h4>
<p>
<?php if ($latestCropDay !== null): ?>
Day <?php echo farmdata_h($latestCropDay); ?> · <?php echo farmdata_h(farmdata_format_number($latestCropDayTons, 2)); ?> tons
<?php else: ?>
Not available
<?php endif; ?>
</p>
</div>
<div class="farmdata-metric">
<h4>All-time tons</h4>
<p><?php echo farmdata_h(farmdata_format_number($overallTons, 2)); ?> tons processed</p>
</div>
</div>
<div class="farmdata-results-card">
<?php if ($resultCount === 0): ?>
<p class="mb-0 text-muted">No loads match the filters you selected. Try adjusting the search criteria.</p>
<?php else: ?>
<div class="farmdata-results-summary">
<span>Gross: <?php echo farmdata_h(farmdata_format_number($resultTotals['gross'], 0)); ?></span>
<span>Tare: <?php echo farmdata_h(farmdata_format_number($resultTotals['tare'], 0)); ?></span>
<span>Tons: <?php echo farmdata_h(farmdata_format_number($resultTotals['tons'], 2)); ?></span>
</div>
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead>
<tr>
<th scope="col">Load #</th>
<th scope="col">Crop day</th>
<th scope="col">Grower</th>
<th scope="col">Tract</th>
<th scope="col">Vehicle</th>
<th scope="col">Gross</th>
<th scope="col">Tare</th>
<th scope="col">Tons</th>
<th scope="col">Time out</th>
<th scope="col">Parked</th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row): ?>
<tr>
<td><?php echo farmdata_h($row['load_id']); ?></td>
<td><?php echo farmdata_h($row['crop_day']); ?></td>
<td><?php echo $row['grower'] !== '' ? farmdata_h($row['grower']) : '—'; ?></td>
<td><?php echo $row['tract'] !== '' ? farmdata_h($row['tract']) : '—'; ?></td>
<td><?php echo $row['vehicle'] !== '' ? farmdata_h($row['vehicle']) : '—'; ?></td>
<td><?php echo farmdata_h(farmdata_format_number($row['gross'], 0)); ?></td>
<td><?php echo farmdata_h(farmdata_format_number($row['tare'], 0)); ?></td>
<td><?php echo farmdata_h(farmdata_format_number($row['tons'], 2)); ?></td>
<td><?php echo $row['time_out'] !== '' ? farmdata_h($row['time_out']) : '—'; ?></td>
<td><?php echo $row['parked'] ? '<span class="badge bg-warning text-dark">Yes</span>' : '<span class="badge bg-success">No</span>'; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>
</section>
</main>
<?php require $rootDir . '/../inc/theme-footer.php'; ?>

View File

@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html>
<head>
<title>Load Data</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</head>
<body>
<div class="center">
<div class="header">
</div>
<div class="row">
<div class="col-3 right">
<div class="aside">
<?php include("tonsin.php");?>
<?php include("tonsintot.php");?>
</div>
</div>
<?php
$dbName = "G:\CBM\SC\data\D_SCALE.mdb";
if (!file_exists($dbName)) {
die("Could not find database file.");
}
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
//select data from db
$sql = "SELECT `Load Data`.`Load No`,
`Load Data`.`Crop Day`,
`Load Data`.`Tract No`,
`Load Data`.`Gross Wt`,
`Load Data`.`In Tare`,
`Load Data`.Tons,
`Load Data`.`In Time`,
`Load Data`.`Out Time`,
INSCALE.farmer,
INSCALE.REMTONs,
INSCALE.hauled
FROM `Load Data` RIGHT JOIN INSCALE ON `Load Data`.`Load No` = INSCALE.Load
WHERE `Crop Day` = ( SELECT Max(`Crop Day`)FROM `Load Data`)
ORDER BY `Crop Day`, `Load No` DESC";
$result = $db->query($sql);
$tonsin = 0;
$tonsin2 = 0;
?>
<div class="col-6">
<table style="margin: 0px auto;">
<tr>
<th>
<form action="search.php">
<?php include("dayselect.php");?>
<?php include("growerselect.php");?><br>
<input id="option" type="checkbox" name="over" value="100000">
<label for="option"><span></span>OVERLOAD</label>
<input type="submit" value="Search" />
</form>
</th>
</tr>
</table>
<table style="margin: 0px auto;" class="stat">
<tr>
<th>Live Scale Load Data</th>
</tr>
</table>
<table class="stat">
<thead>
<tr>
<th>Load</th>
<th>Day</th>
<th>Tract</th>
<th>Grower</th>
<th>Gross</th>
<th>Tare</th>
<th>Tons</th>
<th>Hauled</th>
<th>Remaining</th>
</tr>
</thead>
<?php
while ($row = $result->fetch())
{
echo "<tr>";
echo "<td>".$row [ 'Load No' ]."</td>";
echo "<td><b>".$row [ 'Crop Day' ]."</b></td>";
echo "<td>".$row [ 'Tract No' ]."</td>";
echo "<td>".$row [ 'farmer' ]."</td>";
echo "<td>".$row [ 'Gross Wt' ]." </td>";
echo "<td>".$row [ 'In Tare' ]." </td>";
echo "<td>".$row [ 'Tons' ]."</td>";
echo "<td>".$row [ 'hauled' ]." Tons</td>";
echo "<td>".$row [ 'REMTONs' ]." Tons</td>";
echo "</tr>";
}
//end
?>
</table>
</div>
<a href="#" class="back-to-top">Back to Top</a>
</div>
<?php include 'footer.php';?>
<script type="text/javascript">
// create the back to top button
$('body').prepend('<a href="#" class="back-to-top">Back to Top</a>');
var amountScrolled = 300;
$(window).scroll(function() {
if ($(window).scrollTop() > amountScrolled) {
$('a.back-to-top').fadeIn('slow');
} else {
$('a.back-to-top').fadeOut('slow');
}
});
$('a.back-to-top, a.simple-back-to-top').click(function() {
$('body').animate({
scrollTop: 0
}, 'fast');
return false;
});
</script>
</body>
</html>

151
lasuca/farmdata/indextest Normal file
View File

@@ -0,0 +1,151 @@
<!DOCTYPE html>
<html>
<head>
<title>Load Data</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</head>
<body>
<div class="center">
<div class="header">
</div>
<div class="row">
<div class="col-3 right">
<div class="aside">
<?php include("tonsin.php");?>
<?php include("tonsintot.php");?>
</div>
</div>
<div class="col-6">
<?php
if(isset($_GET['submit'])){
$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));
}
//select data from db
$sql = "SELECT LoadData.LoadId_Pk,
LoadData.CropDay,
LoadData.VehicleId_Fk,
LoadData.TractId_Fk,
LoadData.TareWt,
LoadData.GrossWt,
LoadData.Tons,
LoadData.FarmerId_Fk,
CONVERT(varchar, LoadData.DateOut, 100) [TIME],
LoadData.Parked,
Tract.AccountName
FROM LoadData RIGHT JOIN Tract ON LoadData.FarmerId_Fk = Tract.AccountId_Pk
GROUP BY LoadData.LoadId_Pk,
LoadData.CropDay,
LoadData.VehicleId_Fk,
LoadData.TractId_Fk,
LoadData.TareWt,
LoadData.GrossWt,
LoadData.Tons,
LoadData.FarmerId_Fk,
LoadData.DateOut,
LoadData.Parked,
Tract.AccountName
ORDER by LoadId_Pk DESC";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
$tonsin = 0;
$tonsin2 = 0;
}
?>
<table style="margin: 0px auto;" class="stat">
<tr>
<th>Live Scale Load Data</th>
</tr>
</table>
<table class="stat">
<thead>
<tr>
<th>Load</th>
<th>Day</th>
<th>Tract</th>
<th>Grower</th>
<th>Gross</th>
<th>Tare</th>
<th>Tons</th>
<th>Out Time</th>
</tr>
</thead>
<?php
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
$tonsin += $row['Tons'];
echo "<tr>";
echo "<td>".$row ['LoadId_Pk']."</td>";
echo "<td><b>".$row ['CropDay']."</b></td>";
echo "<td>".$row ['TractId_Fk']."</td>";
echo "<td>".$row ['AccountName']."</td>";
echo "<td>".$row ['GrossWt']." </td>";
echo "<td>".$row ['TareWt']." </td>";
echo "<td>".$row ['Tons']." </td>";
echo "<td>".$row ['TIME']." </td>";
echo "</tr>";
}
//end
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>
</table>
<table style="margin: 0px auto;">
<tr>
<th id="vtitle" id="padded">Total Tons:</th>
<th align="right" id="sum-count"><?php echo $tonsin; ?></th>
</tr>
</table>
</div>
<a href="#" class="back-to-top">Back to Top</a>
</div>
<?php include 'footer.php';?>
<script type="text/javascript">
// create the back to top button
$('body').prepend('<a href="#" class="back-to-top">Back to Top</a>');
var amountScrolled = 300;
$(window).scroll(function() {
if ($(window).scrollTop() > amountScrolled) {
$('a.back-to-top').fadeIn('slow');
} else {
$('a.back-to-top').fadeOut('slow');
}
});
$('a.back-to-top, a.simple-back-to-top').click(function() {
$('body').animate({
scrollTop: 0
}, 'fast');
return false;
});
</script>
</body>
</html>

View File

@@ -0,0 +1,54 @@
<?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 VehicleId_Fk, LoadId_Pk, CropDay, TractId_Fk, TareWt, GrossWt, Tons, FarmerId_Fk, CONVERT(varchar, DateOut, 100) [TIME], SplitPercent, Parked
FROM LoadData
WHERE VehicleId_Fk
LIKE 'V99%'
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>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> ";
echo "</tr>";
}
/* Free statement and connection resources. */
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>
</table>

9
lasuca/farmdata/menu.php Normal file
View File

@@ -0,0 +1,9 @@
<div class="col-3 menu">
<ul>
<li>Factory info</li>
<li>Production</li>
<li>Grower Login</li>
<li>Contact & Personnel</li>
</ul>
</div>

View File

@@ -0,0 +1,34 @@
<?php
$serverName = "LASUCA2K8\CBM";
$uid = "cbm";
$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 20 LoadId_Pk, CropDay, TractId_Fk, TareIN, GrossWt, Tons, FarmerId_Fk, DateOut, SplitPercent
FROM LoadData
WHERE FarmerId_Fk
LIKE 32002
ORDER by LoadId_Pk DESC";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
echo $row['LoadId_Pk'].", ".$row['TareIN'].", ".$row['GrossWt'].", ".$row['Tons'].", ".$row['GrossWt'].", ".$row['FarmerId_Fk']."<br />";
}
/* Free statement and connection resources. */
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>

158
lasuca/farmdata/report.php Normal file
View File

@@ -0,0 +1,158 @@
<!DOCTYPE html>
<html>
<head>
<title>Load Data</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</head>
<body>
<div class="center">
<div class="header">
</div>
<div class="row">
<div class="col-3 right">
<div class="aside">
<?php include("tonsin.php");?>
<?php include("tonsintot.php");?>
</div>
</div>
<div class="col-6">
<table style="margin: 0px auto;">
<tr>
<th>
<form method="POST" action="search.php">
<?php include("dayselect.php");?>
<?php include("growerselect.php");?><br>
<input id="option" type="checkbox" name="over" value="100000">
<label for="option"><span></span>OVERLOADS</label>
<input type="submit" value="Search" />
</form>
</th>
</tr>
</table>
<?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));
}
//select data from db
$sql = "SELECT LoadData.LoadId_Pk,
LoadData.CropDay,
LoadData.TractId_Fk,
LoadData.TareWt,
LoadData.GrossWt,
LoadData.Tons,
LoadData.FarmerId_Fk,
CONVERT(varchar, LoadData.DateOut, 100) [TIME],
LoadData.Parked,
Tract.AccountName
FROM LoadData RIGHT JOIN Tract ON LoadData.FarmerId_Fk = Tract.AccountId_Pk
WHERE CropDay = 90
GROUP BY LoadData.LoadId_Pk,
LoadData.CropDay,
LoadData.TractId_Fk,
LoadData.TareWt,
LoadData.GrossWt,
LoadData.Tons,
LoadData.FarmerId_Fk,
LoadData.DateOut,
LoadData.Parked,
Tract.AccountName
ORDER by LoadId_Pk DESC";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
$tonsin = 0;
$tonsin2 = 0;
?>
<table style="margin: 0px auto;" class="stat">
<tr>
<th>Live Scale Load Data</th>
</tr>
</table>
<table class="stat">
<thead>
<tr>
<th>Load</th>
<th>Day</th>
<th>Tract</th>
<th>Grower</th>
<th>Gross</th>
<th>Tare</th>
<th>Tons</th>
<th>Out Time</th>
</tr>
</thead>
<?php
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
$tonsin += $row['Tons'];
echo "<tr>";
echo "<td>".$row ['LoadId_Pk']."</td>";
echo "<td><b>".$row ['CropDay']."</b></td>";
echo "<td>".$row ['TractId_Fk']."</td>";
echo "<td>".$row ['AccountName']."</td>";
echo "<td>".$row ['GrossWt']." </td>";
echo "<td>".$row ['TareWt']." </td>";
echo "<td>".$row ['Tons']." </td>";
echo "<td>".$row ['TIME']." </td>";
echo "</tr>";
}
//end
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>
</table>
<table style="margin: 0px auto;">
<tr>
<th id="vtitle" id="padded">Total Tons:</th>
<th align="right" id="sum-count"><?php echo $tonsin; ?></th>
</tr>
</table>
</div>
<a href="#" class="back-to-top">Back to Top</a>
</div>
<?php include 'footer.php';?>
<script type="text/javascript">
// create the back to top button
$('body').prepend('<a href="#" class="back-to-top">Back to Top</a>');
var amountScrolled = 300;
$(window).scroll(function() {
if ($(window).scrollTop() > amountScrolled) {
$('a.back-to-top').fadeIn('slow');
} else {
$('a.back-to-top').fadeOut('slow');
}
});
$('a.back-to-top, a.simple-back-to-top').click(function() {
$('body').animate({
scrollTop: 0
}, 'fast');
return false;
});
</script>
</body>
</html>

163
lasuca/farmdata/search.php Normal file
View File

@@ -0,0 +1,163 @@
<!DOCTYPE html>
<html>
<head>
<title>Load Data</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</head>
<body>
<div class="center">
<div class="header">
</div>
<div class="row">
<div class="col-3 right">
<div class="aside">
<?php include("tonsin.php");?>
<?php include("tonsintot.php");?>
</div>
</div>
<div class="col-6">
<table style="margin: 0px auto;">
<tr>
<th>
<form action="index.php">
<?php include("dayselect.php");?>
<?php include("growerselect.php");?><br>
<input id="option" type="checkbox" name="over" value="100000">
<label for="option"><span></span>OVERLOADS</label>
<input type="submit" value="Reset Search" />
</form>
</th>
</tr>
</table>
<?php
print_r($_POST);
$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));
}
//select data from db
$grower = $_POST['grower'];
$cropday = $_POST['cropday'];
$sql = "SELECT LoadData.LoadId_Pk,
LoadData.CropDay,
LoadData.TractId_Fk,
LoadData.TareWt,
LoadData.GrossWt,
LoadData.Tons,
LoadData.FarmerId_Fk,
CONVERT(varchar, LoadData.DateOut, 100) [TIME],
LoadData.Parked,
Tract.AccountName
FROM LoadData RIGHT JOIN Tract ON LoadData.FarmerId_Fk = Tract.AccountName
WHERE CropDay LIKE '%".$cropday."%' OR AccountName LIKE '%".$grower."%'
GROUP BY LoadData.LoadId_Pk,
LoadData.CropDay,
LoadData.TractId_Fk,
LoadData.TareWt,
LoadData.GrossWt,
LoadData.Tons,
LoadData.FarmerId_Fk,
LoadData.DateOut,
LoadData.Parked,
Tract.AccountName
ORDER by LoadId_Pk DESC";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
$tonsin = 0;
$tonsin2 = 0;
?>
<table style="margin: 0px auto;" class="stat">
<tr>
<th>Live Scale Load Data</th>
</tr>
</table>
<table class="stat">
<thead>
<tr>
<th>Load</th>
<th>Day</th>
<th>Tract</th>
<th>Grower</th>
<th>Gross</th>
<th>Tare</th>
<th>Tons</th>
<th>Out Time</th>
</tr>
</thead>
<?php
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
$tonsin += $row['Tons'];
echo "<tr>";
echo "<td>".$row ['LoadId_Pk']."</td>";
echo "<td><b>".$row ['CropDay']."</b></td>";
echo "<td>".$row ['TractId_Fk']."</td>";
echo "<td>".$row ['AccountName']."</td>";
echo "<td>".$row ['GrossWt']." </td>";
echo "<td>".$row ['TareWt']." </td>";
echo "<td>".$row ['Tons']." </td>";
echo "<td>".$row ['TIME']." </td>";
echo "</tr>";
}
//end
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>
</table>
</div>
<a href="#" class="back-to-top">Back to Top</a>
</div>
<?php include 'footer.php';?>
<script type="text/javascript">
// create the back to top button
$('body').prepend('<a href="#" class="back-to-top">Back to Top</a>');
var amountScrolled = 300;
$(window).scroll(function() {
if ($(window).scrollTop() > amountScrolled) {
$('a.back-to-top').fadeIn('slow');
} else {
$('a.back-to-top').fadeOut('slow');
}
});
$('a.back-to-top, a.simple-back-to-top').click(function() {
$('body').animate({
scrollTop: 0
}, 'fast');
return false;
});
</script>
</body>
</html>

232
lasuca/farmdata/style.css Normal file
View File

@@ -0,0 +1,232 @@
body{
max-width: 1080px;
margin: 0 auto !important;
float: none !important;
background-image: url("images/bg.gif");
background-color: #000;
}
* {
box-sizing: border-box;
}
.center {
background-color: #fff;
}
.row:after {
content: "";
clear: both;
display: block;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html, html a {
font-family: Arial, "Lucida Sans", sans-serif;
-webkit-font-smoothing: antialiased !important;
text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
}
.header {
background-image: url("images/fulllogo.png");
background-repeat: no-repeat;
background-position: center;
background-color: #474719;
height: 100px;
color: #ffffff;
padding: 15px;
}
h1 {
padding: 0px;
margin: 0px;
}
p{
padding: 0px;
margin: 0px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color :#333300;
color: #ffffff;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.menu li:hover {
background-color: #333333;
}
.aside {
background-color: #474719;
padding: 2px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #474719;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 20%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 80%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
/*
Max width before this PARTICULAR table gets nasty
This query will take effect for any screen smaller than 760px
and also iPads specifically.
*/
@media
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px) {
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
tr { border: 1px solid #ccc; }
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
}
td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
}
/*
Label the data
*/
td:nth-of-type(1):before { content: "Load Number"; }
td:nth-of-type(2):before { content: "Vehicle ID"; }
td:nth-of-type(3):before { content: "Tract No"; }
td:nth-of-type(4):before { content: "Tons"; }
td:nth-of-type(5):before { content: "Gross Wt"; }
td:nth-of-type(6):before { content: "Tare Wt"; }
td:nth-of-type(7):before { content: "Time Out"; }
td:nth-of-type(8):before { content: "Tons Hauled"; }
td:nth-of-type(9):before { content: "Tons Remaining"; }
}
table {
border-collapse: collapse;
width: 100%;
}
table, th, td {
border: 1px solid black;
}
th {
background-color: grey;
color: white;
text-align: center;
vertical-align: center;
}
td {
text-align: center;
}
tr:nth-child(even) {
background: #6C6C47;
color: white;
}
tr:nth-child(odd) {
background: #FFF;
color: black;
}
input[type=checkbox]:not(old),
input[type=radio ]:not(old){aa
width : 2em;
margin : 0;
padding : 0;
font-size : 1em;
opacity : 0;
}
input[type=checkbox]:not(old) + label,
input[type=radio ]:not(old) + label{
display : inline-block;
margin-left : -2em;
line-height : 1.5em;
}
input[type=checkbox]:not(old) + label > span,
input[type=radio ]:not(old) + label > span{
display : inline-block;
width : 0.875em;
height : 0.875em;
margin : 0.05em 0.2em 0.35em 0.9em;
border : 0.0625em solid rgb(192,192,192);
border-radius : 0.25em;
background : rgb(224,224,224);
background-image : -moz-linear-gradient(rgb(240,240,240),rgb(224,224,224));
background-image : -ms-linear-gradient(rgb(240,240,240),rgb(224,224,224));
background-image : -o-linear-gradient(rgb(240,240,240),rgb(224,224,224));
background-image : -webkit-linear-gradient(rgb(240,240,240),rgb(224,224,224));
background-image : linear-gradient(rgb(240,240,240),rgb(224,224,224));
vertical-align : bottom;
}
input[type=checkbox]:not(old):checked + label > span:before{
content : '✓';
display : block;
width : 1em;
color : rgb(153,204,102);
font-size : 0.875em;
line-height : 1em;
text-align : center;
text-shadow : 0 0 0.0714em rgb(115,153,77);
font-weight : bold;
}
a.back-to-top {
display: none;
width: 35px;
height: 35px;
text-indent: -9999px;
position: fixed;
z-index: 999;
right: 20px;
bottom: 20px;
background: #27AE61 url("up-arrow.png") no-repeat center 43%;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
}
a:hover.back-to-top {
background-color: #000;
}

47
lasuca/farmdata/test.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
//New Join Query
$sql = "SELECT `Load Data`.`Load No`,
`Load Data`.`Crop Day`,
`Load Data`.`Tract No`,
`Load Data`.`Gross Wt`,
`Load Data`.`In Tare`,
`Load Data`.Tons,
`Load Data`.`In Time`,
`Load Data`.`Out Time`,
INSCALE.Hauler
FROM `Load Data` RIGHT JOIN INSCALE ON `Load Data`.`Load No` = INSCALE.Load ORDER BY `Crop Day` DESC,`In Time` DESC";
{
echo "<tr>";
echo "<td>".$row [ 'load' ]."</td>";
echo "<td>".$row [ 'cropday' ]."</td>";
echo "<td>".$row [ 'tractno' ]."</td>";
echo "<td>".$row [ 'gross' ]." </td>";
echo "<td>".$row [ 'intare' ]." </td>";
echo "<td>".$row [ 'tons' ]." Tons</td>";
echo "<td>".$row [ 'intime' ]." </td>";
echo "<td>".$row [ 'outtime' ]." </td>";
echo "</tr>";
}
//Original Query
$sql = "SELECT * FROM `Load Data` ORDER BY `Crop Day` DESC,`In Time` DESC";
{
echo "<tr>";
echo "<td>".$row [ 'Load No' ]."</td>";
echo "<td>".$row [ 'Crop Day' ]."</td>";
echo "<td>".$row [ 'Tract No' ]."</td>";
echo "<td>".$row [ 'Gross Wt' ]." </td>";
echo "<td>".$row [ 'In Tare' ]." </td>";
echo "<td>".$row [ 'Tons' ]." Tons</td>";
echo "<td>".$row [ 'In Time' ]." </td>";
echo "<td>".$row [ 'Out Time' ]." </td>";
echo "</tr>";
}

View File

@@ -0,0 +1,36 @@
<?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 Tons FROM LoadData WHERE CropDay = ( SELECT Max(CropDay) FROM LoadData)";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
$tonsin = 0;
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) )
{
$tonsin += $row['Tons'];
}
//end
?>
<h2>Tons In Today</h2>
<p><?php echo $tonsin; ?></p>
<?
$db = null;
?>

View File

@@ -0,0 +1,36 @@
<?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 Tons FROM LoadData WHERE CropDay = ( SELECT Max(CropDay)-1 FROM LoadData)";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
$tonsin = 0;
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) )
{
$tonsin += $row['Tons'];
}
//end
?>
<h2>Tons In Today</h2>
<p><?php echo $tonsin; ?></p>
<?
$db = null;
?>

View File

@@ -0,0 +1,36 @@
<?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 * FROM LoadData ORDER BY DateIn DESC";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
$tonsin = 0;
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) )
{
$tonsin += $row['Tons'];
}
//end
?>
<h2>Tons In Total</h2>
<p><?php echo $tonsin; ?></p>
<?
$db = null;
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B