-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_board_delete.php
144 lines (132 loc) Β· 5.74 KB
/
admin_board_delete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
session_start();
if (isset($_SESSION["userlevel"])) $userlevel = $_SESSION["userlevel"];
else $userlevel = "";
if ( $userlevel != 1 )
{
echo("
<script>
alert('κ΄λ¦¬μκ° μλλλ€! νμ μμ λ κ΄λ¦¬μλ§ κ°λ₯ν©λλ€!');
history.go(-1)
</script>
");
exit;
}
if (isset($_POST["item"]))
$num_item = count($_POST["item"]);
else
echo("
<script>
alert('μμ ν κ²μκΈμ μ νν΄μ£ΌμΈμ!');
history.go(-1)
</script>
");
$university = $_GET["university"];
$con = mysqli_connect("localhost", "user1", "12345", "sample");
for($i=0; $i<count($_POST["item"]); $i++){
$num = $_POST["item"][$i];
if($university=="건μλνκ΅")
$sql = "select * from mentofind where num = $num";
elseif($university=="λμ λνκ΅")
$sql = "select * from mentofind1 where num = $num";
elseif($university=="λμ μ νλνκ΅")
$sql = "select * from mentofind2 where num = $num";
elseif($university=="λͺ©μλνκ΅")
$sql = "select * from mentofind3 where num = $num";
elseif($university=="λ°°μ¬λνκ΅")
$sql = "select * from mentofind4 where num = $num";
elseif($university=="μ°μ‘λνκ΅")
$sql = "select * from mentofind5 where num = $num";
elseif($university=="μμ§λνκ΅")
$sql = "select * from mentofind6 where num = $num";
elseif($university=="μΆ©λ¨λνκ΅")
$sql = "select * from mentofind7 where num = $num";
elseif($university=="μΉ¨λ‘μ νλνκ΅")
$sql = "select * from mentofind8 where num = $num";
elseif($university=="νκ΅κ³ΌνκΈ°μ μ")
$sql = "select * from mentofind9 where num = $num";
elseif($university=="νλ¨λνκ΅")
$sql = "select * from mentofind10 where num = $num";
elseif($university=="νλ°λνκ΅")
$sql = "select * from mentofind11 where num = $num";
elseif($university=="λλλνκ΅")
$sql = "select * from mentofind12 where num = $num";
elseif($university=="λμ 보건λνκ΅")
$sql = "select * from mentofind13 where num = $num";
elseif($university=="μ°μ‘μ 보λνκ΅")
$sql = "select * from mentofind14 where num = $num";
elseif($university=="λμ κ³ΌνκΈ°μ νκ΅")
$sql = "select * from mentofind15 where num = $num";
elseif($university=="νκ΅ν΄λ¦¬ν
IVλνκ΅")
$sql = "select * from mentofind16 where num = $num";
elseif($university=="κ³ΌνκΈ°μ μ°ν©λνμλνκ΅")
$sql = "select * from mentofind17 where num = $num";
elseif($university=="건μ λνμλνκ΅")
$sql = "select * from mentofind18 where num = $num";
elseif($university=="건μμ¬μ΄λ²λνκ΅")
$sql = "select * from mentofind19 where num = $num";
elseif($university=="νκ΅λ°©μ‘ν΅μ λνκ΅")
$sql = "select * from mentofind20 where num = $num";
elseif($university=="none")
$sql = "select * from mentofind21 where num = $num";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
$copied_name = $row["file_copied"];
if ($copied_name)
{
$file_path = "./data/".$copied_name;
unlink($file_path);
}
if($university=="건μλνκ΅")
$sql = "delete from mentofind where num = $num";
elseif($university=="λμ λνκ΅")
$sql = "delete from mentofind1 where num = $num";
elseif($university=="λμ μ νλνκ΅")
$sql = "delete * from mentofind2 where num = $num";
elseif($university=="λͺ©μλνκ΅")
$sql = "delete * from mentofind3 where num = $num";
elseif($university=="λ°°μ¬λνκ΅")
$sql = "delete * from mentofind4 where num = $num";
elseif($university=="μ°μ‘λνκ΅")
$sql = "delete * from mentofind5 where num = $num";
elseif($university=="μμ§λνκ΅")
$sql = "delete * from mentofind6 where num = $num";
elseif($university=="μΆ©λ¨λνκ΅")
$sql = "delete * from mentofind7 where num = $num";
elseif($university=="μΉ¨λ‘μ νλνκ΅")
$sql = "delete * from mentofind8 where num = $num";
elseif($university=="νκ΅κ³ΌνκΈ°μ μ")
$sql = "delete * from mentofind9 where num = $num";
elseif($university=="νλ¨λνκ΅")
$sql = "delete * from mentofind10 where num = $num";
elseif($university=="νλ°λνκ΅")
$sql = "delete * from mentofind11 where num = $num";
elseif($university=="λλλνκ΅")
$sql = "delete * from mentofind12 where num = $num";
elseif($university=="λμ 보건λνκ΅")
$sql = "delete * from mentofind13 where num = $num";
elseif($university=="μ°μ‘μ 보λνκ΅")
$sql = "delete * from mentofind14 where num = $num";
elseif($university=="λμ κ³ΌνκΈ°μ νκ΅")
$sql = "delete * from mentofind15 where num = $num";
elseif($university=="νκ΅ν΄λ¦¬ν
IVλνκ΅")
$sql = "delete * from mentofind16 where num = $num";
elseif($university=="κ³ΌνκΈ°μ μ°ν©λνμλνκ΅")
$sql = "delete * from mentofind17 where num = $num";
elseif($university=="건μ λνμλνκ΅")
$sql = "delete * from mentofind18 where num = $num";
elseif($university=="건μμ¬μ΄λ²λνκ΅")
$sql = "delete * from mentofind19 where num = $num";
elseif($university=="νκ΅λ°©μ‘ν΅μ λνκ΅")
$sql = "delete * from mentofind20 where num = $num";
elseif($university=="none")
$sql = "delete * from mentofind21 where num = $num";
mysqli_query($con, $sql);
}
mysqli_close($con);
echo "
<script>
location.href = 'admin.php';
</script>
";
?>