LASUCA CONTROLS

Controls Database Search

'PPH/Ton', 'mainspd' => 'MCC Speed', 'mccoutput' => 'MCC Output', 'ttlstmflo' => 'Total Steam Flow', 'exhaustpr' => 'Exhaust Press', 'livstmpr' => 'Live Steam Press', 'prevtons' => 'Previous Tons', 'prevtime' => 'Previous Run Time', 'tonshr' => 'East Tons Per HR', 'WTONSHR' => 'West Tons Per HR', '15minavg' => 'East Average Tons Per HR', 'W15MINAVG' => 'West Average Tons Per HR', 'avgtcd' => 'Average TCD', 'canetot' => 'East Tons Ground', 'WTOTGROUND' => 'West Tons Ground', 'syruprcvrlvl' => 'Syrup RCVR Lvl', 'syrupoverflow' => 'Syrup Overflow Lvl', 'amollvl' => 'A Molasses RCVR Lvl', 'amoloverflow' => 'A Molasses Overflow Lvl', 'molbreclvl' => 'B Molasses RCVR Lvl', 'bmoloverflow' => 'B Molasses Overflow Lvl', 'tdtotnorth' => 'North Dumps YTD', 'tdtotsouth' => 'South Dumps YTD', 'BBABONOFF' => 'Broadbent Run', 'BBTANKLVL' => 'Broadbent Tank Lvl', 'imb5sp' => 'Imibition 5 SP', 'imbsp' => 'Imibition 6 SP', 'mill1lvl' => 'Mill 1 Level', 'mill1spd' => 'East Mill 1 Speed', 'WMILL1SPD' => 'West Mill 1 Speed', 'mill1output' => 'Mill 1 Output', 'MILL1WSP' => 'Mill 1 Setpoint', 'mill2lvl' => 'Mill 2 Level', 'mill3lvl' => 'Mill 3 Level', 'mill4lvl' => 'Mill 4 Level', 'mill5lvl' => 'Mill 5 Level', 'mill6lvl' => 'Mill 6 Level', 'mill2spd' => 'Mill 2 RPM', 'mill3spd' => 'Mill 3 RPM', 'mill4spd' => 'Mill 4 RPM', 'mill5spd' => 'Mill 5 RPM', 'mill6spd' => 'Mill 6 RPM', 'knife1spd' => 'Knife 1 RPM', 'knife2spd' => 'Knife 2 RPM', 'knife3spd' => 'Knife 3 RPM' ]; // Function to create select options function generateSelectOptions($name, $selected = '', $options) { $html = ""; return $html; } // Handle form submission if(isset($_POST['submit'])){ // Sanitize inputs $inputs = ['yearmin', 'monthmin', 'daymin', 'hourmin', 'minutemin', 'secondmin', 'yearmax', 'monthmax', 'daymax', 'hourmax', 'minutemax', 'secondmax', 'option1', 'option2', 'option3', 'option4', 'option5', 'option6', 'accuracy']; foreach ($inputs as $input) { ${$input} = isset($_POST[$input]) ? trim($_POST[$input]) : ''; } // Validate date inputs if (!checkdate((int)$monthmin, (int)$daymin, (int)$yearmin) || !checkdate((int)$monthmax, (int)$daymax, (int)$yearmax)) { die("Invalid date format"); } // Validate accuracy $acc = max(1, (int)$acc); include("dbinfo2.php"); $con = mysqli_connect($host, $username, $password, $database); if (!$con) { die('Connection failed: ' . mysqli_connect_error()); } // Prepare timestamp range $timestamp_min = "$yearmin-$monthmin-$daymin $hourmin:$minutemin:$secondmin"; $timestamp_max = "$yearmax-$monthmax-$daymax $hourmax:$minutemax:$secondmax"; // Build query with prepared statement approach $query = "SELECT ? as option1, ? as option2, ? as option3, ? as option4, ? as option5, ? as option6, Z_TIMESTAMP FROM milling WHERE Z_TIMESTAMP BETWEEN ? AND ? AND milling.id mod ? = 0 ORDER BY id DESC LIMIT 1500"; // For demonstration purposes - you'd need to adjust this based on your actual requirements $query = "SELECT `$option1` as option1, `$option2` as option2, `$option3` as option3, `$option4` as option4, `$option5` as option5, `$option6` as option6, Z_TIMESTAMP FROM milling WHERE Z_TIMESTAMP BETWEEN ? AND ? AND milling.id mod ? = 0 ORDER BY id DESC LIMIT 1500"; // Use prepared statements for security (this is a simplified example) $stmt = mysqli_prepare($con, $query); if ($stmt) { mysqli_stmt_bind_param($stmt, "ssssi", $timestamp_min, $timestamp_max, $acc); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); echo '
'; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; while ($row = mysqli_fetch_assoc($result)) { echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo "
Timestamp" . ($option1 ? $OPTIONS[$option1] : '') . "" . ($option2 ? $OPTIONS[$option2] : '') . "" . ($option3 ? $OPTIONS[$option3] : '') . "" . ($option4 ? $OPTIONS[$option4] : '') . "" . ($option5 ? $OPTIONS[$option5] : '') . "" . ($option6 ? $OPTIONS[$option6] : '') . "
".$row['Z_TIMESTAMP']."".$row['option1']."".$row['option2']."".$row['option3']."".$row['option4']."".$row['option5']."".$row['option6']."
"; mysqli_stmt_close($stmt); } mysqli_close($con); } else { // Display form ?>

Select date range


TO


AS

"; } ?>

display every row(s)

20 rows = approximately 1 minute

Results limited to 1500 rows.