$sdt2 = "";
     if (isset($_POST["sdt2"])) {
         $sdt2 = $_POST["sdt2"];
     }
     $role = $_POST["role"];
     $level = $_POST["level"];
     if ($role != 3) {
         $level = 5;
     }
     $status = 1;
     $time = date('Y-m-d');
     $ip = "";
     echo "<br>role=" . $role;
     echo "<br>level=" . $level;
     echo "<br>";
     $id = UsersBUS::Add($password, $email, $hoten, $gender, $diachi, $sdt1, $sdt2, $role, $level, 1, $time, $ip);
     break;
 case "lock":
     $uid = explode(',', $_GET["uid"]);
     for ($i = 0; $i < count($uid); $i++) {
         UsersBUS::SetStatus($uid[$i], 0);
     }
     break;
 case "unlock":
     $uid = explode(',', $_GET["uid"]);
     for ($i = 0; $i < count($uid); $i++) {
         UsersBUS::SetStatus($uid[$i], 1);
     }
     break;
 case "delete":
     $uid = explode(',', $_GET["uid"]);
示例#2
0
    include_once $PATH . "../../BUS/PicturesBUS.php";
    $username = $_POST["txtUsername"];
    $email = $_POST["txtEmail"];
    $password = $_POST["txtPassword"];
    $repassword = $_POST["txtRePassword"];
    $sex = (int) $_POST["lbSex"];
    $day = (int) $_POST["lbDay"];
    $month = (int) $_POST["lbMonth"];
    $year = (int) $_POST["lbYear"];
    $birthday = sprintf("%d-%d-%d", $year, $month, $day);
    $now = date("Y-m-d H:i:s");
    $security_question = $_POST["lbSecurityQuestion"];
    $answer = $_POST["txtAnswer"];
    $type = $_POST["lbType"];
    $status = $_POST["lbStatus"];
    $user_id = UsersBUS::Add($username, $password, $email, null, $now, $security_question, $answer, null, $status, $type);
    if (!empty($user_id)) {
        User_Personal_InformationBUS::Add($user_id, null, null, null, null, null, null, null);
        User_Contact_InformationBUS::Add($user_id, null, null, null, null);
        User_Basic_InformationBUS::Add($user_id, null, null, null, $username, $sex, $birthday);
        AlbumsBUS::Add("Avatar", null, $now, $user_id, null);
    }
}
if (isset($_POST["btUpdate"])) {
    include_once $PATH . "../../BUS/UsersBUS.php";
    $uid = $_POST["uid"];
    $user = UsersBUS::GetUserByID($uid);
    if ($_POST["txtEmail"] != $user[3]) {
        UsersBUS::SetEmail($uid, $_POST["txtEmail"]);
    }
    if (!empty($_POST["txtPassword"])) {
    }
    $time = date('Y-m-d');
    $radio_gender = $_POST['gender'];
    echo "<br>radio=" . $radio_gender;
    $rsUpdate = UsersBUS::UpdateInfor($id, $username, $radio_gender, $address, $dt1, $dt2, $time);
    if ($rsUpdate == true) {
        header("Location:../thongtinkhachhang.php?update=success");
    } else {
        header("Location:../thongtinkhachhang.php?update=failed");
    }
}
if (isset($_POST["btRegister"])) {
    include "../../BUS/UsersBUS.php";
    $password = $_POST["txtPassword"];
    $username = $_POST["txtUsername"];
    $dt1 = $_POST["txtPhone"];
    $dt2 = $_POST["txtMobile"];
    $email = $_POST["txtEmail"];
    $address = $_POST["txtAddress"];
    $gender = $_POST["gender"];
    $fRegister = "false";
    $time = date('Y-m-d');
    $ip = "192.168.1.22";
    $id = UsersBUS::Add($password, $email, $username, $gender, $address, $dt1, $dt2, 2, 4, 0, $time, $ip);
    if (!empty($id)) {
        $fRegister = "true";
        header("Location:../dichvu.php?do=login");
    } else {
        header("Location:../dangky.php?do=failed");
    }
}