<?php include 'en/admin/_adminheader.php'; ?>
<h2>Resources Page: Add a File to a Category</h2>
<p>
	To add a file to a category, select which category it should be added to
	from the drop-down menu and then find the file with the "Browse" button.
</p>
<form action='/admin/resources.php' method='post' enctype="multipart/form-data">
	<fieldset id='file_info'>
		<legend>File Information</legend>
		<input type='hidden' name='what' value='books' id='what' />
		<input type='hidden' name='do' value='doaddfile' id='do' />
		<div class='field'>
			<label for='which'>Choose category</label>
			<select name='which' id='which'>
			<?php foreach($this->data['categories'] as $cat): ?>
				<option value='<?php echo $cat['id'] ?>'><?php echo $cat->name ?></option>
			<?php endforeach; ?>
			</select>
		</div>
		<div class='field'>
			<label for='file'>HTML file</label>
			<input type='file' name='file' id='file' />
		</div>
		<div>
			<input type='button' value='Cancel' onClick='document.location="/admin/resources.php?what=books"' />
			<input type='submit' value='Add file to category' />
		</div>
	</fieldset>
</form>
