<!-- restorejob/list-restore.phtml -->
<?php $decode = new MyClass_HomebrewBase64; ?>

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

<h1><?php echo $this->escape($this->title); ?></h1>
<?php
    echo "<b>", $this->translate->_("Total"), ": ", $this->total_rows,
        " ", $this->translate->_("file(s)"), ", ", $this->convBytes($this->total_size), "</b>" ;
?>

<div style="margin-top: 1em; margin-bottom: 2em;">
    <?php if ( !empty($this->msgNoValid) ) : ?>
    <div class="ui-widget" style="float: left;">
        <div class="ui-state-error ui-corner-all" style="padding: 0pt 0.7em;">
            <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span>
    		<strong><?php echo $this->msgNoValid; ?></strong></p>
        </div>
    </div>
    <div style="clear: both;"><!--  --></div>
    <?php endif;?>

<?php echo $this->form;?>
    
</div>

<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>
</tr>
</thead>
<tbody>
<?php foreach($this->result as $line) : ?>
<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]+/", $line['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($line['path'] . $line['name']);?>&nbsp;&nbsp;
	<td> &nbsp; <?php echo $this->escape($line['fileid']) ?> &nbsp;</td>
	</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>


<?php
// pager
if ( $this->total_pages > 1 )   {

	// Make links

	for( $i = 1 ; $i <= $this->total_pages ; $i++ ) {
		if ( $i == $this->current_page )
			echo $i;
		else
			echo '<a href="' . $this->baseUrl .'/restorejob/list-restore/page/' . $i . '">' . $i . "</a>";

		echo " &nbsp;\n";
	}
}
?>

<?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; ?>
