{% extends base_template %}

{% block actions %}
{% endblock %}
{% block breadcrumb %}{% endblock %}
{%- block tab_menu -%}
    {{ knp_menu_render(admin.sidemenu(action), {
        'currentClass': 'active',
        'template': get_global_template('tab_menu_template')
    }, 'twig') }}
{%- endblock -%}

{% block title %}
    {{ 'TABLEAU DE BORD'|trans }}
{% endblock %}

{% block navbar_title %}
    {{ block('title') }}
{% endblock %}

{% block content %}
	<div class="box">
        <div class="box-header text-center">
            <h3 class="box-title">{{ 'GLOBAL'|trans }}</h3>
        </div>
        <div class="box-body">
            <h4>Solde de MLC en circulation : 12345 {{KOH_MLC_NAME_SMALL|default('') }}</h4>
			<h4>Solde de Monnaie Nantie : 12345 {{KOH_MLC_NAME_SMALL|default('') }}</h4>
        </div>
    </div>

	<div class="box">
        <div class="box-header text-center">
            <h3 class="box-title">{{ 'GROUPES'|trans }}</h3>
        </div>
        <div class="box-body">
        	<div class="table-responsive">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>Nom</th>
							<th>Compte</th>
						</tr>
					</thead>
					<tbody>
						{% for groupe in getAllGroupes() %}
							<tr>
								<td>{{groupe.name}}</td>
								<td>{{groupe.compte}}</td>
							</tr>
						{% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</div>

	<div class="box">
        <div class="box-header text-center">
            <h3 class="box-title">{{ 'COMPTOIRS'|trans }}</h3>
        </div>
        <div class="box-body">
        	<div class="table-responsive">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>Nom</th>
							<th>Compte</th>
						</tr>
					</thead>
					<tbody>
						{% for comptoir in getAllComptoirs() %}
							<tr>
								<td>{{comptoir.name}}</td>
								<td>{{comptoir.compte}}</td>
							</tr>
						{% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</div>

	<div class="box">
        <div class="box-header text-center">
            <h3 class="box-title">{{ 'COTISATIONS'|trans }}</h3>
        </div>
        <div class="box-body">
			<div class="table-responsive">
				<table class="table table-hover">
					<thead>
						<tr>
							<th colspan='6'>Cotisations des adhérents</th>
						</tr>
						<tr>
							<th>Espèces</th>
							<th>Chèques</th>
							<th>CB</th>
							<th>MLC</th>
							<th>Autre</th>
							<th>TOTAL</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
    {# <div class="p-4">
    	<h4><u>{{ "Exemples d'importations possible (Fichiers .csv uniquement):"|trans }}</u></h4>
    	<div class='mb-5'>
    		{% for key, csvparam in csvparams %}
				<h5><strong>{{ key|capitalize }} : </strong><a class='ml-4' target='_blank' rel="noopener noreferrer" href='{{ csvparam.file }}'>Télécharger un exemple</a></h5>
				<p class='ml-4'><i>{{ csvparam.header }}</i></p>
				<p class='ml-4 mb-4'><i>{{ 'Exemple'|trans }} :</i> {{ csvparam.example }}</p>
	    	{% endfor %}
	    </div>
    	{{form_start(form)}}
			{{ form_row(form.media) }}
			{{ form_row(form.user) }}
			{{ form_row(form.save) }}
		{{form_end(form)}}

		{% if errors is defined and errors|length > 0 %}
			<div class='container bg-danger w-100 py-4 row'>
				{% if errors['error'] is defined %}
					{{ errors['error'] }}
				{% else %}
					{{  macros.show_error(errors) }}
				{% endif %}
			</div>
		{% endif %}
		{% if warnings is defined and warnings|length > 0 %}
			<div class='container bg-warning w-100 py-4 row'>
				{{  macros.show_error(warnings) }}
			</div>
		{% endif %}
		{% if success is defined and success|length > 0 %}
			<div class='container bg-success w-100 py-4 row'>
				{{  macros.show_error(success) }}
			</div>
		{% endif %}
		{% if linkcsverror is defined and linkcsverror != null %}
			<div class='py-4'>
				<a href='{{ linkcsverror }}' role="button" class="btn-primary btn">{{ 'Télécharger CSV avec lignes en erreurs'|trans }}</a>
			</div>
		{% endif %}
    </div> #}
{% endblock %}