Folder reorganize 1
This commit is contained in:
53
OLD/newsearch/index.php
Normal file
53
OLD/newsearch/index.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Search</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<table style="margin: 0px auto;" class="stat">
|
||||
<tr>
|
||||
<th>LASUCA CONTROLS SEARCH</th>
|
||||
<th><a href="../overview.php">BACK TO OVERVIEW</a></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<form action="results2.php" method="GET">
|
||||
<input type="text" value="2018" name="year" />
|
||||
<input type="text" placeholder="month... e.g. 10" name="month" />
|
||||
<input type="text" placeholder="day... e.g. 13" name="day" />
|
||||
<input type="text" placeholder="hour... e.g. 05" name="hour" />
|
||||
<input type="text" placeholder="minute... e.g. 10" name="minute" />
|
||||
<input type="text" placeholder="second... e.g. 10" name="second" />
|
||||
<input type="submit" value="Search" />
|
||||
</form>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
The format for the search input needs to be very specific. It should be entered as follows...
|
||||
<br>
|
||||
<br>
|
||||
To search for a specfic date, the format would be <font color="red"><u>2016-10-02</u></font>. This is year, month, day respectively. This specific search would return all of the results for October 2nd.
|
||||
<br>
|
||||
<br>
|
||||
To search for a specific hour, the format would be <font color="red"><u>2016-10-02 15</u></font>. This is year, month, day, hour respectively. This specific search would return all of the results for October 2nd for the entire 3PM timespan.
|
||||
<br>
|
||||
<br>
|
||||
To search for a specific minute, the format would be <font color="red"><u>2016-10-02 15:30</u></font>. This is year, month, day, hour, minute respectively. This specific search would return all of the results for October 2nd for the entire 3:30PM timespan.
|
||||
<br>
|
||||
<br>
|
||||
All searches need to be based on a 24 hour clock.
|
||||
|
||||
<th>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
165
OLD/newsearch/results.php
Normal file
165
OLD/newsearch/results.php
Normal file
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
mysql_connect("192.168.0.2", "corey", "41945549") or die("Error connecting to database: ".mysql_error());
|
||||
|
||||
mysql_select_db("controls") or die(mysql_error());
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Search results</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css"/>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<table style="margin: 0px auto;" class="stat">
|
||||
<tr>
|
||||
<th><a href="index.php">RESET SEARCH</a></th>
|
||||
<th><a href="../overview.php">BACK TO OVERVIEW</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">Search Results</th>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<th><a href="edit" id="edit">Toggle Columns On/Off</a></th>
|
||||
</tr>
|
||||
-->
|
||||
</table>
|
||||
<table id="table" style="margin: 0px auto;" class="stat">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Timestamp</th>
|
||||
<th>PPH/Ton</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
|
||||
$query = $_GET['year'];
|
||||
// gets value sent over search form
|
||||
|
||||
|
||||
if(strlen($query) >= $min_length){ // if query length is more or equal minimum length then
|
||||
|
||||
$query = htmlspecialchars($query);
|
||||
// changes characters used in html to their equivalents, for example: < to >
|
||||
|
||||
$query = mysql_real_escape_string($query);
|
||||
// makes sure nobody uses SQL injection
|
||||
|
||||
$raw_results = mysql_query("SELECT * FROM milling
|
||||
WHERE (`Z_TIMESTAMP` LIKE '%".$year."%'-'%".$month."%'-'%".$day."%' '%".$hour."%':'%".$minute."%':'%".$second."%')") or die(mysql_error());
|
||||
|
||||
// * means that it selects all fields, you can also write: `id`, `title`, `text`
|
||||
// articles is the name of our table
|
||||
|
||||
// '%$query%' is what we're looking for, % means anything, for example if $query is Hello
|
||||
// it will match "hello", "Hello man", "gogohello", if you want exact match use `title`='$query'
|
||||
// or if you want to match just full word so "gogohello" is out use '% $query %' ...OR ... '$query %' ... OR ... '% $query'
|
||||
|
||||
if(mysql_num_rows($raw_results) > 0){ // if one or more resultss are returned do following
|
||||
|
||||
|
||||
|
||||
while($results = mysql_fetch_array($raw_results)){
|
||||
// $results = mysql_fetch_array($raw_results) puts data from database into array, while it's valid it does the loop
|
||||
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td>".$results [ 'Z_TIMESTAMP' ]."</td>";
|
||||
echo "<td>".$results [ 'LBSPERHR' ]."</td>";
|
||||
echo "<td>".$results [ 'PREVTONS' ]."</td>";
|
||||
echo "<td>".$results [ 'PREVTIME' ]."</td>";
|
||||
echo "<td>".$results [ 'MAINSPD' ]."</td>";
|
||||
echo "<td>".$results [ 'KNIFE1SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'KNIFE2SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'KNIFE3SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL1SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL2SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL3SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL4SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL5SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL6SPD' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL1LVL' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL2LVL' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL3LVL' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL4LVL' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL5LVL' ]."</td>";
|
||||
echo "<td>".$results [ 'MILL6LVL' ]."</td>";
|
||||
echo "</tr>";
|
||||
// posts results gotten from database(title and text) you can also show id ($results['id'])
|
||||
}
|
||||
|
||||
}
|
||||
else{ // if there is no matching resultss do following
|
||||
echo "No results";
|
||||
}
|
||||
|
||||
}
|
||||
else{ // if query length is less than minimum
|
||||
echo "Minimum length is ".$min_length;
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
<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>
|
||||
</html>
|
||||
278
OLD/newsearch/results2.php
Normal file
278
OLD/newsearch/results2.php
Normal file
@@ -0,0 +1,278 @@
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.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>
|
||||
<table style="margin: 0px auto;" width="1000" class="stat">
|
||||
<tr><th>LASUCA CONTROLS SEARCH</th></tr>
|
||||
<tr><th><a href="../overview.php">BACK TO OVERVIEW</a></th></tr>
|
||||
<tr><th><a href="results2.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>
|
||||
-->
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<form action="" method="GET">
|
||||
<input type="text" value="2018" name="year" required />
|
||||
<input type="text"placeholder="month... e.g. 10" name="month" value="<?php echo isset($_GET['month']) ? $_GET['month'] : '' ?>" required />
|
||||
<input type="text" placeholder="day... e.g. 13" name="day" value="<?php echo isset($_GET['day']) ? $_GET['day'] : '' ?>" required />
|
||||
<input type="text" placeholder="hour... e.g. 05" name="hour" value="<?php echo isset($_GET['hour']) ? $_GET['hour'] : '' ?>" required />
|
||||
<input type="text" placeholder="minute... e.g. 10" name="minute" value="<?php echo isset($_GET['minute']) ? $_GET['minute'] : '' ?>"/>
|
||||
<input type="text" placeholder="second... e.g. 10" name="second" value="<?php echo isset($_GET['second']) ? $_GET['second'] : '' ?>" />
|
||||
<select name="option1" id="option1" required>
|
||||
<option value="">Option 1</option>
|
||||
<option value="lbsperhr" >PPH/Ton</option>
|
||||
<option value="mainspd" >MCC Speed</option>
|
||||
<option value="mill1lvl" >Mill 1 Level</option>
|
||||
<option value="mill2lvl" >Mill 2 Level</option>
|
||||
<option value="mill3lvl" >Mill 3 Level</option>
|
||||
<option value="mill4lvl" >Mill 4 Level</option>
|
||||
<option value="mill5lvl" >Mill 5 Level</option>
|
||||
<option value="mill6lvl" >Mill 6 Level</option>
|
||||
<option value="mill1spd" >Mill 1 RPM</option>
|
||||
<option value="mill2spd" >Mill 2 RPM</option>
|
||||
<option value="mill3spd" >Mill 3 RPM</option>
|
||||
<option value="mill4spd" >Mill 4 RPM</option>
|
||||
<option value="mill5spd" >Mill 5 RPM</option>
|
||||
<option value="mill6spd" >Mill 6 RPM</option>
|
||||
<option value="knife1spd" >Knife 1 RPM</option>
|
||||
<option value="knife2spd" >Knife 2 RPM</option>
|
||||
<option value="knife3spd" >Knife 3 RPM</option>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('option1').value = "<?php echo $_GET['option1'];?>";
|
||||
</script>
|
||||
<select name="option2" id="option2" required>
|
||||
<option value="">Option 2</option>
|
||||
<option value="lbsperhr" >PPH/Ton</option>
|
||||
<option value="mainspd" >MCC Speed</option>
|
||||
<option value="mill1lvl" >Mill 1 Level</option>
|
||||
<option value="mill2lvl" >Mill 2 Level</option>
|
||||
<option value="mill3lvl" >Mill 3 Level</option>
|
||||
<option value="mill4lvl" >Mill 4 Level</option>
|
||||
<option value="mill5lvl" >Mill 5 Level</option>
|
||||
<option value="mill6lvl" >Mill 6 Level</option>
|
||||
<option value="mill1spd" >Mill 1 RPM</option>
|
||||
<option value="mill2spd" >Mill 2 RPM</option>
|
||||
<option value="mill3spd" >Mill 3 RPM</option>
|
||||
<option value="mill4spd" >Mill 4 RPM</option>
|
||||
<option value="mill5spd" >Mill 5 RPM</option>
|
||||
<option value="mill6spd" >Mill 6 RPM</option>
|
||||
<option value="knife1spd" >Knife 1 RPM</option>
|
||||
<option value="knife2spd" >Knife 2 RPM</option>
|
||||
<option value="knife3spd" >Knife 3 RPM</option>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('option2').value = "<?php echo $_GET['option2'];?>";
|
||||
</script>
|
||||
<select name="option3" id="option3" required>
|
||||
<option value="">Option 3</option>
|
||||
<option value="lbsperhr" >PPH/Ton</option>
|
||||
<option value="mainspd" >MCC Speed</option>
|
||||
<option value="mill1lvl" >Mill 1 Level</option>
|
||||
<option value="mill2lvl" >Mill 2 Level</option>
|
||||
<option value="mill3lvl" >Mill 3 Level</option>
|
||||
<option value="mill4lvl" >Mill 4 Level</option>
|
||||
<option value="mill5lvl" >Mill 5 Level</option>
|
||||
<option value="mill6lvl" >Mill 6 Level</option>
|
||||
<option value="mill1spd" >Mill 1 RPM</option>
|
||||
<option value="mill2spd" >Mill 2 RPM</option>
|
||||
<option value="mill3spd" >Mill 3 RPM</option>
|
||||
<option value="mill4spd" >Mill 4 RPM</option>
|
||||
<option value="mill5spd" >Mill 5 RPM</option>
|
||||
<option value="mill6spd" >Mill 6 RPM</option>
|
||||
<option value="knife1spd" >Knife 1 RPM</option>
|
||||
<option value="knife2spd" >Knife 2 RPM</option>
|
||||
<option value="knife3spd" >Knife 3 RPM</option>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('option3').value = "<?php echo $_GET['option3'];?>";
|
||||
</script>
|
||||
<select name="option4" id="option4" required>
|
||||
<option value="">Option 4</option>
|
||||
<option value="lbsperhr" >PPH/Ton</option>
|
||||
<option value="mainspd" >MCC Speed</option>
|
||||
<option value="mill1lvl" >Mill 1 Level</option>
|
||||
<option value="mill2lvl" >Mill 2 Level</option>
|
||||
<option value="mill3lvl" >Mill 3 Level</option>
|
||||
<option value="mill4lvl" >Mill 4 Level</option>
|
||||
<option value="mill5lvl" >Mill 5 Level</option>
|
||||
<option value="mill6lvl" >Mill 6 Level</option>
|
||||
<option value="mill1spd" >Mill 1 RPM</option>
|
||||
<option value="mill2spd" >Mill 2 RPM</option>
|
||||
<option value="mill3spd" >Mill 3 RPM</option>
|
||||
<option value="mill4spd" >Mill 4 RPM</option>
|
||||
<option value="mill5spd" >Mill 5 RPM</option>
|
||||
<option value="mill6spd" >Mill 6 RPM</option>
|
||||
<option value="knife1spd" >Knife 1 RPM</option>
|
||||
<option value="knife2spd" >Knife 2 RPM</option>
|
||||
<option value="knife3spd" >Knife 3 RPM</option>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('option4').value = "<?php echo $_GET['option4'];?>";
|
||||
</script>
|
||||
<select name="option5" id="option5" required>
|
||||
<option value="">Option 5</option>
|
||||
<option value="lbsperhr" >PPH/Ton</option>
|
||||
<option value="mainspd" >MCC Speed</option>
|
||||
<option value="mill1lvl" >Mill 1 Level</option>
|
||||
<option value="mill2lvl" >Mill 2 Level</option>
|
||||
<option value="mill3lvl" >Mill 3 Level</option>
|
||||
<option value="mill4lvl" >Mill 4 Level</option>
|
||||
<option value="mill5lvl" >Mill 5 Level</option>
|
||||
<option value="mill6lvl" >Mill 6 Level</option>
|
||||
<option value="mill1spd" >Mill 1 RPM</option>
|
||||
<option value="mill2spd" >Mill 2 RPM</option>
|
||||
<option value="mill3spd" >Mill 3 RPM</option>
|
||||
<option value="mill4spd" >Mill 4 RPM</option>
|
||||
<option value="mill5spd" >Mill 5 RPM</option>
|
||||
<option value="mill6spd" >Mill 6 RPM</option>
|
||||
<option value="knife1spd" >Knife 1 RPM</option>
|
||||
<option value="knife2spd" >Knife 2 RPM</option>
|
||||
<option value="knife3spd" >Knife 3 RPM</option>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('option5').value = "<?php echo $_GET['option5'];?>";
|
||||
</script>
|
||||
<select name="option6" id="option6" required>
|
||||
<option value="">Option 6</option>
|
||||
<option value="lbsperhr" >PPH/Ton</option>
|
||||
<option value="mainspd" >MCC Speed</option>
|
||||
<option value="mill1lvl" >Mill 1 Level</option>
|
||||
<option value="mill2lvl" >Mill 2 Level</option>
|
||||
<option value="mill3lvl" >Mill 3 Level</option>
|
||||
<option value="mill4lvl" >Mill 4 Level</option>
|
||||
<option value="mill5lvl" >Mill 5 Level</option>
|
||||
<option value="mill6lvl" >Mill 6 Level</option>
|
||||
<option value="mill1spd" >Mill 1 RPM</option>
|
||||
<option value="mill2spd" >Mill 2 RPM</option>
|
||||
<option value="mill3spd" >Mill 3 RPM</option>
|
||||
<option value="mill4spd" >Mill 4 RPM</option>
|
||||
<option value="mill5spd" >Mill 5 RPM</option>
|
||||
<option value="mill6spd" >Mill 6 RPM</option>
|
||||
<option value="knife1spd" >Knife 1 RPM</option>
|
||||
<option value="knife2spd" >Knife 2 RPM</option>
|
||||
<option value="knife3spd" >Knife 3 RPM</option>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('option6').value = "<?php echo $_GET['option6'];?>";
|
||||
</script>
|
||||
<input type="submit" name="submit" value="Search" />
|
||||
</form>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if(isset($_GET['submit'])){
|
||||
|
||||
|
||||
$username="corey";
|
||||
$password="41945549";
|
||||
$database="controls";
|
||||
|
||||
mysql_connect('192.168.0.2',$username,$password);
|
||||
@mysql_select_db($database) or die( "Unable to select database");
|
||||
$year = mysql_real_escape_string($_REQUEST['year']);
|
||||
$month = mysql_real_escape_string($_REQUEST['month']);
|
||||
$day = mysql_real_escape_string($_REQUEST['day']);
|
||||
$hour = mysql_real_escape_string($_REQUEST['hour']);
|
||||
$minute = mysql_real_escape_string($_REQUEST['minute']);
|
||||
$second = mysql_real_escape_string($_REQUEST['second']);
|
||||
$option1 = mysql_real_escape_string($_REQUEST['option1']);
|
||||
$option2 = mysql_real_escape_string($_REQUEST['option2']);
|
||||
$option3 = mysql_real_escape_string($_REQUEST['option3']);
|
||||
$option4 = mysql_real_escape_string($_REQUEST['option4']);
|
||||
$option5 = mysql_real_escape_string($_REQUEST['option5']);
|
||||
$option6 = mysql_real_escape_string($_REQUEST['option6']);
|
||||
$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 LIKE '".$year."-".$month."-".$day." %".$hour."%:%".$minute."%:%".$second."%' ORDER BY id DESC)";
|
||||
|
||||
$result=mysql_query($query);
|
||||
|
||||
echo '<table id="table" style="margin: 0px auto;" class="stat">';
|
||||
echo "<thead>";
|
||||
echo "<tr>";
|
||||
echo "<th>Timestamp</th>";
|
||||
echo "<th>".$_GET['option1']."</th>";
|
||||
echo "<th>".$_GET['option2']."</th>";
|
||||
echo "<th>".$_GET['option3']."</th>";
|
||||
echo "<th>".$_GET['option4']."</th>";
|
||||
echo "<th>".$_GET['option5']."</th>";
|
||||
echo "<th>".$_GET['option6']."</th>";
|
||||
echo "</tr>";
|
||||
echo "</thead>";
|
||||
|
||||
echo "<tbody>";
|
||||
|
||||
while($row=mysql_fetch_assoc($result))
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>".$row [ 'Z_TIMESTAMP' ]."</td>";
|
||||
echo "<td>".$row [ 'option1' ]."</td>";
|
||||
echo "<td>".$row [ 'option2' ]."</td>";
|
||||
echo "<td>".$row [ 'option3' ]."</td>";
|
||||
echo "<td>".$row [ 'option4' ]."</td>";
|
||||
echo "<td>".$row [ 'option5' ]."</td>";
|
||||
echo "<td>".$row [ 'option6' ]."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody>";
|
||||
echo "</table>";
|
||||
mysql_close();
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
</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>
|
||||
128
OLD/newsearch/style.css
Normal file
128
OLD/newsearch/style.css
Normal file
@@ -0,0 +1,128 @@
|
||||
body {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
#font {
|
||||
font: normal 16px/1 "Lucida Console", Monaco;
|
||||
color: rgba(255,255,255,1);
|
||||
display: inline;
|
||||
float: left;
|
||||
}
|
||||
#tableEditor {
|
||||
position: absolute;
|
||||
width: 800px;
|
||||
left: 20px; top: 20px;
|
||||
padding: 5px;
|
||||
border: 1px solid #000;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 900px;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: .5em 1em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
thead th {
|
||||
white-space: nowrap;
|
||||
border-bottom: 1px solid #ccc;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
th:first-child,
|
||||
td:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background: #ccc;
|
||||
color: blck;
|
||||
}
|
||||
tr:nth-child(odd) {
|
||||
background: #eee;
|
||||
color: black;
|
||||
}
|
||||
tbody th, td {
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.enhanced th,
|
||||
.enhanced td {
|
||||
display: none;
|
||||
}
|
||||
.enhanced th.essential,
|
||||
.enhanced td.essential {
|
||||
display: table-cell;
|
||||
}
|
||||
@media screen and (min-width: 500px) {
|
||||
.enhanced th.optional,
|
||||
.enhanced td.optional {
|
||||
display: table-cell;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 800px) {
|
||||
.enhanced th,
|
||||
.enhanced td {
|
||||
display: table-cell;
|
||||
}
|
||||
}
|
||||
.table-menu-wrapper {
|
||||
position: absolute;
|
||||
top: -3em;
|
||||
right: 0;
|
||||
}
|
||||
.table-menu {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: auto;
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
font-size: 1.2em;
|
||||
width: 12em;
|
||||
}
|
||||
.table-menu-hidden {
|
||||
left: -999em;
|
||||
right: auto;
|
||||
}
|
||||
.table-wrapper {
|
||||
position: relative;
|
||||
margin: 5em 5%;
|
||||
}
|
||||
table.stat th, table.stat td {
|
||||
width: 900px;
|
||||
font-size : 77%;
|
||||
font-family : "Myriad Web",Verdana,Helvetica,Arial,sans-serif;
|
||||
|
||||
|
||||
}
|
||||
.hidden { display: none }
|
||||
|
||||
form {
|
||||
width:100%;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
margin:0px auto;
|
||||
background-color: grey;
|
||||
border:0px solid #dbdbdb;
|
||||
}
|
||||
.search {
|
||||
padding:8px 15px;
|
||||
background:rgba(50, 50, 50, 0.2);
|
||||
border:0px solid #dbdbdb;
|
||||
}
|
||||
.button {
|
||||
position:relative;
|
||||
padding:6px 15px;
|
||||
left:-8px;
|
||||
border:2px solid #207cca;
|
||||
background-color:#207cca;
|
||||
color:#fafafa;
|
||||
}
|
||||
.button:hover {
|
||||
background-color:#fafafa;
|
||||
color:#207cca;
|
||||
}
|
||||
Reference in New Issue
Block a user