{block content}
	{var $showSum = 0}
	<div class="span12">
		<div class="box-content">
			<div class="filter">
				{form filterForm, class => 'form-inline'}
					<i class="icon-search fs20"></i>&nbsp;{input search, class => 'input-large'}&nbsp;&nbsp;
					<i class="icon-truck fs20"></i>&nbsp;{input driver, class => 'input-medium'}&nbsp;&nbsp;
					<i class="icon-user fs20"></i>&nbsp;{input expedition, class => 'input-medium'}&nbsp;&nbsp;{input submit}
					<a n:href="add" class="btn btn-primary" style="float: right;">
						<i class="icon-plus icon-white"></i>&nbsp;Vytvořit nového zákazníka
					</a>
				{/form}

				<div class="clear"></div>
			</div>

			<div n:foreach="$flashes as $flash" class="alert alert-{$flash->type}">{$flash->message}</div>

			<div class="alert alert-info alert-no-margin" n:if="$customersSum <= 0">
				Nic nebylo nalezeno, zkuste jiné nastavení filtru.
			</div>

			<table class="table table-striped" n:if="$customersSum > 0">
				<thead>
					<tr>
						<th>Id&nbsp;<a n:href='this, orderBy => id, orderWay => asc' class="order"><i class='icon-circle-arrow-up'></i></a>&nbsp;<a n:href='this, orderBy => id, orderWay => desc' class="order"><i class='icon-circle-arrow-down'></i></a></th>
						<th>Název&nbsp;<a n:href='this, orderBy => name, orderWay => asc' class="order"><i class='icon-circle-arrow-up'></i></a>&nbsp;<a n:href='this, orderBy => name, orderWay => desc' class="order"><i class='icon-circle-arrow-down'></i></a></th>
						<th>Jméno&nbsp;/&nbsp;Firma&nbsp;<a n:href='this, orderBy => contact_name, orderWay => asc' class="order"><i class='icon-circle-arrow-up'></i></a>&nbsp;<a n:href='this, orderBy => contact_name, orderWay => desc' class="order"><i class='icon-circle-arrow-down'></i></a></th>
						<th>Město&nbsp;<a n:href='this, orderBy => city, orderWay => asc' class="order"><i class='icon-circle-arrow-up'></i></a>&nbsp;<a n:href='this, orderBy => city, orderWay => desc' class="order"><i class='icon-circle-arrow-down'></i></a></th>
						<th>Řidič&nbsp;<a n:href='this, orderBy => nameDriver, orderWay => asc' class="order"><i class='icon-circle-arrow-up'></i></a>&nbsp;<a n:href='this, orderBy => nameDriver, orderWay => desc' class="order"><i class='icon-circle-arrow-down'></i></a></th>
						<th>Expedice&nbsp;<a n:href='this, orderBy => nameExpedition, orderWay => asc' class="order"><i class='icon-circle-arrow-up'></i></a>&nbsp;<a n:href='this, orderBy => nameExpedition, orderWay => desc' class="order"><i class='icon-circle-arrow-down'></i></a></th>
						<th>Stav&nbsp;<a n:href='this, orderBy => state, orderWay => desc' class="order"><i class='icon-circle-arrow-up'></i></a>&nbsp;<a n:href='this, orderBy => state, orderWay => asc' class="order"><i class='icon-circle-arrow-down'></i></a></th>
					</tr>
				</thead>

				<tbody>
					<tr n:foreach="$customers as $detail">
						{var $showSum = ($showSum + 1)}
						<td>{$detail->id}</td>
						<td style="font-weight: bold;">
							<a n:href="detail, id => $detail->id">{$detail->name}</a>
						</td>
						<td>{$detail->contact_name}</td>
						<td>{$detail->city}</td>
						<td><i class="icon-truck"></i>&nbsp;{$detail->nameDriver}</td>
						<td><i class="icon-user"></i>&nbsp;{$detail->nameExpedition}</td>
						<td>
							{if $detail->state == \App\Models\CustomerModel::STATE_ACTIVE}
								<span class="label label-success">Aktivní</span>
							{else}
								<span class="label label-important">Neaktivní</span>
							{/if}
						</td>
					</tr>
				</tbody>
			</table>

			<table style="width: 100%;">
				<tr>
					<td style="width: 85%;">
						{control VisualPaginator}
					</td>
					<td style="text-align: right;">
						<span>{$showSum|plural:'Zobrazen','Zobrazeny','Zobrazeno'}&nbsp;{$showSum}&nbsp;ze&nbsp;{$customersSum}&nbsp;{$customersSum|plural:'záznam','záznamy','záznamů'}.</span>
					</td>
				</tr>
			</table>
		</div>
	</div>
