| 1 | <?php | 
|---|
| 2 |  | 
|---|
| 3 |  | 
|---|
| 4 |  | 
|---|
| 5 |  | 
|---|
| 6 |  | 
|---|
| 7 |  | 
|---|
| 8 |  | 
|---|
| 9 |  | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 |  | 
|---|
| 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 |  | 
|---|
| 85 |  | 
|---|
| 86 | if(($fName == ".") or ($fName == "..") ){ continue; } | 
|---|
| 87 | ereg(".m2p", $fName)){ | 
|---|
| 88 | $filesplit = split("-",$fName); | 
|---|
| 89 |  | 
|---|
| 90 | $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 |  | 
|---|
| 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 |  | 
|---|
| 117 | $title = $rowdata[1]; | 
|---|
| 118 | $count = $rowdata[2]; | 
|---|
| 119 | $subtitle = $rowdata[3]; | 
|---|
| 120 | } | 
|---|
| 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 |  | 
|---|
| 137 | print "            <td align=\"left\"> N/A </td>\n"; | 
|---|
| 138 |  | 
|---|
| 139 |  | 
|---|
| 140 | "</tr>\n | 
|---|
| 141 | ; | 
|---|
| 142 |  | 
|---|
| 143 | } | 
|---|
| 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 |  | 
|---|
| 202 |  | 
|---|
| 203 |  | 
|---|
| 204 |  | 
|---|
| 205 |  | 
|---|
| 206 | print "            <td align=\"left\"><a href=\"./selectcaptureimage.php?pid=$pid\">キャプ</a></td>\n"; | 
|---|
| 207 |  | 
|---|
| 208 | "</tr>\n | 
|---|
| 209 | ; | 
|---|
| 210 |  | 
|---|
| 211 | }else{ | 
|---|
| 212 | print " | 
|---|
| 213 | <tr> | 
|---|
| 214 | <td COLSPAN=\"5\">ファイルがありません</td> | 
|---|
| 215 | </tr> | 
|---|
| 216 | "; | 
|---|
| 217 |  | 
|---|
| 218 |  | 
|---|
| 219 | } | 
|---|
| 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 | } | 
|---|
| 264 | print "</tbody></table>\n"; | 
|---|
| 265 | } | 
|---|
| 266 | } | 
|---|
| 267 |  | 
|---|
| 268 | ?> | 
|---|
| 269 |  | 
|---|
| 270 |  | 
|---|
| 271 | </body> | 
|---|
| 272 | </html> | 
|---|
| 273 |  | 
|---|