#!/mod/bin/jimsh package require sqlite3 source /mod/var/mongoose/lib/altrow set db [sqlite3.open /var/lib/humaxtv/rsv.db] $db query {attach database '/var/lib/humaxtv/channel.db' as channel} set res [$db query { select *, channel.TBL_SVC.szSvcName, channel.TBL_SVC.usLcn, case when ersvtype > 3 then 1 else 0 end as sort from tbl_reservation left join channel.TBL_SVC on main.TBL_RESERVATION.hSvc = channel.TBL_SVC.hSvc order by sort, nsttime }] puts "" puts "" #puts "" puts "" puts "" puts "" puts "" puts "" puts "" puts "" foreach r $res { set name [string range $r(szevtname) 1 end] if {[string first "i7" $name] == 0} { set name [string range $name 2 end] set b "*" } else { set b "" } altrow set rsvicon "" set alta "" switch $r(ersvtype) { 1 { set rsvicon "175_1_00_Reservation_Watch.png" } 2 { set rsvicon "175_1_00_Reservation_Watch.png" } 3 { set rsvicon "175_1_11_Reservation_Record.png" } 5 { set rsvicon "745_1_10_Video_2Live.png"; set alta "Wake-up" } 6 { set rsvicon "745_1_11_Video_1REC.png"; set alta "Sleep" } 7 { set rsvicon "345_6_08_ST_Ad_Hoc.png" set alta "Auto Update" } default { set alta "Unknown type $r(ersvtype)" } } if {$name == ""} { set name "-- $alta --" } set series 0 if {$r(ucRecKind) == 4} { set RKIcon "175_1_11_Series_Record.png" set series 1 } else { switch $r(erepeat) { 1 {set RKIcon "521_1_00_RP_Daily_C.png"} 2 {set RKIcon "521_1_00_RP_Weekly_C.png"} 3 {set RKIcon "521_1_00_RP_Weekdays_C.png"} 4 {set RKIcon "521_1_00_RP_Weekend_C.png"} default {set RKIcon ""} } } if {$rsvicon ne ""} { set rsvicon " } if {$RKIcon ne ""} { set RKIcon " } # puts "" puts "" puts "" puts "" puts "" if { $r(nsttime) < [clock seconds] } { puts "" puts "" puts "" puts "" } puts "
SlotProgrammeDurationChannelDate/TimeModeEvent/Series ID
{$r(ulslot)}$b$name[clock format $r(nduration) -format %T]$r(usLcn)[string range $r(szSvcName) 1 end]" } else { puts "" } puts "[clock format $r(nsttime) -format {%c %Z}]$rsvicon $RKIcon" set crid [join [lrange [split $r(szCRID) "/"] 1 end]] if {$crid != ""} { puts -nonewline " $r(szCRID)" } puts "
" puts "Click on the CRID to view episodes." $db close