2011-06-07 13:26:45 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
2011-06-29 22:53:15 +00:00
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2014-02-23 22:22:07 +00:00
|
|
|
require epg.class spinner.class altrow epg_search system.class
|
|
|
|
|
|
|
|
noheader
|
|
|
|
|
|
|
|
require totop
|
2013-09-07 22:13:03 +00:00
|
|
|
|
|
|
|
set irinst [system pkginst ir]
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-06-08 23:33:35 +00:00
|
|
|
[spinner new {
|
2011-06-29 22:53:15 +00:00
|
|
|
text "Loading Now/Next Information..."
|
2011-06-08 23:33:35 +00:00
|
|
|
size "1.2em"
|
|
|
|
style "margin: 1em;"
|
|
|
|
}] start
|
|
|
|
|
2011-07-01 22:56:53 +00:00
|
|
|
require epg_popup
|
2011-06-08 23:33:35 +00:00
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
set start [clock milliseconds]
|
2011-09-29 23:22:02 +00:00
|
|
|
set now [clock seconds]
|
2011-10-03 09:37:24 +00:00
|
|
|
set then $($now + 14400)
|
2014-02-23 22:22:07 +00:00
|
|
|
set s [settings]
|
|
|
|
set favgroup [$s channel_group]
|
2011-09-29 23:22:02 +00:00
|
|
|
if {$::qepg} {
|
2012-05-30 19:51:20 +00:00
|
|
|
if {$favgroup} {
|
|
|
|
set records [epg dbfetch dump \
|
|
|
|
-trange "$now:$then" -fav $favgroup]
|
|
|
|
} else {
|
|
|
|
set records [epg dbfetch dump -trange "$now:$then"]
|
|
|
|
}
|
2011-09-29 23:22:02 +00:00
|
|
|
} else {
|
|
|
|
require channelsort
|
|
|
|
set records [channelsort [epg fetch dump -trange "$now:$then"]]
|
|
|
|
}
|
2011-06-07 13:26:45 +00:00
|
|
|
set got [clock milliseconds]
|
|
|
|
|
2014-02-23 22:22:07 +00:00
|
|
|
if {[$s chanchangenc]} {
|
2014-02-21 21:25:33 +00:00
|
|
|
jscss /js/chanchangeenc.js
|
2013-09-18 17:54:33 +00:00
|
|
|
} else {
|
|
|
|
jqplugin confirmAction
|
2014-02-21 21:25:33 +00:00
|
|
|
jscss /js/chanchange.js
|
2013-09-18 17:54:33 +00:00
|
|
|
}
|
2011-06-14 11:48:55 +00:00
|
|
|
|
2014-02-23 22:22:07 +00:00
|
|
|
if {[$s service_style] eq "standard"} {
|
|
|
|
set surl xservice
|
|
|
|
} else {
|
|
|
|
set surl service
|
|
|
|
}
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
puts {
|
2011-10-03 09:37:24 +00:00
|
|
|
<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>
|
2011-06-07 13:26:45 +00:00
|
|
|
<table class=borders>
|
|
|
|
<tr>
|
2011-06-09 21:16:30 +00:00
|
|
|
<th colspan=3>Channel</th>
|
2011-06-07 13:26:45 +00:00
|
|
|
<th>On Now</th>
|
|
|
|
<th>On Next</th>
|
2011-09-29 23:22:02 +00:00
|
|
|
<th>On Later</th>
|
2011-06-07 13:26:45 +00:00
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
|
2011-09-29 23:22:02 +00:00
|
|
|
set lcn 0
|
|
|
|
set num 0
|
2011-06-14 11:48:55 +00:00
|
|
|
foreach record $records {
|
2011-09-29 23:22:02 +00:00
|
|
|
set chnum [$record get channel_num]
|
|
|
|
if {$chnum == 0} { continue }
|
|
|
|
|
|
|
|
if {$chnum != $lcn} {
|
|
|
|
if {$lcn > 0} { puts "</tr>" }
|
|
|
|
altrow
|
|
|
|
puts "<td>$chnum</td>"
|
2013-09-07 22:13:03 +00:00
|
|
|
puts "<td>"
|
|
|
|
if {$irinst} {
|
|
|
|
puts "<a class=chanchange chan=$chnum href=#>"
|
|
|
|
}
|
|
|
|
puts "[$record channel_icon 50]"
|
|
|
|
if {$irinst} { puts "</a>" }
|
|
|
|
puts "</td>
|
2011-09-29 23:22:02 +00:00
|
|
|
<td>
|
2014-02-23 22:22:07 +00:00
|
|
|
<a href=\"/epg/$surl.jim?service=[\
|
2013-06-24 21:34:46 +00:00
|
|
|
$record get service_id]\">
|
2011-09-29 23:22:02 +00:00
|
|
|
[$record get channel_name]
|
|
|
|
</a></td>"
|
|
|
|
set lcn $chnum
|
|
|
|
set num 0
|
|
|
|
}
|
|
|
|
incr num
|
|
|
|
if {$num < 4} {
|
|
|
|
catch { puts [$record cell] }
|
2011-06-16 03:10:41 +00:00
|
|
|
}
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
2011-09-29 23:22:02 +00:00
|
|
|
if {$lcn > 0} { puts "</tr>" }
|
2011-06-07 13:26:45 +00:00
|
|
|
puts "</table>"
|
|
|
|
|
2011-06-14 11:48:55 +00:00
|
|
|
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>
|
|
|
|
"
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
set end [clock milliseconds]
|
|
|
|
puts "<font class=footnote>
|
2011-06-14 11:48:55 +00:00
|
|
|
Retrieved in: [expr [expr $got - $start] / 1000.0] seconds.
|
|
|
|
Rendered in: [expr [expr $end - $start] / 1000.0] seconds.
|
2011-06-07 13:26:45 +00:00
|
|
|
</font>"
|
|
|
|
|
|
|
|
epg cleanup
|
|
|
|
|