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, stationname, foltia_program.title, |
---|
65 |
foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
66 |
foltia_subtitle.startdatetime as x, foltia_subtitle.lengthmin, |
---|
67 |
foltia_tvrecord.bitrate, foltia_subtitle.startoffset, |
---|
68 |
foltia_subtitle.pid, foltia_subtitle.epgaddedby, |
---|
69 |
foltia_tvrecord.digital |
---|
70 |
FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
71 |
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 |
---|
72 |
AND foltia_subtitle.enddatetime >= ? |
---|
73 |
UNION |
---|
74 |
SELECT |
---|
75 |
foltia_program.tid, stationname, foltia_program.title, |
---|
76 |
foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
77 |
foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
78 |
foltia_tvrecord.bitrate, foltia_subtitle.startoffset, |
---|
79 |
foltia_subtitle.pid, foltia_subtitle.epgaddedby, |
---|
80 |
foltia_tvrecord.digital |
---|
81 |
FROM foltia_tvrecord |
---|
82 |
LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
83 |
LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
84 |
LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
85 |
WHERE foltia_tvrecord.stationid = 0 AND |
---|
86 |
foltia_subtitle.enddatetime >= ? ORDER BY x ASC |
---|
87 |
"; |
---|
88 |
|
---|
89 |
|
---|
90 |
$rs = sql_query($con, $query, "DBクエリに失敗しました",array($now,$now)); |
---|
91 |
|
---|
92 |
|
---|
93 |
if (getgetnumform(r) != ""){ |
---|
94 |
$recunits = getgetnumform(r); |
---|
95 |
}elseif($recunits == ""){ |
---|
96 |
$recunits = 2; |
---|
97 |
} |
---|
98 |
|
---|
99 |
?> |
---|
100 |
|
---|
101 |
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > |
---|
102 |
<div align="center"> |
---|
103 |
<?php |
---|
104 |
printhtmlpageheader(); |
---|
105 |
?> |
---|
106 |
<p align="left"><font color="#494949" size="6">予約一覧</font></p> |
---|
107 |
<hr size="4"> |
---|
108 |
<p align="left">録画予約番組放映予定と予約番組名を表示します。</p> |
---|
109 |
|
---|
110 |
<?php |
---|
111 |
$rowdata = $rs->fetch(); |
---|
112 |
if (! $rowdata) { |
---|
113 |
print "番組データがありません<BR>\n"; |
---|
114 |
}else{ |
---|
115 |
|
---|
116 |
$maxcols = $rs->columnCount(); |
---|
117 |
?> |
---|
118 |
<table BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="100%"> |
---|
119 |
<thead> |
---|
120 |
<tr> |
---|
121 |
<th align="left">TID</th> |
---|
122 |
<th align="left">放映局</th> |
---|
123 |
<th align="left">タイトル</th> |
---|
124 |
<th align="left">話数</th> |
---|
125 |
<th align="left">サブタイトル</th> |
---|
126 |
<th align="left">開始時刻(ズレ)</th> |
---|
127 |
<th align="left">総尺</th> |
---|
128 |
<th align="left">画質</th> |
---|
129 |
<th align="left">デジタル優先</th> |
---|
130 |
|
---|
131 |
</tr> |
---|
132 |
</thead> |
---|
133 |
|
---|
134 |
<tbody> |
---|
135 |
<?php |
---|
136 |
|
---|
137 |
do { |
---|
138 |
echo("<tr>\n"); |
---|
139 |
|
---|
140 |
$pid = htmlspecialchars($rowdata[9]); |
---|
141 |
|
---|
142 |
$tid = htmlspecialchars($rowdata[0]); |
---|
143 |
$title = htmlspecialchars($rowdata[2]); |
---|
144 |
$subtitle = htmlspecialchars($rowdata[4]); |
---|
145 |
$dbepgaddedby = htmlspecialchars($rowdata[10]); |
---|
146 |
|
---|
147 |
|
---|
148 |
|
---|
149 |
|
---|
150 |
$endtime = calcendtime($rowdata[5],$rowdata[6]); |
---|
151 |
|
---|
152 |
|
---|
153 |
$query = " |
---|
154 |
SELECT |
---|
155 |
foltia_program.tid, stationname, foltia_program.title, |
---|
156 |
foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
157 |
foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
158 |
foltia_tvrecord.bitrate, foltia_subtitle.startoffset, |
---|
159 |
foltia_subtitle.pid, foltia_tvrecord.digital |
---|
160 |
FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
161 |
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 |
---|
162 |
AND foltia_subtitle.enddatetime > ? |
---|
163 |
AND foltia_subtitle.startdatetime < ? |
---|
164 |
UNION |
---|
165 |
SELECT |
---|
166 |
foltia_program.tid, stationname, foltia_program.title, |
---|
167 |
foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
168 |
foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
169 |
foltia_tvrecord.bitrate, foltia_subtitle.startoffset, |
---|
170 |
foltia_subtitle.pid, foltia_tvrecord.digital |
---|
171 |
FROM foltia_tvrecord |
---|
172 |
LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
173 |
LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
174 |
LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
175 |
WHERE foltia_tvrecord.stationid = 0 AND |
---|
176 |
foltia_subtitle.enddatetime > ? |
---|
177 |
AND foltia_subtitle.startdatetime < ? |
---|
178 |
"; |
---|
179 |
$rclass = ""; |
---|
180 |
|
---|
181 |
$overlap = sql_query($con, $query, "DBクエリに失敗しました",array($rowdata[5],$endtime,$rowdata[5],$endtime)); |
---|
182 |
$owrowall = $overlap->fetchAll(); |
---|
183 |
$overlapmaxrows = count($owrowall); |
---|
184 |
$overlapmaxrows > ($recunits) ){ |
---|
185 |
|
---|
186 |
$owtimeline = array(); |
---|
187 |
|
---|
188 |
$rrow = 0; $rrow < $overlapmaxrows ; $rrow++) { |
---|
189 |
$owrowdata = $owrowall[$rrow]; |
---|
190 |
$owtimeline[ $owrowdata['startdatetime'] ] = $owtimeline[ $owrowdata['startdatetime'] ] +1; |
---|
191 |
|
---|
192 |
$owrend = calcendtime( $owrowdata['startdatetime'], $owrowdata['lengthmin'] ); |
---|
193 |
$owtimeline[ $owrend ] = $owtimeline[ $owrend ] -1; |
---|
194 |
|
---|
195 |
} |
---|
196 |
|
---|
197 |
ksort ( $owtimeline ); |
---|
198 |
|
---|
199 |
$owcount = 0; |
---|
200 |
$owtimeline as $key => $val ) { |
---|
201 |
$owcount += $val; |
---|
202 |
|
---|
203 |
$owcount > $recunits ) { |
---|
204 |
$rclass = "overwraped"; |
---|
205 |
|
---|
206 |
|
---|
207 |
|
---|
208 |
|
---|
209 |
|
---|
210 |
|
---|
211 |
$externalinputs = 1; |
---|
212 |
$query = " |
---|
213 |
SELECT |
---|
214 |
foltia_program.tid, stationname, foltia_program.title, |
---|
215 |
foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
216 |
foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
217 |
foltia_tvrecord.bitrate, foltia_subtitle.startoffset, |
---|
218 |
foltia_subtitle.pid, foltia_tvrecord.digital |
---|
219 |
FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
220 |
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 |
---|
221 |
AND foltia_subtitle.enddatetime > ? |
---|
222 |
AND foltia_subtitle.startdatetime < ? |
---|
223 |
AND (foltia_station.stationrecch = '0' OR foltia_station.stationrecch = '-1' ) |
---|
224 |
UNION |
---|
225 |
SELECT |
---|
226 |
foltia_program.tid, stationname, foltia_program.title, |
---|
227 |
foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
228 |
foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
229 |
foltia_tvrecord.bitrate, foltia_subtitle.startoffset, |
---|
230 |
foltia_subtitle.pid, foltia_tvrecord.digital |
---|
231 |
FROM foltia_tvrecord |
---|
232 |
LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
233 |
LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
234 |
LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
235 |
WHERE foltia_tvrecord.stationid = 0 AND |
---|
236 |
foltia_subtitle.enddatetime > ? |
---|
237 |
AND foltia_subtitle.startdatetime < ? |
---|
238 |
AND (foltia_station.stationrecch = '0' OR foltia_station.stationrecch = '-1' ) |
---|
239 |
"; |
---|
240 |
|
---|
241 |
$eoverlap = sql_query($con, $query, "DBクエリに失敗しました",array($rowdata[5], $endtime,$rowdata[5], $endtime)); |
---|
242 |
$eowrowall = $eoverlap->fetchAll(); |
---|
243 |
$eoverlapmaxrows = count($eowrowall); |
---|
244 |
$eoverlapmaxrows > ($externalinputs) ){ |
---|
245 |
|
---|
246 |
$eowtimeline = array(); |
---|
247 |
|
---|
248 |
$erow = 0; $erow < $eoverlapmaxrows ; $erow++) { |
---|
249 |
$eowrowdata = $eowrowall[$erow]; |
---|
250 |
$eowtimeline[ $eowrowdata['startdatetime'] ] = $eowtimeline[ $eowrowdata['startdatetime'] ] +1; |
---|
251 |
|
---|
252 |
$eowrend = calcendtime( $eowrowdata['startdatetime'], $eowrowdata['lengthmin'] ); |
---|
253 |
$eowtimeline[ $eowrend ] = $eowtimeline[ $eowrend ] -1; |
---|
254 |
|
---|
255 |
|
---|
256 |
ksort ( $eowtimeline ); |
---|
257 |
|
---|
258 |
$eowcount = 0; |
---|
259 |
$eowtimeline as $key => $val ) { |
---|
260 |
$eowcount += $val; |
---|
261 |
|
---|
262 |
$eowcount > $externalinputs ) { |
---|
263 |
$rclass = "exoverwraped"; |
---|
264 |
|
---|
265 |
|
---|
266 |
|
---|
267 |
|
---|
268 |
|
---|
269 |
"<tr class=\"$rclass\">\n"); |
---|
270 |
|
---|
271 |
print "<td>"; |
---|
272 |
$tid == 0 ){ |
---|
273 |
"$tid"; |
---|
274 |
|
---|
275 |
"<a href=\"reserveprogram.php?tid=$tid\">$tid</a>"; |
---|
276 |
|
---|
277 |
"</td>\n"; |
---|
278 |
|
---|
279 |
echo("<td>".htmlspecialchars($rowdata[1])."<br></td>\n"); |
---|
280 |
|
---|
281 |
print "<td>"; |
---|
282 |
$tid == 0 ){ |
---|
283 |
"$title"; |
---|
284 |
|
---|
285 |
"<a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a>"; |
---|
286 |
|
---|
287 |
|
---|
288 |
"</td>\n"; |
---|
289 |
|
---|
290 |
echo("<td>".htmlspecialchars($rowdata[3])."<br></td>\n"); |
---|
291 |
|
---|
292 |
if ($pid > 0 ){ |
---|
293 |
"<td><a href=\"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle<br></td>\n"; |
---|
294 |
|
---|
295 |
|
---|
296 |
if (($mymemberid == $dbepgaddedby)||($userclass <= 1)){ |
---|
297 |
$userclass <= 1 ){ |
---|
298 |
$membername = getmemberid2name($con,$dbepgaddedby); |
---|
299 |
$membername = ":" . $membername ; |
---|
300 |
|
---|
301 |
$membername = ""; |
---|
302 |
|
---|
303 |
"<td>$subtitle [<a href=\"delepgp.php?pid=$pid\">予約解除</a>$membername]<br></td>\n"; |
---|
304 |
|
---|
305 |
"<td>$subtitle [解除不能]<br></td>\n"; |
---|
306 |
|
---|
307 |
|
---|
308 |
|
---|
309 |
echo("<td>".htmlspecialchars(foldate2print($rowdata[5]))."<br>(".htmlspecialchars($rowdata[8]).")</td>\n"); |
---|
310 |
|
---|
311 |
echo("<td>".htmlspecialchars($rowdata[6])."<br></td>\n"); |
---|
312 |
|
---|
313 |
|
---|
314 |
echo("<td>".htmlspecialchars($rowdata[7])."<br></td>\n"); |
---|
315 |
|
---|
316 |
|
---|
317 |
echo("<td>"); |
---|
318 |
htmlspecialchars($rowdata[11]) == 1){ |
---|
319 |
"する"; |
---|
320 |
|
---|
321 |
"しない"; |
---|
322 |
|
---|
323 |
"<br></td>\n"); |
---|
324 |
"</tr>\n"); |
---|
325 |
$rowdata = $rs->fetch()); |
---|
326 |
?> |
---|
327 |
</tbody> |
---|
328 |
</table> |
---|
329 |
|
---|
330 |
|
---|
331 |
<table> |
---|
332 |
<tr><td>アナログ重複表示</td><td><br /></td></tr> |
---|
333 |
<tr><td>エンコーダ数</td><td><?php print "$recunits"; ?></td></tr> |
---|
334 |
<tr class="overwraped"><td>チューナー重複</td><td><br /></td></tr> |
---|
335 |
<tr class="exoverwraped"><td>外部入力重複</td><td><br /></td></tr> |
---|
336 |
</table> |
---|
337 |
|
---|
338 |
|
---|
339 |
<?php |
---|
340 |
} |
---|
341 |
$query = " |
---|
342 |
SELECT |
---|
343 |
foltia_program.tid, stationname, foltia_program.title, |
---|
344 |
foltia_tvrecord.bitrate, foltia_tvrecord.stationid, |
---|
345 |
foltia_tvrecord.digital |
---|
346 |
FROM foltia_tvrecord , foltia_program , foltia_station |
---|
347 |
WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid |
---|
348 |
ORDER BY foltia_program.tid DESC |
---|
349 |
"; |
---|
350 |
|
---|
351 |
$rs = sql_query($con, $query, "DBクエリに失敗しました"); |
---|
352 |
$rowdata = $rs->fetch(); |
---|
353 |
if (! $rowdata) { |
---|
354 |
|
---|
355 |
|
---|
356 |
}else{ |
---|
357 |
$maxcols = $rs->columnCount(); |
---|
358 |
|
---|
359 |
?> |
---|
360 |
<p align="left">録画予約番組タイトルを表示します。</p> |
---|
361 |
<table BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="100%"> |
---|
362 |
<thead> |
---|
363 |
<tr> |
---|
364 |
<th align="left">予約解除</th> |
---|
365 |
<th align="left">TID</th> |
---|
366 |
<th align="left">放映局</th> |
---|
367 |
<th align="left">タイトル</th> |
---|
368 |
<th align="left">録画リスト</th> |
---|
369 |
<th align="left">画質</th> |
---|
370 |
<th align="left">デジタル優先</th> |
---|
371 |
|
---|
372 |
</tr> |
---|
373 |
</thead> |
---|
374 |
|
---|
375 |
<tbody> |
---|
376 |
<?php |
---|
377 |
|
---|
378 |
do { |
---|
379 |
$tid = htmlspecialchars($rowdata[0]); |
---|
380 |
|
---|
381 |
if ($tid > 0){ |
---|
382 |
echo("<tr>\n"); |
---|
383 |
|
---|
384 |
if ( $userclass <= 1){ |
---|
385 |
echo("<td><a href=\"delreserve.php?tid=$tid&sid=" . |
---|
386 |
htmlspecialchars($rowdata[4]) . "\">解除</a></td>\n"); |
---|
387 |
}else{ |
---|
388 |
echo("<td>−</td>"); |
---|
389 |
} |
---|
390 |
|
---|
391 |
echo("<td><a href=\"reserveprogram.php?tid=$tid\">$tid</a></td>\n"); |
---|
392 |
|
---|
393 |
echo("<td>".htmlspecialchars($rowdata[1])."<br></td>\n"); |
---|
394 |
|
---|
395 |
echo("<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">" . |
---|
396 |
htmlspecialchars($rowdata[2]) . "</a></td>\n"); |
---|
397 |
|
---|
398 |
|
---|
399 |
echo("<td><a href=\"showlibc.php?tid=$tid\">mp4</a></td>\n"); |
---|
400 |
|
---|
401 |
echo("<td>".htmlspecialchars($rowdata[3])."<br></td>\n"); |
---|
402 |
|
---|
403 |
echo("<td>"); |
---|
404 |
if (htmlspecialchars($rowdata[5]) == 1){ |
---|
405 |
print "する"; |
---|
406 |
}else{ |
---|
407 |
print "しない"; |
---|
408 |
} |
---|
409 |
echo("</tr>\n"); |
---|
410 |
}else{ |
---|
411 |
print "<tr> |
---|
412 |
<td>−</td><td>0</td> |
---|
413 |
<td>[全局]<br></td> |
---|
414 |
<td>EPG録画</td> |
---|
415 |
<td><a href=\"showlibc.php?tid=0\">mp4</a></td>"; |
---|
416 |
echo("<td>".htmlspecialchars($rowdata[3])."<br></td>"); |
---|
417 |
|
---|
418 |
echo("<td>"); |
---|
419 |
if (htmlspecialchars($rowdata[5]) == 1){ |
---|
420 |
print "する"; |
---|
421 |
}else{ |
---|
422 |
print "しない"; |
---|
423 |
} |
---|
424 |
echo("\n</tr>"); |
---|
425 |
} |
---|
426 |
} while ($rowdata = $rs->fetch()); |
---|
427 |
} |
---|
428 |
?> |
---|
429 |
</tbody> |
---|
430 |
</table> |
---|
431 |
|
---|
432 |
|
---|
433 |
</body> |
---|
434 |
</html> |
---|
435 |
|
---|