2011-06-07 13:26:45 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2012-03-31 21:16:31 +00:00
|
|
|
require altrow rsv.class progressbar epg.class system.class
|
2011-07-05 00:19:02 +00:00
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
header
|
2011-08-29 22:34:26 +00:00
|
|
|
|
2012-11-29 22:28:08 +00:00
|
|
|
set svcmap {}
|
|
|
|
lmap i \
|
|
|
|
[$::channeldb query {select hSvc, usSvcid from TBL_SVC}] \
|
|
|
|
{
|
|
|
|
set svcmap([lindex $i 1]) [lindex $i 3]
|
|
|
|
}
|
|
|
|
|
|
|
|
require epg_popup
|
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
puts {
|
|
|
|
<script type=text/javascript src=/js/jquery.tablesorter.js></script>
|
|
|
|
<link type=text/css href=/css/tsort.css rel=Stylesheet />
|
|
|
|
<link href=/css/jquery.contextMenu.css rel=stylesheet type=text/css />
|
|
|
|
<script type=text/javascript src=/js/jquery.contextMenu.js></script>
|
|
|
|
<script type=text/javascript src=/js/jquery.form.js></script>
|
|
|
|
<script type=text/javascript src=script.js></script>
|
2011-12-27 18:43:40 +00:00
|
|
|
|
2012-11-29 22:28:08 +00:00
|
|
|
<div id=sdialogue></div>
|
2011-08-22 20:55:06 +00:00
|
|
|
}
|
2011-07-17 20:52:33 +00:00
|
|
|
|
2011-09-05 22:23:29 +00:00
|
|
|
proc eventheader {{table TBL_RESERVATION} note} {
|
2011-08-22 20:55:06 +00:00
|
|
|
puts {
|
2011-09-05 22:23:29 +00:00
|
|
|
<fieldset style="display: inline; padding: 1em">
|
|
|
|
<legend>
|
|
|
|
}
|
|
|
|
puts "<h3>$note</h3>"
|
|
|
|
puts {
|
|
|
|
</legend>
|
2011-08-22 20:55:06 +00:00
|
|
|
<table class="borders tablesorter">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2011-08-29 22:34:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if {$table eq "pending" } { puts "<th>Action</th>" }
|
|
|
|
|
|
|
|
puts {
|
2011-08-22 20:55:06 +00:00
|
|
|
<th></th>
|
|
|
|
<th> </th><th>Channel</th>
|
|
|
|
<th>Programme</th>
|
|
|
|
<th>Start Time</th>
|
|
|
|
<th>Duration</th>
|
|
|
|
<th>Mode</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
}
|
2011-07-05 00:19:02 +00:00
|
|
|
}
|
|
|
|
|
2013-02-04 22:32:21 +00:00
|
|
|
proc eventrow {event {table TBL_RESERVATION} {pending 0}} {
|
2012-11-29 22:28:08 +00:00
|
|
|
global svcmap
|
|
|
|
|
2011-07-05 18:38:42 +00:00
|
|
|
set name [$event name]
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
set attrs "table=$table sid=[$event get ulslot] \
|
|
|
|
reckind=[$event get ucRecKind] rsvtype=[$event get ersvtype] \
|
|
|
|
ar=[expr ! [$event padded]]"
|
2013-02-04 22:32:21 +00:00
|
|
|
if {$pending} {
|
|
|
|
append attrs " class=\"blueshade strike\""
|
|
|
|
}
|
2012-03-31 21:16:31 +00:00
|
|
|
altrow $attrs
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-08-29 22:34:26 +00:00
|
|
|
if {$table eq "pending"} {
|
2012-10-30 18:58:54 +00:00
|
|
|
puts "<td align=center>[$event pendingicon]</td>"
|
2011-08-29 22:34:26 +00:00
|
|
|
}
|
|
|
|
|
2011-07-07 22:33:19 +00:00
|
|
|
puts "<td>[$event get ulslot]</td>"
|
|
|
|
|
2011-07-05 00:19:02 +00:00
|
|
|
if {[$event get usLcn] ne ""} {
|
|
|
|
puts "
|
|
|
|
<td>
|
2011-09-09 19:38:37 +00:00
|
|
|
[epg channelicon [$event channel_name] 50]
|
2011-07-05 00:19:02 +00:00
|
|
|
</td>
|
2011-07-05 18:38:42 +00:00
|
|
|
<td nowrap>[$event get usLcn]<br>
|
|
|
|
[$event channel_name]</td>
|
2011-07-05 00:19:02 +00:00
|
|
|
"
|
|
|
|
} else {
|
2011-07-17 20:52:33 +00:00
|
|
|
puts "<td> <br><br></td><td> </td>"
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
|
2011-08-29 22:34:26 +00:00
|
|
|
puts "<td nowrap>
|
|
|
|
<a slot=[$event get ulslot] table=$table
|
2012-03-31 21:16:31 +00:00
|
|
|
href=# class=schedule>$name</a>"
|
2012-04-10 19:45:49 +00:00
|
|
|
if {
|
|
|
|
([$event get ucRecKind] == 4 && $name ne [$event folder]) ||
|
|
|
|
([$event get ucRecKind] == 1 && [$event folder] ne "")
|
|
|
|
} {
|
2012-03-31 21:16:31 +00:00
|
|
|
puts "<br><span class=also> (Folder: [$event folder])</span>"
|
|
|
|
}
|
2012-11-29 22:28:08 +00:00
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
puts "</td>"
|
2011-07-05 00:19:02 +00:00
|
|
|
|
|
|
|
set s [$event get nsttime]
|
|
|
|
set d [$event get nduration]
|
|
|
|
set e $($s + $d)
|
|
|
|
set n [clock seconds]
|
|
|
|
|
2012-10-30 18:58:54 +00:00
|
|
|
if {$n > $e && [$event get ersvtype] <= 3} {
|
2012-11-06 22:58:17 +00:00
|
|
|
set ds "[clock format $s -format {%a %d %b %Y %H:%M}]"
|
|
|
|
puts "<td nowrap class=va>
|
|
|
|
--- -- --- ---- --:--<br>
|
|
|
|
<span class=footnote>(Last: $ds)</span>"
|
2011-09-11 21:23:42 +00:00
|
|
|
puts "</td><td>--:--:--</td>"
|
|
|
|
} else {
|
2012-11-29 22:28:08 +00:00
|
|
|
set elist [$event aul]
|
|
|
|
|
|
|
|
set ds "[clock format $s -format {%a %d %b %Y %H:%M}]"
|
2011-09-11 21:23:42 +00:00
|
|
|
puts "<td nowrap class=\"va"
|
|
|
|
if {$n > $e} { puts " blood" }
|
2012-11-29 22:28:08 +00:00
|
|
|
puts "\">"
|
|
|
|
|
|
|
|
if {[llength $elist] > 0} {
|
|
|
|
lassign [lindex $elist 0] service_id start end event_id
|
|
|
|
if {$start == $s} {
|
|
|
|
puts "<a class=event href=#
|
|
|
|
xs=$svcmap($service_id) xe=$event_id>
|
|
|
|
$ds</a>"
|
|
|
|
} else {
|
|
|
|
puts $ds
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
puts $ds
|
|
|
|
}
|
|
|
|
|
2011-09-11 21:23:42 +00:00
|
|
|
if {$d > 0 && $n > $s && $n < $e} {
|
|
|
|
puts "<br>"
|
|
|
|
set perc [expr [expr $n - $s] * 100 / $d]
|
|
|
|
puts "<img class=va
|
|
|
|
src=/images/745_1_11_Video_1REC.png>"
|
|
|
|
puts [progressbar $perc]
|
|
|
|
}
|
2012-11-29 22:28:08 +00:00
|
|
|
|
|
|
|
if {[llength $elist] > 1} {
|
|
|
|
puts "<div class=also style=\"margin-top: 0.5em\">"
|
|
|
|
foreach e $elist {
|
|
|
|
lassign $e service_id start end event_id
|
|
|
|
if {$start == $s} continue
|
|
|
|
puts "<a class=event href=#
|
|
|
|
xs=$svcmap($service_id) xe=$event_id>
|
|
|
|
[clock format $start \
|
|
|
|
-format {%a %d %b %Y %H:%M}]</a><br>"
|
|
|
|
}
|
|
|
|
puts "</div>";
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "</td><td align=center>"
|
2013-02-04 22:32:21 +00:00
|
|
|
set xndur [$event get nduration]
|
|
|
|
if {$xndur > 0} {
|
|
|
|
puts "[clock format $xndur -format %H:%M]"
|
|
|
|
} else {
|
|
|
|
puts "--:--:--"
|
|
|
|
}
|
2012-11-29 22:28:08 +00:00
|
|
|
if {[llength $elist] > 1} {
|
|
|
|
puts "<div class=also style=\"margin-top: 0.5em\">"
|
|
|
|
foreach e $elist {
|
|
|
|
lassign $e service_id start end event_id
|
|
|
|
if {$start == $s} continue
|
|
|
|
puts "[clock format $($end - $start) \
|
|
|
|
-format {%H:%M}]<br>"
|
|
|
|
}
|
|
|
|
puts "</div>";
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "</td>"
|
2011-06-09 21:16:30 +00:00
|
|
|
}
|
2011-07-05 00:19:02 +00:00
|
|
|
|
2012-10-30 18:58:54 +00:00
|
|
|
puts "<td nowrap>[join [$event iconset] ""]</td>"
|
2012-03-31 21:16:31 +00:00
|
|
|
|
|
|
|
puts "<td><a href=# class=smenu sid=[$event get ulslot]>
|
|
|
|
<img border=0 src=/img/more_btn.gif></a></td>"
|
2011-06-07 13:26:45 +00:00
|
|
|
puts "</tr>"
|
|
|
|
}
|
2011-08-22 20:55:06 +00:00
|
|
|
|
|
|
|
proc eventfooter {} {
|
2011-09-05 22:23:29 +00:00
|
|
|
puts "</tbody></table></fieldset>"
|
2011-08-22 20:55:06 +00:00
|
|
|
}
|
|
|
|
|
2013-02-04 22:32:21 +00:00
|
|
|
proc ekey {event} {
|
|
|
|
set ret ""
|
|
|
|
foreach key {ersvtype nsttime nduration hsvc usevtid} {
|
|
|
|
append ret ".[$event get $key]"
|
|
|
|
}
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
|
|
|
set pmap {}
|
2011-08-22 20:55:06 +00:00
|
|
|
set events [rsv list pending]
|
|
|
|
if {[llength $events] > 0} {
|
2011-09-05 22:23:29 +00:00
|
|
|
eventheader pending "Pending Scheduled Events"
|
2013-02-04 22:32:21 +00:00
|
|
|
foreach event $events {
|
|
|
|
eventrow $event pending
|
|
|
|
lappend pmap [ekey $event]
|
|
|
|
}
|
2011-08-22 20:55:06 +00:00
|
|
|
eventfooter
|
|
|
|
puts {
|
|
|
|
<small>
|
|
|
|
<button onclick="window.location='/cgi-bin/db.jim?db=rsvp.db&tab=pending';">
|
|
|
|
Raw database view
|
|
|
|
</button>
|
|
|
|
</small>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set events [rsv list]
|
2011-09-05 22:23:29 +00:00
|
|
|
eventheader "live" "Scheduled Events"
|
2013-02-04 22:32:21 +00:00
|
|
|
foreach event $events {
|
|
|
|
if {[ekey $event] in $pmap} {
|
|
|
|
eventrow $event TBL_RESERVATION 1
|
|
|
|
} else {
|
|
|
|
eventrow $event
|
|
|
|
}
|
|
|
|
}
|
2011-08-22 20:55:06 +00:00
|
|
|
eventfooter
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-07-07 22:33:19 +00:00
|
|
|
puts {
|
2011-09-05 22:23:29 +00:00
|
|
|
<br>
|
2011-07-12 18:57:30 +00:00
|
|
|
<small>
|
2011-07-07 22:33:19 +00:00
|
|
|
<button onclick="window.location='/backup.shtml';">
|
2011-07-12 18:57:30 +00:00
|
|
|
Backup/Restore Scheduled Recordings/Events
|
|
|
|
</button>
|
|
|
|
<button onclick="window.location='/cgi-bin/db.jim?db=rsv.db&tab=TBL_RESERVATION';">
|
|
|
|
Raw database view
|
2011-07-07 22:33:19 +00:00
|
|
|
</button>
|
2011-07-12 18:57:30 +00:00
|
|
|
<script type=text/javascript>
|
|
|
|
$('button').button();
|
|
|
|
</script>
|
2011-07-07 22:33:19 +00:00
|
|
|
}
|
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
source assets.jim
|
|
|
|
|
|
|
|
footer
|
|
|
|
|