<?php
/*
$Id: sorting.php 727 2023-11-16 20:40:20Z bhockney $
(C) 2003-2023 by Bob Hockney <zeus@ix.netcom.com>

report defintion order by form

This code is distributed under the terms of GNU GPL
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Webfwlog - Edit Report <?php print "{$FWLOG["report"]}" ?> - Sorting</title>
  <LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>
</head>

<body>
<?php if ($config["debug"]) include "include/debug.php"; ?>
<h1 class="align_center"><?php print "{$config["title"]}"; ?></h1>

<form action="<?php print "$self"; ?>" method="POST">
<?php
	foreach ($FWLOG as $a => $b) {
		if   (!(substr($a,0,2) == "s_")
		  and !(substr($a,0,2) == "o_")
		  and !($a == "data_tables")
		  and !($a == "page")
		  and !($a == "summarize")
		  and !($a == "sorting")) {
			print "<input type='hidden' name='".htmlspecialchars("$a", ENT_QUOTES).
				"' value='".htmlspecialchars("$b", ENT_QUOTES)."'>\n";
		}
	}
?>
<div class="align_center">
<table class="align_table">
<tr>
<td>
<input type="hidden" name="page" value="sorting">

<table class="align_left display_border">
	<tr>
	<td>
	 <!-- Sorting menu -->
	<table>
		<caption>
			<strong>SUMMARIZE REPORT:</strong>
			<input
				type="checkbox"
				name="summarize"
				value="on" 
				<?php if (isset($FWLOG["summarize"])) print "checked"; ?> 
				tabindex=1
			>
		</caption>
	<?php 
		$numrows = 34;
		$numcols = 3;
		print "<tr>";
		for ($a = 0; $a <= ($numcols - 1);  $a++) {
			echo "<th scope=col>Sort</th>",
				 "<th scope=col title='Check to sort in Decending order'>Dec</th>",
				 "<th scope=col class=\"align_left\">Sort by:</th>";
		}
		print "</tr>\n";
		for ($i = 0; $i <= ($numrows - 1);  $i++) {
			print "<tr>";
			for ($j = 1; $j <= $numcols; $j++) {
				$colnum = $i + ($j - 1) * $numrows;
				if (!isset($sortorder["$colnum"])) {
					print "\t<td></td><td></td><td></td>\n";
				} else {
					$a = $sortorder["$colnum"];
					$t = substr("$a",2);
					$o = $a; $o[0] = "o";
					$l = $longnames["$t"];
	?> 
		<td>
			<input
				class="edit_num"
				type="text"
				size="3"
				maxlength="4"
				name="<?php print "$a"?>"
				value="<?php if (isset($FWLOG["$a"])) print "{$FWLOG["$a"]}"?>"
				tabindex=<?php print "$j"; ?>
			>
		</td>
		<td>
			<input
				class="edit_checkbox"
				type="checkbox"
				<?php if (isset($FWLOG["$o"])) print "checked"; ?>
				name="<?php print "$o"?>"
				value="on"
				tabindex=<?php print "$j"; ?>
			>
		</td>
		<td ><?php print "{$longnames["$t"]}";?></td>
	<?php
				}
			}
		print "</tr>\n";
		}
	?>
	</table>
	</td>
	</tr>
	<tr>
		<td class="bottom_submit">
		<input class="submit" type="submit" name="action" value="Refresh">&nbsp;
		<input class="submit" type="reset" value="Reset">&nbsp;
		<input class="submit" type="submit" name="action" value="Accept">&nbsp;
		</td>
	</tr>
</table>
</td>
</tr>
<?php
	$doc_page = "sort";
	include "include/edit_doc.php";
?>
</table>
</div>
</form>

</body>
</html>

<!-- vim:set ts=4: -->
