133 lines
3.3 KiB
PHP
133 lines
3.3 KiB
PHP
<head>
|
|
<link rel="stylesheet" href="styles.css">
|
|
<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>
|
|
|
|
<?php
|
|
$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();
|
|
|
|
?>
|
|
|
|
<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>PPH/Ton</th>
|
|
<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 [ 'LBSPERHR' ]."</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>
|
|
<script type="text/javascript">
|
|
$('#edit').click(function() {
|
|
var headers = $('#table th').map(function() {
|
|
var th = $(this);
|
|
return {
|
|
text: th.text(),
|
|
shown: th.css('display') != 'none'
|
|
};
|
|
});
|
|
|
|
var h = ['<div id=tableEditor><button id=done>Done</button><table><thead>'];
|
|
$.each(headers, function() {
|
|
h.push('<tr><th><input type=checkbox',
|
|
(this.shown ? ' checked ' : ' '),
|
|
'/> ',
|
|
this.text,
|
|
'</th></tr>');
|
|
});
|
|
h.push('</thead></table></div>');
|
|
$('body').append(h.join(''));
|
|
|
|
$('#done').click(function() {
|
|
var showHeaders = $('#tableEditor input').map(function() { return this.checked; });
|
|
$.each(showHeaders, function(i, show) {
|
|
var cssIndex = i + 1;
|
|
var tags = $('#table th:nth-child(' + cssIndex + '), #table td:nth-child(' + cssIndex + ')');
|
|
if (show)
|
|
tags.show();
|
|
else
|
|
tags.hide();
|
|
});
|
|
|
|
$('#tableEditor').remove();
|
|
return false;
|
|
});
|
|
|
|
return false;
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|