} else {
        $uns = $objunidad->listDB();
    }
} else {
    $uns = $objunidad->listDB();
}
if (is_array($uns)) {
    foreach ($uns as $u) {
        echo "<tr>";
        echo "<td>" . $u["placa"] . "</td>";
        $unidades[] = $u["placa"];
        $objtu = new tipo_unidad();
        $objtu->setId($u["id_tipo_unidad"]);
        $objtu->getDB();
        echo "<td>" . $objtu->getNombre() . "</td>";
        $peso_minimo = $objtu->getCargaMinima();
        $peso_maximo = $objtu->getCargaMaxima();
        $sql = "Select count(*) as cnt from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id" . $sql_where . " AND cv.id_unidad = '" . $u["id"] . "' AND r.peso_neto < '" . $peso_minimo . "'";
        $c_sub = $objtu->consulta_arreglo($sql);
        $c_nor = $objtu->consulta_arreglo("Select count(*) as cnt from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id" . $sql_where . " AND cv.id_unidad = '" . $u["id"] . "' AND r.peso_neto BETWEEN '" . $peso_minimo . "' AND '" . $peso_maximo . "'");
        $c_sob = $objtu->consulta_arreglo("Select count(*) as cnt from registro r, configuracion_vehiculo cv, unidad u where r.id_configuracion_vehiculo = cv.id AND cv.id_unidad = u.id" . $sql_where . " AND cv.id_unidad = '" . $u["id"] . "' AND r.peso_neto > '" . $peso_maximo . "'");
        $col1 = $col1 + intval($c_sub["cnt"]);
        $col2 = $col2 + intval($c_nor["cnt"]);
        $col3 = $col3 + intval($c_sob["cnt"]);
        $subcargas[] = intval($c_sub["cnt"]);
        $normales[] = intval($c_nor["cnt"]);
        $sobrecargas[] = intval($c_sob["cnt"]);
        echo "<td>" . intval($c_sub["cnt"]) . "</td>";
        echo "<td>" . intval($c_nor["cnt"]) . "</td>";
        echo "<td>" . intval($c_sob["cnt"]) . "</td>";
        echo "</tr>";