<!DOCTYPE html>

<html>
	<head>
		<style>
			* {
				font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "Helvetica", "Arial", "Lucida Grande", sans-serif;
				font-weight: 200;
			}
			
			body {
				font-size: 70%;
			}
			
			h3 {
				font-size: 2em;
				text-transform: lowercase;
			}
			
			table {
				width: 100%;
				border-collapse: collapse;
			}
			
			table td, table th {
				text-align: left;
				border: 1px solid #ccc;
				padding: 6px 4px;	
				border-left: none;
				border-right: none;
			}
			
			table th {
				border-top: none;
				font-weight: 600;
				font-size: 80%;
			}
			
			.page {
				page-break-after: always;
			}
		</style>
	</head>
	
	<body>
		
	<div class='page'>
		<h3>Overview by Operating System</h3>
		<table>
			<tr>
				<th>#</th>
				<th>Manufacturer</th>
				<th>Model</th>
				<th>Screen size</th>
				<th>Screen dimensions</th>
				<th>Operating System</th>
				<th>Box</th>
			</tr>
					
<?php while(list(,$device) = each($operatingsystems)): ?>
			<tr>
				<td><?php echo $device->id; ?></td>
				<td><?php echo $device->deviceManufacturer; ?></td>
				<td><?php echo $device->deviceModel; ?></td>
				<td><?php echo $device->deviceSize; ?></td>
				<td><?php echo $device->deviceWidth; ?> x <?php echo $device->deviceHeight; ?></td>
				<td><?php echo $device->osName; ?> <?php echo $device->osVersion; ?></td>
				<td><?php echo $device->box; ?></td>
			</tr>
<?php endwhile; ?>
		</table>
		
		<p>Total: <?php echo count($operatingsystems); ?></p>		
	</div>



	<div class='page'>
		<h3>Overview by Manufacturer</h3>
		<table>
			<tr>
				<th>#</th>
				<th>Manufacturer</th>
				<th>Model</th>
				<th>Screen size</th>
				<th>Screen dimensions</th>
				<th>Operating System</th>
				<th>Box</th>
			</tr>
					
<?php while(list(,$device) = each($manufacturers)): ?>
			<tr>
				<td><?php echo $device->id; ?></td>
				<td><?php echo $device->deviceManufacturer; ?></td>
				<td><?php echo $device->deviceModel; ?></td>
				<td><?php echo $device->deviceSize; ?></td>
				<td><?php echo $device->deviceWidth; ?> x <?php echo $device->deviceHeight; ?></td>
				<td><?php echo $device->osName; ?> <?php echo $device->osVersion; ?></td>
				<td><?php echo $device->box; ?></td>
			</tr>
<?php endwhile; ?>
		</table>

		<p>Total: <?php echo count($manufacturers); ?></p>		
	</div>
	
<?php while(list($box, $contents) = each($boxes)): ?>
	<div class='page'>
		<h3>Contents of box <?php echo $box; ?></h3>
		<table>
			<tr>
				<th>#</th>
				<th>Manufacturer</th>
				<th>Model</th>
				<th>Screen size</th>
				<th>Screen dimensions</th>
				<th>Operating System</th>
			</tr>
					
<?php while(list(,$device) = each($contents)): ?>
			<tr>
				<td><?php echo $device->id; ?></td>
				<td><?php echo $device->deviceManufacturer; ?></td>
				<td><?php echo $device->deviceModel; ?></td>
				<td><?php echo $device->deviceSize; ?></td>
				<td><?php echo $device->deviceWidth; ?> x <?php echo $device->deviceHeight; ?></td>
				<td><?php echo $device->osName; ?> <?php echo $device->osVersion; ?></td>
			</tr>
<?php endwhile; ?>
		</table>

		<p>Total: <?php echo count($contents); ?></p>		
	</div>
	
<?php endwhile; ?>		

	
	</body>
</html>