⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 temp_qx.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:报表模板权限设置
'参数:request.form("addedit_subed")="true"#表单提交;
%>

<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->

<%
'response.buffer=false

'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
Typeid=request("Typeid") : if Typeid="" then Typeid=0 '当前栏目ID
'------------------------------------------------
'------------------------------------------------修改记录
table="tbioaOffice_TemplateType" '表名
if request.form("addedit_subed")="true" then
'表单提交后
	input_users=Request.Form("input_users")'使用者
	input_usermod=Request.Form("input_usermod")'使用者属性

	'编辑时使用的字段
	field1=array("users","usermod")
	value1=array(input_users,input_usermod)
	sql="UPDATE " & table & " SET "
	for i=0 to ubound(field1)
		sql = sql & field1(i) & "='" & replace(value1(i),"'","''") & "'"
		if i <> ubound(field1) then sql=sql & ","  else  sql=sql & " where ID=" & Typeid
	next
	oConn.Execute sql

	set rs_id=Server.CreateObject("ADODB.RECORDSET")
	rs_id.Open "SELECT MAX(id) AS id FROM " & table,oConn
	word="<p>模板权限信息已成功修改!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href='javascript: history.back()'>继续修改</a>"
	rs_id.close
else'------------------------------------------------取记录
'取模板使用记录 (返回rs对象)
	set rs=Server.CreateObject("ADODB.RecordSet")
	sql="select * from " & table & " where ID="&Typeid
	rs.open sql,oConn,1,1
end if
'------------------------------------------------
%>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<base target="FrmMain">
<script src="../js/front_chec.js"></script>
<script language="JavaScript">
<!--
 function doSel_Cx(sCxqx,sCxqxsz){
	url = "../inc/SelectQx.asp?cxqx="+sCxqx+"&cxqxsz="+sCxqxsz
	k=showModalDialog(url,"","dialogWidth:510px;status:no;dialogHeight:60px")
	if (k!="") {
		k=k.split("_")
		if (k[0]!="0"){
			eventfrm1.users.value=k[2].replace(/ /g,"\n")
			eventfrm1.input_users.value=k[1]
			eventfrm1.input_usermod.value=k[0]
		}else{
			eventfrm1.users.value='全部人员'
			eventfrm1.input_users.value=k[1]
			eventfrm1.input_usermod.value=k[0]
		}
	}
 }
-->
</script>
</head>

<body topmargin="10" leftmargin="10">

<br>

<div align="center">
<table width="580" cellspacing="1" cellpadding="2" class="tab">
  <tr>
    <td width="100%" class="tdTop">
      <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdTop">
            <p align="left"><img border="0" src="../images/icon_title.gif" align="left">编辑模板使用权限</p>
          </td>
          <td class="tdTop2" width="50">
            <p align="left"><img border="0" src="../images/icon_return.gif" align="left"><a href="Temp_manage.asp" class="linktop">返回</a></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="25%" class="td1">

    <% if request.form("addedit_subed")="true" then %>
      <table border="0" width="100%" cellspacing="10" cellpadding="0">
        <tr>
          <td width="36%">
            <p align="right"><img border="0" src="../images/edit.gif" width="32" height="32">
          </td>
          <td width="64%"><p> </p>
            <%=word%>
          </td>
        </tr>
        <tr>
          <td width="100%" colspan="2">
          </td>
        </tr>
      </table>
    <% else %>
    <form name="eventfrm1" method="POST" action="?Typeid=<%=Typeid%>">
      <input type=hidden name="addedit_subed" value="true">
	<table width="100%" cellspacing="3" cellpadding="2">
	  <tr>
	    <td width="100" class="td1" align="right"><font COLOR="RED">*</font> 模板名称:</td>
	    <td class="td1"><input type="text" name="input_name" value="<%=htmlout(rs("TempName"))%>" size="50" maxlength="50" class="input"></td>
	  </tr>
	  <tr>
	    <td width="100" class="td1" align="right" valign="_top"><font COLOR="RED">*</font> 使用权限:
	      <img src="../images/selectman.gif" border="0" onclick="doSel_Cx(eventfrm1.input_users.value,eventfrm1.input_usermod.value)" style="cursor:hand">
	    </td>
	    <td class="td1"><textarea rows="7" name="users" cols="60" class="textarea" readonly><%=ShowNames(rs("usermod"),rs("users"))%></textarea>
	      <input type=hidden name="input_usermod" value="<%=rs("usermod")%>">
	      <input type=hidden name="input_users" value="<%=rs("users")%>">
	    </td>
	  </tr>
	  <tr>
	    <td class="tdBottom" colspan="2"></td>
	  </tr>
          <tr>
            <td class="td1" width="100%" colspan="2" align="center">
             <input type="submit" value="确定" name="B1" class="button0" onmouseout=className="button0" onmouseover=className="button1"> <input type="reset" value="全部重写" name="B2" class="button0" onmouseout=className="button0" onmouseover=className="button1">
            </td>
          </tr>
	</table>
    </form>
    <%rs.close%>
    <% end if %>

    </td>
  </tr>
  <tr>
    <td width="25%" class="tdBottom">
    </td>
  </tr>
</table>
</div>
</body>

</html>

<%'释放对象变量
oConn.close
%>

<%
Function ShowNames(smod,sid)
	if not smod then ShowNames="全部人员"

	dim sql,str
	if smod=1 then
		sql="select * from tbioaDepartment where ID in (" + sid + ")"
		set rs_ShowNames=oConn.execute(sql)
		while not rs_ShowNames.EOF '循环
			str=str + htmlout(rs_ShowNames("name")) + vbcrlf
			rs_ShowNames.MoveNext
		wend
		rs_ShowNames.close
		ShowNames=str
	elseif smod=2 then
		sql="select a.*,b.name	from tbioaRole a,tbioaDepartment b where a.department=b.id and a.id in (" + sid + ")"
		set rs_ShowNames=oConn.execute(sql)
		while not rs_ShowNames.EOF '循环
			str=str + htmlout(rs_ShowNames("name")) + "/" + htmlout(rs_ShowNames("rolename")) + vbcrlf
			rs_ShowNames.MoveNext
		wend
		rs_ShowNames.close
		ShowNames=str
	end if
End Function
%> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -