1
0
mirror of https://github.com/mbirth/tcl_update_db.git synced 2024-11-09 23:06:45 +00:00
tcl_update_db/index_main.php

76 lines
2.4 KiB
PHP
Raw Normal View History

2017-12-16 17:17:57 +00:00
<!DOCTYPE html>
<html>
<head>
2017-12-28 23:46:12 +00:00
<title>BlackBerry/TCL Firmware List</title>
<link rel="stylesheet" href="node_modules/material-components-web/dist/material-components-web.css"/>
<link rel="stylesheet" href="assets/material-icons.css"/>
<link rel="stylesheet" href="assets/style.css"/>
2017-12-16 17:17:57 +00:00
</head>
2017-12-28 23:46:12 +00:00
<body class="mdc-typography">
<header class="mdc-toolbar mdc-toolbar--fixed">
<div class="mdc-toolbar__row">
<section class="mdc-toolbar__section mdc-toolbar__section--align-start">
<span class="mdc-toolbar__title">BlackBerry/TCL Firmware List</span>
</section>
</div>
</header>
<main>
<div class="mdc-toolbar-fixed-adjust"></div>
2017-12-16 17:17:57 +00:00
<?php
require_once __DIR__ . '/lib/autoloader.php';
use \TclUpdates\SQLiteReader;
$db = new SQLiteReader();
$allVars = $db->getAllVariants();
2017-12-16 18:42:24 +00:00
$unknowns = $db->getUnknownRefs();
if (count($unknowns) > 0) {
$variants = array();
foreach ($unknowns as $uref) {
$variants[$uref] = '';
}
$allVars['Unknown'] = array(
'Variants' => $variants,
);
}
2017-12-16 17:17:57 +00:00
foreach ($allVars as $family => $models) {
foreach ($models as $model => $variants) {
echo '<h2>' . $family . ' ' . $model . '</h2>' . PHP_EOL;
2017-12-16 18:42:24 +00:00
$allVersions = $db->getAllVersionsForModel($model);
echo '<table><tbody>';
2017-12-16 17:17:57 +00:00
foreach ($variants as $ref => $name) {
2017-12-17 18:57:39 +00:00
echo '<tr><td class="ref">';
if (mb_strlen($name) > 0) {
echo '<abbr title="' . $name . '">' . $ref . '</abbr>';
} else {
echo $ref;
}
echo '</td>';
2017-12-16 18:42:24 +00:00
$refVersions = $db->getAllVersionsForRef($ref);
$allOta = $db->getAllVersionsForRef($ref, $db::OTA_ONLY);
2017-12-16 18:42:24 +00:00
foreach ($allVersions as $v) {
if (in_array($v, $refVersions, true)) {
if (in_array($v, $allOta)) {
echo '<td>' . $v . '</td>';
} else {
echo '<td class="fullonly mdc-theme--secondary-dark">' . $v . '</td>';
}
2017-12-16 18:42:24 +00:00
} else {
2017-12-16 19:17:11 +00:00
echo '<td class="empty">- - -</td>';
2017-12-16 18:42:24 +00:00
}
}
echo '</tr>' . PHP_EOL;
2017-12-16 17:17:57 +00:00
}
2017-12-16 18:42:24 +00:00
echo '</tbody></table>';
2017-12-16 17:17:57 +00:00
}
}
?>
2017-12-28 23:46:12 +00:00
</main>
<script src="node_modules/material-components-web/dist/material-components-web.js"></script>
<script>window.mdc.autoInit()</script>
2017-12-16 17:17:57 +00:00
</body>
</html>