/var/www/hkosl.com/innoutstorage/webadmin/sys_cms_user_deleted.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
<?php

    
include 'config.php';
// Check if the user is logged in
    
if ((!isSet($_SESSION['loginname'])) || ($loggin <> '1')) {
        
header("Location: login.php");
        exit;
    }

    if (
$_SESSION['role'] != 'super_admin') {
        
header("Location: sys_cms_user_index.php");
    }

    if(empty(
$_GET["cmsloginid"]) || (int)$_GET["cmsloginid"] <= 0){
        echo 
"<script>alert('請選擇正確的用戶。');history.back();</script>";
        exit;
    }

    
$nowdate date("Y-m-d H:i:s");
    
$cmsloginid = (int)$_GET["cmsloginid"];

    
$sth1 $dbh->prepare("update sys_cms_login set deleted=? where cmsloginid = ?");
    
$parameter = array(1$cmsloginid);
    if (!
$sth1->execute($parameter))
        throw new 
Exception('[' $sth1->errorCode() . ']: '.print_r($sth1->errorInfo()));
    else
        
header("Location: sys_cms_user_index.php?msg=刪除成功");

    
$dbh null;