<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/nosql.asp"-->
<!--#include file="../conn/config.asp"-->
<%if Not ChkPosturl then response.redirect ("login.asp")
if session("adminname")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
action=nosql(request("action"))
if action="edit" or action="add"  then
zy=nosql(request("zy"))
djname=nosql(request("djname"))
dj=nosql(request("dj"))
jifen=nosql(request("jifen"))
youhui=nosql(request("youhui"))/100
jiadian=nosql(request("jiadian"))/100
jiafen=nosql(request("jiafen"))
end if

'修改
if action= "edit" then
if isChkInteger(request("id")) then
id=request("id")
else
Response.Redirect ("../index.asp")
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from snsn_zy where id="&id,conn,1,3
rs("zy")=zy
rs("djname")=djname
rs("dj")=dj
rs("jifen")=jifen
rs("jiadian")=jiadian
rs("jiafen")=jiafen
rs("youhui")=youhui
rs.Update
rs.Close
set rs=nothing
response.write "<script language='javascript'>"
response.write "alert('操作成功，正在返回！');"
response.write"this.location.href='zy.asp';</SCRIPT>"
response.End
end if

'//添加新数据
if action= "add" then
if nosql(request("zy2"))="" then
conn.execute"insert into snsn_zy(zy,djname,dj,jifen,youhui,jiadian,jiafen)values('"&zy&"','"&djname&"',"&dj&","&jifen&","&youhui&","&jiadian&","&jiafen&")"
else
conn.execute"insert into snsn_zy(zy,djname,dj,jifen,youhui,jiadian,jiafen)values('"&nosql(request("zy2"))&"','"&djname&"',"&dj&","&jifen&","&youhui&","&jiadian&","&jiafen&")"
end if
response.write "<script language='javascript'>"
response.write "alert('添加成功，正在返回！');"
response.write"this.location.href='zy.asp';</SCRIPT>"
response.End
end if

'保存参数

if action= "save" then
conn.execute"update snsn_config set zhuanzhi="&nosql(request("zhuanzhi"))&",jfen_qian="&nosql(request("jfen_qian"))/100&",zhucefen="&nosql(request("zhucefen"))&",tjr_qian="&nosql(request("tjr_qian"))
response.write "<script language='javascript'>"
response.write "alert('保存成功，正在返回！');"
response.write"this.location.href='zy.asp';</SCRIPT>"
response.End
end if


'//删除数据
if action= "del" then
if isChkInteger(request("id")) then
id=request("id")
else
Response.Redirect ("../index.asp")
end if
conn.execute ("delete from snsn_zy where id="&id)

response.write "<script language='javascript'>"
response.write "alert('删除成功，正在返回！');"
response.write"this.location.href='zy.asp';</SCRIPT>"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from snsn_zy order by zy,dj",conn,1,3
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
-->
</style>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/right_top2.gif">
  <tr>
    <td width="1%">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td width="30%" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">等级管理</font></strong></td>
          <td width="70%" align="right">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
</table>
<br>
<form name="form2" method="post" action="?action=save"　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　>
  <%
set rs10=server.CreateObject("adodb.recordset")
rs10.open "select * from snsn_config",conn,1,1
%>
<script language="javascript">
function cks2(){

if(form2.jfen_qian.value==""){
alert("请输入积分换银两比")
form2.jfen_qian.focus()
return false
}
if(form2.zhuanzhi.value==""){
alert("请输入转职费用")
form2.zhuanzhi.focus()
return false
}

if(form2.zhucefen.value==""){
alert("请输入注册默认分!!")
form2.zhucefen.focus()
return false
}
if(form2.tjr_qian.value==""){
alert("请输入推荐一个人给多少分!!")
form2.tjr_qian.focus()
return false
}
form2.submit()
}
</script>
  <table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#BBD7FF">
    <tr align="center" bgcolor="#e8f4ff">
      <td width="14%" height="21">转职费用</td>
      <td width="12%" height="21" bgcolor="#e8f4ff">积分换银两比</td>
      <td width="14%" bgcolor="#e8f4ff">注册默认分</td>
      <td width="22%" bgcolor="#e8f4ff">推荐加分</td>
      <td width="23%" bgcolor="#e8f4ff">&nbsp;</td>
      <td width="15%" height="21">操作</td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21"><input name="zhuanzhi" type="text" class="wenbenkuang" id="zhuanzhi" value="<%=rs10("zhuanzhi")%>" size="12" onkeypress="return event.keyCode>=46&&event.keyCode<=57"></td>
      <td height="21" bgcolor="#FFFFFF"><p>
          <input name="jfen_qian" type="text" class="wenbenkuang" id="jfen_qian" value="<%=rs10("jfen_qian")*100%>" size="7" onkeypress="return event.keyCode>=46&&event.keyCode<=57">
        %</p>        </td>
      <td height="21" bgcolor="#FFFFFF"><input name="zhucefen" type="text" class="wenbenkuang" id="zhucefen" value="<%=rs10("zhucefen")%>" size="12" onkeypress="return event.keyCode>=46&&event.keyCode<=57"></td>
      <td height="21" bgcolor="#FFFFFF"><input name="tjr_qian" type="text" class="wenbenkuang" id="tjr_qian" value="<%=rs10("tjr_qian")%>" size="12" onkeypress="return event.keyCode>=46&&event.keyCode<=57"></td>
      <td height="21" bgcolor="#FFFFFF">&nbsp;</td>
      <td><input name="Submit4" type="button" class="go-wenbenkuang" value="保存" onClick="return cks2()">
          <input name="Submit5" type="reset" class="go-wenbenkuang" value="取消"></td>
    </tr>
  </table>
</form>
<br>
<table width="99%"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#BBD7FF">
  <tr align="center" bgcolor="#e8f4ff">
    <td width="13%" height="20">职业</td>
    <td width="12%" height="20">等级名称</td>
    <td width="5%" height="20">等级</td>
    <td width="17%" height="20">升级所需分</td>
    <td width="13%" height="20">购物支付</td>
    <td width="13%" height="20" bgcolor="#e8f4ff">在线倍率</td>
    <td width="12%" height="20">登陆加分</td>
    <td width="15%" height="20">操作</td>
  </tr>
<%iiii=1
do while not rs.eof%>
  <tr align="center" bgcolor="#FFFFFF"><form action="?action=edit" name="ck<%=iiii%>" method="post" onsubmit="return ckck<%=iiii%>()">
    <td height="20">  <select name="zy" id="zy">
		<%set rs3=server.CreateObject("adodb.recordset")
rs3.open "select zy from snsn_zy GROUP BY zy",conn,1,3
do while not rs3.eof%>

          <option value="<%=rs3("zy")%>" <%if rs3("zy")=rs("zy") then%>selected<%end if%>><%=rs3("zy")%></option>		
		 <%rs3.movenext
		 loop%>
      </select>  &nbsp;</td>
    <td height="20"><input name="djname" type="text" class="wenbenkuang" id="djname" value="<%=rs("djname")%>" size="12" ></td>
    <td height="20"><input name="dj" type="text" class="wenbenkuang" id="dj" value="<%=rs("dj")%>" size="3" onkeypress="return event.keyCode>=46&&event.keyCode<=57"></td>
    <td height="20"><input name="jifen" type="text" class="wenbenkuang" id="jifen" value="<%=rs("jifen")%>" size="12" onkeypress="return event.keyCode>=46&&event.keyCode<=57"></td>
    <td height="20"><input name="youhui" type="text" class="wenbenkuang" id="youhui" value="<%=rs("youhui")*100%>" size="5" onkeypress="return event.keyCode>=46&&event.keyCode<=57">
      %</td>
    <td height="20"><input name="jiadian" type="text" class="wenbenkuang" id="jiadian" value="<%=rs("jiadian")*100%>" size="5" onkeypress="return event.keyCode>=46&&event.keyCode<=57">
      %</td>
    <td height="20"><input name="jiafen" type="text" class="wenbenkuang" id="jiafen" value="<%=rs("jiafen")%>" size="5" onkeypress="return event.keyCode>=46&&event.keyCode<=57"> 
      分      </td>
    <td height="20"><input name="id" type="hidden" id="id" value="<%=rs("id")%>">      <input name="Submit" type="submit" class="go-wenbenkuang" value="修改" >
      <input name="Submit3" type="button" class="go-wenbenkuang" value="删除" onClick="ckdel<%=iiii%>()"></td>
	  <script language=javascript>
	  function ckdel<%=iiii%>(){
	  ckdel1=confirm('确定删除')
	  if(ckdel1==1){
	  location.href='zy.asp?id=<%=rs("id")%>&action=del'
	  }
	 }  
	  function ckck<%=iiii%>(){
	
	  if(ck<%=iiii%>.djname.value==""){
	  alert("请输入等级名称")
	  ck<%=iiii%>.djname.focus()
	  return false
	  }
	   
	  
	  if(ck<%=iiii%>.dj.value==""){
	  alert("请输入等级")
	  ck<%=iiii%>.dj.focus()
	  return false
	  }
	  
	  if(ck<%=iiii%>.jifen.value==""){
	  alert("请输入升级所需分")
	  ck<%=iiii%>.jifen.focus()
	  return false
	  }
	   
	  
	  if(ck<%=iiii%>.jiadian.value==""){
	  alert("请输入在线倍率")
	  ck<%=iiii%>.jiadian.focus()
	  return false
	  }
	  

	  if(ck<%=iiii%>.jiafen.value==""){
	  alert("请输入登陆加分")
	  ck<%=iiii%>.jiafen.focus()
	  return false
	  }
	 
	  
	  if(ck<%=iiii%>.djname.value==""){
	  alert("请输入等级名称")
	  ck<%=iiii%>.djname.focus()
	  return false
	  }
	
	  
	 
	  }
	  </script></form>
  </tr><%rs.movenext
  iiii=iiii+1
  loop%>
</table>
<br>
<table width="620" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#BBD7FF">
  <form name="form1" method="post" action="?action=add" onsubmit="return ckck()">
  <script language=javascript>
function ckck(){

if (form1.djname.value==""){
 alert("请输入等级名称")
	 form1.djname.focus()
	  return false
}
if (form1.dj.value==""){
 alert("请输入等级")
	 form1.dj.focus()
	  return false
}
if (form1.jifen.value==""){
 alert("请输入升级所需积分")
	 form1.jifen.focus()
	  return false
}
if (form1.jiafen.value==""){
 alert("请输入登陆加分")
	 form1.jiafen.focus()
	  return false
}
if (form1.youhui.value==""){
 alert("请输入购物应支付")
	 form1.youhui.focus()
	  return false
}
if (form1.jiadian.value==""){
 alert("请输入在线倍率")
	 form1.jiadian.focus()
	  return false
}
}
  </script>
    <tr bgcolor="#C7D3E6">
      <td width="620" colspan="2" bgcolor="#FFFFFF"> &nbsp;&nbsp;等级名称
        <input name="djname" type="text" class="wenbenkuang" id="djname" size="12">
        等级
        <input name="dj" type="text" class="wenbenkuang" id="dj" onkeypress="return event.keyCode>=46&&event.keyCode<=57" size="3">
        升级所需分
        <input name="jifen" type="text" class="wenbenkuang" id="jifen" onkeypress="return event.keyCode>=46&&event.keyCode<=57" size="11"> 
        职业
        <select name="zy" id="zy">
		<%set rs3=server.CreateObject("adodb.recordset")
rs3.open "select zy from snsn_zy GROUP BY zy ",conn,1,3
do while not rs3.eof%>
          <option value="<%=rs3("zy")%>"><%=rs3("zy")%></option>		
		 <%rs3.movenext
		 loop%>
        </select>
        &nbsp;新增职业
        <input name="zy2" type="text" class="wenbenkuang" id="zy2" size="12">        <br>
&nbsp;        购物支付(商)
        
        <input name="youhui" type="text" class="wenbenkuang" id="youhui" onkeypress="return event.keyCode>=46&&event.keyCode<=57" size="5">
        % 
        &nbsp;在线时长倍率(商)
        
        <input name="jiadian" type="text" class="wenbenkuang" id="jiadian" onkeypress="return event.keyCode>=46&&event.keyCode<=57" size="5">
        %
        &nbsp;用户登陆给其加点(官)
        <input name="jiafen" type="text" class="wenbenkuang" id="jiafen" onkeypress="return event.keyCode>=46&&event.keyCode<=57" size="5">
        分
        <input type="submit" name="Submit2" value="添 加" class="go-wenbenkuang"></td>
    </tr>  </form>
</table>
<p>&nbsp;</p>
</body>
</html>

