<?php echo $this->partial('Layout/nav'); ?>

<div class="container-fluid">
	<div class="container-page-wrapper shodowed bordered">
		<div class="container-page-container">

			<?php //debug($this->view->centers); ?>

			<div class="row">
				<div class="col-lg-8">
					<h1><?php echo $this->actionTitle; ?></h1>
				</div>
				<div class="col-lg-4 clearfix">
					<div class="float-right">
						<div class="float-left margin-right-20">
							<!-- Other buttons... -->
						</div>
						<div class="float-right">
							<!-- Other buttons... -->
						</div>
					</div>
				</div>
			</div>

			<div class="table-overflow">
				<form id="table-search-users">
					<table class="table table-hover">
						<thead class="thead-light">
							<tr>
								<th nowrap><?php echo _('Name'); ?></th>
								<th nowrap><?php echo _('Continent'); ?></th>
								<th nowrap><?php echo _('Country'); ?></th>
								<th nowrap><?php echo _('Anonymize'); ?></th>
								<th nowrap><?php echo _('Notes'); ?></th>
								<th nowrap><?php echo _('Med. Spec.'); ?></th>
							</tr>
						</thead>

						<tbody>
							<?php if (!empty($this->view->centers)): ?>
								<?php foreach($this->view->centers as $centers): ?>
									<tr>
										<td><?php echo $centers['description']; ?></td>
										<td><?php echo $centers['continent_name']; ?></td>
										<td><?php echo $centers['country_name']; ?></td>
										<td class="text-center"><?php echo (int)$centers['anonymize'] == 1 ? _('Yes') : _('No'); ?></td>
										<td><?php echo $centers['notes']; ?></td>
										<td>
											<?php foreach($centers['specialties'] as $specialties): ?>
												<?php $badgeClass = $specialties['active'] ? 'light' : 'danger' ?>
												<?php echo '<span class="badge badge-'.$badgeClass.'">',  $specialties['description'], '</span>'; ?>
											<?php endforeach; ?>
										</td>
									</tr>
								<?php endforeach; ?>
							<?php endif; ?>
						</tbody>
					</table>
					<?php if (empty($this->view->centers)): ?>
						<div class="alert alert-warning" role="alert">
							<?php echo _('No data available in this list.'); ?>
						</div>
					<?php endif; ?>
				</form>
			</div>
	</div>
</div>
