<?php echo $this->partial('Layout/nav'); ?>

<div class="container">
	<div class="container-page-wrapper">
		<div class="container-page-container">
			<h1><?php echo $this->actionTitle; ?></h1>
			<hr>
			<?php //debug($this->view->accesses); ?>
			
			<?php if(is_array($this->view->accesses) && !empty($this->view->accesses)): ?>
				<div class="table-overflow">
					<table  class="table table-hover">
						<thead class="thead-light">
							<tr>
								<th><?php echo _('Username'); ?></th>
								<th><?php echo _('Surname'); ?></th>
								<th><?php echo _('Name'); ?></th>
								<th><?php echo _('IP'); ?></th>
								<th><?php echo _('GMT date'); ?></th>
								<th><?php echo _('Interval'); ?></th>
								<th></th>
							</tr>
						</thead>
						
						<tbody>
							<?php foreach($this->view->accesses as $access): ?>
								<tr>
									<td><?php echo $access['username']; ?></td>
									<td><?php echo $access['surname']; ?></td>
									<td><?php echo $access['name']; ?></td>
									<td><?php echo $access['remote_ip']; ?></td>
									<td><?php echo $this->helper->getDateString($access['access_date'], true); ?></td>
									<td><?php echo $this->helper->dateIntervalString($access['access_date']); ?></td>
								</tr>
							<?php endforeach; ?>
						</tbody>
					</table>
				</div>
				<?php echo $this->partial('Layout/pagination'); ?>
			<?php else: ?>
			<?php endif; ?>
		</div>
	</div>
</div>