/**
  * Get count of  displays
  *
  *
  * @param int $type type 1 is external, type 0 is internal
  **/
 public function get_count($type = 1)
 {
     $obj = new View();
     if (!$this->authorized()) {
         $obj->view('json', array('msg' => array('error' => 'Not authenticated')));
         return;
     }
     $dim = new Displays_info_model();
     $obj->view('json', array('msg' => $dim->get_count($type)));
 }
<?php

$display = new Displays_info_model();
$sql = "SELECT *\n\t\t\t\t\tFROM displays\n\t\t\t\t\tWHERE serial_number = '{$serial_number}'\n\t\t\t\t\tORDER BY type";
?>

	<h2>Displays</h2>
		<?php 
foreach ($display->query($sql) as $obj) {
    ?>
			<span class="label label-success nw-displayscount"></span>
			<table class="table table-striped">
				<thead>
					<tr>
						<th>
							<?php 
    switch ($obj->vendor) {
        case "610":
            echo "Apple";
            break;
        case "10ac":
            echo "Dell";
            break;
        case "5c23":
            echo "Wacom";
            break;
        case "4d10":
            echo "Sharp";
            break;
        case "1e6d":
            echo "LG";