28,391
社区成员
发帖
与我相关
我的任务
分享
<td>工序code</td>
<td><select name="ProcessCode" id="ProcessCode">
<%
While (NOT procss.EOF)
%>
<option value="<%=(procss.Fields.Item("ProcessCode").Value)%>" <%If procss.Fields.Item("name").Value="解冻" Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(procss.Fields.Item("name").Value)%></option>
<%
procss.MoveNext()
Wend
If (procss.CursorType > 0) Then
procss.MoveFirst
Else
procss.Requery
End If
%>
</select></td>
</tr>
<%
if request.Form("ProcessCode") <>"" then
Set jobs = Server.CreateObject("ADODB.Recordset")
jobs_Source = "select JobCode,name from Man_jobs where jobtype= "&request.Form("ProcessCode")&" "
Response.Write(jobs_Source)
jobs.open jobs_Source, connm,1,1
end if
%>
<tr>
<td>工种</td>
<td><select name="jobs" id="jobs">
<%
While (NOT jobs.EOF)
%>
<option value="<%=(jobs.Fields.Item("jobcode").Value)%>" <%If jobs.Fields.Item("name").Value="班长" Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(jobs.Fields.Item("name").Value)%></option>
<%
jobs.MoveNext()
Wend
If (jobs.CursorType > 0) Then
jobs.MoveFirst
Else
jobs.Requery
End If
%>
</select></td>
<%
strSQLServerName = "192.168.8.78" '数据库服务器地址
strSQLDBUserName = "sa" '用户名
strSQLDBPassword = "PPP" ' '密码
strSQLDBName = "PP" '数据库名
'----------------------------------------------------------
Set connpaos = Server.CreateObject("ADODB.Connection")
connm = "Provider=SQLOLEDB.1;Persist Security Info=False;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"
connpaos.Open connm
%>
<%
function DbCombox()
dim rs,sql,msg
sql = "select ProcessCode as ProcessCode,name as name from Man_processes"
set rs = connm.execute(sql)
response.Write("1")
while not rs.eof
msg = msg & "<option value=""" & rs("ProcessCode") & """>"&rs("ProcessCode")&"</option>"
rs.movenext
wend
rs.close
set rs = nothing
DbCombox = msg
End function
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员登录</title>
</head>
<body>
<script language ="javascript" >
jobs = new Array();
<%
dim rs,sql,i
sql = "select job,name from LT.[paliu].[dbo].View_proc_jobs "
set rs = connm.execute(sql)
i = 0
while not rs.eof
%>
jobs[<%=i%>] =new Array("<%=rs("job")%>","<%=rs("job")%>");
<%
i = i + 1
rs.movenext
wend
rs.close
set rs = nothing
%>
function changeselect(selvalue){
var selvalue = selvalue;
var i;
document.form1.City.length = 0 ;
document.form1.City.options[document.form1.City.length] = new Option("请选择","");
for (i = 0 ;i <jobs.length;i++){
if(jobs[i][0]==selvalue){
document.form1.City.options[document.form1.City .length] = new Option(jobs[i][1],jobs[i][1]);
}
}
}
document.form1.City.options[document.form1.City.length] = new Option("请选择","");
</script>
<div align="center">
<form method="POST" action="sub.asp" name="form1">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table1" height="59">
<tr>
<td width="67" height="30" bgcolor="#D4D0C8"><b><font size="2">工序</font></b></td>
<td height="30" bgcolor="#D4D0C8"><select name="gongxu" size="1" id="gongxu" onchange ="changeselect(document.form1.Region.options[document.form1.Region.selectedIndex].value)">
<%=DbCombox()%></select></td>
</tr>
<tr>
<td width="67" height="30"><b><font size="2">工种</font></b></td>
<td height="30"><select name="gongzhong" size="1" id="gongzhong"></select></td>
</tr>
</table>
</form>
</div>
</body>
</html>