2011-06-07 13:26:45 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
package require cgi
|
2011-07-01 22:56:53 +00:00
|
|
|
source /mod/var/mongoose/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
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
puts "Content-Type: text/html"
|
|
|
|
puts ""
|
2011-08-29 22:34:26 +00:00
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
header
|
2011-08-29 22:34:26 +00:00
|
|
|
|
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-03-31 21:16:31 +00:00
|
|
|
<div id=dialogue></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
|
|
|
}
|
|
|
|
|
2011-08-29 22:34:26 +00:00
|
|
|
proc eventrow {event {table TBL_RESERVATION}} {
|
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]]"
|
|
|
|
altrow $attrs
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-08-29 22:34:26 +00:00
|
|
|
set rsvicon [$event icon]
|
|
|
|
set RKIcon [$event RKIcon]
|
2011-07-05 00:19:02 +00:00
|
|
|
if {[$event get ucRecKind] == 4} {
|
2011-06-09 21:16:30 +00:00
|
|
|
set series 1
|
2011-06-07 13:26:45 +00:00
|
|
|
} else {
|
2011-08-29 22:34:26 +00:00
|
|
|
set series 0
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if {$rsvicon ne ""} {
|
2011-12-19 15:57:03 +00:00
|
|
|
set rsvicon "<img src='/images/$rsvicon' height=20>"
|
|
|
|
if {[$event get ersvtype] == 3} {
|
|
|
|
if {[$event padded]} {
|
|
|
|
set padding "<- [expr [$event get ulPreOffset] / 60], [expr [$event get ulPostOffset] / 60] ->"
|
|
|
|
append rsvicon \
|
|
|
|
"<img src=/img/pad.png height=20
|
|
|
|
title=\"$padding\" alt=\"$padding\">"
|
|
|
|
} else {
|
|
|
|
append rsvicon \
|
|
|
|
"<img src=/img/ar.png height=20>"
|
|
|
|
}
|
|
|
|
}
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
if {$RKIcon ne ""} {
|
2011-12-19 15:57:03 +00:00
|
|
|
set RKIcon "<img src='/images/$RKIcon' height=20>"
|
2011-07-05 00:19:02 +00:00
|
|
|
}
|
|
|
|
|
2011-08-29 22:34:26 +00:00
|
|
|
if {$table eq "pending"} {
|
2011-12-19 22:52:17 +00:00
|
|
|
switch [$event get action] {
|
|
|
|
0 { set icon "add" }
|
|
|
|
1 { set icon "close" }
|
|
|
|
2 { set icon "ar" }
|
|
|
|
3 { set icon "pad" }
|
2012-03-31 21:16:31 +00:00
|
|
|
4 { set icon "folder" }
|
2011-08-29 22:34:26 +00:00
|
|
|
}
|
|
|
|
puts "<td align=center>
|
|
|
|
<img class=va width=30 src=/img/$icon.png></td>"
|
|
|
|
}
|
|
|
|
|
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>"
|
|
|
|
if {[$event get ucRecKind] == 4 && $name ne [$event folder]} {
|
|
|
|
puts "<br><span class=also> (Folder: [$event folder])</span>"
|
|
|
|
}
|
|
|
|
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]
|
|
|
|
|
2011-09-11 21:23:42 +00:00
|
|
|
set ds "[clock format $s -format "%a %d %b %Y"]<br>
|
2011-07-05 18:38:42 +00:00
|
|
|
[clock format $s -format "%H:%M %Z"]"
|
2011-07-05 00:19:02 +00:00
|
|
|
|
2011-09-11 21:23:42 +00:00
|
|
|
if { $n > $e && [$event get ersvtype] <= 3} {
|
|
|
|
puts "<td nowrap class=va
|
|
|
|
alt=\"$ds\" title=\"$ds\">
|
|
|
|
--- -- --- ----<br>--:--"
|
|
|
|
puts "</td><td>--:--:--</td>"
|
|
|
|
} else {
|
|
|
|
puts "<td nowrap class=\"va"
|
|
|
|
if {$n > $e} { puts " blood" }
|
|
|
|
puts "\">$ds"
|
|
|
|
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]
|
|
|
|
}
|
|
|
|
puts "</td><td>"
|
|
|
|
puts "[clock format [$event get nduration] -format %T]</td>"
|
2011-06-09 21:16:30 +00:00
|
|
|
}
|
2011-07-05 00:19:02 +00:00
|
|
|
|
2012-03-31 21:16:31 +00:00
|
|
|
puts "<td nowrap>$rsvicon $RKIcon</td>"
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
set events [rsv list pending]
|
|
|
|
if {[llength $events] > 0} {
|
2011-09-05 22:23:29 +00:00
|
|
|
eventheader pending "Pending Scheduled Events"
|
2011-08-29 22:34:26 +00:00
|
|
|
foreach event $events {eventrow $event pending}
|
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"
|
2011-08-22 20:55:06 +00:00
|
|
|
foreach event $events {eventrow $event}
|
|
|
|
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
|
|
|
|
|