root/trunk/install/php/showplaylist.php

リビジョン 1, 6.8 kB (コミッタ: jplcom, コミット時期: 18 年 前)

initial import

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