<section class="container">
	<?php if (isset($table)): ?>
	<div class="row">
		<div class="col-xs-12 table-responsive">
			<table width="100%">
				<?php if (isset($table['header'])): ?>
					<thead>
						<tr>
							<th class="tac">#</th>
							<?php foreach ($table['header'] as $header): ?>
								<th><?php echo $header; ?></th>
							<?php endforeach; ?>
						</tr>
					</thead>
				<?php endif; ?>
				<?php if (isset($table['body'])): ?>
					<tbody>
						<?php $row = 0; foreach ($table['body'] as $data): if (is_object($data)) $data = get_object_vars($data); ?>
							<tr>
								<td class="tac"><?php echo ++$row; ?></td>
								<?php $index = 0; foreach ($data as $key => $value): ?>
									<td>
										<?php 
											if (is_string($value)) {
												echo nl2br($value);
											} else { 
												if (is_array($value)){
													echo "<ul>";

													foreach ($value as $detail){
														echo "<li>".$detail['id'].' : '.$detail['title']." [".$detail['company_name']."]</li>";
													}

													echo "</ul>";

												} else {
													echo "-";
												}
											}
										?>
									</td>
								<?php endforeach; ?>
							</tr>
						<?php endforeach; ?>
					</tbody>
				<?php endif; ?>
			</table>
		</div>
	</div><br>
	<?php endif; ?>
</section>
