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

{% block title %} Annonce {% 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">Annonces</h1>
    <ol class="breadcrumb float-sm-right">
        <li class="breadcrumb-item">Annonce</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 Annonce</h6>
        </div>
        <div class="card-body">

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

                    {{ form_errors(form) }}
                    {{ form_row(form._token) }}
                    
                    <div class="col-8 my-3">
						{{ form_label(form.titre, 'Titre *', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-book"></i></span>
							{{ form_widget(form.titre, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.titre) }}
							</div>
						</div>
					</div>

                    <div class="col-4 my-3">
						{{ form_label(form.categorie, 'Catégorie', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-bars"></i></span>
							{{ form_widget(form.categorie, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.categorie) }}
							</div>
						</div>
					</div>

                    
                    <div class="col-6 my-3">
						{{ form_label(form.prix_promo, 'Prix promo *', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-money-bill-wave"></i></span>
							{{ form_widget(form.prix_promo, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.prix_promo) }}
							</div>
						</div>
					</div>

                    <div class="col-6">
						{{ form_label(form.pourcentage_reduction, 'Pourcentage reduction', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-percent"></i></span>
							{{ form_widget(form.pourcentage_reduction, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.pourcentage_reduction) }}
							</div>
						</div>
					</div>

                    
                    <div class="col-8">
						{{ form_label(form.societe, '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.societe, {'attr': {'class': 'form-control select-filter select2bs4 select-filter-speaker'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.societe) }}
							</div>
						</div>
					</div>

                    <div class="col-6">
						{{ form_label(form.prix_marche, 'Prix du marché', {'attr': {'class': 'form-label'}}) }}
						<div class="input-group">
							<span class="input-group-text"><i class="fa-solid fa-money-bill-1"></i></span>
							{{ form_widget(form.prix_marche, {'attr': {'class': 'form-control'}}) }}
							<div class="invalid-feedback">
								{{ form_errors(form.prix_marche) }}
							</div>
						</div>
					</div>

                    
					<div class="col-12 my-3">
						<div class="col-4" >
							{{ form_label(form.largeur, 'Largeur Annonce', {'attr': {'class': 'form-label'}}) }}
							<div class="input-group">
								<span class="input-group-text"><i class="fa-solid fa-left-right"></i></span>
								{{ form_widget(form.largeur, {'attr': {'class': 'form-control'}}) }}
								<div class="invalid-feedback">
									{{ form_errors(form.largeur) }}
								</div>
							</div>
						</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 %}