<?php

global $Bootstrap;
$this->start('clients_list');
$Clients = new Clients();
// check if the query is ok
if ($Clients->listClients() === true) {
    $client_no = 1;
    // check if query returned results
    if (empty($Clients->_Data)) {
        // if query did not return results inform the user
        echo '
				<tr>
					<td colspan="9" align="center">
						<div class="alert alert-info">No clients in the database</div>
					</td>
				</tr>';
    } else {
        // if query return results show them in the table
        foreach ($Clients->_Data as $client) {
            echo '
					<tr>
						<td>' . $client_no++ . '</td>
						<td>' . $client['client_name'] . '</td>
						<td>' . $client['client_email'] . '</td>
						<td>' . $client['client_phone'] . '</td>
						<td>' . $client['client_cars'] . '</td>
						<td>' . date('dS \\o\\f M Y', strtotime($client['client_date_registered'])) . '</td>
						<td width="1"><a href="#" class="btn btn-warning btn-xs"><i class="fa fa-pencil-square"></i></a></td>
						<td width="1"><a href="#" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></a></td>
						<td width="1"><a href="#" class="btn btn-info btn-xs"><i class="fa fa-car"></i></a></td>