<?php if (!defined('PICONTROL')) exit(); ?>
<div>
	<div class="box">
		<div class="inner-header">
			<span><?php _e('Einstellungen zu Fritz!Box'); ?></span>
			<?php showGoBackIcon('?s=plugins&amp;id=fritzbox'); ?>
		</div>
		<form action="?s=plugins&amp;id=fritzbox&amp;settings" method="post">
			<div class="inner-table">
				<table class="table table-borderless table-form">
					<tr>
						<td><?php _e('Adresse zur Fritz!Box'); ?></td>
						<td><input type="text" name="address" value="<?php echo $data['address']; ?>" /></td>
					</tr>
					<tr>
						<td><?php _e('Fritz!OS'); ?></td>
						<td><input type="radio" name="version" value="5" id="rb-5"<?php if ($data['version'] == '5') echo ' checked="checked"'; ?> /><label for="rb-5" class="radio"><?php _e('5 und niedriger'); ?></label><br />
							<input type="radio" name="version" value="6" id="rb-6"<?php if ($data['version'] == '6') echo ' checked="checked"'; ?> /><label for="rb-6" class="radio"><?php _e('6 und h&ouml;her'); ?></label></td>
					</tr>
					<tr>
						<td><?php _e('Geschwindigkeitsangaben'); ?></td>
						<td><select name="unit">
								<option value="mbit"<?php if ($data['unit'] == 'mbit') echo ' selected="selected"'; ?>>MBit/s</option>
								<option value="mbyte"<?php if ($data['unit'] == 'mbyte') echo ' selected="selected"'; ?>>MByte/s</option>
							</select></td>
					</tr>
				</table>
			</div>
			<div class="inner-end">
				<input type="submit" name="submit-main" value="<?php _e('Speichern'); ?>" />
			</div>
		</form>
	</div>
	<div class="box">
		<div class="inner-header">
			<span><?php _e('Statistik'); ?></span>
		</div>
		<form action="?s=plugins&amp;id=fritzbox&amp;settings" method="post">
			<div class="inner-table">
				<table class="table table-borderless table-form">
					<tr>
						<td><?php _e('Aktivieren'); ?></td>
						<td><input type="checkbox" name="activation" value="checked" id="cb-activiation"<?php if ($data['activation'] == true) echo ' checked="checked"'; ?>><label for="cb-activiation" class="checkbox only-checkbox">&nbsp;</label></td>
					</tr>
				</table>
			</div>
			<div class="inner-table">
				<table class="table table-borderless">
					<tr>
						<th style="width: 80%;"><?php _e('Name'); ?></th>
						<th style="width: 10%;" class="table-center"><?php _e('Download'); ?></th>
						<th style="width: 10%;"></th>
					</tr>
<?php foreach ($data['statistics'] as $id => $statistic) { ?>
					<tr>
						<td><?php echo $statistic['array']['title'] ?></td>
						<td class="table-center"><a href="api/v1/statistic_download.php?id=<?php echo $id; ?>&amp;plugin=fritzbox" class="text-decoration-none"><span class="button button-small">CSV</span></a></td>
						<td class="table-right"><a href="?s=plugins&amp;id=fritzbox&amp;settings&amp;reset=<?php echo $id; ?>" class="text-decoration-none"><span class="button button-small"><?php _e('Zur&uuml;cksetzen'); ?></span></a></td>
					</tr>
<?php } ?>
				</table>
			</div>
			<div class="inner-end">
				<input type="submit" name="submit-statistic" value="<?php _e('Speichern'); ?>" />
			</div>
		</form>
	</div>
</div>