diff --git a/CONTROL/control b/CONTROL/control
index cf14d77..9f4847e 100644
--- a/CONTROL/control
+++ b/CONTROL/control
@@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
-Version: 0.6.8-3
+Version: 0.6.9
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.3),hmt(>=1.0.6),ssmtp
diff --git a/var/mongoose/cgi-bin/channel.jim b/var/mongoose/cgi-bin/channel.jim
new file mode 100755
index 0000000..cf54933
--- /dev/null
+++ b/var/mongoose/cgi-bin/channel.jim
@@ -0,0 +1,113 @@
+#!/mod/bin/jimsh
+
+package require cgi
+package require sqlite3
+source /mod/var/mongoose/lib/setup
+require altrow progressbar epg.class
+
+puts "Content-Type: text/html"
+puts ""
+
+header
+
+cgi_input
+
+proc f2c {frequency} {
+ set ch int($((($frequency / 1000) - 303.25) / 8))
+ return [expr int($ch)]
+}
+
+if {[catch {set db [sqlite3.open /var/lib/humaxtv/channel.db]} msg]} {
+ puts "Error opening channel database: $msg"
+ exit
+}
+
+puts "
+ Expand All
+ Collapse All
+
+
+
+ Channel
+ Frequency
+ Signal Strength
+ Signal Quality
+ Channels
+
+"
+foreach tw [$db query {
+ select tsIdx, usTsID, ulFrequency, ucLevel, ucQuality
+ from TBL_TS
+ order by ulFrequency
+ }] {
+ lassign $tw x tsIdx x usTsID x ulFrequency x ucLevel x ucQuality
+
+ altrow
+ puts "
+ [f2c $ulFrequency]
+ [expr $ulFrequency / 1000.0] MHz
+ "
+ puts "[progressbar $ucLevel] "
+ puts "[progressbar $ucQuality] "
+
+ set channels [$db query {
+ select usLcn, szSvcName, szPrvName, aucDefaultAuthority
+ from TBL_SVC left join TBL_PRV using (prvIdx)
+ where tsIdx = %s
+ order by usLcn
+ } $tsIdx]
+ puts "[llength $channels]
+
+
+ view
+ "
+ puts ""
+ puts "
+ "
+ puts ""
+ puts "
+ Channel
+ Provider
+ Authority
+ "
+ foreach chan $channels {
+ lassign $chan x lcn x name x prv x auth
+ set name [string range $name 1 end]
+ set prv [string range $prv 3 end]
+ altrow
+ puts ""
+ puts "[epg channelicon $name 50]
+ $lcn $name "
+ puts ""
+ puts $prv
+ puts " "
+ puts $auth
+ puts " "
+ puts ""
+ }
+ puts "
"
+ puts " "
+}
+
+puts "
"
+
+puts {
+
+}
+
diff --git a/var/mongoose/cgi-bin/db.jim b/var/mongoose/cgi-bin/db.jim
index 4149264..b0a429b 100755
--- a/var/mongoose/cgi-bin/db.jim
+++ b/var/mongoose/cgi-bin/db.jim
@@ -8,6 +8,14 @@ require altrow
puts "Content-Type: text/html"
puts ""
+set databases {
+ /var/lib/humaxtv/rsvp.db
+ /var/lib/humaxtv/rsv.db
+ /var/lib/humaxtv/setup.db
+ /var/lib/humaxtv/channel.db
+ /mnt/hd2/dms_cds.db
+}
+
header
cgi_input
@@ -62,11 +70,16 @@ proc db_info {db_file} {
$db close
}
-db_info /var/lib/humaxtv/rsvp.db
-db_info /var/lib/humaxtv/rsv.db
-db_info /var/lib/humaxtv/setup.db
-db_info /var/lib/humaxtv/channel.db
-db_info /mnt/hd2/dms_cds.db
+if {$fdb == 0} {
+ puts "Please choose database to view:"
+ foreach db $databases {
+ puts "
+ $db "
+ }
+ puts " "
+} else {
+ foreach db $databases { db_info $db }
+}
footer
diff --git a/var/mongoose/html/index.shtml b/var/mongoose/html/index.shtml
index 6c8f2b1..2e9d552 100644
--- a/var/mongoose/html/index.shtml
+++ b/var/mongoose/html/index.shtml
@@ -111,6 +111,8 @@ $(document).ready(function() {