{% extends template ~ '.html.twig' %}

{% block title %}{{ title }}{% endblock %}

{% block top %} 
    <div class="top-section">
        <h1 class="title" id="page-title">{{ title }}</h1>
         <div class="search-wrap search-input">
            <select id="select-search" name="searchType">
                <option value="name">по имени</option>
                <option value="dep">по отделению</option>
                <option value="pl" selected>по услуге</option>
            </select>
            <input id="select-name-input" data-controller="searchNameInput" type="text" class="form-control" placeholder="Поиск:">
            <div class="show-content d-none"></div>
            <div data-controller="searchButton" class="search-btn">
                <button class="btn" type="button" data-action="click->searchButton#searchForm">
                    <i class="fa fa-search" aria-hidden="true"></i>
                </button>
                <button class="btn" type="button" data-action="click->searchButton#cancelForm">
                    <i class="fa fa-window-close" aria-hidden="true"></i>
                </button>
            </div>
        </div>
    </div>
{% endblock %}

{% block filter %}
	<div class="filter__title">Найти услугу</div>
    {{ include('base/_search_form_price.html.twig', {'searchForm': searchForm}) }}
{% endblock %}

{% block body %}
<div class="main pt-md-3">       
    {% for item in pagination %}
    	{% if item.priceInfo.price != 0 %}
		    <div class="staff-detail block-content mb-2"> 
		        <div class="row">
		        	<div class="col-md-10">
		        		<h5>{{ item.schname }}</h5>
		        		<p>Код услуги: {{ item.kodoper }}</p>
		        	</div>
		        	<div class="col-md-2">
		        		<p class="pull-right"><b>{{ item.priceInfo.price }} ₽</b></p>
		        	</div>
		        </div>
		        <div class="row">
		        	<div class="col-md-8">
						<p>{{ item.fname }}</p>
		        	</div>
		        	<div class="col-md-4">
		        		<div class="pull-right">
			        		<button data-comment="{{ item.kodoper }}, {{ item.schname }}, {{ item.specname }}" class="btn btn-outline-secondary btn-uslugi collapse-item__btn" type="button" data-controller="uslugi">Записаться</button>
		        		</div>
		        	</div>
		        </div>
		    </div>
    	{% endif %}
	{% endfor %}

	<div class="d-block text-center">
        {{ knp_pagination_render(pagination) }}
    </div>
</div>
{% endblock %}