{if isset($filter) && !empty($filter) && $filter eq true}

	<form action="{$url}" method="post">
		<div class="card-header bg-light py-2 d-sm-flex align-items-sm-center">
			<div class="mb-0">
				<div class="input-group">
					<input type="text" class="form-control" name="query" value="{if isset($query)}{$query}{/if}" autocomplete="off" placeholder="{products:general:searchByName}">
					<button type="submit" class="btn btn-sm btn-primary"><i class="icon-search4 me-2"></i>{general:search}</button>
				</div>
			</div>

			<div class="ms-sm-auto">
				<ul class="list-inline list-inline-condensed mb-0">
					<li class="list-inline-item">
						<div class="input-group">
							{if isset($sections) && !empty($sections)}
								{html_options options=$sections selected=$sctn|default:'' name="sctn" class="form-control select" onchange="this.form.submit()" data-width="250"}
							{/if}

                            {if isset($statuses) && !empty($statuses)}
                                {html_options options=$statuses selected=$sts|default:'' name="sts" class="form-control select" onchange="this.form.submit()" data-width="160"}
                            {/if}

							{if isset($filterDate) && !empty($filterDate)}
								<span class="input-group-text"><i class="icon-calendar3 mr-2"></i></span>
								<button type="button" class="btn btn-light daterange-predefined"> {$dateStart|date_format:"%Y-%m-%d"} - {$dateEnd|date_format:"%Y-%m-%d"}</button>
							{/if}
						</div>
{*                        {if isset($filterTypeId)}<input type="hidden" name="filterTypeId" value="{$filterTypeId}" />{/if}*}
						<input type="hidden" class="form-control" name="newDateStart" value="">
						<input type="hidden" class="form-control" name="newDateEnd" value="">
						<button class="btn btn-sm btn-primary daterange-btn" type="submit" style="display: none">{stats:show}</button>
					</li>
				</ul>
			</div>
		</div>
	</form>

{else}
	<form method="post" action="{$action}">
	<div class="card-header bg-light py-2 d-sm-flex align-items-sm-center">
		<div class="mb-0"></div>
		<div class="ms-sm-auto">
			<ul class="list-inline list-inline-condensed mb-0">
				<li class="list-inline-item text-muted">Выберите дату или временной период: </li>
				<li class="list-inline-item">
					<div class="input-group">
						{if isset($action) && !empty($action)}
							{if !empty($select) && $select eq 'errors'}
								{html_options options=$filterErrorCodeOptions selected=$filterErrorCode|default:"" name="filterErrorCode" onchange="this.form.submit()" class="form-control select" data-width="200"}
							{else}
								{html_options options=$filterTypeOptions selected=$filterTypeId|default:'' name="filterTypeId" onchange="this.form.submit()" class="form-control select" data-width="200"}
							{/if}
						{/if}


{*						{if isset($filterTypeId)}<input type="hidden" name="filterTypeId" value="{$filterTypeId}" />{/if}*}
						<span class="input-group-text"><i class="icon-calendar3 mr-2"></i></span>
						<button type="button" class="btn btn-light daterange-predefined"> {$dateStart|date_format:"%Y-%m-%d"} - {$dateEnd|date_format:"%Y-%m-%d"}</button>

					</div>
					<input type="hidden" class="form-control" name="newDateStart" value="">
					<input type="hidden" class="form-control" name="newDateEnd" value="">
					<button class="btn btn-sm btn-primary daterange-btn" type="submit" style="display: none">{stats:show}</button>
				</li>
			</ul>
		</div>
	</div>
	</form>
{/if}

<style>
    .daterangepicker.auto-apply .drp-buttons, .daterangepicker.single .drp-selected {
        display: none !important;
    }
</style>




