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