<?
session_start();
require_once "../init.php";
$GLOBALS["parentpath"] = file_exists("authority.inc.php")?".":"..";


if($_GET['key'])
{
	$key = $_GET['key'];
}
else
{
	$key = $_POST['key'];
}
$Edit = $_POST['Edit'];
if($_GET['qq_id'])
{
	$qq_id = $_GET['qq_id'];
}
else
{
	$qq_id = $_POST['qq_id'];
}
if($_GET['qq_no'])
{
	$qq_no = $_GET['qq_no'];
}
else
{
	$qq_no = $_POST['qq_no'];
}
$qq_name = $_POST['qq_name'];

if(!CheckHashKey('qq'.$qq_id,$key)){
   $DB->close();
   die("非法入侵");
}
if($UserID != $_SESSION['AdmUserID_S'])require_once "../authority.inc.php";
if(!$Edit){
	$sql = "select * from qq where qq_id='$qq_id'";
	$AdminInfo = $DB->getdata($sql);

	$NiceCallInfo = explode("||",$AdminInfo[NiceCall]);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/admin/lib/html5.js"></script>
<script type="text/javascript" src="/admin/lib/respond.min.js"></script>
<script type="text/javascript" src="/admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />


<!--[if IE 6]>
<script type="text/javascript" src="/admin/static/h-ui.admin/js/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>修改管理员</title>

<script>
/*function check(form){
   if(form.UserID.value==""){
       alert("请输入用户名");
	   form.UserID.focus();
	   return false;
   }
   if(form.Password.value!=""){
	   if(form.Password.value!=form.Password_C.value){
		   alert("密码与确认密码不相同");
		   form.Password.focus();
		   return false;
	   }
   }
   if(form.RealName.value==""){
       alert("请输入真实姓名");
	   form.RealName.focus();
	   return false;
   }
}*/
</script>
<script src='../share/global.js'></script>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> QQ管理 <span class="c-gray en">&gt;</span> QQ修改<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>


<div class="page-container">
<!--子导航-->
<? include "qq_nav.inc.php"?>
<!--结束-->


	  <?
	  if($Edit==1){
		  if($qq_no == null || $qq_name == null)
		 {
			 echo "<center><br><br><br>增加QQ客服失败，QQ号或名字为空。";
		  	 echo "<center><br><br><a href='qq_list.php'>[ 返 回 ]</a><br><br><br>"; 
		 }
		 else
		 {
			  $sql="update qq set  qq_name='$qq_name',qq_no='$qq_no' where qq_id='$qq_id'";
			  $DB->query($sql);
			  echo "<center><br><br><br>修改管理员 $qq_no 成功";
			  echo "<center><br><br><br><a href='qq_list.php'>[ 返 回 ]</a><br><br>";
		 }
	  }else{ 
	  ?>
      <form action="qq_edit.php" method="post" onSubmit="return check(this)">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="table" class="table table-border table-bordered table-hover table-bg table-sort">
          <tr id="tr">
            <td colspan="2">修改QQ客服<?=$AdminInfo['qq_no']?>资料</td>
          </tr>
          <tr>
            <td width="45%" align="right">QQ号</td>
            <td>
			<input name="qq_no" type="text" class="inputline" value="<?=$AdminInfo['qq_no']?>" >
             <font color='red'>*</font>
			 </td>
          </tr>
          
          <tr>
            <td align="right">QQ姓名:</td>
            <td><input name="qq_name" type="text" class="inputline" value="<?=$AdminInfo['qq_name']?>">
                <font color='red'>*</font></td>
          </tr>
          
          <tr>
            <td colspan="2" align="center">
			    <input name="Edit" type="hidden" value="1">
				<input name="key" type="hidden" value="<?=$key?>">
                <input name="qq_id" type="hidden" value="<?=$AdminInfo['qq_id']?>">
				<input name="submit" type="submit" class="bt2" value="提交"> &nbsp; &nbsp;
                <input name="reset" type="reset" class="bt2" value="重置">
			</td>
          </tr>
        </table>
    </form>
	<?}?>
</div>
<? 
$DB->close();
include "../share/bottom.php"?>
</body>
</html>
