diff --git a/assets/style.css b/assets/style.css index 1d98c7c..898b381 100755 --- a/assets/style.css +++ b/assets/style.css @@ -22,3 +22,7 @@ td.empty { tr:hover { background-color: #ddd; } + +td.fullonly { + color: #88f; +} diff --git a/index_main.php b/index_main.php index be10c4d..b5526a7 100755 --- a/index_main.php +++ b/index_main.php @@ -33,9 +33,14 @@ foreach ($allVars as $family => $models) { foreach ($variants as $ref => $name) { echo '' . $ref . ''; $refVersions = $db->getAllVersionsForRef($ref); + $allOta = $db->getAllVersionsForRef($ref, $db::OTA_ONLY); foreach ($allVersions as $v) { if (in_array($v, $refVersions, true)) { - echo '' . $v . ''; + if (in_array($v, $allOta)) { + echo '' . $v . ''; + } else { + echo '' . $v . ''; + } } else { echo '- - -'; } diff --git a/lib/TclUpdates/SQLiteReader.php b/lib/TclUpdates/SQLiteReader.php index b2e8156..b905ba8 100644 --- a/lib/TclUpdates/SQLiteReader.php +++ b/lib/TclUpdates/SQLiteReader.php @@ -117,14 +117,23 @@ class SQLiteReader return $result; } - public function getAllVersionsForRef($ref = null) + public function getAllVersionsForRef($ref = null, $which = self::BOTH) { $sql = 'SELECT fv, tv FROM updates u LEFT JOIN files f ON u.file_sha1=f.sha1'; + $where_arr = array(); $params_arr = array(); if (!is_null($ref)) { - $sql .= ' WHERE curef=?'; + $where_arr[] = 'curef=?'; $params_arr[] = $ref; } + if ($which == self::OTA_ONLY) { + $where_arr[] = 'fv IS NOT null'; + } elseif ($which == self::FULL_ONLY) { + $where_arr[] = 'fv IS null'; + } + if (count($where_arr) > 0) { + $sql .= ' WHERE ' . implode(' AND ', $where_arr); + } $stmt = $this->pdo->prepare($sql); $ok = $stmt->execute($params_arr); $result = $stmt->fetchAll(\PDO::FETCH_ASSOC);