<style>
    .h3
    {
        display: block;
        height: 18.1875px;
        margin: 16.9px 0;
        width: 100%; /* Or 1639px, if a fixed width is required */
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
        font-size: 16.9px;
        font-weight: 600;
        line-height: 18.2px;
        color: rgb(29, 35, 39);
        -webkit-font-smoothing: subpixel-antialiased;
        unicode-bidi: isolate;
    }
</style>
<h3 id="results-heading">Please select your Google Business from the Results:</h3>
<form method="POST" action="" id="place-selection-form">
    <input type="hidden" name="selected_place_id" id="selected_place_id">
    <input type="hidden" name="business_name" value="<?php echo htmlspecialchars($_POST['business_name']); ?>">
    <table class="table table-striped" id="results-table" style="border: 1px solid #dee2e6; margin: 20px 0;">
        <thead>
            <tr>
                <th>Business Name</th>
                <th>Address</th>
            </tr>
        </thead>
        <tbody>
            <?php
            foreach ($this->candidates as $candidate)
            {
                if (isset($candidate['place_id']))
                {
                    $placeId = $candidate['place_id'];
                    $details = $this->get_place_details($placeId);
                    ?>
                    <tr style="cursor: pointer;" onclick="selectPlace('<?php echo $placeId; ?>')">
                        <td><?php echo htmlspecialchars($details['name']); ?></td>
                        <td><?php echo htmlspecialchars($details['formatted_address']); ?></td>
                    </tr>
                    <?php
                }
            }
            ?>
        </tbody>
    </table>
</form>
<script>
    function selectPlace(placeId)
    {
        document.getElementById('selected_place_id').value = placeId;
        document.getElementById('place-selection-form').submit();
    }
</script>