{% extends 'layout.twig' %}

{% block css %}
	<link rel="stylesheet" href="../vendor/almasaeed2010/adminlte/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
	<link rel="stylesheet" href="../vendor/almasaeed2010/adminlte/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
	<link rel="stylesheet" href="../vendor/almasaeed2010/adminlte/plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
{% endblock %}

{% import 'messagesysteme.twig' as msgSyst %}

{% block content %}
	<div class="row">
		<div class="col col-md-12">

			<div class="box box-info">
				<div class="box-header">
					<h3 class="box-title">{{trad.users_connected}}</h3>
				</div>
				<!-- /.box-header -->
				<div class="box-body">
				  <table id="tableuser" class="table display table-bordered table-striped">
						<thead>
							<tr>
							  <th>{{trad.login_name}}</th>
							  <th>{{trad.names}}</th>
							  <th>{{trad.sen_a_mail}}</th>
							  <th>{{trad.action}}</th>
							</tr>
						</thead>
						<tbody>
							{% for utilisateurCo in utilisateursconnecte %}
								<tr>
									<td>{{ utilisateurCo.login }}</td>
									<td>{{ utilisateurCo.nomprenom }}</td>
									<td><a href="mailto:{{ utilisateurCo.email }}" class="btn btn-info btn-md"><i class="icon fa fa-envelope"></i></a></td>
									<td>
										{% if utilisateurCo.deconnexion == 1 %}
											<a href="?p=admin_view_connexions&user_login={{ utilisateurCo.login }} ">{{ trad.disconnect2 }}</a>
										{% endif %}
									</td>
								</tr>
							{% endfor %}
						</tbody>
						<thead>
							<tr>
							  <th>{{trad.login_name}}</th>
							  <th>{{trad.names}}</th>
							  <th>{{trad.sen_a_mail}}</th>
							  <th>{{trad.action}}</th>
							</tr>
						</thead>
				  </table>
				</div>
			</div>


			<div class="box box-success">
				<div class="box-header">
					<h3 class="box-title">{{d.TitreDateLog}}</h3>
				</div>
				<!-- /.box-header -->
				<div class="box-body">
					<p>{{ trad.msg_explain_log }}
				  <table id="tablelog" class="table display table-bordered table-striped">
						<thead>
							<tr>
							  <th>{{trad.login_name}}</th>
							  <th>{{trad.names}}</th>
							  <th>{{trad.begining_of_session}}</th>
							  <th>{{trad.end_of_session}}</th>
							  <th>{{trad.ip_adress}}</th>
							  <th>{{trad.navigator}}</th>
							  <th>{{trad.referer}}</th>
							</tr>
						</thead>
						<tbody>
							{% for log in logsconnexion %}
								<tr {% if log.clos == 0 %}class="success"{% endif %}>
									<td>{{ log.login }}</td>
									<td>{{ log.nomprenom }}</td>
									<td>{{ log.debut }}</td>
									<td>{{ log.fin }}</td>
									<td>{{ log.ip }}</td>
									<td>{{ log.navigateur }}</td>
									<td>{{ log.provenance }}</td>
								</tr>
							{% endfor %}
						</tbody>
						<thead>
							<tr>
							  <th>{{trad.login_name}}</th>
							  <th>{{trad.names}}</th>
							  <th>{{trad.begining_of_session}}</th>
							  <th>{{trad.end_of_session}}</th>
							  <th>{{trad.ip_adress}}</th>
							  <th>{{trad.navigator}}</th>
							  <th>{{trad.referer}}</th>
							</tr>
						</thead>
				  </table>
				</div>
			</div>

		</div>
	</div>
{% endblock %}

{% block javascript %}
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/jszip/jszip.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/pdfmake/pdfmake.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/pdfmake/vfs_fonts.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-buttons/js/buttons.html5.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-buttons/js/buttons.print.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
	<script>
		// Table
		$("#tablelog").DataTable({
     		 "responsive": true, "lengthChange": false, "autoWidth": false,
     		 "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
    	}).buttons().container().appendTo('#tablelog_wrapper .col-md-6:eq(0)')
	</script>
{% endblock %}