Files
controls-web/controls-classic/OLD/newsearch.php
2026-02-17 09:29:34 -06:00

98 lines
2.5 KiB
PHP

<form name="name" action="newsearch.php" method="post">
<input type="text" placeholder="2015-10-06 23:55:27..." name="term" />
<input type="hidden" name="doSearch" value="1">
</form>
<?php
if($_POST['doSearch']==1) {
$username="corey";
$password="41945549";
$database="controls";
mysql_connect('192.168.0.2',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$term = mysql_real_escape_string($_REQUEST['term']);
$query = "(SELECT * FROM milling WHERE Z_TIMESTAMP LIKE '%".$term."%' ORDER BY id DESC)";
$result=mysql_query($query);
mysql_close();
} ?>
<?php if($_POST['doSearch']) { //a search request was made display my search results ?>
<table style="margin: 0px auto;" class="stat">
<tr>
<th><a href="search.php">RESET SEARCH</a></th>
</tr>
<tr>
<th>Search Results</th>
</tr>
<tr>
<th><a href="edit" id="edit">Toggle Columns On/Off</a></th>
</tr>
<table id="table" style="margin: 0px auto;" class="stat">
<thead>
<tr>
<th>Timestamp</th>
<th>Prev Tons</th>
<th>Prev Run</th>
<th>MCC Spd</th>
<th>K1 Spd</th>
<th>K2 Spd</th>
<th>K3 Spd</th>
<th>M1 Spd</th>
<th>M2 Spd</th>
<th>M3 Spd</th>
<th>M4 Spd</th>
<th>M5 Spd</th>
<th>M6 Spd</th>
<th>M1 Lvl</th>
<th>M2 Lvl</th>
<th>M3 Lvl</th>
<th>M4 Lvl</th>
<th>M5 Lvl</th>
<th>M6 Lvl</th>
</tr>
</thead>
<tbody>
<?php
while($row=mysql_fetch_assoc($result))
{
echo "<tr>";
echo "<td>".$row [ 'Z_TIMESTAMP' ]."</td>";
echo "<td>".$row [ 'PREVTONS' ]."</td>";
echo "<td>".$row [ 'PREVTIME' ]."</td>";
echo "<td>".$row [ 'MAINSPD' ]."</td>";
echo "<td>".$row [ 'KNIFE1SPD' ]."</td>";
echo "<td>".$row [ 'KNIFE2SPD' ]."</td>";
echo "<td>".$row [ 'KNIFE3SPD' ]."</td>";
echo "<td>".$row [ 'MILL1SPD' ]."</td>";
echo "<td>".$row [ 'MILL2SPD' ]."</td>";
echo "<td>".$row [ 'MILL3SPD' ]."</td>";
echo "<td>".$row [ 'MILL4SPD' ]."</td>";
echo "<td>".$row [ 'MILL5SPD' ]."</td>";
echo "<td>".$row [ 'MILL6SPD' ]."</td>";
echo "<td>".$row [ 'MILL1LVL' ]."</td>";
echo "<td>".$row [ 'MILL2LVL' ]."</td>";
echo "<td>".$row [ 'MILL3LVL' ]."</td>";
echo "<td>".$row [ 'MILL4LVL' ]."</td>";
echo "<td>".$row [ 'MILL5LVL' ]."</td>";
echo "<td>".$row [ 'MILL6LVL' ]."</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</table>
<?php } ?>