	<!DOCTYPE HTML>
	<html lang="la">
	<head>
		<title>Index generalis Civis Romani et Scriptoris Latini – Index fasciculorum</title>
		<meta name="author" content="Bernd Platzdasch"><!-- 25.3.2021 -->
		<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-collapse: collapse; margin: 0.5em 2em 4em 0; }
			th { text-align: left; font-weight: normal; border: 1px solid lightgray; padding: 0.4em; background-color: #f0f1e1; }
			th.border { border-right: 1px solid gray;  width: 6em; text-align: center;}
			td { text-align: center; border: 1px solid lightgrey; padding: 0em; width: 3.3em; height: 2em;}
			td.border {border-right: 1px solid gray; background-color; #fff;}
			a.list { display: block; color: darkblue; padding: 0.4em; }
			a.list:hover { text-decoration: none; background-color: gray; color: #fff; }
		</style>
	</head>
	<body onload="store_mnu();">
	<?php
		include("header.inc.php");
		$arr_fasc = array(
	// 		"1.1901-x-x-x-x-x-x-x-x-x-x-x-x",
	// 		"1.1902-x-x-x-x-x-x-x-x-x-x-x-x",
			"2.1902-1-2-3-4-5-6-x-x-x-x-x-x",
			"2.1903-7-8-9-10-11-12-x-x-x-x-x-x",
			"3.1903-1-2-3-4-5-6-x-x-x-x-x-x",
			"3.1904-7-8-9-10-11-12-x-x-x-x-x-x",
			"4.1904-1-2-3-4-5-6-x-x-x-x-x-x",
			"4.1905-7-8-9-10-11-12-13-14-15-16-17-18",
			"5.1906-1-2-3-4-5-6-7-8-9-10-11-12",
			"6.1907-1-2/3-4-5-6-7-8-9-10-11-12-x",
			"7.1908-1-2-3-4-x-x-x-x-x-x-x-x",
			"7.1909-5-6-7-8-x-x-x-x-x-x-x-x",
			"8.1910-1-2-3-4-5-6-7-x-x-x-x-x",
			"8.1911-8-9-10-11-12-x-x-x-x-x-x-x",
			"9.1911-1-x-x-x-x-x-x-x-x-x-x-x",
			"9.1912-2-3-4-5-6-x-x-x-x-x-x-x",
			"9.1913-7-8-9-10-x-x-x-x-x-x-x-x",
			"10.1913-1-2-x-x-x-x-x-x-x-x-x-x",
			"10.1914-3-4-5-6-7-x-x-x-x-x-x-x",
			"10.1915-8-x-x-x-x-x-x-x-x-x-x-x",
			"10.1916-9-10-x-x-x-x-x-x-x-x-x-x",
			"11.1917-1-2-x-x-x-x-x-x-x-x-x-x"
	);
		function tabelle($n,$y,$z,$arr_fasc,$m,$tit) {
			$leer = "<td>&nbsp;</td>";
			echo "<table $m'><thead ><tr><th class='border'>Annus</th><th colspan='$y'> Numerus // <span style='letter-spacing: 1px;'>$tit</span></th></tr></thead>";
			for($i = $z; $i < $n; $i++) {
				$arr_zeile = explode("-", $arr_fasc[$i]);
				echo "<tr><td class='border'>$arr_zeile[0]</td>";
				for($j = 1; $j <= $y; $j++) {
					if ($arr_zeile[$j] == "x") {
						echo $leer;
					} else {
						$az_0 = $arr_zeile[0] . '-';
						$az_0 = str_pad($az_0, 8, '0', STR_PAD_LEFT);
						$az_j = str_pad($arr_zeile[$j], 2, '0', STR_PAD_LEFT);
						$fasc_num = $az_0 . $az_j;
						$fasc_num = str_pad($fasc_num, 2,'0',STR_PAD_LEFT);
						if ($fasc_num == '06.1907-2/3') {$fasc_num = '06.1907-02';}
						echo "<td><a class='list' href='contenta.php?f=$fasc_num'>$arr_zeile[$j]</a></td>";
					}
				}
				echo "</tr>";
			}
			echo "</table>";
		}
	?>
		<div>
			<div id="main" style="border-radius: 0 0 5px 5px;">
				<h1>Index fasciculorum</h1>
				<?php
					$m = "style='margin-bottom:0;";
					$tit = "CIVIS ROMANUS";
					tabelle(10, 12, 0, $arr_fasc, $m, $tit); // Anz. Tabellenzeilen, Anz. Tabellenspalten, Daten ab Element x des arr_fasc 
					$m = "style='margin-top:-1px;";
					$tit = "SCRIPTOR LATINUS";
					tabelle(20, 12, 10, $arr_fasc, $m, $tit);
				?>
			</div>
		</div>
	<?php include("footer.inc.php"); ?>
	</body>
	</html>
