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