-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
205 lines (195 loc) Β· 7.36 KB
/
admin.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>λ©λλ‘±λν</title>
<link rel="stylesheet" type="text/css" href="./css/common.css">
<link rel="stylesheet" type="text/css" href="./css/admin.css">
<link rel="stylesheet" href="css/main1.css">
<link rel="shortcut icon" href="img/favicon.png">
</head>
<body>
<header>
<?php include "header.php";?>
</header>
<section>
<div id="main_img_bar">
<img src="./img/main_img.png">
</div>
<div id="admin_box">
<h3 id="member_title">
κ΄λ¦¬μ λͺ¨λ > νμ κ΄λ¦¬
</h3>
<ul id="member_list">
<li>
<span class="col1">λ²νΈ</span>
<span class="col2">μμ΄λ</span>
<span class="col3">μ΄λ¦</span>
<span class="col4">λ 벨</span>
<span class="col5">ν¬μΈνΈ</span>
<span class="col6">κ°μ
μΌ</span>
<span class="col7">μμ </span>
<span class="col8">μμ </span>
</li>
<?php
ini_set('display_errors', '0');
$con = mysqli_connect("localhost", "user1", "12345", "sample");
$sql = "select * from members order by num desc";
$result = mysqli_query($con, $sql);
$total_record = mysqli_num_rows($result); // μ 체 νμ μ
$number = $total_record;
while ($row = mysqli_fetch_array($result))
{
$num = $row["num"];
$id = $row["id"];
$name = $row["name"];
$level = $row["level"];
$point = $row["point"];
$regist_day = $row["regist_day"];
?>
<li>
<form method="post" action="admin_member_update.php?num=<?=$num?>">
<span class="col1"><?=$number?></span>
<span class="col2"><?=$id?></a></span>
<span class="col3"><?=$name?></span>
<span class="col4"><input type="text" name="level" value="<?=$level?>"></span>
<span class="col5"><input type="text" name="point" value="<?=$point?>"></span>
<span class="col6"><?=$regist_day?></span>
<span class="col7"><button type="submit">μμ </button></span>
<span class="col8"><button type="button" onclick="location.href='admin_member_delete.php?num=<?=$num?>'">μμ </button></span>
</form>
</li>
<?php
$number--;
$university = $_GET["university"];
}
?><div id="board_box">
<h3 id="board_title">
λνκ΅ μ ν
</h3>
<form name="get1" method="get" action="admin.php">
<select name="university">
<option value="none">=== λνκ΅λ₯Ό μ ννμμ€. ===</option>
<option value="건μλνκ΅">건μλνκ΅</option>
<option value="λμ λνκ΅">λμ λνκ΅</option>
<option value="λμ μ νλνκ΅">λμ μ νλνκ΅</option>
<option value="λͺ©μλνκ΅">λͺ©μλνκ΅</option>
<option value="λ°°μ¬λνκ΅">λ°°μ¬λνκ΅</option>
<option value="μ°μ‘λνκ΅">μ°μ‘λνκ΅</option>
<option value="μμ§λνκ΅">μμ§λνκ΅</option>
<option value="μΆ©λ¨λνκ΅">μΆ©λ¨λνκ΅</option>
<option value="μΉ¨λ‘μ νλνκ΅">μΉ¨λ‘μ νλνκ΅</option>
<option value="νκ΅κ³ΌνκΈ°μ μ">νκ΅κ³ΌνκΈ°μ μ</option>
<option value="νλ¨λνκ΅">νλ¨λνκ΅</option>
<option value="νλ°λνκ΅">νλ°λνκ΅</option>
<option value="λλλνκ΅">λλλνκ΅</option>
<option value="λμ 보건λνκ΅">λμ 보건λνκ΅</option>
<option value="μ°μ‘μ 보λνκ΅">μ°μ‘μ 보λνκ΅</option>
<option value="λμ κ³ΌνκΈ°μ νκ΅">λμ κ³ΌνκΈ°μ νκ΅</option>
<option value="νκ΅ν΄λ¦¬ν
IVλνκ΅">νκ΅ν΄λ¦¬ν
IVλνκ΅</option>
<option value="κ³ΌνκΈ°μ μ°ν©λνμλνκ΅">κ³ΌνκΈ°μ μ°ν©λνμλνκ΅</option>
<option value="건μ λνμλνκ΅">건μ λνμλνκ΅</option>
<option value="건μμ¬μ΄λ²λνκ΅">건μμ¬μ΄λ²λνκ΅</option>
<option value="νκ΅λ°©μ‘ν΅μ λνκ΅">νκ΅λ°©μ‘ν΅μ λνκ΅</option>
</select>
<input type = "submit" value = "μλ£" ></input>
</form>
</div>
</ul>
<h3 id="member_title">
κ΄λ¦¬μ λͺ¨λ > κ²μν κ΄λ¦¬
</h3>
<ul id="board_list">
<li class="title">
<span class="col1">μ ν</span>
<span class="col2">λ²νΈ</span>
<span class="col3">μ΄λ¦</span>
<span class="col4">μ λͺ©</span>
<span class="col5">첨λΆνμΌλͺ
</span>
<span class="col6">μμ±μΌ</span>
</li>
<form method="post" action="admin_board_delete.php?university=<?=$university?>">
<?php
ini_set('display_errors', '0');
$university = $_GET["university"];
if($university=="건μλνκ΅")
$sql = "select * from mentofind order by num desc";
elseif($university=="λμ λνκ΅")
$sql = "select * from mentofind1 order by num desc";
elseif($university=="λμ μ νλνκ΅")
$sql = "select * from mentofind2 order by num desc";
elseif($university=="λͺ©μλνκ΅")
$sql = "select * from mentofind3 order by num desc";
elseif($university=="λ°°μ¬λνκ΅")
$sql = "select * from mentofind4 order by num desc";
elseif($university=="μ°μ‘λνκ΅")
$sql = "select * from mentofind5 order by num desc";
elseif($university=="μμ§λνκ΅")
$sql = "select * from mentofind6 order by num desc";
elseif($university=="μΆ©λ¨λνκ΅")
$sql = "select * from mentofind7 order by num desc";
elseif($university=="μΉ¨λ‘μ νλνκ΅")
$sql = "select * from mentofind8 order by num desc";
elseif($university=="νκ΅κ³ΌνκΈ°μ μ")
$sql = "select * from mentofind9 order by num desc";
elseif($university=="νλ¨λνκ΅")
$sql = "select * from mentofind10 order by num desc";
elseif($university=="νλ°λνκ΅")
$sql = "select * from mentofind11 order by num desc";
elseif($university=="λλλνκ΅")
$sql = "select * from mentofind12 order by num desc";
elseif($university=="λμ 보건λνκ΅")
$sql = "select * from mentofind13 order by num desc";
elseif($university=="μ°μ‘μ 보λνκ΅")
$sql = "select * from mentofind14 order by num desc";
elseif($university=="λμ κ³ΌνκΈ°μ νκ΅")
$sql = "select * from mentofind15 order by num desc";
elseif($university=="νκ΅ν΄λ¦¬ν
IVλνκ΅")
$sql = "select * from mentofind16 order by num desc";
elseif($university=="κ³ΌνκΈ°μ μ°ν©λνμλνκ΅")
$sql = "select * from mentofind17 order by num desc";
elseif($university=="건μ λνμλνκ΅")
$sql = "select * from mentofind18 order by num desc";
elseif($university=="건μμ¬μ΄λ²λνκ΅")
$sql = "select * from mentofind19 order by num desc";
elseif($university=="νκ΅λ°©μ‘ν΅μ λνκ΅")
$sql = "select * from mentofind1 order by num desc";
elseif($university=="none")
$sql = "select * from mentofind21 order by num desc";
else
$sql = "select * from mentofind order by num desc";
$result = mysqli_query($con, $sql);
$total_record = mysqli_num_rows($result); // μ 체 κΈμ μ
$number = $total_record;
while ($row = mysqli_fetch_array($result))
{
$num = $row["num"];
$name = $row["name"];
$subject = $row["subject"];
$file_name = $row["file_name"];
$regist_day = $row["regist_day"];
$regist_day = substr($regist_day, 0, 10)
?>
<li>
<span class="col1"><input type="checkbox" name="item[]" value="<?=$num?>"></span>
<span class="col2"><?=$number?></span>
<span class="col3"><?=$name?></span>
<span class="col4"><?=$subject?></span>
<span class="col5"><?=$file_name?></span>
<span class="col6"><?=$regist_day?></span>
</li>
<?php
$number--;
}
mysqli_close($con);
?>
<button type="submit">μ νλ κΈ μμ </button>
</form>
</ul>
</div> <!-- admin_box -->
</section>
<footer>
<?php include "footer.php";?>
</footer>
</body>
</html>