#!/mod/bin/jimsh package require cgi source /mod/webif/lib/setup require altrow rsv.class progressbar epg.class system.class puts "Content-Type: text/html" puts "" set svcmap {} lmap i \ [$::channeldb query {select hSvc, usSvcid from TBL_SVC}] \ { set svcmap([lindex $i 1]) [lindex $i 3] } header require epg_popup puts {
} proc eventheader {{table TBL_RESERVATION} note} { puts {
} puts "

$note

" puts {
} if {$table eq "pending" } { puts "" } puts { } } proc eventrow {event {table TBL_RESERVATION} {pending 0}} { global svcmap set name [$event name] set attrs "table=$table sid=[$event get ulslot] \ reckind=[$event get ucRecKind] rsvtype=[$event get ersvtype] \ ar=[expr ! [$event padded]]" if {$pending} { append attrs " class=\"blueshade strike\"" } altrow $attrs if {$table eq "pending"} { puts "" } puts "" if {[$event get usLcn] ne ""} { puts " " } else { puts "" } puts "" set s [$event get nsttime] set d [$event get nduration] set e $($s + $d) set n [clock seconds] if {$n > $e && [$event get ersvtype] <= 3} { set ds "[clock format $s -format {%a %d %b %Y %H:%M}]" puts "" } else { set elist [$event aul] set ds "[clock format $s -format {%a %d %b %Y %H:%M}]" puts "" } puts "" puts "" puts "" } proc eventfooter {} { puts "
Action  Channel Programme Start Time Duration Mode
[$event pendingicon][$event get ulslot] [epg channelicon [$event channel_name] 50] [$event get usLcn]
[$event channel_name]
 

  $name" if { ([$event get ucRecKind] == 4 && $name ne [$event folder]) || ([$event get ucRecKind] == 1 && [$event folder] ne "") } { puts "
 (Folder: [$event folder])" } puts "
--- -- --- ---- --:--
(Last: $ds)" puts "
--:--:-- $e} { puts " blood" } puts "\">" if {[llength $elist] > 0} { lassign [lindex $elist 0] service_id start end event_id if {$start == $s} { puts " $ds" } else { puts $ds } } else { puts $ds } if {$d > 0 && $n > $s && $n < $e} { puts "
" set perc [expr [expr $n - $s] * 100 / $d] puts "" puts [progressbar $perc] } if {[llength $elist] > 1} { puts "
" foreach e $elist { lassign $e service_id start end event_id if {$start == $s} continue puts " [clock format $start \ -format {%a %d %b %Y %H:%M}]
" } puts "
"; } puts "
" set xndur [$event get nduration] if {$xndur > 0} { puts "[clock format $xndur -format %H:%M]" } else { puts "--:--:--" } if {[llength $elist] > 1} { puts "
" foreach e $elist { lassign $e service_id start end event_id if {$start == $s} continue puts "[clock format $($end - $start) \ -format {%H:%M}]
" } puts "
"; } puts "
[join [$event iconset] ""]
" } proc ekey {event} { set ret "" foreach key {ersvtype nsttime nduration hsvc usevtid} { append ret ".[$event get $key]" } return $ret } set pmap {} set events [rsv list pending] if {[llength $events] > 0} { eventheader pending "Pending Scheduled Events" foreach event $events { eventrow $event pending lappend pmap [ekey $event] } eventfooter puts { } } set events [rsv list] eventheader "live" "Scheduled Events" foreach event $events { if {[ekey $event] in $pmap} { eventrow $event TBL_RESERVATION 1 } else { eventrow $event } } eventfooter puts {
} source assets.jim footer