Example #1
0
function checked_quyenhan()
{
    if (isset($_GET['key'])) {
        $idkey = EncodeSpecialChar($_GET['key']);
        $sql_quyenhan = "SELECT * FROM capquyen where user='******'";
        $result_thanhvien = mysql_query($sql_quyenhan);
        echo "<script language='JavaScript'>";
        while ($row = mysql_fetch_array($result_thanhvien)) {
            echo "document.form1.check_" . $row["id_chuyenmuc"] . ".checked=true;";
        }
        echo "</script>";
        // dong javascript
    }
}
Example #2
0
        echo "<script>alert('Mật khẩu mới phải lớn hơn 6 ký tự'); window.location='../admincp/?m=changepw';</script>";
    } else {
        if ($pw_old == $db_matkhau) {
            $pw = md5($pw);
            $result_changepw = mysql_query("UPDATE thanhvien SET pass='******' WHERE user='******'");
            echo "<script>alert('Đổi mật khẩu thành công.'); window.location='../admincp/index.php';</script>";
        } else {
            echo "<script>alert('Mật khẩu cũ bị sai'); window.location='../admincp/?m=changepw';</script>";
        }
    }
}
?>

<?php 
$ss_tendangnhap = $_SESSION['user'];
$idkey = EncodeSpecialChar($ss_tendangnhap);
$result_thanhvien = mysql_query("SELECT * FROM thanhvien where user='******'");
$row = mysql_fetch_array($result_thanhvien);
$db_user = $row["user"];
?>
<form name="form1" method="post" onSubmit="return admin_changepw(pw_old.value,pw.value,cpw.value);">
<table border="0" width="960" cellpadding="0" cellspacing="0" style="padding-top:5px ">
<tr bgcolor="#d4340c" style="color:#0B55C4; font-family:Tahoma; font-size: 13px; font-weight:bold" align="center" height="30">
<td class="tieude">ĐỔI MẬT KHẨU</td>
</tr>
</table>

   <table width="960"  border="0" cellpadding="5" cellspacing="1">
 <tr height="30" bgcolor="#FFFFFF" onmouseover="style.background='FFCC99'" onmouseout="style.background='#FFFFFF'">
      <td style="padding-left:250px" align="left">Tên đăng nhập:</td>
      <td width="500" align="left"><?php 
Example #3
0
$act = "";
$hoten = "";
$diachi = "";
$email = "";
$dienthoai = "";
if (isset($_POST["act"])) {
    include "connect.php";
    $hoten = $_POST["hoten"];
    $hoten = EncodeSpecialChar($hoten);
    $diachi = $_POST["diachi"];
    $diachi = EncodeSpecialChar($diachi);
    $email = $_POST["email"];
    $email = EncodeSpecialChar($email);
    $dienthoai = $_POST["dienthoai"];
    $dienthoai = EncodeSpecialChar($dienthoai);
    $anti = $_POST['anti'];
    $sql = "update thanhvien set hoten='{$hoten}',email='{$email}',dienthoai='{$dienthoai}',diachi='{$diachi}' where user='******'";
    $kq = mysql_query($sql);
    if (!$kq) {
        echo "<script>alert('Có lỗi SQL! Nhập lại!');</script>";
    } else {
        echo "<script>alert('Quý khách đã thay đổi thông tin cá nhân thành công! ');window.location='index.php?b=ttcn';</script>";
    }
}
?>

<?php 
$user = $_SESSION["user"];
$sql = "select * from thanhvien where user='******'";
$kq = mysql_query($sql);
Example #4
0
$diachi = "";
$email = "";
$dienthoai = "";
$user = "";
if (isset($_POST["act"])) {
    include "connect.php";
    $hoten = $_POST["hoten"];
    $hoten = EncodeSpecialChar($hoten);
    $diachi = $_POST["diachi"];
    $diachi = EncodeSpecialChar($diachi);
    $email = $_POST["email"];
    $email = EncodeSpecialChar($email);
    $dienthoai = $_POST["dienthoai"];
    $dienthoai = EncodeSpecialChar($dienthoai);
    $user = $_POST["user"];
    $user = EncodeSpecialChar($user);
    $pass = md5($_POST["pass"]);
    $sql = "insert into thanhvien(hoten,diachi,email,dienthoai,user,pass,hieuluc,capquyen) values('{$hoten}','{$diachi}','{$email}','{$dienthoai}','{$user}','{$pass}',1,3)";
    $kq = mysql_query($sql);
    if (!$kq) {
        echo "<script>alert('Có lỗi SQL! Nhập lại!');</script>";
    } else {
        echo "<script>alert('Chúc mừng {$user}! Quý khách đã đăng ký thành công! ');window.location='index.php';</script>";
    }
}
?>
<script language="javascript">
function createXMLHttp()
    {
        var xmlHttp =false;
        try{
Example #5
0
<?php

if (isset($HTTP_GET_VARS['active']) && isset($HTTP_GET_VARS['n'])) {
    $keyactive = $HTTP_GET_VARS["active"];
    $keyactive = EncodeSpecialChar($keyactive);
    $number = $HTTP_GET_VARS["n"];
    $number = intval($number);
    if ($keyactive == "administrator" || $keyactive == "admin") {
        echo "<script> alert('Bạn không có thể chỉnh sửa quyền của Administrator.')</script>";
    } else {
        if ($number == 1) {
            $result_hieuluc = mysql_query("UPDATE thanhvien SET hieuluc=0 WHERE user='******'");
        }
        if ($number == 0) {
            $result_hieuluc = mysql_query("UPDATE thanhvien SET hieuluc=1 WHERE user='******'");
        }
    }
    if ($result_hieuluc) {
        echo "<script>window.location='?m=thanhvien';</script>";
    }
}
if (isset($_POST["act"])) {
    if (isset($_POST["xoa"])) {
        $chon = $_POST["chon"];
        $count = count($chon);
        if ($count == 0) {
            echo "<script>alert('Chưa chọn thành viên cần xóa');</script>";
        } else {
            for ($j = 0; $j < $count; $j++) {
                if ($chon[$j] == "administrator" || $chon[$j] == "admin") {
                    echo "<script>alert('Không thể xóa tài khoản quản trị');</script>";
<?php

include "function.php";
include "connect.php";
if (!isset($_POST["user"])) {
    echo "<script>alert('Bạn chưa nhập tên đăng nhập');window.history.go(-1);</script>";
    //header("location:login.php");
} else {
    $user = EncodeSpecialChar($_POST["user"]);
    if (!isset($_POST["pass"])) {
        echo "<script>alert('Bạn chưa nhập mật khẩu');window.history.go(-1);</script>";
        //header("location:login.php");
    } else {
        $pass = md5($_POST["pass"]);
        $sql = "select * from thanhvien where user='******' and pass='******'";
        $kq = mysql_query($sql);
        $thanhvien = mysql_fetch_array($kq);
        $hieuluc = $thanhvien["hieuluc"];
        $n = mysql_num_rows($kq);
        if ($n == 0) {
            echo "<script>alert('Thông tin bạn nhập không chính xác!');window.history.go(-1);</script>";
            //header("location: login.php");
        } else {
            if ($hieuluc == 1) {
                if (!isset($_SESSION)) {
                    session_start();
                }
                $_SESSION["useradmin"] = $user;
                $_SESSION["success"] = true;
                $_SESSION['hotenadmin'] = $thanhvien['hoten'];
                $_SESSION["hieuluc"] = $thanhvien["hieuluc"];
Example #7
0
<?php

$ss_tendangnhap = $_SESSION['user'];
$idkey = EncodeSpecialChar($ss_tendangnhap);
$result_thanhvien = mysql_query("SELECT * FROM thanhvien where user='******'");
$row = mysql_fetch_array($result_thanhvien);
$db_user = $row["user"];
if (isset($_POST["act"])) {
    $user = $_POST["user"];
    $sql = "SELECT * FROM thanhvien where user='******'";
    $result_thanhvien2 = mysql_query($sql);
    $row2 = mysql_fetch_array($result_thanhvien2);
    $db_matkhau = $row2["pass"];
    $pw = $_POST['pw'];
    $pw = EncodeSpecialChar($pw);
    $pww = md5($pw);
    $pw_old = md5($_POST['pw_old']);
    if (strlen($pw) < 6) {
        echo "<script>alert('Mật khẩu mới phải lớn hơn 6 ký tự');</script>";
    } else {
        if ($pw_old == $db_matkhau) {
            $pw = md5($pw);
            $result_changepw = mysql_query("UPDATE thanhvien SET pass='******' WHERE user='******'");
            echo "<script>alert('Đổi mật khẩu thành công.'); window.location='index.php';</script>";
        } else {
            echo "<script>alert('Đổi mật khẩu thất bại! Kiểm tra lại mật khẩu cũ'); window.history.go(-1);</script>";
        }
    }
}
?>
<form method="post" name="formthanhvien" id="formthanhvien" onSubmit="return thanhvien_changepw(pw_old.value,pw.value,cpw.value);">