| 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 |  | 
|---|
| 85 |  | 
|---|
| 86 |  | 
|---|
| 87 |  | 
|---|
| 88 |  | 
|---|
| 89 |  | 
|---|
| 90 |  | 
|---|
| 91 |  | 
|---|
| 92 |  | 
|---|
| 93 |  | 
|---|
| 94 |  | 
|---|
| 95 |  | 
|---|
| 96 |  | 
|---|
| 97 |  | 
|---|
| 98 |  | 
|---|
| 99 |  | 
|---|
| 100 |  | 
|---|
| 101 |  | 
|---|
| 102 |  | 
|---|
| 103 | $query = " | 
|---|
| 104 | SELECT foltia_program.tid,foltia_program.title,foltia_subtitle.countno,foltia_subtitle.subtitle | 
|---|
| 105 | FROM foltia_subtitle , foltia_program | 
|---|
| 106 | WHERE foltia_program.tid = foltia_subtitle.tid | 
|---|
| 107 | AND foltia_subtitle.m2pfilename =  ? | 
|---|
| 108 | "; | 
|---|
| 109 |  | 
|---|
| 110 |  | 
|---|
| 111 |  | 
|---|
| 112 | $rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName)); | 
|---|
| 113 | $rall = $rs->fetchAll(); | 
|---|
| 114 |  | 
|---|
| 115 | $rowdata = $rall[0]; | 
|---|
| 116 |  | 
|---|
| 117 | $title = $rowdata[1]; | 
|---|
| 118 | $count = $rowdata[2]; | 
|---|
| 119 | $subtitle = $rowdata[3]; | 
|---|
| 120 |  | 
|---|
| 121 |  | 
|---|
| 122 |  | 
|---|
| 123 | $tid = htmlspecialchars($rowdata[0]); | 
|---|
| 124 | $title = htmlspecialchars($title); | 
|---|
| 125 | $count = htmlspecialchars($count); | 
|---|
| 126 | $subtitle = htmlspecialchars($subtitle); | 
|---|
| 127 |  | 
|---|
| 128 | print " | 
|---|
| 129 | <tr> | 
|---|
| 130 | <td>$fName<br></td> | 
|---|
| 131 | <td>"; | 
|---|
| 132 |  | 
|---|
| 133 | if ($tid > 0 ){ | 
|---|
| 134 | print "<a href=\"http://cal.syoboi.jp/tid/$tid\" target=\"_blank\">$title</a>"; | 
|---|
| 135 | }else{ | 
|---|
| 136 | print "$title"; | 
|---|
| 137 | } | 
|---|
| 138 |  | 
|---|
| 139 | print "</td> | 
|---|
| 140 | <td>$count<br></td> | 
|---|
| 141 | <td>$subtitle<br></td> | 
|---|
| 142 | </tr>\n | 
|---|
| 143 | "; | 
|---|
| 144 |  | 
|---|
| 145 |  | 
|---|
| 146 | if ($demomode){ | 
|---|
| 147 | }else{ | 
|---|
| 148 |  | 
|---|
| 149 | $query = " | 
|---|
| 150 | DELETE  FROM  foltia_m2pfiles | 
|---|
| 151 | WHERE m2pfilename = ? | 
|---|
| 152 | "; | 
|---|
| 153 |  | 
|---|
| 154 | $rs = sql_query($con, $query, "DBクエリに失敗しました",array($fName)); | 
|---|
| 155 |  | 
|---|
| 156 |  | 
|---|
| 157 | $oserr = system("$toolpath/perl/deletemovie.pl $fName"); | 
|---|
| 158 | } | 
|---|
| 159 |  | 
|---|
| 160 | } | 
|---|
| 161 |  | 
|---|
| 162 | print "    </tbody></table>\n"; | 
|---|
| 163 |  | 
|---|
| 164 | }else{ | 
|---|
| 165 | print "<p align=\"left\">ファイル削除権限がありません。</p>"; | 
|---|
| 166 | } | 
|---|
| 167 | } | 
|---|
| 168 | ?> | 
|---|
| 169 |  | 
|---|
| 170 | </body> | 
|---|
| 171 | </html> | 
|---|
| 172 |  | 
|---|