-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeletec.php
47 lines (43 loc) · 972 Bytes
/
deletec.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
<?php
require_once("load.php");
if($session->check(function ($user, $level) {
return $level == "admin";
})){
$code = $member->delete_u($_POST['username']);//使用刪除函數
switch ($code)
{
case 0:
$status = 0;
$msg = "使用者不能為空!";
$redirectTo = "delete.php";
break;
case 1:
$status = 0;
$msg = "使用者不存在!";
$redirectTo = "delete.php";
break;
case 2:
$status = 1;
$msg = "刪除成功!";
$redirectTo = "member.php";
break;
case 3:
$status = 0;
$msg = "刪除失敗!";
$redirectTo = "member.php";
break;
}
}
else
{
$status = 0;
$msg = "帳號權限不足或您尚未登入!";
$redirectTo = "login.php";
}
//blade
echo $view->view()->make('tpl.msg',[
'title' => '刪除會員',
'status' => $status,
'msg' => $msg,
'redirectTo' => $redirectTo
])->render();