function outputBrandCounts($dbAdapter)
{
    $id = $_GET[brand_id];
    if (!empty($id) && is_numeric($id) && $id >= 1 && $id <= 12) {
        $gateBrand = new DeviceBrandTableGateway($dbAdapter);
        $result = $gateBrand->findBrandWithCountsById($id);
        echo '<table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
          <thead>
            <tr>
              <th class="mdl-data-table__cell--non-numeric">Device Brand</th>
              <th>Visits</th>
            </tr>
          </thead>
          <tbody>';
        echo '<tr>
              <td class="mdl-data-table__cell--non-numeric">' . $result->name . '</td>
              <td>' . $result->DeviceVisits . '</td>
              </tr>';
        echo '</tbody>
            </table>';
    } else {
        echo "<h2>Device brand does not exist</h2>";
    }
}
function outputBrandCounts($dbAdapter)
{
    $id = $_GET["brand_id"];
    if (!empty($id) && is_numeric($id) && $id >= 1 && $id <= 12) {
        $gateBrand = new DeviceBrandTableGateway($dbAdapter);
        $result = $gateBrand->findBrandWithCountsById($id);
        $visitCount = $result->DeviceVisits;
        echo json_encode($visitCount);
    }
}