<!-- restorejob/restore-single-file.phtml -->

<script type="text/javascript">
$(document).ready(function() {
	$('#ok1').click(function() {
    	$.blockUI({
        	message: '<h2><?php print $this->translate->_("Please wait"); ?>...</h2>'
        });
    });
});
</script>

<script type="text/javascript">
  // select
  $(function(){
      $('select').each(function() {
          var t = $(this).selectmenu({maxHeight: 300});
          eval(t);
      });
  });
</script>

<?php if ($this->file): ?>

<h1><?php echo $this->escape($this->title); ?></h1>

<?php echo $this->form;?>
<br style="clear: both; margin-top: 1.5em;" />

<?php $decode = new MyClass_HomebrewBase64; ?>

<table id="box-table-minimalist" border="0">
<thead>
<tr>
     <th scope="col" colspan="4"> <?php print $this->translate->_("Attribute"); ?> </th>
     <th scope="col"> <?php print $this->translate->_("Name File"); ?> </th>
     <th scope="col"> <?php print $this->translate->_("File Id"); ?> </th>
     <th scope="col"> <?php print $this->translate->_("Job Id"); ?> </th>
</tr>
</thead>
<tbody>
<tr>
<?php
	// LStat example:
	// MI OfON IGk B Bk Bl A e BAA I BGkZWg BGkZWg BGkZWg A A E
	list($st_dev, $st_ino, $st_mode, $st_nlink, $st_uid, $st_gid, $st_rdev, $st_size, $st_blksize,
		$st_blocks, $st_atime, $st_mtime, $st_ctime) = preg_split("/[\s]+/", $this->file[0]['lstat']);

	if ( $decode->homebrewBase64($st_dev) == 0 )     {
		// OS : windows
		echo '<td>' , date("d-M-y H:i:s", $decode->homebrewBase64($st_mtime)) , '</td><td>' ,
			$this->convBytes($decode->homebrewBase64($st_size)) , '</td>',
			'<td></td><td></td>';
	}
	else {
		// OS : linux/unix
		echo '<td>' , $this->permissionOctal2String(($decode->homebrewBase64($st_mode))), '</td><td>' ,
			$decode->homebrewBase64($st_uid), " &nbsp;",  $decode->homebrewBase64($st_gid),'</td><td>',
			date("d-M-y H:i:s", $decode->homebrewBase64($st_mtime)),'</td><td>',
			$this->convBytes($decode->homebrewBase64($st_size)), '</td>';
	}
?>
</td>

	<td><?php echo $this->escape($this->file[0]['path'] . $this->file[0]['filename']);?>&nbsp;&nbsp;
	<td> &nbsp; <?php echo $this->escape($this->file[0]['fileid']) ?> &nbsp;</td>
	<td> &nbsp; <?php echo $this->escape($this->file[0]['jobid']) ?> &nbsp;</td>
	</td>
</tr>
</tbody>
</table>

<?php else: ?>
<div class="ui-widget" style="float: left;">
	<div class="ui-state-highlight ui-corner-all" style="padding: 0pt 0.7em; margin-top: 20px;">
		<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: 0.3em;"></span>
		<strong><?php print $this->translate->_("No Files found."); ?></strong></p>
	</div>
</div>
<div style="clear: both;"><!--  --></div>
<?php endif; ?>