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