mirror of
https://github.com/mbirth/tcl_update_db.git
synced 2024-11-09 23:06:45 +00:00
62 lines
1.7 KiB
PHP
Executable File
62 lines
1.7 KiB
PHP
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>BlackBerry/TCL Firmware List</title>
|
|
<link rel="stylesheet" href="assets/style.css"/>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
|
|
require_once __DIR__ . '/lib/autoloader.php';
|
|
|
|
use \TclUpdates\SQLiteReader;
|
|
|
|
$db = new SQLiteReader();
|
|
|
|
$allVars = $db->getAllVariants();
|
|
$unknowns = $db->getUnknownRefs();
|
|
if (count($unknowns) > 0) {
|
|
$variants = array();
|
|
foreach ($unknowns as $uref) {
|
|
$variants[$uref] = '';
|
|
}
|
|
$allVars['Unknown'] = array(
|
|
'Variants' => $variants,
|
|
);
|
|
}
|
|
|
|
foreach ($allVars as $family => $models) {
|
|
foreach ($models as $model => $variants) {
|
|
echo '<h2>' . $family . ' ' . $model . '</h2>' . PHP_EOL;
|
|
$allVersions = $db->getAllVersionsForModel($model);
|
|
echo '<table><tbody>';
|
|
foreach ($variants as $ref => $name) {
|
|
echo '<tr><td class="ref">';
|
|
if (mb_strlen($name) > 0) {
|
|
echo '<abbr title="' . $name . '">' . $ref . '</abbr>';
|
|
} else {
|
|
echo $ref;
|
|
}
|
|
echo '</td>';
|
|
$refVersions = $db->getAllVersionsForRef($ref);
|
|
$allOta = $db->getAllVersionsForRef($ref, $db::OTA_ONLY);
|
|
foreach ($allVersions as $v) {
|
|
if (in_array($v, $refVersions, true)) {
|
|
if (in_array($v, $allOta)) {
|
|
echo '<td>' . $v . '</td>';
|
|
} else {
|
|
echo '<td class="fullonly">' . $v . '</td>';
|
|
}
|
|
} else {
|
|
echo '<td class="empty">- - -</td>';
|
|
}
|
|
}
|
|
echo '</tr>' . PHP_EOL;
|
|
}
|
|
echo '</tbody></table>';
|
|
}
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|