<!DOCTYPE HTML>
<html lang="la">
<head>
	<title>Index generalis Vocis Latinae – Index fasciculorum</title>
	<meta name="author" content="Bernd Platzdasch"><!-- 21.1.2015 // 24.7.2015 -->
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css" href="css/main.css">
	<script src="js/store.js" type="text/javascript"></script>
	<style type="text/css">
		div#main { width: 840px; padding-left: 80px; overflow: auto; float: left; margin-left: -1px; margin-left: +1px; border: none; }
		table { border: 1px solid lightgrey; border-collapse: collapse; float: left; margin: 0.5em 1em 4em 0; }
		th { text-align: left; font-weight: normal; border: 1px solid lightgray; padding: 0.4em; background-color: lightyellow; }
		th.border { border-right: 1px solid gray; }
		td { text-align: center; border: 1px solid lightgrey; padding: 0; }
		td.border {border-right: 1px solid gray; background-color: lightyelow; }
		td.fs { text-align: right; color: darkgreen; }
		a.list { display: block; color: green; padding: 0.38em; }
		a.list:hover { text-decoration: none; background-color: gray; color: #fff; }

	</style>
</head>
<body onload="store_mnu();">
<?php
	include("header.inc.php");
?>
	<div>
		<div id="main" style="border-radius: 0 0 5px 5px;">
			<h1>Index fasciculorum</h1>
			<?php
			// $ultimus ist global
				tabelle(22, 1965, 1, 3, 1, $ultimus);
				tabelle(23, 1987, 23, 91, 0, $ultimus);
				$n = (($ultimus-181) / 4)+1;
				tabelle($n, 2010, 46, 183, 0, $ultimus);
				function tabelle($n, $annus, $tom, $fasc, $primi, $ultimus) {
					echo "<table><thead><tr><th>Tomus</th><th class='border'>Annus</th><th colspan='4'>Fasciculi</th></tr></thead>";
					if($primi == 1) {
						echo "<tr>
								<td>1</td>
								<td class='border'>1965</td>
								<td class='fs'>&#160;</td>
								<td class='fs'>&#160;</td>
								<td class='fs'><a class='list' href='contenta.php?f=1'>1</a></td>
								<td class='fs'><a class='list' href='contenta.php?f=2'>2</a></td>
							</tr>";
					}
					for($i = 0; $i < $n; $i++) {
						$annus++;
						$tom++;
						echo "<tr>
								<td>$tom</td><td class='border'>$annus</td>";
								echo "<td class='fs'><a class='list' href='contenta.php?f=$fasc'>$fasc</a></td>";
								$fasc++;
								if ($fasc > $ultimus) {
									echo "<td>&#160;</td><td>&#160;</td><td>&#160;</td></tr>"; break;
								}
								echo "<td class='fs'><a class='list' href='contenta.php?f=$fasc'>$fasc</a></td>";
								$fasc++;
								if ($fasc > $ultimus) {
									echo "<td>&#160;</td><td>&#160;</td></tr>"; break;
								}
								echo "<td class='fs'><a class='list' href='contenta.php?f=$fasc'>$fasc</a></td>";
								$fasc++;
								if ($fasc > $ultimus) {
									echo "<td>&#160;</td></tr>"; break;
								}
								echo "<td class='fs'><a class='list' href='contenta.php?f=$fasc'>$fasc</a></td>
							</tr>";
						$fasc++;
						if ($fasc > $ultimus) { break; }
					}
					echo "</table>";
				}
			?>
		</div>
	</div>
<?php include("footer.inc.php"); ?>
</body>
</html>