| 1 | <?php | 
|---|
| 2 |  | 
|---|
| 3 |  | 
|---|
| 4 |  | 
|---|
| 5 |  | 
|---|
| 6 |  | 
|---|
| 7 |  | 
|---|
| 8 |  | 
|---|
| 9 |  | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | include("./foltialib.php"); | 
|---|
| 19 | $con = m_connect(); | 
|---|
| 20 |  | 
|---|
| 21 | if ($useenvironmentpolicy == 1){ | 
|---|
| 22 | if (!isset($_SERVER['PHP_AUTH_USER'])) { | 
|---|
| 23 | header("WWW-Authenticate: Basic realm=\"foltia\""); | 
|---|
| 24 | header("HTTP/1.0 401 Unauthorized"); | 
|---|
| 25 | redirectlogin(); | 
|---|
| 26 | exit; | 
|---|
| 27 | } else { | 
|---|
| 28 | login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']); | 
|---|
| 29 | } | 
|---|
| 30 | } | 
|---|
| 31 |  | 
|---|
| 32 | ?> | 
|---|
| 33 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | 
|---|
| 34 | <html lang="ja"> | 
|---|
| 35 | <head> | 
|---|
| 36 | <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> | 
|---|
| 37 | <meta http-equiv="Content-Style-Type" content="text/css"> | 
|---|
| 38 | <link rel="stylesheet" type="text/css" href="graytable.css"> | 
|---|
| 39 | <title>foltia:ファイル削除</title> | 
|---|
| 40 | </head> | 
|---|
| 41 |  | 
|---|
| 42 | <?php | 
|---|
| 43 | $now = date("YmdHi"); | 
|---|
| 44 |  | 
|---|
| 45 | $delete = $_POST['delete']; | 
|---|
| 46 |  | 
|---|
| 47 | ?> | 
|---|
| 48 |  | 
|---|
| 49 | <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > | 
|---|
| 50 | <div align="center"> | 
|---|
| 51 | <?php | 
|---|
| 52 | printhtmlpageheader(); | 
|---|
| 53 | ?> | 
|---|
| 54 | <p align="left"><font color="#494949" size="6">録画番組削除</font></p> | 
|---|
| 55 | <hr size="4"> | 
|---|
| 56 | <?php | 
|---|
| 57 | if ($delete == ""){ | 
|---|
| 58 | print "<p align=\"left\">削除番組はありません。</p>\n"; | 
|---|
| 59 | }else{ | 
|---|
| 60 |  | 
|---|
| 61 |  | 
|---|
| 62 | $userclass = getuserclass($con); | 
|---|
| 63 | if ( $userclass <= 1){ | 
|---|
| 64 |  | 
|---|
| 65 | print "<p align=\"left\">次の番組を削除しました。</p> | 
|---|
| 66 | <table BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\"> | 
|---|
| 67 | <thead> | 
|---|
| 68 | <tr> | 
|---|
| 69 | <th align=\"left\">ファイル名</th> | 
|---|
| 70 | <th align=\"left\">タイトル</th> | 
|---|
| 71 | <th align=\"left\">話数</th> | 
|---|
| 72 | <th align=\"left\">サブタイ</th> | 
|---|
| 73 | </tr> | 
|---|
| 74 | </thead> | 
|---|
| 75 | <tbody>"; | 
|---|
| 76 |  | 
|---|
| 77 |  | 
|---|
| 78 |  | 
|---|
| 79 |  | 
|---|
| 80 | foreach ($delete as $fName) { | 
|---|
| 81 |  | 
|---|
| 82 | $filesplit = split("-",$fName); | 
|---|
| 83 |  | 
|---|
| 84 | if ($filesplit[1] == ""){ | 
|---|
| 85 | $query = " | 
|---|
| 86 | SELECT | 
|---|
| 87 | foltia_program.tid,foltia_program.title,foltia_subtitle.subtitle | 
|---|
| 88 | FROM foltia_subtitle , foltia_program | 
|---|
| 89 | WHERE foltia_program.tid = foltia_subtitle.tid | 
|---|
| 90 | AND foltia_subtitle.tid = $filesplit[0] | 
|---|
| 91 | "; | 
|---|
| 92 | $rs = m_query($con, $query, "DBクエリに失敗しました"); | 
|---|
| 93 | $rowdata = pg_fetch_row($rs, $row); | 
|---|
| 94 |  | 
|---|
| 95 | $title = $rowdata[1]; | 
|---|
| 96 | $subtitle = ""; | 
|---|
| 97 | $count = ""; | 
|---|
| 98 | }else{ | 
|---|
| 99 |  | 
|---|
| 100 | $query = " | 
|---|
| 101 | SELECT | 
|---|
| 102 | foltia_program.tid,foltia_program.title,foltia_subtitle.countno,foltia_subtitle.subtitle | 
|---|
| 103 | FROM foltia_subtitle , foltia_program | 
|---|
| 104 | WHERE foltia_program.tid = foltia_subtitle.tid | 
|---|
| 105 | AND foltia_subtitle.tid = $filesplit[0] | 
|---|
| 106 | AND foltia_subtitle.countno = $filesplit[1] | 
|---|
| 107 | "; | 
|---|
| 108 | $rs = m_query($con, $query, "DBクエリに失敗しました"); | 
|---|
| 109 | $rowdata = pg_fetch_row($rs, $row); | 
|---|
| 110 |  | 
|---|
| 111 | $title = $rowdata[1]; | 
|---|
| 112 | $count = $rowdata[2]; | 
|---|
| 113 | $subtitle = $rowdata[3]; | 
|---|
| 114 |  | 
|---|
| 115 | } | 
|---|
| 116 |  | 
|---|
| 117 | $tid = htmlspecialchars($rowdata[0]); | 
|---|
| 118 | $title = htmlspecialchars($title); | 
|---|
| 119 | $count = htmlspecialchars($count); | 
|---|
| 120 | $subtitle = htmlspecialchars($subtitle); | 
|---|
| 121 |  | 
|---|
| 122 |  | 
|---|
| 123 |  | 
|---|
| 124 |  | 
|---|
| 125 | print " | 
|---|
| 126 | <tr> | 
|---|
| 127 | <td>$fName<br></td> | 
|---|
| 128 | <td><a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a></td> | 
|---|
| 129 | <td>$count<br></td> | 
|---|
| 130 | <td>$subtitle<br></td> | 
|---|
| 131 | </tr>\n | 
|---|
| 132 | "; | 
|---|
| 133 |  | 
|---|
| 134 |  | 
|---|
| 135 | if ($demomode){ | 
|---|
| 136 | }else{ | 
|---|
| 137 |  | 
|---|
| 138 | $query = " | 
|---|
| 139 | DELETE  FROM  foltia_m2pfiles | 
|---|
| 140 | WHERE m2pfilename = '$fName' | 
|---|
| 141 | "; | 
|---|
| 142 | $rs = m_query($con, $query, "DBクエリに失敗しました"); | 
|---|
| 143 |  | 
|---|
| 144 |  | 
|---|
| 145 | $oserr = system("$toolpath/perl/deletemovie.pl $fName"); | 
|---|
| 146 | } | 
|---|
| 147 |  | 
|---|
| 148 | } | 
|---|
| 149 |  | 
|---|
| 150 | print "    </tbody></table>\n"; | 
|---|
| 151 |  | 
|---|
| 152 | }else{ | 
|---|
| 153 | print "<p align=\"left\">ファイル削除権限がありません。</p>"; | 
|---|
| 154 | } | 
|---|
| 155 | } | 
|---|
| 156 | ?> | 
|---|
| 157 |  | 
|---|
| 158 | </body> | 
|---|
| 159 | </html> | 
|---|
| 160 |  | 
|---|