{% extends 'base_backend_admin.html.twig' %}

{% block title %} Société {% endblock %}

{% block content %}

{% set titlePage = 'Ajouter' %}
{% if app.request.attributes.get('_route') == 'backend_societe_update' %}
   {% set titlePage = 'Modifier' %}     
{% endif %}


<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-gray-800">Sociétés</h1>
    <ol class="breadcrumb float-sm-right">
        <li class="breadcrumb-item">Société</li>
        <li class="breadcrumb-item">{{ titlePage }}</li>
    </ol>
</div>


<!-- Begin Page Content -->
<div class="container-fluid">
    
    {% include 'backend_admin/basic/notice.html.twig' %}
    
    <!-- DataTales Example -->
    <div class="card shadow mb-4">
       
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary">{{ titlePage }} une nouvelle société</h6>
        </div>
        <div class="card-body">


            {{ form_start(form) }}
                <div class="row g-3">

                    {{ form_errors(form) }}
                    {{ form_row(form._token) }}
                    
                    <div class="col-6 my-3">
						{{ form_label(form.nom, 'Nom Société', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-building"></i></span>
							{{ form_widget(form.nom, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.nom) }}
							</div>
						</div>
					</div>

                    <div class="col-6">
						{{ form_label(form.immatriculation, 'Immatriculation', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-cash-register"></i></span>
							{{ form_widget(form.immatriculation, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.immatriculation) }}
							</div>
						</div>
					</div>
                    
                    <div class="col-12 my-3">
						{{ form_label(form.email, 'Email', {'attr': {'class': 'form-label'}}) }} 
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-at"></i></span>
							{{ form_widget(form.email, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								Your username is required.
							</div>
						</div>
					</div>


                    <div class="col-12 my-3">
						{{ form_label(form.telephone, 'Téléphone', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-phone-volume"></i></span>
							{{ form_widget(form.telephone, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.telephone) }}
							</div>
						</div>
					</div>

                    <div class="col-12 my-3">
						{{ form_label(form.fax, 'Fax', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-fax"></i></span>
							{{ form_widget(form.fax, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.fax) }}
							</div>
						</div>
					</div>

                    
                    <div class="col-12 my-3">
						{{ form_label(form.adresse, 'Adresse', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-location-dot"></i></span>
							{{ form_widget(form.adresse, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.adresse) }}
							</div>
						</div>
					</div>

                    <div class="col-12 my-3">
                        {{ form_label(form.photo, 'Logo', {'attr': {'class': 'form-label'}}) }}
                        {{ form_widget(form.photo, {'attr': {'class': 'form-control'}}) }}
                        <div class="invalid-feedback">{{ form_errors(form.photo) }}</div>
                    </div>

                    <div class="col-12 my-3">
                        {{ form_label(form.description, 'Déscription', {'attr': {'class': 'form-label'}}) }}
                        {{ form_widget(form.description, {'attr': {'class': 'form-control'}}) }}
                        <div class="invalid-feedback">{{ form_errors(form.description) }}</div>
                    </div>

                    <hr class="my-4">
                    {{ form_widget(form.save, {'label': "Enregister", 'attr': {'class': 'w-90 btn btn-primary btn-lg'}}) }}
						

                </div>

            {{ form_end(form) }}

        </div>
    </div>

</div>
                

{% endblock %}