config_manage_son.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:6k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("checks.php");
- include("../inc/conn.php");
- include("../inc/base_status.inc.php");
- $_SESSION["menus"]="子账号管理";
- if(isset($_GET["fct"]))
- {
- $fct=$_GET["fct"];
- $id=$_GET["id"];
- if($fct=="stop") mysql_query("update son_manage set deleted='1' where ID='$id'",$conn);
- if($fct=="use") mysql_query("update son_manage set deleted='0' where ID='$id'",$conn);
- }
- function outscript($arr)
- {
- echo "<script language='javascript'>alert('".$arr."');window.location.href='config_manage_son.php';</script>";
- }
- if(isset($_GET["act"]))
- { $act=$_GET["act"];
- if($act=="add")
- {
- $username="am".$_POST["add_account"];
- $add_pwd1=$_POST["add_pwd1"];
- $add_pwd2=$_POST["add_pwd2"];
- $password=md5($add_pwd1);
- if($username=="")
- {
- outscript('请输入用户名!');
- }elseif($add_pwd1==""||$add_pwd2=="")
- {
- outscript('请输入用户密码!');
- }elseif($add_pwd1<>$add_pwd2)
- {
- outscript('两次密码不一致!');
- }else
- {
- $sqp=mysql_query("select * from son_manage where account='$username'",$conn);
- if(mysql_num_rows($sqp)<>0)
- {
- outscript('添加失败,该账号已经存在!');
- }else $sqls=mysql_query("insert into son_manage(account,password,sign)values('$username','$password','1')",$conn);
- if($sqls) outscript('添加成功!');
- }
- }elseif($act=="mod")
- {
- $id=$_POST["id"];
- $username=$_POST["mod_account"];
- $mod_pwd1=$_POST["mod_pwd1"];
- $mod_pwd2=$_POST["mod_pwd2"];
- $password=md5($mod_pwd1);
- if($mod_pwd1==""||$mod_pwd2=="")
- {
- outscript('请输入用户密码!');
- }elseif($mod_pwd1<>$mod_pwd2)
- {
- outscript('两次密码不一致!');
- }else
- {
- $sqls=mysql_query("update son_manage set password='$password' where ID='$id'",$conn);
- if($sqls) outscript('修改成功!');
- }
- }elseif($act=="del")
- {
- $id=$_GET["id"];
- mysql_query("delete from son_manage where ID='$id'",$conn);
- outscript('删除成功!');
- }
- }
- $sqlr=mysql_query("select * from son_manage order by id desc",$conn);
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href="../css/css.CSS" rel="stylesheet" type="text/css">
- <title></title>
- <style type="text/css">
- <!--
- body {
- margin-left: 0px;
- }
- -->
- </style></head>
- <script language="JavaScript">
- <!--
- function chkuser()
- {
- var uname;
- uname="am"+myform.add_account.value;
- if (myform.add_account.value=="")
- {
- alert("您还没有输入账号!");
- myform.add_account.focus();
- return false;
- }
- else
- {
- window.open("isson.php?searchuser=" + uname ,"","width=2,height=2,top=1000,left=5000");
- }
- }
- //-->
- </script>
- <body oncontextmenu="return false" onselectstart="return false"
- onkeydown="return (event.ctrlKey && event.keyCode == 78) ? false : true"
- ondragstart="return false" onmouseover="window.status=''; return true">
- <table width="100%" height="82" border="0" align="left" cellpadding="0" cellspacing="0" class="tmove">
- <tr>
- <td height="82" valign="top"><table width="100%" height="78" border="0" cellpadding="0" cellspacing="1" class="t12">
- <tr class="t11">
- <td width="127" height="22"><div align="center" class="fw12">子账号</div></td>
- <td width="132"><div align="center" class="fw12">新密码</div></td>
- <td width="140"><div align="center" class="fw12">确认密码</div></td>
- <td width="70"><div align="center"><span class="fw12">状态</span></div></td>
- <td width="170"><div align="center" class="fw12">功能</div></td>
- </tr>
- <?php while($rs=mysql_fetch_array($sqlr))
- { ?><form name="form2" method="post" action="config_manage_son.php?act=mod&menu=8">
- <tr class="t17">
- <td height="28"><div align="center">
- <?=$rs["account"]?> </div></td>
- <td><div align="center">
- <input name="mod_pwd1" type="password" class="input" id="mod_pwd1" value="<?=$rs["password"]?>" size="16" maxlength="16" onClick="this.value='';">
- </div></td>
- <td><div align="center">
- <input name="id" type="hidden" id="id" value="<?=$rs["ID"]?>">
- <input name="mod_pwd2" type="password" class="input" id="mod_pwd2" value="<?=$rs["password"]?>" size="16" maxlength="16" onClick="this.value='';">
- </div></td>
- <td><div align="center"><?
- if($rs["deleted"]=="1")
- {
- echo "<a href='config_manage_son.php?fct=use&id=".$rs["ID"]."&act=uselist'>停用</a>";
- }else
- {
- echo "<a href='config_manage_son.php?fct=stop&id=".$rs["ID"]."&act=stoplist'>启用</a>";
- }
- ?></div></td>
- <td><div align="center">
- <input type="submit" name="Submit" value="修改"> <input type="button" name="Submit4" value="权限" onClick="javascript:window.location.href='config_manage_son_details.php?user=<?=$rs["account"]?>&id=<?=$rs["ID"]?>'"> <input type="button" name="Submit2" value="删除" onClick="javascript:window.location.href='config_manage_son.php?act=del&id=<?=$rs["ID"]?>'">
- </div></td>
- </tr> </form><? }?> <form name="myform" method="post" action="config_manage_son.php?act=add&menu=8">
- <tr class="t17">
- <td height="28"><div align="center">am
- <input name="add_account" type="text" class="input" id="add_account" size="15" maxlength="15">
- </div></td>
- <td><div align="center">
- <input name="add_pwd1" type="password" class="input" id="add_pwd1" size="16" maxlength="16">
- </div></td>
- <td><div align="center">
- <input name="add_pwd2" type="password" class="input" id="add_pwd2" size="16" maxlength="16">
- </div></td>
- <td> </td>
- <td><div align="center">
- <span class="fbred"> <input type="button" name="Submit3" value="检测" onClick="chkuser();"></span> <input type="submit" name="Submit" value="添加">
- </div></td>
- </tr> </form>
- </table></td>
- </tr>
- </table>
- <p> </p>
- <p> </p>
- </body>
- </html>