<div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="./">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">修改账号</span></div>
        </div>
        <div class="result-wrap">
            <form action="" method="post" id="myform" name="myform">
                <div class="config-items">
                    <div class="config-title">
                        <h1><i class="icon-font">&#xe00a;</i>修改管理员密码</h1>
                    </div>
                    <div class="result-content">
                        <table width="100%" class="insert-tab">
                            <tbody><tr>
                                <th width="15%"><i class="require-red">*</i>账号：</th>
                                <td><input type="text" value="<?php echo $_SESSION['username']; ?>" size="85" name="username" class="common-text" readonly="true"></td>
                            </tr>
                                <tr>
                                    <th><i class="require-red">*</i>密码：</th>
                                    <td><input type="password" id="" value="" size="85" name="password" class="common-text"></td>
                                </tr>
                                <tr>
                                    <th><i class="require-red">*</i>确认密码：</th>
                                    <td><input type="password" id="" value="" size="85" name="password2" class="common-text"></td>
                                </tr>
                                <tr>
                                    <th></th>
                                    <td>
                                        <input type="submit" value="提交" class="btn btn-primary btn6 mr10">
                                        <input type="button" value="返回" onClick="history.go(-1)" class="btn btn6">
                                    </td>
                                </tr>
                            </tbody></table>
                    </div>
                </div>
            </form>
        </div>
    </div>
<?php
if($_POST){
	if(!$_POST['username']){Msg("账号不能为空");die;}
	if(!$_POST['password']){Msg("密码不能为空");die;}
	if(!$_POST['password2']){Msg("确认密码不能为空");die;}
	if($_POST['password']!=$_POST['password2']){Msg("两次输入密码不一样");die;}
	$sql = "UPDATE  `".$dbname."`.`".$qz."admin` SET  `username` =  '".$_POST['username']."',`password` =  '".MD5($_POST['password'])."' WHERE  `".$qz."admin`.`username` ='".$_POST['username']."';";
	mysql_query($sql);
	mysql_close($conn); 
	echo '<script>alert("修改成功,请重新登录!");document.location="index.php?m=logout";</script>';
}
?>