root/trunk/install/php/showplaylist.php

リビジョン 32, 6.7 kB (コミッタ: sorshi, コミット時期: 18 年 前)

 録画ディスクの空き容量が少なくなってくると一部ページの背景を色変えて警告する機能追加。
 100GB以下:黄灰
 50GB以下:赤灰
 30GB以下:赤

Line 
1 <?php
2 /*
3  Anime recording system foltia
4  http://www.dcc-jpl.com/soft/foltia/
5
6 showplaylist.php
7
8 目的
9 録画したmpeg2の番組一覧を表示します。
10
11
12 オプション
13 list:
14  省略時、録画順にソートされる。
15  titleのときに、番組順ソートされる。
16  rawのときに、DBに記録されている番組録画情報ではなくディレクトリにあるm2pファイルを全て表示する。
17
18  DCC-JPL Japan/foltia project
19
20 */
21 ?>
22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
23 <html lang="ja">
24 <head>
25 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
26 <meta http-equiv="Content-Style-Type" content="text/css">
27 <link rel="stylesheet" type="text/css" href="graytable.css">
28 <?php
29 include("./foltialib.php");
30
31 //ディスク空き容量によって背景色表示変更
32 warndiskfreearea();
33
34 print "<title>foltia:recorded file list</title>
35 </head>";
36
37 $con = m_connect();
38 $now = date("YmdHi");   
39 ?>
40 <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" >
41 <div align="center">
42 <?php
43     printhtmlpageheader();
44 ?>
45   <p align="left"><font color="#494949" size="6">録画一覧表示</font></p>
46   <hr size="4">
47 <p align="left">再生可能番組リストを表示します。<br>
48 <?php
49 if ($demomode){
50 }else{
51     printdiskusage();
52     printtrcnprocesses();
53 }
54 ?>
55 <form name="deletemovie" method="POST" action="./deletemovie.php">
56 <p align="left"><input type="submit" value="項目削除" ></p>
57
58   <table BORDER="0" CELLPADDING="0" CELLSPACING="2" WIDTH="100%">
59     <thead>
60         <tr>
61             <th align="left">削除</th>
62             <th align="left"><A HREF="./showplaylist.php">ファイル名</A></th>
63             <th align="left"><A HREF="./showplaylist.php?list=title">タイトル</A></th>
64             <th align="left">話数</th>
65             <th align="left">サブタイ</th>
66 <?php
67 if (file_exists("./selectcaptureimage.php") ) {
68 print "            <th align=\"left\">キャプ</th>\n";
69 }
70 ?>
71         </tr>
72     </thead>
73
74     <tbody>
75
76
77 <?
78 $list = getgetform('list');
79
80 //旧仕様
81 if($list == "raw"){
82 exec ("ls -t  $recfolderpath/*.m2p", $m2pfiles);
83
84
85 foreach($m2pfiles as $pathfName) {
86 $fNametmp = split("/",$pathfName);
87 $fName = array_pop($fNametmp);
88 //print "FILENAME:$fName<BR>\n";
89
90         if(($fName == ".") or ($fName == "..") ){ continue; }
91     if (ereg(".m2p", $fName)){
92         $filesplit = split("-",$fName);
93     
94 if ($filesplit[1] == ""){
95 $query = "
96 SELECT
97 foltia_program.tid,foltia_program.title,foltia_subtitle.subtitle 
98 FROM foltia_subtitle , foltia_program   
99 WHERE foltia_program.tid = foltia_subtitle.tid 
100  AND foltia_subtitle.tid = $filesplit[0]
101 ";
102 $rs = m_query($con, $query, "DBクエリに失敗しました");
103 $rowdata = pg_fetch_row($rs, $row);
104 //print" $fName./$rowdata[1]//$rowdata[2]<BR>\n";
105 $title = $rowdata[1];
106 $subtitle = "";
107 $count = "";
108 }else{
109
110 $query = "
111 SELECT
112 foltia_program.tid,foltia_program.title,foltia_subtitle.countno,foltia_subtitle.subtitle 
113 FROM foltia_subtitle , foltia_program   
114 WHERE foltia_program.tid = foltia_subtitle.tid 
115  AND foltia_subtitle.tid = $filesplit[0]
116  AND foltia_subtitle.countno = $filesplit[1]
117 ";
118 $rs = m_query($con, $query, "DBクエリに失敗しました");
119 $rowdata = pg_fetch_row($rs, $row);
120 //print" $fName./$rowdata[1]/$rowdata[2]/$rowdata[3]<BR>\n";
121 $title = $rowdata[1];
122 $count = $rowdata[2];
123 $subtitle = $rowdata[3];
124 }//if 話数あるかどうか
125
126 $tid = htmlspecialchars($rowdata[0]);
127 $title = htmlspecialchars($title);
128 $count = htmlspecialchars($count);
129 $subtitle = htmlspecialchars($subtitle);
130
131 //--
132 print "
133 <tr>
134 <td><INPUT TYPE='checkbox' NAME='delete[]' VALUE='$fName'><br></td>
135 <td><A HREF=\"$httpmediamappath/$fName\">$fName</A><br></td>
136 <td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a></td>
137 <td>$count<br></td>
138 <td>$subtitle<br></td>";
139     if (file_exists("./selectcaptureimage.php") ) {
140 //    $capimgpath = preg_replace("/.m2p/", "", $fName);
141     print "            <td align=\"left\"> N/A </td>\n";
142     }
143
144 print "</tr>\n
145 ";
146 }//ereg
147 }//foreach
148 print "    </tbody>\n</table>\n</FORM>\n</body>\n</html>\n";
149 exit;
150 }elseif ($list== "title"){//新仕様
151 $query = "
152 SELECT
153 foltia_program.tid,
154 foltia_program.title,
155 foltia_subtitle.countno,
156 foltia_subtitle.subtitle  ,
157 foltia_m2pfiles.m2pfilename  ,
158 foltia_subtitle.pid   
159 FROM foltia_subtitle , foltia_program , foltia_m2pfiles
160 WHERE foltia_program.tid = foltia_subtitle.tid 
161  AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename
162 ORDER BY foltia_subtitle.tid  DESC , foltia_subtitle.startdatetime  ASC
163
164
165 ";
166 }else{
167 $query = "
168 SELECT
169 foltia_program.tid,
170 foltia_program.title,
171 foltia_subtitle.countno,
172 foltia_subtitle.subtitle  ,
173 foltia_m2pfiles.m2pfilename  ,
174 foltia_subtitle.pid   
175 FROM foltia_subtitle , foltia_program , foltia_m2pfiles
176 WHERE foltia_program.tid = foltia_subtitle.tid 
177  AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename
178 ORDER BY foltia_subtitle.startdatetime DESC
179 ";
180 }
181
182 $rs = m_query($con, $query, "DBクエリに失敗しました");
183 $maxrows = pg_num_rows($rs);
184
185 if ($maxrows > 0){
186 for ($row = 0; $row < $maxrows; $row++) {
187 $rowdata = pg_fetch_row($rs, $row);
188
189 $tid = htmlspecialchars($rowdata[0]);
190 $title = htmlspecialchars($rowdata[1]);
191 $count = htmlspecialchars($rowdata[2]);
192 $subtitle = htmlspecialchars($rowdata[3]);
193 $fName  = htmlspecialchars($rowdata[4]);
194 $pid  = htmlspecialchars($rowdata[5]);
195 //--
196 print "
197 <tr>
198 <td><INPUT TYPE='checkbox' NAME='delete[]' VALUE='$fName'><br></td>
199 <td><A HREF=\"$httpmediamappath/$fName\">$fName</A><br></td>";
200 if ($tid > 0){
201 print"<td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a></td>
202 <td>$count<br></td>
203 <td><a href = \"http://cal.syoboi.jp/tid/$tid/time#$pid\" target=\"_blank\">$subtitle</a><br></td>";
204 }else{
205 print"<td>$title</td>
206 <td>$count<br></td>
207 <td>$subtitle<br></td>";
208 }
209     if (file_exists("./selectcaptureimage.php") ) {
210     $capimgpath = preg_replace("/.m2p/", "", $fName);
211     print "            <td align=\"left\"><a href=\"./selectcaptureimage.php?pid=$pid\">キャプ</a></td>\n";
212     }
213 print "</tr>\n
214 ";
215 }//for
216 }else{
217 print "
218 <tr>
219 <td COLSPAN=\"5\">ファイルがありません</td>
220 </tr>
221 ";
222
223
224 }//end if
225
226 print "</tbody>
227 </table>
228 </FORM>\n";
229
230 //番組ソートの時、未読番組のタイトルだけ表示
231 if ($list== "title"){
232 $query = "
233 SELECT distinct
234 foltia_program.tid,
235 foltia_program.title
236 FROM foltia_subtitle , foltia_program , foltia_m2pfiles
237 WHERE foltia_program.tid = foltia_subtitle.tid 
238  AND foltia_subtitle.m2pfilename = foltia_m2pfiles.m2pfilename
239 ORDER BY foltia_program.tid DESC
240 ";
241
242 $rs = m_query($con, $query, "DBクエリに失敗しました");
243 $maxrows = pg_num_rows($rs);
244
245
246 if ($maxrows > 0){
247 print "<hr>
248 <p align=\"left\">未読タイトルを表示します。<br>
249   <table BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">
250     <thead>
251         <tr>
252             <th align=\"left\">TID</th>
253             <th align=\"left\">タイトル</th>
254         </tr>
255     </thead>
256     <tbody>
257 ";
258
259 for ($row = 0; $row < $maxrows; $row++) {
260 $rowdata = pg_fetch_row($rs, $row);
261
262 $tid = htmlspecialchars($rowdata[0]);
263 $title = htmlspecialchars($rowdata[1]);
264
265
266 print "<tr><td>$tid</td><td>$title</td></tr>\n";
267
268 }//for
269 print "</tbody></table>\n";
270 }//if maxrows
271 }//if title
272
273 ?>
274    
275
276 </body>
277 </html>
278
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed