webif/var/mongoose/html/m/schedule.jim
hummypkg 0a2c7966b5 checkpoint
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1182 2a923420-c742-0410-a762-8d5b09965624
2012-10-30 18:58:54 +00:00

86 lines
1.9 KiB
Plaintext
Executable File

#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require epg.class
proc eventtab {type title} {
set events [rsv list $type]
if {[set num [llength $events]] <= 0} return
puts "<li data-role=list-divider>$title ($num)</li>\n";
foreach event $events {
set name [$event name]
set rsvicon [$event icon]
set RKIcon [$event RKIcon]
set icons ""
if {$type eq "pending"} {
switch [$event get action] {
0 { set icon "add" }
1 { set icon "close" }
2 { set icon "ar" }
3 { set icon "pad" }
4 { set icon "folder" }
}
append icons "<img src=/img/$icon.png height=30>"
}
if {$rsvicon ne ""} {
append icons "<img src='/images/$rsvicon' height=20>"
}
if {$RKIcon ne ""} {
append icons "<img src='/images/$RKIcon' height=20>"
}
set s [$event get nsttime]
set d [$event get nduration]
set e $($s + $d)
set n [clock seconds]
set recording 0
if {$d > 0 && $n > $s && $n < $e} {
set recording 1
}
set last "[clock format $s -format {%a %d %b %Y %H:%M %Z}]"
if {$n > $e && [$event get ersvtype] <= 3} {
set ds "--- -- --- ---- --:--"
set dur "--:--:--<br>
<span class=blood>(Last: $last)</span>"
} else {
set ds $last
set dur "[clock format [$event get nduration] \
-format %T]"
}
puts "
<li><a data-rel=dialog data-transition=slidedown
href=schedule_d.jim?table=$type&slot=[$event get ulslot]>
[epg channelicon [$event channel_name] 80]
<h3>$icons $name</h3>
<p>
$ds $dur
</p>
";
if {$recording} {
set perc $(($n - $s) * 100 / $d)
puts "<p class=va>
<img class=va src=/images/745_1_11_Video_1REC.png>
[progressbar $perc]
</p>
"
}
puts "</a></li>";
}
}
mheader
puts "<ul data-role=listview data-filter=true>"
eventtab "pending" "Pending Events"
eventtab "TBL_RESERVATION" "Active Events"
puts "</ul>"
mfooter