-- vim:set ft=lua:
dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua')
ct={
title='予約一覧',
css='\n',
progres=true,
macro=sidePanel
}
edcb.htmlEscape=15
a=edcb.GetReserveData()
table.sort(a, function(a,b) return os.time(a.startTime) < os.time(b.startTime) end)
pageIndex=GetVarInt(mg.request_info.query_string,'page',0,100000) or 0
PAGE_COUNT=tonumber(edcb.GetPrivateProfile('SET','PAGE_COUNT','30',ini))
if PAGE_COUNT==0 then PAGE_COUNT=#a end
if math.ceil((#a/PAGE_COUNT)-1)>0 then
pg='0 and 'href="reserve.html?page=0"' or 'disabled')..'>first_page\n'
..'0 and 'href="reserve.html?page='..(pageIndex-1)..'"' or 'disabled')..'>chevron_left\n'
n=pageIndex>(#a/PAGE_COUNT-2) and math.floor(#a/PAGE_COUNT)-4 or math.max(0,pageIndex-2)
for i=n, n+4 do
pg=pg..(i>=0 and i<#a/PAGE_COUNT and ''..(i+1)..'\n' or '')
end
pg=pg..'chevron_right\n'
..'last_page\n'
pg='
\n'..pg..'
\n'
end
ct.main='\n'
..(sidePanel and sidePanelTemplate(true) or '')
..'
\n'
ctt={}
rsdef=(edcb.GetReserveData(0x7FFFFFFF) or {}).recSetting
rate={}
for i=pageIndex*PAGE_COUNT+1,math.min(#a,(pageIndex+1)*PAGE_COUNT) do
v=a[i]
size=nil
if v.recSetting.recMode~=4 then
--予想ファイルサイズ
for j=1,4 do
key=('%04X%04X%04X'):format((j>3 and 65535 or v.onid),(j>2 and 65535 or v.tsid),(j>1 and 65535 or v.sid))
rate[key]=rate[key] or tonumber(edcb.GetPrivateProfile('BITRATE',key,0,'Bitrate.ini')) or 0
if rate[key]>0 then
break
elseif j==4 then
rate[key]=19456
end
end
size=rate[key]/8*1000*math.max((v.recSetting.startMargin or rsdef and rsdef.startMargin or 0)+
(v.recSetting.endMargin or rsdef and rsdef.endMargin or 0)+v.durationSecond,0)
end
bg=v.recSetting.recMode==5 and ' disabled'
or v.overlapMode==1 and ' partially'
or v.overlapMode==2 and ' shortage' or nil
table.insert(ctt, '