<?
if(!$this->startup->group_config->can_search)
{
	?>
	<h2 style="vertical-align:middle"><img src="<?php echo base_url().'img/icons/search_32.png'?>" class="nb" alt="" /><?php echo $this->lang->line('files_search_query_files_heading'); ?></h2>
	<span class="alert"><?php echo $this->lang->line('files_search_query_files_1'); ?><a href="<?php echo site_url('user/login'); ?>"><?php echo $this->lang->line('files_search_query_files_1_1'); ?></a><?php echo $this->lang->line('files_search_query_files_1_2'); ?></span>
	<?
}
else
{
	?>
	<h2 style="vertical-align:middle"><img src="<?php echo base_url().'img/icons/search_32.png'?>" class="nb" alt="" /><?php echo $this->lang->line('files_search_query_files_heading'); ?></h2>
	<div id="massActions" style="clear:both; padding-top:4px;">
		<div class="float-right">
			<?php echo generateLinkButton('New Search', site_url('files/search'), base_url().'img/icons/new_16.png', NULL); ?>
		</div>
	</div>
	<div style=" clear:both;"></div>
	<?php echo $flashMessage?>
	
	<h3><?php echo $this->lang->line('files_search_query_1'); ?><?php echo $query?><?php echo $this->lang->line('files_search_query_2'); ?><?php echo $num_results?><?php echo $this->lang->line('files_search_query_3'); ?></h3>
	
	<table border="0" style="width:95%" id="file_list_table">
		<tr>
			<th><?php echo $this->lang->line('files_manage_table_1') ?></th>
			<th><?php echo $this->lang->line('files_manage_table_2') ?></th>
			<th style="width:80px"><?php echo $this->lang->line('files_manage_table_3') ?></th>
		</tr>
		<?php 
		$i=0;
		foreach($files->result() as $file)
		{
			$id = $file->id;
			$link = $this->files_db->getLinks($file->secid);
		?>
		<tr id="<?php echo $file->file_id?>" <?php echo alternator('class="odd"', 'class="even"'); ?>>
			<td>
				<a href='<?php echo site_url('/files/get/'.$file->file_id.'/'.$file->link_name); ?>' target="_blank" title="<?php echo $file->o_filename?>">
					<img src="<?php echo base_url().'img/files/'.$this->functions->getFileTypeIcon($file->type);?>" class="nb" alt="" />
					<?php echo $this->functions->elipsis($file->o_filename); ?>
				</a>
			</td>
			<td>
				<?php echo $this->functions->getFilesizePrefix($file->size); ?>
			</td>
			<td>
				<a href='javascript:;' onclick='$("#<?php echo $file->file_id?>-details").toggle()'><img src="<?php echo $base_url.'/img/icons/about_16.png'?>"  title="<?php echo $this->lang->line('files_manage_table_4') ?>" class="nb" /></a>
			</td>
		</tr>
		<tr class="details" style="display:none; border-top:none;" id="<?php echo $file->file_id?>-details">
			<td colspan="4" id="<?php echo $file->file_id?>-details-inner">
			<p>
				<img title="<?php echo $this->lang->line('files_manage_table_7') ?>"  class="nb" alt="<?php echo $this->lang->line('files_manage_table_7') ?>:" src="<?php echo $base_url?>img/icons/link_16.png" /> <input class="down_link" readonly="readonly" type="text" size="65" value="<?php echo $link['down']?>" onfocus="this.select()" onclick="this.select()" ondblclick="this.select()" /><br />
				
				<img title="Date Uploaded" alt="Date Uploaded:" class="nb" src="<?php echo $base_url?>img/icons/calendar_16.png" /> <em><?php echo unix_to_human($file->time); ?></em>
				
				<?
				if(isset($link['img']))
				{
					?><br /><img title="<?php echo $this->lang->line('files_manage_table_9'); ?>" alt="<?php echo $this->lang->line('files_manage_table_9') ?>:" class="nb" src="<?php echo $base_url?>img/icons/pictures_16.png" /> <a href="<?php echo $link['img']?>"><?php echo $link['img']?></a><?
				}
				?>
				</p>
			</td>
		</tr>
		
		<?php 
			$i++;
		}
		?>
	</table>
	<?php echo $pagination?>
	<?
}