}
foreach ($_POST['client_car'] as $key => $value) {
    if (empty($value['make'])) {
        $errors++;
        $issues[] .= 'Please enter car no. ' . $key . ' make';
    }
    if (empty($value['registration'])) {
        $errors++;
        $issues[] .= 'Please enter car no. ' . $key . ' registration';
    }
}
if ($errors === 0) {
    // if it's all ok insert data into database
    $data = array('client_name' => $client_fname . ' ' . $client_lname, 'client_username' => $client_username, 'client_password' => $client_password, 'client_salt' => $client_salt, 'client_email' => $client_email, 'client_phone' => $client_phone);
    $Clients = new Clients();
    if ($Clients->addClient($data) === true) {
        // if client was added, add the cars too
        foreach ($_POST['client_car'] as $car) {
            $data = array('ccar_make' => $car['make'], 'ccar_registration' => $car['registration']);
            $Clients->addClientCar($data, $Clients->_LastId);
        }
        echo '<div class="alert alert-success">Client <strong>' . $client_fname . ' ' . $client_lname . '</strong> was added (no redirect for debug purposes)</div>';
    } else {
        echo '<div class="alert alert-danger">Could not reach database</div>';
    }
} else {
    echo '<div class="alert alert-danger">';
    echo '<div><strong>Correct the following errors:</strong></div>';
    foreach ($issues as $issue) {
        echo '<div>' . $issue . '</div>';
    }