Untitled

mail@pastecode.io avatar
unknown
twig
a year ago
5.3 kB
1
Indexable
Never
{% extends 'base.html.twig' %}

{% block body %}
    <div class="example-wrapper">
        <form method="GET" action="{{ path('app_search_index') }}">
            <!-- Vos champs de formulaire ici -->
            <input placeholder="Titre de l'annonce" type="text" name="keyword" value="{{ app.request.request.get('keyword') }}" >
            <input placeholder="Marque du Véhicule" type="text" name="brand" value="{{ app.request.request.get('brand') }}" >
            {#  <input placeholder= "Prix Mini" type="text" name="minPrice" value="{{ app.request.request.get('minPrice') }}">
            <input placeholder= "Prix Maxi" type="text" name="maxPrice" value="{{ app.request.request.get('maxPrice') }}">#}
            <!-- Slider pour le prix minimum -->
            <!--<div id="priceMinSlider" data-start="0{#  {{ app.request.request.get('minPrice')|default(0) }}#}" >
                <div  class="noUiSlider"  id="minPrice">
            </div>-->
           <input type="text" name="minPrice" id="minPrice" value="{{ app.request.request.get('minPrice') }}">


                <!-- Slider pour le prix maximum -->
            <!--<div id="priceMaxSlider" data-start="10000{#  {{ app.request.request.get('maxPrice')|default(10000) }}#}">
                <div  class="noUiSlider" id="maxPrice">
            </div>-->
            <input type="text" name="maxPrice" id="maxPrice" value="{{ app.request.request.get('maxPrice') }}">


            <input placeholder="Kilometres Min" type="text" name="minKilometers" value="{{ app.request.request.get('minKilometers') }}">
            <input placeholder="Kilometres Max" type="text" name="maxKilometers" value="{{ app.request.request.get('maxKilometers') }}">
            <input placeholder="Reference de l'annonce" type="text" name="reference" value="{{ app.request.request.get('reference') }}">

            <button type="submit">Rechercher</button>
        </form>



    </div>

    <div class="container">
        <div class="row">
            {% set counter = 0 %}
            {% for result in results %}
                <div class="col-sm-12 m-5">
                    <div class="card border">
                        <div id="carouselExampleControls{{ counter }}" class="carousel slide" data-ride="carousel">
                            <div class="carousel-inner">
                                {#  {{ dump(car) }}#}
                                {%for image in result.images %}
                                    {% if loop.first %}
                                        <div class="carousel-item active" {#  {% if dzdzzd == 0 alors "active" %}#}>
                                            <img class=" img-fluid  d-block w-auto " src="{{ asset('assets/uploadscars/') ~ image.name }}" alt="slide">
                                        </div>
                                    {% elseif loop.last %}
                                        <div class="carousel-item" {#  {% if dzdzzd == 0 alors "active" %}#}>
                                            <img class=" img-fluid  d-block w-auto" src="{{ asset('assets/uploadscars/') ~ image.name }}" alt="slide">
                                        </div>
                                    {% else %}
                                        <div class="carousel-item" {#  {% if dzdzzd == 0 alors "active" %}#}>
                                            <img class="img-fluid  d-block w-auto" src="{{ asset('assets/uploadscars/') ~ image.name }}" alt="slide">
                                        </div>
                                    {% endif %}


                                {% endfor %}
                            </div>
                            <a class="carousel-control-prev" href="#carouselExampleControls{{ counter }}" role="button" data-slide="prev">
                                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                                <span class="sr-only">Previous</span>
                            </a>
                            <a class="carousel-control-next" href="#carouselExampleControls{{ counter }}" role="button" data-slide="next">
                                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                                <span class="sr-only">Next</span>
                            </a>
                        </div>
                        {% set counter = counter + 1 %}
                        {#  <img src="" alt="" class="card-img-top">#}
                        <div class="card-body ">
                            <h3 class="card-title" ><a href="{{ path('app_offers_show', {id:result.id }) }}">{{result.offertitle }}</a></h3>
                            <h4 class="card-title">{{result.car.brand }} {{result.car.model }}</h4>
                            <h5 class="card-kilometers"> {{result.car.kilometers }} km</h5>
                            <h5 class="card-price"> {{ result.car.price }} €</h5>
                            <p class="card-text">{{ counter }}</p>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
    </div>


{% endblock %}