<div class="row">
	<div class="col-lg-8 col-md-8 col-sm-12">
	
		<? if (file_exists($baseL)) { ?>
		<div class="table-responsive"> 
			<table id="index-logs" class="table table-hover all-logs">
				<thead> 
					<tr> 
						<th width="20%" style="text-align:center!important;"><?=Dict::_('TXTSESSIONTIME')?></th>
						<th width="15%" style="text-align:center!important;"><?=Dict::_('TXTSESSION')?></th> 
						<th style="text-align:left!important;"><?=Dict::_('TXTACTION')?></th>
						<th width="3%"></th>
					</tr> 
				</thead> 
				<tbody>
					<?
					$logs = $xmllogs->xpath('/logs/log');
					arsort($logs);
					$countLogs 	= count($xmllogs->xpath('/logs/log'));
					foreach ($logs as $log) {
						$listLogsLogin 		= $log->login;
						$listLogsAction 	= $log->action;
						$listLogsIp 		= $log->userip;
						$listLogsTime 		= $log->sessiontime;
					?>
					<tr session="<? echo $listLogsLogin; ?>'">
						<td width="20%">
							<div class="rem_days_body" >
								<div class="txt" align="center"><? echo date("Y-m-d  H:i:s",strtotime($listLogsTime)); ?></div>
							</div>
						</td>
						<td width="15%" style="text-align:center!important;"><? echo $listLogsLogin; ?></td>
						<td style="text-align:left!important;"><? echo $listLogsAction; ?><br/><small class="clr_none">IP: <? echo $listLogsIp; ?></small></td>
						<td width="3%" style="text-align:center!important;">
							<form method="POST" name="formIP">
								<input type="text" class="hide" name="inputIP" value="<? echo $listLogsIp; ?>">
								<button type="submit" name="sessionADD" class="btn btn-md btn-link"><i class="fa fa-fw fa-lock" aria-hidden="true" title="<?=Dict::_('TTLBLOCKIP2'); ?>"></i></button>
							</form>
						</td>
					</tr>
					<? } ?>
				</tbody>
			</table>
		</div>
		<? include_once(ROOT . '/templates/table-pager.php'); ?>
		<? } ?>
	
	</div>
	<div class="col-lg-4 col-md-4 col-sm-12">
		<form method="POST">
			<div class="input-group input-group-lg" style="margin:0px 0px 20px 0px;">
				<span class="input-group-addon"><i class="fa fa-fw fa-times" aria-hidden="true"></i></span>
				<span class="input-group-btn" style="width:100%;">
					<button type="submit" name="sessionDEL" onclick="return confirm('<?=Dict::_('TXTCLLOGS2')?>')" class="btn btn-lg btn-block btn-default" style="height:46px;"><?=Dict::_('TXTCLLOGS1')?></button>
				</span>
			</div>
		</form>
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><i class="fa fa-fw fa-info-circle" aria-hidden="true"></i> <?=Dict::_('TXTATTENTION')?></h3>
			</div>
			<div class="panel-body">
				<?=Dict::_('TXTATTENTION1')?>
			</div>
		</div>
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><i class="fa fa-fw fa-lock" aria-hidden="true"></i> <?=Dict::_('TTLBLOCKIP')?></h3>
			</div>
			<div class="panel-body" >
				<form method="POST" name="formIP">
					<div class="input-group">
						<span class="input-group-btn">
							<button type="submit" name="searchIP" class="btn btn-md btn-default" title="<?=Dict::_('SEARCHBTN') ?>"><i class="fa fa-fw fa-search" aria-hidden="true"></i></button>
						</span>
						<input style="width:50%;" type="text" class="form-control" name="inputIP" placeholder="<?=Dict::_('TXTIPADDRESS') ?>" maxlength="150" required="">
						<input style="width:50%;" type="text" class="form-control" name="inputDATE" placeholder="<?=Dict::_('NODATE2') ?>">
						<span class="input-group-btn">
							<button type="submit" name="sessionADD" class="btn btn-md btn-info" title="<?=Dict::_('ADDBTN') ?>"><i class="fa fa-fw fa-plus" aria-hidden="true"></i></button>
						</span>
					</div>
				</form>
			</div>
			<? if($countSessions > 0){ ?>
			<div class="panel-body" style="border-top:1px solid #e4e4e4;padding:0px 0px 15px 0px;" >
				<div style="max-height:300px;overflow:auto;" >
					<table id="bip-table" class="table table-hover" style="margin-bottom:0px;">
						<thead> 
							<tr>  
								<th width="50%" style="text-align:center!important;"><?=Dict::_('TXTIPADDRESS') ?></th> 
								<th width="40%" style="text-align:center!important;"><?=Dict::_('TXTDATE') ?></th> 
								<th width="10%"></th>
							</tr> 
						</thead> 
						<tbody>
						<?
						$sessions = $xmluserip->xpath('/sessions/session');
						$start = 0;
						$end = 4;
						foreach ($sessions as $session) if($start++ <= $end) {
							$listSessionIp 		= $session['ip'];
							$listSessionDate 	= $session['date'];
						?>
						<tr>
							<td align="center"><? echo $listSessionIp; ?></td>
							<td>
								<div class="rem_days_body" >
									<div class="txt"><? if($listSessionDate != ''){echo Dict::_('TO') . ' ' . $listSessionDate;} else {echo '-';} ?></div>
								</div>
							</td>
							<td align="center">
								<form method="POST">
									<button class="btn btn-sm btn-link" type="submit" name="sessionUNLOCK" onclick="return confirm('<?=Dict::_('TXTDELIP') ?> <? echo $listSessionIp; ?> ?')"><i class="fa fa-fw fa-times" aria-hidden="true"></i></button>
									<input type="text" class="hidden" name="sessionUNLOCKIP" value="<? echo $listSessionIp; ?>" />
								</form>
							</td>
						</tr>
						<? } ?>
						</tbody>
					</table>
				</div>
			</div>
			<? } ?>
		</div>
	</div>
</div>
		


