<!--#include file="conn.asp"-->
<!--#include file="INC/md5.asp"-->
<%
	'检查访问的来源是否合法
	call checkPrePage()
	
	'检查用户访问的权限
	call checkuser(1)


strM_ID=GetQueryString("id")
if GetQueryString("action")="save" then

	strSQL="Select m_name From member Where id=" & strM_ID
	Set rsSub=server.CreateObject("ADODB.RecordSet")
	rsSub.open strSQL,conn,1,1
	strname=trim(rsSub("m_name"))
	rsSub.close
	set rsSub=nothing
	strnames="('"&strname&"_Eng"&"',"&"'"&strname&"_Big5'"&","&"'"&strname&"_Kor'"&","&"'"&strname&"_Jap"&"')"
	

	strSQL="Select * From member Where m_name in " & strnames&""
	Set rsSub=server.CreateObject("ADODB.RecordSet")
	rsSub.open strSQL,conn,1,1
	strIDs=strM_ID
	For i=1 to rsSub.recordcount
		strIDs=strIDs & "," & rsSub("id")
		rsSub.movenext
	next
	rsSub.close
	set rsSub=nothing

	strSQL="Update member Set "
	strLang=GetFormVariable("chkLang")
	strLamu=GetFormVariable("chkLaMu")
	strLamuCount=GetFormVariable("txtLaMuCount")
	strTemplet=GetFormVariable("chkTemplet")
	strTplock=GetFormVariable("chktplock")
	txtTemplet=GetFormVariable("txttemplet")
	if trim(strTplock)<>"" then
		strTplock=1
		if txttemplet<>"" then
			websitestrSQL="Update website Set w_templet='"&txttemplet&"' where m_id=" & strM_ID
			conn.execute websitestrSQL,0,1
		else
			ShowMsg "锁定模板不存在！"
		end if
	else
		strTplock=0
	end if
	strSQL=strSQL & " m_tplock=" & strTplock &", "
	strSQL=strSQL & " m_language='" & strLang & "',m_lamu='" & strLamu & "',m_lamucount=" & Cint(strLamuCount) &  ",m_templet='" & strTemplet & "' Where id in (" & strIDs &")"
	conn.execute strSQL,0,1
	
	'删除这次被禁止的栏目
	strSQL="Select id  From v_menu_templet Where m_id in(" & strIDs & ")"
	if strLamu<>"" then
	strSQL=strSQL&"	And Not (l_code In (" & strLamu & "))"
	end if
	Set rsSub=server.CreateObject("ADODB.RecordSet")
	rsSub.open strSQL,conn,1,1
	strIDs="0"
	For i=1 to rsSub.recordcount
		strIDs=strIDs & "," & rsSub("id")
		rsSub.movenext
	next
	rsSub.close
	
	strSQL="Delete  From menu Where id In (" & strIDs & ")"
	conn.execute strSQL,0,1
end if
%>
	<%
	strSQL="Select * from member Where id=" & strM_ID
	rs.open strSQL,conn,1,1
	%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>电子商务自助建站--您理想的助手</title>
<link href="common/styleMain.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="common/JS_CheckForm.js"></script>
<script language="JavaScript">

function checksearch(theform){
	if (theform.txtkey.value==""){
		alert("请输入搜索关键字 ");
		return false;
	}
}

function checkform(theform){
	if(!confirm('警告：\n\n如果您删除了用户原有的某些功能，则该功能相关的资料将会被删除！确定要修改吗？　')){
		return false;
	} 
}

function init(){
	CheckValues(form1.chkLang,"<%=Trim(rs("m_language"))%>")
	CheckValues(form1.chkLamu,"<%=Trim(rs("m_lamu"))%>")
	CheckValues(form1.chkTemplet,"<%=Trim(rs("m_templet"))%>")
}
</script>
</head>
<body leftmargin="0" topmargin="0" onLoad="init()">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/top.asp"-->
          </td>
        </tr>
        <tr> 
          <td height="100%" align="center" valign="top">
<TABLE class=table002 cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
                <TR> 
                  <!--左边开始-->
                  <TD width="20%" align=right vAlign=top> <!--#include file="common/adminleft.asp"--> </TD>
                  <!--左边结束-->
                  <TD width="2%" background="images/rowline.gif">&nbsp;</TD>
                  <!--右边开始-->
                  <TD vAlign=top align=center width="78%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td>
						<form name="form1" method="post" action="?action=save&id=<%=strM_ID%>" onSubmit="return checkform(this)">
                            <TABLE width="100%" height="100%" border=0 cellPadding=6 cellSpacing=0>
                              <TBODY>
                                <TR> 
                                  <TD vAlign=top align=left bgColor=#ffffff><strong><font color="#FF0000">用户管理：<%=trim(rs("m_name"))%></font></strong><BR> <HR SIZE=1>
                                    <table width="98%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td height="25" align="center" valign="bottom"> 
                                          <table width="551" height="23" border="0" cellpadding="0" cellspacing="0">
                                            <tr align="center"> 
                                              <td width="30" valign="bottom">&nbsp;</td>
                                              <td width="88" bgcolor="#EEEEEE"><strong><a href="Admin_UserInfo.asp?id=<%=GetVariable("id")%>">基本资料</a></strong></td>
                                              <td width="17">&nbsp;</td>
                                              <td width="88" bgcolor="#EEEEEE"><a href="Admin_UserInfo1.asp?id=<%=GetVariable("id")%>"><strong>财务相关</strong></a></td>
                                              <td width="17">&nbsp;</td>
                                              <td width="88" bgcolor="#5F8AC5"><strong><font color="#FFFFFF">权限管理</font></strong></td>
                                              <td width="210">&nbsp;</td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                      <tr> 
                                        <td height="1" bgcolor="#5F8AC5"></td>
                                      </tr>
                                      <tr> 
                                        <td><table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#5F8AC5">
                                            <tr> 
                                              <td height="30" align="center" bgcolor="#FFFFFF"> 
                                                <table width="98%" border="0" cellspacing="0" cellpadding="3">
                                                  <tr> 
                                                    <td height="30" colspan="3" align="center"><strong>权 
                                                      限 设 置</strong> </td>
                                                  </tr>
                                                  <tr bgcolor="#D7D7D7"> 
                                                    <td colspan="3"><strong>网站所能使用语言</strong></td>
                                                  </tr>
                                                  <tr> 
                                                    <td colspan="3" align="center"> 
                                                      <table width="98%" height="60" border="0" cellpadding="3" cellspacing="1">
                                                        <tr> 
                                                          <td width="11%">&nbsp;</td>
                                                          <td width="89%"> <input name="chkLang" type="checkbox" id="chkLang6" value="GB" checked>
                                                            中文简体（GB2312） 
                                                            <input name="chkLang" type="checkbox" id="chkLang6" value="Big5">
                                                            中文繁体（Big5） 
                                                            <input name="chkLang" type="checkbox" id="chkLang6" value="Eng">
                                                            英文（English） <br> <input name="chkLang" type="checkbox" id="chkLang6" value="Kor">
                                                            韩国文（Korean）&nbsp;&nbsp; 
                                                            <input name="chkLang" type="checkbox" id="chkLang6" value="Jap">
                                                            日文 （Japanese）</td>
                                                        </tr>
                                                      </table></td>
                                                  </tr>
                                                  <tr bgcolor="#D7D7D7"> 
                                                    <td colspan="3"><strong>网站所能使用的栏目</strong></td>
                                                  </tr>
                                                  <%
												  strSQL="Select * From lamu"
												  Set rsSub=Server.CreateObject("ADODB.RecordSet")
												  rsSub.open strSQL,conn,1,1
												  for i=1 to (rsSub.recordcount+1)\2
												if i mod 2=0 then
													strColor="#F8F8F8"
												else
													strColor="#fFfFfF"
												end if
												 %>
                                                  <tr bgcolor="<%=strColor%>"> 
                                                    <td width="20%"></td>
                                                    <td width="40%"> <input name="chkLamu" type="checkbox" value="<%=Trim(rsSub("l_code"))%>"> 
                                                      <%=Trim(rsSub("l_name"))%> 
                                                      <%
													rsSub.movenext
													%>
                                                    </td>
                                                    <td width="40%"> 
                                                      <%if Not rsSub.eof Then %>
                                                      <input name="chkLamu" type="checkbox" value="<%=Trim(rsSub("l_code"))%>"> 
                                                      <%=Trim(rsSub("l_name"))%> 
                                                      <%
													rsSub.movenext
													end if
													%>
                                                    </td>
                                                  </tr>
                                                  <%
												  next
												  rsSub.close
												  %>
                                                  <tr> 
                                                    <td align="right" bgcolor="#FFFFFF"><font color="#003366">栏目总数：</font></td>
                                                    <td bgcolor="#FFFFFF"><input name="txtLaMuCount" type="text" id="txtLaMuCount" value="<%=rs("m_lamucount")%>" size="10" maxlength="5"></td>
                                                    <td bgcolor="#FFFFFF">&nbsp; </td>
                                                  </tr>
                                                  <tr bgcolor="#D7D7D7"> 
                                                    <td colspan="3"><strong>网站所能使用的模板类</strong></td>
                                                  </tr>
                                                  <%
												  strSQL="Select * From templet_class"
												  Set rsSub=Server.CreateObject("ADODB.RecordSet")
												  rsSub.open strSQL,conn,1,1
												  for i=1 to (rsSub.recordcount+1)\2
												if i mod 2=0 then
													strColor="#F8F8F8"
												else
													strColor="#fFfFfF"
												end if
												 %>
                                                  <tr bgcolor="<%=strColor%>"> 
                                                    <td width="20%"></td>
                                                    <td width="40%"> <input name="chkTemplet" type="checkbox" value="<%=Trim(rsSub("id"))%>"> 
                                                      <%=Trim(rsSub("tc_name"))%> 
                                                      <%
													rsSub.movenext
													%>
                                                    </td>
                                                    <td width="40%"> 
                                                      <%
													if not(rsSub.eof) Then
													%>
                                                      <input name="chkTemplet" type="checkbox" value="<%=Trim(rsSub("id"))%>"> 
                                                      <%=Trim(rsSub("tc_name"))%> 
                                                      <%
													rsSub.movenext
													end if
													%>
                                                    </td>
                                                  </tr>
                                                  <%
												  next
												  %>
                                                  <tr bgcolor="#D7D7D7"> 
                                                    <td height="15" colspan="3"><strong>模板锁定</strong></td>
                                                  </tr>
                                                  <tr bgcolor="#FFFFFF"> 
                                                    <td height="15" colspan="3"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                                        <tr> 
                                                          <td width="11%">&nbsp;</td>
                                                          <td width="40%"> <input name="chktplock" type="checkbox" id="chktplock" value="1" <%if rs("m_tplock") then response.Write(" checked")%>>
                                                            锁定/解锁</td>
                                                          <td width="30%" align="center"> 
                                                            <%
																strSQL="Select * From v_templet Where m_id=" & strM_ID
																set rstemplet=Server.CreateObject("ADODB.RecordSet")
																rstemplet.open strSQL,conn,1,1
																if rstemplet.recordcount<=0 then
																	response.Write "找不到模板，或许是模板已经被删除！"
																end if
																strTempletCode=trim(rstemplet("t_code"))
																strTempletType=trim(rstemplet("t_type"))
																strTempletName=trim(rstemplet("t_name"))
																strTempletIntro=trim(rstemplet("t_intro"))
																rstemplet.close
																set rstemplet=nothing
															%>
                                                            <a id=templethref href="Templet/pic/<%=strTempletCode%>.gif" target="_blank"><img id=templetpic src="Templet/pic/small/<%=strTempletCode%>.gif" vspace="2" border="1" title="<%=strTempletName%>"></a> 
                                                            <input name="txttemplet" type="hidden" id="txttemplet" value="<%=strTempletCode%>">
                                                            <br> 
                                                            <input type="button" name="Submit2" value="更换模版" onClick="showModalDialog('Admin_TempletlockSel.asp',window,'dialogWidth:760px;dialogHeight:522px;help:no;scroll:yes;status:yes')"></td>
                                                          <td>&nbsp;</td>
                                                        </tr>
                                                      </table></td>
                                                  </tr>
                                                  <tr bgcolor="#FFFFFF"> 
                                                    <td height="15" colspan="3" align="right"></td>
                                                  </tr>
                                                  <tr> 
                                                    <td height="40" colspan="3" align="center" bgcolor="#F9F9F9">　 
                                                      <input type="submit" name="Submit" value=" 保 存 ">
                                                      　 
                                                      <input type="reset" name="reset" value=" 取 消 "></td>
                                                  </tr>
                                                </table></td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                    </table> </TD>
                                </TR>
                              </TBODY>
                            </TABLE>
                          </form>
						 </td>
                      </tr>
                      <tr>
                        <td align="center"> 
                          <form action="Admin_User.asp?state=用户搜索：搜索结果" method="post" name="search" id="search" onSubmit="return checksearch(this)">
                            <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#5F8AC5">
                              <tr> 
                                <td bgcolor="#5F8AC5">&nbsp<strong><font color="#FFFFFF">用户搜索</font></strong></td>
                              </tr>
                              <tr> 
                                <td height="40" align="center" bgcolor="F9F9F9"> 
                                  关键字： 
                                  <input name="txtkey" type=text id="txtkey" value="" size=30> 
                                  <select name="SchType">
                                    <option value="" selected>模糊查询</option>
                                    <option value="id" >用户ID</option>
                                    <option value="name" >单位域名</option>
                                    <option value="email" >email</option>
                                    <option value="oicq" >oicq</option>
                                  </select> <input type=submit name="submit" value="搜 索">
                                </td>
                              </tr>
                            </table>
                          </form></td>
                      </tr>
                    </table> 
                  </TD>
                </TR>
              </TBODY>
            </TABLE></td>
        </tr>
        <tr> 
          <td height="0" align="center">
		  <!--#include file="common/bottom.asp"-->
		  </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
