www.gusucode.com > 25175 学生同学录管理系统 2007 build 1231D源码程序 > admin/common/admin_res_Pro_inc.asp

    <%
'****************************************************
'名称:nowmenu
'功能:管理快捷菜单
'****************************************************
Sub nowmenu()
res "<h4><b>相关操作:</b>",1
res "<a href=""?action=add"">添加新专业</a> | ",1
res "<a href=""?action=list"">专业列表管理</a> ",1
res "</h4>",1
res "<div style=""height:3px;width:100%;background: #fff;""></div>",1
End Sub

'****************************************************
'名称:jstable
'功能:接收表单提交过来的值
'****************************************************
Sub jstable()
	pro = che(request("pro"))
	con = che(request("con"))
End Sub

'****************************************************
'名称:sqltable
'功能:将值提交入库
'参数:types 为空或 "add" 判断是修改记录还是添加记录
'****************************************************
Sub sqltable(types)
	rs("Col_id") = Col_id
	rs("pro") = pro
	rs("con") = con
End Sub


'****************************************************
'名称:listinfo
'功能:列表
'****************************************************
Sub listinfos()
	If Col_id="" Or Not IsNumeric(Col_id) Then Col_id=0
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
function check_Col(strid)	{
	window.location.href="admin_res_Pro.asp?action=<%=action%>&page=<%=page%>&Col_id="+strid;
}
//-->
</SCRIPT>

<style type="text/css">
h5 ul {clear:left;width:800px;}
h5 ul li {clear:left;float:left;width:300px;line-height:30px;}
h5 ul li select {width:200px;}
h5 ul li.lefts {clear:left;}
</style>
<H6>切换查看: <a href="admin_res_Pro.asp?action=list">全部</a> </H6>
<h5>
<ul>

	<li>系&nbsp;&nbsp;&nbsp;&nbsp;所 <SELECT NAME="<%=proslm(0)%>" onchange="javascript:check_Col(this.options[this.selectedIndex].value)"><%=my_sqlsel(Col_id,"Col")%></SELECT>
</ul>
</h5>
	<table width="100%" align="center" border="1" class="info_tab2">
	<tr> 
		<th width="5%" style="text-align:center;text-indent: 4px;">选</th>
		<% If Col_id=0 Then res "<th width=""30%"">所属系所</th>",1%>
		<th width="30%">专业名称</th>
		<th width="10%">操作</th>
		<th>&nbsp;</th>
	</tr>
	<%
	If Col_id<>0 Then Sql_Conditions=" where Col_id="&Col_id
	sql="select id,Col_id,pro from res_pro "&Sql_Conditions&" order by id desc"
	strFileName="admin_res_pro.asp?action="&action
	colnum="6"
	formaction="admin_res_pro.asp?action=del"
	sqllist sql,colnum,strFileName,formaction 
	If outcom=True Then
	showContent
	showdelpages
	End If
	%>
	</TABLE>
<%
end sub 

'****************************************************
'名称:showContent
'功能:翻页列表输出
'****************************************************
sub showContent
	dim i
	i=0
	do while not rs.eof
		%>
		<tr> 
			<td class="art_info2" align="center">
				<input name='id' type='checkbox' class="chek" onclick="unselectall()" id="ArticleID" value='<%=Rs(0)%>' style=" border: 0px"> 
			</td>
			<% If Col_id=0 Then res "<td>&nbsp;"&pros_names(rs(1))&"</td>",1%></td>
			<td>&nbsp;<%=rs(2)%></td>
			<td>&nbsp;<A HREF="admin_res_pro.asp?action=edit&id=<%=Rs(0)%>">修改</A>|<A HREF="admin_res_pro.asp?action=del&id=<%=Rs(0)%>">删除</A></td>
			<td>&nbsp;</td>
		</tr>
	<%
		i=i+1
		if i>=MaxPerPage then exit do
		rs.movenext
	loop
end Sub


'****************************************************
'名称:addinfos
'功能:添加信息
'****************************************************
Sub addinfos()
%>
<table width="100%" cellspacing="1" cellpadding="0" class="info_tab">
	<FORM METHOD=POST ACTION="admin_res_pro.asp?action=save" name="add">

	<TR><TD class="zq" width="20%"><%=pros(0)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=proslm(0)%>"><%=my_sqlsel(0,"Col")%></SELECT>
		&nbsp;<span id="<%=proslm(0)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=pros(1)%></TD>
		<TD>&nbsp;<input name="<%=proslm(1)%>" type="text" maxlength="20" value="" class="put"/>
		&nbsp;<span id="<%=proslm(1)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=pros(2)%></TD>
		<TD>&nbsp;<TEXTAREA NAME="<%=proslm(2)%>" ROWS="" COLS=""></TEXTAREA>
		&nbsp;<span id="<%=proslm(2)%>_txt"></span><BR>
		</td>
	</tr>
	<TR><TD>&nbsp;</TD><TD>&nbsp;<input type="submit" name="send" value=" 确 认 "></TD></TR>
	</FORM>
	</TABLE>

<%
end Sub

'****************************************************
'名称:editinfos
'功能:编辑信息
'****************************************************
Sub editinfos()
	If id="" Then errormsg "参数错误!"
	sql=Sqlinfo("Col_id,pro,con","res_pro"," ID = "&id,"","","")
	rs_edit = connopen(sql)
	If isArray(rs_edit)=False Then errormsg "参数错误"
	%>
	<table width="100%" cellspacing="1" cellpadding="0" class="info_tab">
	<FORM METHOD=POST ACTION="admin_res_pro.asp?action=mod" name="edit" onsubmit="return CheckForm2();">
	<TR><TD class="zq" width="20%"><%=pros(0)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=proslm(0)%>"><%=my_sqlsel(rs_edit(0,0),"Col")%></SELECT>
		&nbsp;<span id="<%=proslm(0)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=pros(1)%></TD>
		<TD>&nbsp;<input name="<%=proslm(1)%>" type="text" maxlength="20" value="<%=rs_edit(1,0)%>" class="put"/>
		&nbsp;<span id="<%=proslm(1)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=pros(2)%></TD>
		<TD>&nbsp;<TEXTAREA NAME="<%=proslm(2)%>" ROWS="" COLS=""><%=rs_edit(2,0)%></TEXTAREA>
		&nbsp;<span id="<%=proslm(2)%>_txt"></span><BR>
		</td>
	</tr>
	
	<TR><TD>&nbsp;</TD><TD>&nbsp;<input type="submit" name="send" value=" 确 认 ">
	<INPUT TYPE="hidden" NAME="id" value="<%=id%>">
	</TD></TR>
	</FORM>
	</TABLE>

<%
end sub 

Function pros_names(nos)
	sql=Sqlinfo("Col","res_Col"," id="&nos,"","","")
	fun_get = connopen(sql)
	If isArray(fun_get) Then
		pros_names=fun_get(0,0)
	Else
		pros_names="<span tit=""参数错误"">------</span>"
	End If 
End Function

%>