1 |
<?php |
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 |
?> |
---|
20 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
---|
21 |
<html lang="ja"> |
---|
22 |
<head> |
---|
23 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> |
---|
24 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
---|
25 |
<link rel="stylesheet" type="text/css" href="graytable.css"> |
---|
26 |
<title>foltia:record plan</title> |
---|
27 |
</head> |
---|
28 |
|
---|
29 |
<?php |
---|
30 |
|
---|
31 |
include("./foltialib.php"); |
---|
32 |
|
---|
33 |
$con = m_connect(); |
---|
34 |
|
---|
35 |
$now = getgetnumform(startdate); |
---|
36 |
if ($now > 200501010000){ |
---|
37 |
}else{ |
---|
38 |
$now = date("YmdHi"); |
---|
39 |
} |
---|
40 |
$query = " |
---|
41 |
SELECT |
---|
42 |
foltia_program .tid, |
---|
43 |
stationname, |
---|
44 |
foltia_program .title, |
---|
45 |
foltia_subtitle.countno, |
---|
46 |
foltia_subtitle.subtitle, |
---|
47 |
foltia_subtitle.startdatetime , |
---|
48 |
foltia_subtitle.lengthmin , |
---|
49 |
foltia_tvrecord.bitrate , |
---|
50 |
foltia_subtitle.startoffset , |
---|
51 |
foltia_subtitle.pid |
---|
52 |
FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
53 |
WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
54 |
AND foltia_subtitle.enddatetime >= '$now' |
---|
55 |
UNION |
---|
56 |
SELECT |
---|
57 |
foltia_program .tid, |
---|
58 |
stationname, |
---|
59 |
foltia_program .title, |
---|
60 |
foltia_subtitle.countno, |
---|
61 |
foltia_subtitle.subtitle, |
---|
62 |
foltia_subtitle.startdatetime , |
---|
63 |
foltia_subtitle.lengthmin , |
---|
64 |
foltia_tvrecord.bitrate , |
---|
65 |
foltia_subtitle.startoffset , |
---|
66 |
foltia_subtitle.pid |
---|
67 |
FROM foltia_tvrecord |
---|
68 |
LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
69 |
LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
70 |
LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
71 |
WHERE foltia_tvrecord.stationid = 0 AND |
---|
72 |
foltia_subtitle.enddatetime >= '$now' ORDER BY \"startdatetime\" ASC |
---|
73 |
"; |
---|
74 |
|
---|
75 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
76 |
$maxrows = pg_num_rows($rs); |
---|
77 |
|
---|
78 |
|
---|
79 |
|
---|
80 |
if (getgetnumform(r) != ""){ |
---|
81 |
$recunits = getgetnumform(r); |
---|
82 |
}elseif($recunits == ""){ |
---|
83 |
$recunits = 2; |
---|
84 |
} |
---|
85 |
|
---|
86 |
?> |
---|
87 |
|
---|
88 |
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > |
---|
89 |
<div align="center"> |
---|
90 |
<?php |
---|
91 |
printhtmlpageheader(); |
---|
92 |
?> |
---|
93 |
<p align="left"><font color="#494949" size="6">予約一覧</font></p> |
---|
94 |
<hr size="4"> |
---|
95 |
<p align="left">録画予約番組放映予定と予約番組名を表示します。</p> |
---|
96 |
|
---|
97 |
<? |
---|
98 |
if ($maxrows == 0) { |
---|
99 |
print "番組データがありません<BR>\n"; |
---|
100 |
}else{ |
---|
101 |
|
---|
102 |
|
---|
103 |
|
---|
104 |
$maxcols = pg_num_fields($rs); |
---|
105 |
?> |
---|
106 |
<table BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="100%"> |
---|
107 |
<thead> |
---|
108 |
<tr> |
---|
109 |
<th align="left">TID</th> |
---|
110 |
<th align="left">放映局</th> |
---|
111 |
<th align="left">タイトル</th> |
---|
112 |
<th align="left">話数</th> |
---|
113 |
<th align="left">サブタイトル</th> |
---|
114 |
<th align="left">開始時刻</th> |
---|
115 |
<th align="left">総尺</th> |
---|
116 |
<th align="left">画質</th> |
---|
117 |
|
---|
118 |
</tr> |
---|
119 |
</thead> |
---|
120 |
|
---|
121 |
<tbody> |
---|
122 |
<?php |
---|
123 |
|
---|
124 |
for ($row = 0; $row < $maxrows; $row++) { |
---|
125 |
echo("<tr>\n"); |
---|
126 |
|
---|
127 |
$rowdata = pg_fetch_row($rs, $row); |
---|
128 |
$pid = htmlspecialchars($rowdata[9]); |
---|
129 |
|
---|
130 |
$tid = htmlspecialchars($rowdata[0]); |
---|
131 |
$title = htmlspecialchars($rowdata[2]); |
---|
132 |
$subtitle = htmlspecialchars($rowdata[4]); |
---|
133 |
|
---|
134 |
|
---|
135 |
|
---|
136 |
$endtime = calcendtime($rowdata[5],$rowdata[6]); |
---|
137 |
|
---|
138 |
|
---|
139 |
$query = " |
---|
140 |
SELECT |
---|
141 |
foltia_program .tid, |
---|
142 |
stationname, |
---|
143 |
foltia_program .title, |
---|
144 |
foltia_subtitle.countno, |
---|
145 |
foltia_subtitle.subtitle, |
---|
146 |
foltia_subtitle.startdatetime , |
---|
147 |
foltia_subtitle.lengthmin , |
---|
148 |
foltia_tvrecord.bitrate , |
---|
149 |
foltia_subtitle.startoffset , |
---|
150 |
foltia_subtitle.pid |
---|
151 |
FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
152 |
WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
153 |
AND foltia_subtitle.enddatetime > '$rowdata[5]' |
---|
154 |
AND foltia_subtitle.startdatetime < '$endtime' |
---|
155 |
UNION |
---|
156 |
SELECT |
---|
157 |
foltia_program .tid, |
---|
158 |
stationname, |
---|
159 |
foltia_program .title, |
---|
160 |
foltia_subtitle.countno, |
---|
161 |
foltia_subtitle.subtitle, |
---|
162 |
foltia_subtitle.startdatetime , |
---|
163 |
foltia_subtitle.lengthmin , |
---|
164 |
foltia_tvrecord.bitrate , |
---|
165 |
foltia_subtitle.startoffset , |
---|
166 |
foltia_subtitle.pid |
---|
167 |
FROM foltia_tvrecord |
---|
168 |
LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
169 |
LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
170 |
LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
171 |
WHERE foltia_tvrecord.stationid = 0 AND |
---|
172 |
foltia_subtitle.enddatetime > '$rowdata[5]' |
---|
173 |
AND foltia_subtitle.startdatetime < '$endtime' |
---|
174 |
"; |
---|
175 |
$rclass = ""; |
---|
176 |
$overlap = m_query($con, $query, "DBクエリに失敗しました"); |
---|
177 |
$overlapmaxrows = pg_num_rows($overlap); |
---|
178 |
if ($overlapmaxrows > ($recunits) ){ |
---|
179 |
for ($rrow = 0; $rrow < $overlapmaxrows ; $rrow++) { |
---|
180 |
$owrowdata = pg_fetch_row($overlap, $rrow); |
---|
181 |
$overlappid[] = $owrowdata[9]; |
---|
182 |
} |
---|
183 |
if (in_array($rowdata[9], $overlappid)) { |
---|
184 |
$rclass = "overwraped"; |
---|
185 |
} |
---|
186 |
}else{ |
---|
187 |
$overlappid = ""; |
---|
188 |
} |
---|
189 |
|
---|
190 |
//外部チューナー録画 |
---|
191 |
$externalinputs = 1; |
---|
192 |
$query = " |
---|
193 |
SELECT |
---|
194 |
foltia_program .tid, |
---|
195 |
stationname, |
---|
196 |
foltia_program .title, |
---|
197 |
foltia_subtitle.countno, |
---|
198 |
foltia_subtitle.subtitle, |
---|
199 |
foltia_subtitle.startdatetime , |
---|
200 |
foltia_subtitle.lengthmin , |
---|
201 |
foltia_tvrecord.bitrate , |
---|
202 |
foltia_subtitle.startoffset , |
---|
203 |
foltia_subtitle.pid |
---|
204 |
FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
205 |
WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
206 |
AND foltia_subtitle.enddatetime > '$rowdata[5]' |
---|
207 |
AND foltia_subtitle.startdatetime < '$endtime' |
---|
208 |
AND (foltia_station.stationrecch = '0' OR foltia_station.stationrecch = '-1' ) |
---|
209 |
UNION |
---|
210 |
SELECT |
---|
211 |
foltia_program .tid, |
---|
212 |
stationname, |
---|
213 |
foltia_program .title, |
---|
214 |
foltia_subtitle.countno, |
---|
215 |
foltia_subtitle.subtitle, |
---|
216 |
foltia_subtitle.startdatetime , |
---|
217 |
foltia_subtitle.lengthmin , |
---|
218 |
foltia_tvrecord.bitrate , |
---|
219 |
foltia_subtitle.startoffset , |
---|
220 |
foltia_subtitle.pid |
---|
221 |
FROM foltia_tvrecord |
---|
222 |
LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
223 |
LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
224 |
LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
225 |
WHERE foltia_tvrecord.stationid = 0 AND |
---|
226 |
foltia_subtitle.enddatetime > '$rowdata[5]' |
---|
227 |
AND foltia_subtitle.startdatetime < '$endtime' |
---|
228 |
AND (foltia_station.stationrecch = '0' OR foltia_station.stationrecch = '-1' ) |
---|
229 |
|
---|
230 |
"; |
---|
231 |
$eoverlap = m_query($con, $query, "DBクエリに失敗しました"); |
---|
232 |
$eoverlapmaxrows = pg_num_rows($eoverlap); |
---|
233 |
if ($eoverlapmaxrows > ($externalinputs) ){ |
---|
234 |
for ($erow = 0; $erow < $eoverlapmaxrows ; $erow++) { |
---|
235 |
$eowrowdata = pg_fetch_row($eoverlap, $erow); |
---|
236 |
$eoverlappid[] = $eowrowdata[9]; |
---|
237 |
} |
---|
238 |
|
---|
239 |
if (in_array($rowdata[9], $eoverlappid)) { |
---|
240 |
$rclass = "exoverwraped"; |
---|
241 |
} |
---|
242 |
}else{ |
---|
243 |
$eoverlappid = ""; |
---|
244 |
} |
---|
245 |
echo("<tr class=\"$rclass\">\n"); |
---|
246 |
|
---|
247 |
print "<td>"; |
---|
248 |
if ($tid == 0 ){ |
---|
249 |
print "$tid"; |
---|
250 |
}else{ |
---|
251 |
print "<a href=\"reserveprogram.php?tid=$tid\">$tid</a>"; |
---|
252 |
} |
---|
253 |
print "</td>\n"; |
---|
254 |
|
---|
255 |
echo("<td>".htmlspecialchars($rowdata[1])."<br></td>\n"); |
---|
256 |
|
---|
257 |
print "<td>"; |
---|
258 |
if ($tid == 0 ){ |
---|
259 |
print "$title"; |
---|
260 |
}else{ |
---|
261 |
print "<a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a>"; |
---|
262 |
} |
---|
263 |
print "</td>\n"; |
---|
264 |
|
---|
265 |
echo("<td>".htmlspecialchars($rowdata[3])."<br></td>\n"); |
---|
266 |
|
---|
267 |
if ($pid > 0 ){ |
---|
268 |
print "<td><a href=\"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle<br></td>\n"; |
---|
269 |
}else{ |
---|
270 |
if ($protectmode) { |
---|
271 |
print "<td>$subtitle<br></td>\n"; |
---|
272 |
}else{ |
---|
273 |
print "<td>$subtitle [<a href=\"delepgp.php?pid=$pid\">予約解除</a>]<br></td>\n"; |
---|
274 |
} |
---|
275 |
} |
---|
276 |
|
---|
277 |
echo("<td>".htmlspecialchars(foldate2print($rowdata[5]))."<br>(".htmlspecialchars($rowdata[8]).")</td>\n"); |
---|
278 |
|
---|
279 |
echo("<td>".htmlspecialchars($rowdata[6])."<br></td>\n"); |
---|
280 |
|
---|
281 |
|
---|
282 |
echo("<td>".htmlspecialchars($rowdata[7])."<br></td>\n"); |
---|
283 |
echo("</tr>\n"); |
---|
284 |
} |
---|
285 |
?> |
---|
286 |
</tbody> |
---|
287 |
</table> |
---|
288 |
|
---|
289 |
|
---|
290 |
<table> |
---|
291 |
<tr><td>エンコーダ数</td><td><?=$recunits ?></td></tr> |
---|
292 |
<tr class="overwraped"><td>チューナー重複</td><td><br /></td></tr> |
---|
293 |
<tr class="exoverwraped"><td>外部入力重複</td><td><br /></td></tr> |
---|
294 |
</table> |
---|
295 |
|
---|
296 |
|
---|
297 |
<?php |
---|
298 |
} |
---|
299 |
|
---|
300 |
|
---|
301 |
$query = " |
---|
302 |
SELECT |
---|
303 |
foltia_program.tid, |
---|
304 |
stationname, |
---|
305 |
foltia_program .title , |
---|
306 |
foltia_tvrecord.bitrate , |
---|
307 |
foltia_tvrecord.stationid |
---|
308 |
FROM foltia_tvrecord , foltia_program , foltia_station |
---|
309 |
WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid |
---|
310 |
ORDER BY foltia_program.tid DESC |
---|
311 |
"; |
---|
312 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
313 |
$maxrows = pg_num_rows($rs); |
---|
314 |
|
---|
315 |
if ($maxrows == 0) { |
---|
316 |
|
---|
317 |
|
---|
318 |
}else{ |
---|
319 |
$maxcols = pg_num_fields($rs); |
---|
320 |
|
---|
321 |
?> |
---|
322 |
<p align="left">録画予約番組タイトルを表示します。</p> |
---|
323 |
<table BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="100%"> |
---|
324 |
<thead> |
---|
325 |
<tr> |
---|
326 |
<th align="left">予約解除</th> |
---|
327 |
<th align="left">TID</th> |
---|
328 |
<th align="left">放映局</th> |
---|
329 |
<th align="left">タイトル</th> |
---|
330 |
<th align="left">録画リスト</th> |
---|
331 |
<th align="left">画質</th> |
---|
332 |
</tr> |
---|
333 |
</thead> |
---|
334 |
|
---|
335 |
<tbody> |
---|
336 |
<?php |
---|
337 |
|
---|
338 |
for ($row = 0; $row < $maxrows; $row++) { |
---|
339 |
/* pg_fetch_row で一行取り出す */ |
---|
340 |
$rowdata = pg_fetch_row($rs, $row); |
---|
341 |
|
---|
342 |
$tid = htmlspecialchars($rowdata[0]); |
---|
343 |
|
---|
344 |
if ($tid > 0){ |
---|
345 |
echo("<tr>\n"); |
---|
346 |
|
---|
347 |
if ($protectmode) { |
---|
348 |
echo("<td>−</td>"); |
---|
349 |
}else{ |
---|
350 |
echo("<td><a href=\"delreserve.php?tid=$tid&sid=" . |
---|
351 |
htmlspecialchars($rowdata[4]) . "\">解除</a></td>\n"); |
---|
352 |
} |
---|
353 |
|
---|
354 |
echo("<td><a href=\"reserveprogram.php?tid=$tid\">$tid</a></td>\n"); |
---|
355 |
|
---|
356 |
echo("<td>".htmlspecialchars($rowdata[1])."<br></td>\n"); |
---|
357 |
|
---|
358 |
echo("<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">" . |
---|
359 |
htmlspecialchars($rowdata[2]) . "</a></td>\n"); |
---|
360 |
|
---|
361 |
|
---|
362 |
echo("<td><a href=\"showlibc.php?tid=$tid\">mp4</a></td>\n"); |
---|
363 |
|
---|
364 |
echo("<td>".htmlspecialchars($rowdata[3])."<br></td>\n"); |
---|
365 |
|
---|
366 |
echo("</tr>\n"); |
---|
367 |
}else{ |
---|
368 |
print "<tr> |
---|
369 |
<td>−</td><td>0</td> |
---|
370 |
<td>[全局]<br></td> |
---|
371 |
<td>EPG録画</td> |
---|
372 |
<td><a href=\"showlibc.php?tid=0\">mp4</a></td>"; |
---|
373 |
echo("<td>".htmlspecialchars($rowdata[3])."<br></td>\n</tr>"); |
---|
374 |
} |
---|
375 |
} |
---|
376 |
} |
---|
377 |
?> |
---|
378 |
</tbody> |
---|
379 |
</table> |
---|
380 |
|
---|
381 |
|
---|
382 |
</body> |
---|
383 |
</html> |
---|
384 |
|
---|