forked from hummypkg/webif
3416d4e9e2
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1804 2a923420-c742-0410-a762-8d5b09965624
115 lines
2.2 KiB
Plaintext
Executable File
115 lines
2.2 KiB
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
package require cgi
|
|
source /mod/webif/lib/setup
|
|
require epg.class spinner.class altrow epg_search system.class
|
|
|
|
noheader
|
|
|
|
require totop
|
|
|
|
set irinst [system pkginst ir]
|
|
|
|
[spinner new {
|
|
text "Loading Now/Next Information..."
|
|
size "1.2em"
|
|
style "margin: 1em;"
|
|
}] start
|
|
|
|
require epg_popup
|
|
|
|
set start [clock milliseconds]
|
|
set now [clock seconds]
|
|
set then $($now + 14400)
|
|
set s [settings]
|
|
set favgroup [$s channel_group]
|
|
if {$::qepg} {
|
|
if {$favgroup} {
|
|
set records [epg dbfetch dump \
|
|
-trange "$now:$then" -fav $favgroup]
|
|
} else {
|
|
set records [epg dbfetch dump -trange "$now:$then"]
|
|
}
|
|
} else {
|
|
require channelsort
|
|
set records [channelsort [epg fetch dump -trange "$now:$then"]]
|
|
}
|
|
set got [clock milliseconds]
|
|
|
|
if {[$s chanchangenc]} {
|
|
jscss /js/chanchangeenc.js
|
|
} else {
|
|
jqplugin confirmAction
|
|
jscss /js/chanchange.js
|
|
}
|
|
|
|
if {[$s service_style] eq "standard"} {
|
|
set surl xservice
|
|
} else {
|
|
set surl service
|
|
}
|
|
|
|
puts {
|
|
<small><button id=switch>Switch to grid-style Now/Next</button></small>
|
|
<script type=text/javascript>
|
|
$('#switch').button().click(function() {
|
|
window.location = '/cgi-bin/xepg.jim'; });
|
|
</script>
|
|
<table class=borders>
|
|
<tr>
|
|
<th colspan=3>Channel</th>
|
|
<th>On Now</th>
|
|
<th>On Next</th>
|
|
<th>On Later</th>
|
|
</tr>
|
|
}
|
|
|
|
set lcn 0
|
|
set num 0
|
|
foreach record $records {
|
|
set chnum [$record get channel_num]
|
|
if {$chnum == 0} { continue }
|
|
|
|
if {$chnum != $lcn} {
|
|
if {$lcn > 0} { puts "</tr>" }
|
|
altrow
|
|
puts "<td>$chnum</td>"
|
|
puts "<td>"
|
|
if {$irinst} {
|
|
puts "<a class=chanchange chan=$chnum href=#>"
|
|
}
|
|
puts "[$record channel_icon 50]"
|
|
if {$irinst} { puts "</a>" }
|
|
puts "</td>
|
|
<td>
|
|
<a href=\"/epg/$surl.jim?service=[\
|
|
$record get service_id]\">
|
|
[$record get channel_name]
|
|
</a></td>"
|
|
set lcn $chnum
|
|
set num 0
|
|
}
|
|
incr num
|
|
if {$num < 4} {
|
|
catch { puts [$record cell] }
|
|
}
|
|
}
|
|
if {$lcn > 0} { puts "</tr>" }
|
|
puts "</table>"
|
|
|
|
puts "
|
|
<a href=/cgi-bin/settings.jim>
|
|
<img border=0 height=14 src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
|
Visit settings to change EPG options.
|
|
</a><br>
|
|
"
|
|
|
|
set end [clock milliseconds]
|
|
puts "<font class=footnote>
|
|
Retrieved in: [expr [expr $got - $start] / 1000.0] seconds.
|
|
Rendered in: [expr [expr $end - $start] / 1000.0] seconds.
|
|
</font>"
|
|
|
|
epg cleanup
|
|
|