<form action="<?php echo $tpl['link']('category/1'); ?>" method="post" class="tool<?php if (strstr($_GET['section_1'], 'search')) : ?> show<?php endif; ?>" id="search">
	<fieldset>
		<p class="field">
			<span class="field_sep">
				<?php echo __('Rechercher :'); ?>
			</span>
			<span class="field_sep">
				<input<?php echo $tpl['search']['type']['categories'] ? ' checked' : ''; ?> id="search_categories" type="radio" name="search_options[type]" value="categories">
				<label for="search_categories"><?php echo __('Albums et catégories'); ?></label>
			</span>
			<span class="field_sep">
				<input<?php echo $tpl['search']['type']['items'] ? ' checked' : ''; ?> id="search_items" type="radio" name="search_options[type]" value="items">
				<label for="search_items"><?php echo __('Fichiers'); ?></label>
			</span>
		</p>
		<p class="field">
			<input<?php if (strstr($_GET['section_1'], 'search')) : ?> autofocus<?php endif; ?> required data-help-icon="search" value="<?php echo $tpl['search']['query']; ?>" class="focus" type="text" name="search_query" id="search_query" maxlength="255" size="20" data-reset="">
		</p>
		<p class="field">
			<input<?php echo $tpl['search']['all_words'] ? ' checked' : ''; ?> type="checkbox" name="search_options[all_words]" id="search_all_words" data-reset="1">
			<label for="search_all_words"><?php echo __('Rechercher tous les mots'); ?></label>
		</p>
		<p class="field">
			<span class="icon icon_search_options showhide" rel="#adv_search"><a class="js" href="<?php echo in_array($_GET['section'], ['album', 'category', 'category-items']) ? $tpl['link']($_GET['section'] . (strstr($_GET['section_1'], 'advanced') ? '-search' : '-search-advanced') . '/' . $tpl['category']['id'] . '/page/' . $_GET['page']) : 'javascript:;'; ?>"><?php echo __('Options de recherche'); ?></a></span>
		</p>
		<div id="adv_search" class="adv_search_col<?php if (strstr($_GET['section_1'], 'advanced')) : ?> show<?php endif; ?>">
			<div>
				<p class="field search_items_fields">
					<input<?php echo $tpl['search']['item_exclude'] ? ' checked' : ''; ?> type="checkbox" name="search_options[items][item_exclude]" id="search_item_exclude" data-reset="">
					<label for="search_item_exclude"><?php echo __('Rechercher uniquement les fichiers qui ne possèdent pas de :'); ?></label>
					<select name="search_options[items][item_exclude_column]" data-reset="tags">
<?php foreach ($tpl['search']['item_exclude_column'] as &$i) : ?>
						<option<?php echo $i['selected'] ? ' selected' : ''; ?> value="<?php echo $i['value']; ?>"><?php echo $i['text']; ?></option>
<?php endforeach; ?>
					</select>
				</p>
				<p class="field">
					<?php echo __('Rechercher dans les champs suivants :'); ?>
				</p>
				<div class="field_sublvl search_categories_fields">
					<p class="field">
						<input<?php echo $tpl['search']['columns']['cat_name'] ? ' checked' : ''; ?> type="checkbox" name="search_options[categories][columns][]" value="cat_name" id="search_cat_name" data-reset="1">
						<label for="search_cat_name"><?php echo __('Titre'); ?></label>
						&nbsp;
						<input<?php echo $tpl['search']['columns']['cat_url'] ? ' checked' : ''; ?> type="checkbox" name="search_options[categories][columns][]" value="cat_url" id="search_cat_url" data-reset="1">
						<label for="search_cat_url"><?php echo __('URL'); ?></label>
						&nbsp;
						<input<?php echo $tpl['search']['columns']['cat_path'] ? ' checked' : ''; ?> type="checkbox" name="search_options[categories][columns][]" value="cat_path" id="search_cat_path" data-reset="1">
						<label for="search_cat_path"><?php echo __('Nom de répertoire'); ?></label>
						&nbsp;
						<input<?php echo $tpl['search']['columns']['cat_desc'] ? ' checked' : ''; ?> type="checkbox" name="search_options[categories][columns][]" value="cat_desc" id="search_cat_desc" data-reset="1">
						<label for="search_cat_desc"><?php echo __('Description'); ?></label>
					</p>
				</div>
				<div class="field_sublvl search_items_fields">
					<p class="field">
						<input<?php echo $tpl['search']['columns']['item_name'] ? ' checked' : ''; ?> type="checkbox" name="search_options[items][columns][]" value="item_name" id="search_items_name" data-reset="1">
						<label for="search_items_name"><?php echo __('Titre'); ?></label>
						&nbsp;
						<input<?php echo $tpl['search']['columns']['item_url'] ? ' checked' : ''; ?> type="checkbox" name="search_options[items][columns][]" value="item_url" id="search_items_url" data-reset="1">
						<label for="search_items_url"><?php echo __('URL'); ?></label>
						&nbsp;
						<input<?php echo $tpl['search']['columns']['item_desc'] ? ' checked' : ''; ?> type="checkbox" name="search_options[items][columns][]" value="item_desc" id="search_items_desc" data-reset="1">
						<label for="search_items_desc"><?php echo __('Description'); ?></label>
					</p>
					<p class="field">
						<input<?php echo $tpl['search']['columns']['item_path'] ? ' checked' : ''; ?> type="checkbox" name="search_options[items][columns][]" value="item_path" id="search_items_path" data-reset="1">
						<label for="search_items_path"><?php echo __('Nom de fichier'); ?></label>
						&nbsp;
						<input<?php echo $tpl['search']['columns']['item_id'] ? ' checked' : ''; ?> type="checkbox" name="search_options[items][columns][]" value="item_id" id="search_items_id" data-reset="">
						<label for="search_items_id"><?php echo __('Identifiant'); ?></label>
						&nbsp;
						<input<?php echo $tpl['search']['item_tags'] ? ' checked' : ''; ?> type="checkbox" name="search_options[items][item_tags]" id="search_items_tags" data-reset="1">
						<label for="search_items_tags"><?php echo __('Tags'); ?></label>
					</p>
				</div>
				<p class="field search_items_fields">
					<label for="search_item_type"><?php echo __('Rechercher par type de fichier :'); ?></label>
					<select name="search_options[items][item_type]" id="search_item_type" data-reset="all">
<?php foreach ($tpl['search']['item_type'] as &$i) : ?>
						<option<?php echo $i['selected'] ? ' selected' : ''; ?> value="<?php echo $i['value']; ?>"><?php echo $i['text']; ?></option>
<?php endforeach; ?>
					</select>
				</p>
				<p class="field search_items_fields">
					<label for="search_item_format"><?php echo __('Rechercher par format d\'image :'); ?></label>
					<select name="search_options[items][item_format]" id="search_item_format" data-reset="all">
<?php foreach ($tpl['search']['item_format'] as &$i) : ?>
						<option<?php echo $i['selected'] ? ' selected' : ''; ?> value="<?php echo $i['value']; ?>"><?php echo $i['text']; ?></option>
<?php endforeach; ?>
					</select>
				</p>
				<p class="field">
					<label for="search_status"><?php echo __('Rechercher par état :'); ?></label>
					<select name="search_options[status]" id="search_status" data-reset="all">
<?php foreach ($tpl['search']['status'] as &$i) : ?>
						<option<?php echo $i['selected'] ? ' selected' : ''; ?> value="<?php echo $i['value']; ?>"><?php echo $i['text']; ?></option>
<?php endforeach; ?>
					</select>
				</p>
				<p class="field">
					<label for="search_user"><?php echo __('Rechercher par propriétaire :'); ?></label>
					<select name="search_options[user]" id="search_user" data-reset="all">
						<option<?php echo $tpl['search']['user'] == 'all' ? ' selected' : ''; ?> value="all"><?php echo '*' . __('Tous'); ?></option>
<?php foreach ($tpl['users'] as &$i) : ?>
						<option<?php echo $i['id'] == $tpl['search']['user'] ? ' selected' : ''; ?> value="<?php echo $i['id']; ?>"><?php echo $i['nickname']; ?></option>
<?php endforeach; ?>
					</select>
				</p>
			</div>
			<div>
				<p class="field">
					<input<?php echo $tpl['search']['date'] ? ' checked' : ''; ?> id="search_date" type="checkbox" name="search_options[date]" data-reset="0">
					<label for="search_date"><?php echo __('Rechercher par date :'); ?></label>
				</p>
				<div class="field_sublvl">
					<p class="field search_categories_fields">
						<span class="field_sep">
							<input<?php echo $tpl['search']['date_column_cat'] == 'cat_crtdt' ? ' checked' : ''; ?> id="search_date_column_cat_crtdt" type="radio" name="search_options[categories][date_column]" value="cat_crtdt" data-reset="1">
							<label for="search_date_column_cat_crtdt"><?php echo __('Date de création'); ?></label>
						</span>
						<span class="field_sep">
							<input<?php echo $tpl['search']['date_column_cat'] == 'cat_lastpubdt' ? ' checked' : ''; ?> id="search_date_column_cat_lastpubdt" type="radio" name="search_options[categories][date_column]" value="cat_lastpubdt" data-reset="0">
							<label for="search_date_column_cat_lastpubdt"><?php echo __('Date de publication du fichier le plus récent'); ?></label>
						</span>
					</p>
					<p class="field search_items_fields">
						<span class="field_sep">
							<input<?php echo $tpl['search']['date_column_items'] == 'item_crtdt' ? ' checked' : ''; ?> id="search_date_column_items_crtdt" type="radio" name="search_options[items][date_column]" value="item_crtdt" data-reset="1">
							<label for="search_date_column_items_crtdt"><?php echo __('Date de création'); ?></label>
						</span>
						<span class="field_sep">
							<input<?php echo $tpl['search']['date_column_items'] == 'item_adddt' ? ' checked' : ''; ?> id="search_date_column_items_adddt" type="radio" name="search_options[items][date_column]" value="item_adddt" data-reset="0">
							<label for="search_date_column_items_adddt"><?php echo __('Date d\'ajout'); ?></label>
						</span>
						<span class="field_sep">
							<input<?php echo $tpl['search']['date_column_items'] == 'item_pubdt' ? ' checked' : ''; ?> id="search_date_column_items_pubdt" type="radio" name="search_options[items][date_column]" value="item_pubdt" data-reset="0">
							<label for="search_date_column_items_pubdt"><?php echo __('Date de publication'); ?></label>
						</span>
						<span class="field_sep">
							<input<?php echo $tpl['search']['date_column_items'] == 'item_expdt' ? ' checked' : ''; ?> id="search_date_column_items_expdt" type="radio" name="search_options[items][date_column]" value="item_expdt" data-reset="0">
							<label for="search_date_column_items_expdt"><?php echo __('Date d\'expiration'); ?></label>
						</span>
					</p>
<?php include('search_date.tpl.php'); ?>
				</div>
				<p class="field search_items_fields">
					<input<?php echo $tpl['search']['item_size'] ? ' checked' : ''; ?> id="search_item_size" type="checkbox" name="search_options[items][item_size]" data-reset="0">
					<label for="search_item_size"><?php echo __('Rechercher par dimensions :'); ?></label>
				</p>
				<div class="field_sublvl search_items_fields">
					<p class="field">
						<span class="field_sep">
							<?php echo __('Largeur :'); ?>
						</span>
						<span class="field_sep">
							<label for="search_options_item_size_width_start"><?php echo __('entre'); ?></label>
							&nbsp;
							<input id="search_options_item_size_width_start" name="search_options[items][item_size_width_start]" type="text" size="6" maxlength="5" value="<?php echo $tpl['search']['item_size_width_start']; ?>" data-reset="">
							&nbsp;
							<label for="search_options_item_size_width_end"><?php echo __('et'); ?></label>
							&nbsp;
							<input id="search_options_item_size_width_end" name="search_options[items][item_size_width_end]" type="text" size="6" maxlength="5" value="<?php echo $tpl['search']['item_size_width_end']; ?>" data-reset="">
							&nbsp;
							<?php echo __('pixels'); ?>
						</span>
					</p>
					<p class="field">
						<span class="field_sep">
							<?php echo __('Hauteur :'); ?>
						</span>
						<span class="field_sep">
							<label for="search_options_item_size_height_start"><?php echo __('entre'); ?></label>
							&nbsp;
							<input id="search_options_item_size_height_start" name="search_options[items][item_size_height_start]" type="text" size="6" maxlength="5" value="<?php echo $tpl['search']['item_size_height_start']; ?>" data-reset="">
							&nbsp;
							<label for="search_options_item_size_height_end"><?php echo __('et'); ?></label>
							&nbsp;
							<input id="search_options_item_size_height_end" name="search_options[items][item_size_height_end]" type="text" size="6" maxlength="5" value="<?php echo $tpl['search']['item_size_height_end']; ?>" data-reset="">
							&nbsp;
							<?php echo __('pixels'); ?>
						</span>
					</p>
				</div>
				<p class="field search_items_fields">
					<input<?php echo $tpl['search']['item_filesize'] ? ' checked' : ''; ?> id="search_item_filesize" type="checkbox" name="search_options[items][item_filesize]" data-reset="0">
					<label for="search_item_filesize"><?php echo __('Rechercher par poids :'); ?></label>
				</p>
				<div class="field_sublvl search_items_fields">
					<p class="field">
						<label for="search_options_item_filesize_start"><?php echo __('entre'); ?></label>
						&nbsp;
						<input id="search_options_item_filesize_start" name="search_options[items][item_filesize_start]" type="text" size="6" maxlength="6" value="<?php echo $tpl['search']['item_filesize_start']; ?>" data-reset="">
						&nbsp;
						<label for="search_options_item_filesize_end"><?php echo __('et'); ?></label>
						&nbsp;
						<input id="search_options_item_filesize_end" name="search_options[items][item_filesize_end]" type="text" size="6" maxlength="6" value="<?php echo $tpl['search']['item_filesize_end']; ?>" data-reset="">
						&nbsp;
						<select name="search_options[items][item_filesize_unit]" data-reset="kb">
<?php foreach ($tpl['search']['item_filesize_unit'] as &$i) : ?>
							<option<?php echo $i['selected'] ? ' selected' : ''; ?> value="<?php echo $i['value']; ?>"><?php echo $i['text']; ?></option>
<?php endforeach; ?>
						</select>
						
					</p>
				</div>
			</div>
		</div>
		<input name="anticsrf" type="hidden" value="<?php echo $tpl['anticsrf'](); ?>">
		<input name="search" type="submit" value="<?php echo __('Chercher'); ?>">
		<input class="button reset_js" type="reset" value="<?php echo __('Réinitialiser'); ?>">
	</fieldset>
</form>