{% extends 'layout.twig' %}

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

{% block css %}
{% endblock %}

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

            <div class="card card-primary card-outline card-tabs">
				<div class="card-header p-0 pt-1 border-bottom-0">
				  <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
					<li class="nav-item"><a class="nav-link active" href="#grr" data-bs-toggle="tab">Infos GRR</a></li>
					<li class="nav-item"><a class="nav-link" href="#serveur" data-bs-toggle="tab">Serveur</a></li>
					<li class="nav-item"><a class="nav-link" href="#infosphp" data-bs-toggle="tab">Infos PHP</a></li>
					<li class="nav-item"><a class="nav-link" href="#fichierconfig" data-bs-toggle="tab">Fichier configuration</a></li>
					<li class="pull-right"><button type="button" id="copy" class="btn btn-info pull-right btn-block btn-sm">Copier infos pour aide</button></li>
				  </ul>
				</div>
				<div class="card-body">
				<div class="tab-content">
					<!-- GRR -->
					<div class="tab-pane active" id="grr">
						<ul class="list-group list-group-unbordered">
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">{{ trad.num_version }}</p><b>{{ d.num_version }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">{{ trad.num_versionbdd }}</p><b>{{ d.num_versionbdd }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">{{ trad.prefixe }}</p><b>{{ d.prefixe }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">{{ trad.maj_bdd }}</p><b>{{ d.maj_bdd |raw }} </b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">{{ trad.maj_recherche_grr }}</p><b>{{ d.maj_SiteGRR |raw }}&nbsp;</b></div></li>
							<li class="list-group-item"><p class="col col-sm-6"><b>Infos support </b><i>(A fournir pour toute demande d'aide)</i> :</p><textarea id="to-copy" rows="8" cols="40">
{{ trad.num_version }} : {{ d.num_version }}
{{ trad.num_versionbdd }} : {{ d.num_versionbdd }}
{{ trad.system }} : {{ d.system }}
Version PHP : {{ d.versionPHP }}
{{ trad.database }} : {{ d.database }} => {{ d.versionBDD }}
Time : {{ d.time }}
Timezone : {{ d.timezone }}</textarea></li>
						</ul>
						<!-- Infos pour support -->

						<!-- Fin infos pour support -->
					</div>

					<!-- Serveur -->
					<div class="tab-pane" id="serveur">
						<ul class="list-group list-group-unbordered">
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">{{ trad.system }}</p><b>{{ d.system }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Version PHP</p><b><small class="badge pull-left {{ d.couleurVersionPHP }}">{{ d.versionPHP }}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">PHP fileinfo</p><b><small class="badge pull-left {% if d.phpfileinfo %}bg-green{% else %}bg-red{% endif %}">{% if d.phpfileinfo %}Oui{% else %}Non{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">PHP gd</p><b><small class="badge pull-left {% if d.phpgd %}bg-green{% else %}bg-red{% endif %}">{% if d.phpgd %}Oui{% else %}Non{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">PHP mbstring</p><b><small class="badge pull-left {% if d.phpmbstring %}bg-green{% else %}bg-red{% endif %}">{% if d.phpmbstring %}Oui{% else %}Non{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">PHP mysqli</p><b><small class="badge pull-left {% if d.phpmysqli %}bg-green{% else %}bg-red{% endif %}">{% if d.phpmysqli %}Oui{% else %}Non{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">PHP mysqlnd</p><b><small class="badge pull-left {% if d.mysqlnd %}bg-green{% else %}bg-red{% endif %}">{% if d.mysqlnd %}Oui{% else %}Non{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">PHP xml</p><b><small class="badge pull-left {% if d.phpxml %}bg-green{% else %}bg-red{% endif %}">{% if d.phpxml %}Oui{% else %}Non{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">PHP intl</p><b><small class="badge pull-left {% if d.phpintl %}bg-green{% else %}bg-red{% endif %}">{% if d.phpintl %}Oui{% else %}Non{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">{{ trad.database }}</p><b>{{ d.database }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Version BDD</p><b><small class="badge pull-left {{ d.couleurVersionMySQL }}">{{ d.versionBDD }}</small>&nbsp;</b></div></li>

							<li class="list-group-item"><b class="col col-sm-12">Dossiers : </b></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Existence dossier "installation"</p><b><small class="badge pull-left {% if d.dossierInstallation == 1 %}bg-orange{% else %}bg-green{% endif %}">{% if d.dossierInstallation == 1 %}Existant - Nous recommandons de le supprimer{% else %}Innexistant{% endif %}</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Droits dossier "personnalisation/images/logos"</p><b><small class="badge pull-left {% if d.dossierImgLogosEcriture == 1 %}bg-green{% else %}bg-red{% endif %}">Ecriture</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Droits dossier "personnalisation/images/ressources"</p><b><small class="badge pull-left {% if d.dossierImgRessourcesEcriture == 1 %}bg-green{% else %}bg-red{% endif %}">Ecriture</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Droits dossier "export"</p><b><small class="badge pull-left {% if d.dossierExportEcriture == 1 %}bg-green{% else %}bg-red{% endif %}">Ecriture</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Droits dossier "temp"</p><b><small class="badge pull-left {% if d.dossierTempEcriture == 1 %}bg-green{% else %}bg-red{% endif %}">Ecriture</small>&nbsp;</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Droits dossier "personnalisation/modules"</p><b><small class="badge pull-left {% if d.dossierModulesEcriture == 1 %}bg-green{% else %}bg-red{% endif %}">Ecriture</small>&nbsp;</b></div></li>

							<li class="list-group-item"><b class="col col-sm-12">Temps : </b></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Time</p><b>{{ d.time }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Date du serveur (Jour-Mois-Annee)</p><b>{{ d.date }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Heure du serveur</p><b>{{ d.heure }}</b></div></li>
							<li class="list-group-item"><div class="row"><p class="col col-sm-6">Timezone (date_default_timezone_set)</p><b>{{ d.timezone }}</b></div></li>
						</ul>
					</div>

					<!-- Infos PHP -->
					<div class="tab-pane" id="infosphp">
						
							{{ infosPHP |raw }}

					</div>

					<!-- Fichier Config -->
					<div class="tab-pane" id="fichierconfig">
						<ul class="list-group list-group-unbordered">
							{{ d.infosConfigVar |raw }}
						</ul>
					</div>
				</div>
				</div>
			</div>
		</div>
	</div>
	
{% endblock %}

{% block javascript %}
	<script>
		var toCopy  = document.getElementById( 'to-copy' ),
		btnCopy = document.getElementById( 'copy' );
		btnCopy.addEventListener( 'click', function(){
			toCopy.select();
			document.execCommand( 'copy' );
			return false;
		} );
	</script>
{% endblock %}