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

    <%
Dim arr_t_id(2)
arr_t_id(1)="选修"
arr_t_id(2)="必修"
'****************************************************
'名称:jstable
'功能:接收表单提交过来的值
'****************************************************
Sub jstable()
	con = che(request("con"))
End Sub

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


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

'****************************************************
'名称:listinfo
'功能:列表
'****************************************************
Sub listinfos()
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
function check_list()	{
	var check_lj=$("select")[0].options[$("select")[0].selectedIndex].value;
	var check_Col=$("select")[1].options[$("select")[1].selectedIndex].value;
	var check_pro=$("select")[2].options[$("select")[2].selectedIndex].value;
	var check_cla=$("select")[3].options[$("select")[3].selectedIndex].value;
	var check_name=$("input")[1].value;
	var check_stuid=$("input")[0].value;
	var check_IdentityNO=$("input")[2].value;

	window.location.href="admin_stuid.asp?action=<%=action%>&page=<%=page%>&stuid="+check_stuid+"&name="+check_name+"&IdentityNO="+check_IdentityNO+"&lj_id="+check_lj+"&Col_id="+check_Col+"&pro_id="+check_pro+"&cla_id="+check_cla;
}
//-->
</SCRIPT>

<H6>搜索查询: </H6>
<h5>
<ul>
	<li class="searchin">学&nbsp;&nbsp;&nbsp;&nbsp;号 <input type="text" value="<%=stuid%>" maxlength="20">
	<li class="searchin">姓&nbsp;&nbsp;&nbsp;&nbsp;名 <input type="text" value="<%=name%>" maxlength="10">
	<li class="searchin">身份证号 <input type="text" value="<%=IdentityNO%>" maxlength="18">
</ul>
<div style="height:3px;width:100%;background: #fff;"></div>
<H6>切换查看:<a href="?action=list">全部</a> </H6>

<h5>
<ul>
	<li>年&nbsp;&nbsp;&nbsp;&nbsp;届 <SELECT NAME="<%=claslm(0)%>" onchange="checkinfos('lj');"><%=my_sqlsel(lj_id,"lj")%></SELECT>
	<li>系&nbsp;&nbsp;&nbsp;&nbsp;所 <SELECT NAME="<%=claslm(1)%>" onchange="checkinfos('Col');"><%=my_sqlsel(Col_id,"Col")%></SELECT>
	<li>专&nbsp;&nbsp;&nbsp;&nbsp;业 <SELECT NAME="<%=claslm(2)%>" onchange="checkinfos('pro');" ><option>请选择...</option></SELECT> <SPAN></SPAN>
	<li>班&nbsp;&nbsp;&nbsp;&nbsp;级 <SELECT NAME="<%=claslm(4)%>"><option>请选择...</option></SELECT> <SPAN></SPAN>
</ul>
</h5>
<h5>&nbsp;<INPUT TYPE="button" value="查询&切换 " onclick="check_list();" class="submits"></h5>	
	<table width="100%" align="center" border="1" class="info_tab2">
	<tr> 
		<th width='5%' style="text-align:center;text-indent: 4px;">选</th>
		<th width='10%'>学号</th>
		<th width='8%'>姓名</th>
		<th width='15%'>身份证号</th>
		<%
		If lj_id=0 Then res "<th width='5%'>年届</th>",1
		If Col_id=0 Then res "<th width=""15%"">系所</th>",1
		If pro_id=0 Then res "<th width='15%'>专业</th>",1
		If cla_id=0 Then res "<th width='12%'>班级</th>",1
		%>
		<th width='15%'>操作</th>
		<th> &nbsp;</th>
	</tr>
	<%
	Sql_Conditions=""
	If lj_id<>0 Then Sql_Conditions=" and a.lj_id="&lj_id
	If Col_id<>0 Then Sql_Conditions=Sql_Conditions&" and a.Col_id="&Col_id
	If pro_id<>0 Then Sql_Conditions=Sql_Conditions&" and a.pro_id="&pro_id
	If cla_id<>0 Then Sql_Conditions=Sql_Conditions&" and a.cla_id="&cla_id
	If stuid<>"" Then Sql_Conditions=Sql_Conditions&" and a.stuid like '%"&stuid&"%'"
	If name<>"" Then Sql_Conditions=Sql_Conditions&" and a.name like '%"&name&"%'"
	If IdentityNO<>"" Then Sql_Conditions=Sql_Conditions&" and a.IdentityNO like '%"&IdentityNO&"%'"
	sql="select a.id,stuid,name,IdentityNO,b.lj,c.Col,d.pro,e.cla "&_
		" from admin_stu as a,"&_
			"res_lj as b,"&_
			"res_Col as c,"&_
			"res_pro as d,"&_
			"res_cla as e"&_
		" where a.lj_id=b.id "&_
			"and a.Col_id=c.id "&_
			"and a.pro_id=d.id "&_
			"and a.cla_id=e.id "&_
			Sql_Conditions&" order by a.id desc"
	
	strFileName="admin_stuid.asp?action="&action&"&lj_id="&lj_id&"&Col_id="&Col_id&"&pro_id="&pro_id&"&cla_id="&cla_id
	colnum="9"
	formaction="admin_stuid.asp?action=del"
	sqllist sql,colnum,strFileName,formaction 
	If outcom=True Then
	showContent
	showdelpages
	End If
	%>
	</TABLE>
<%
check_auto
end sub 

'****************************************************
'名称:showContent
'功能:翻页列表输出
'****************************************************
sub showContent
	dim i
	i=0
	do while not rs.eof
		%>
		<tr> 
			<td align="center">
				<input name='id' type='checkbox' class="chek" onclick="unselectall()" id="ArticleID" value='<%=Rs(0)%>' style=" border: 0px"> 
			</td>
			<td>&nbsp;<%=rs(1)%></td>
			<td>&nbsp;<%=rs(2)%></td>
			<td>&nbsp;<%=rs(3)%></td>
			<%
		If lj_id=0 Then res "<td>"&rs(4)&"</td>",1
		If Col_id=0 Then res "<td>"&CutStr(rs(5),16)&"</td>",1
		If pro_id=0 Then res "<td>"&CutStr(rs(6),16)&"</td>",1
		If cla_id=0 Then res "<td>"&rs(7)&"</td>",1
		%>
			<td>&nbsp;<A HREF="admin_stuid.asp?action=edit&id=<%=Rs(0)%>">修改</A>|<A HREF="admin_stuid.asp?action=del&id=<%=Rs(0)%>">删除</A>|<A HREF="admin_cert.asp?action=list&IdentityNO=<%=Rs(3)%>">证书</A>
			</td>
			<td> </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_stuid.asp?action=save" name="edit">
	<TR><TD class="zq" width="20%"><%=clas(0)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(0)%>" onchange="checkinfos('lj');" style="width:200px;"><%=my_sqlsel(lj_id,"lj")%></SELECT>
		&nbsp;<BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(1)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(1)%>" onchange="checkinfos('Col');" style="width:200px;"><%=my_sqlsel(Col_id,"Col")%></SELECT>
		&nbsp;<BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(2)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(2)%>" onchange="checkinfos('pro');" style="width:200px;"><option>请选择...</option></SELECT> 
		&nbsp;<span id="<%=claslm(2)%>_txt"></span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(3)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(3)%>" style="width:200px;"><option>请选择...</option></SELECT></SELECT>
		&nbsp;<span id="<%=claslm(3)%>_txt"></span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(4)%></TD>
		<TD>&nbsp;<input type="text" name="<%=claslm(4)%>" style="width:200px;" maxlength="10">
		&nbsp;<span id="<%=claslm(4)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(5)%></TD>
		<TD>&nbsp;<input name="<%=claslm(5)%>" type="text" maxlength="20" value="" style="width:200px;" maxlength="20"/>
		&nbsp;<span id="<%=claslm(5)%>_txt">*</span><BR>
		</td>
	</tr>

	<TR><TD class="zq" width="20%"><%=clas(6)%></TD>
		<TD>&nbsp;<INPUT TYPE="text" NAME="<%=claslm(6)%>" maxlength="20" style="width:200px;" maxlength="18">
		&nbsp;<span id="<%=claslm(6)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(7)%></TD>
		<TD>&nbsp;<TEXTAREA NAME="<%=claslm(7)%>" ROWS="6" COLS="" style="width:200px;"></TEXTAREA>
		&nbsp;<span id="<%=claslm(7)%>_txt"></span><BR>
		</td>
	</tr>

	<TR><TD>&nbsp;</TD><TD>&nbsp;<input type="submit" name="send" value=" 确 认 ">
	</TD></TR>
	</FORM>
	</TABLE>
<%
check_auto
end Sub


'****************************************************
'名称:addinfos
'功能:批量添加信息
'****************************************************
Sub addsinfos()

%>

<FORM METHOD=POST ACTION="admin_stuid.asp?action=saves" name="edit" onsubmit="return CheckForm_adds();">
<table width="100%" cellspacing="1" cellpadding="0" class="info_tab">
	<TR><TD class="zq" width="20%"><%=clas(0)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(0)%>" onchange="checkinfos('lj');" style="width:200px;"><%=my_sqlsel(lj_id,"lj")%></SELECT>
		&nbsp;<BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(1)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(1)%>" onchange="checkinfos('Col');" style="width:200px;"><%=my_sqlsel(Col_id,"Col")%></SELECT>
		&nbsp;<BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(2)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(2)%>" onchange="checkinfos('pro');" style="width:200px;"><option>请选择...</option></SELECT> 
		&nbsp;<span id="<%=claslm(2)%>_txt"></span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(3)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(3)%>" style="width:200px;"><option>请选择...</option></SELECT></SELECT>
		&nbsp;<span id="<%=claslm(3)%>_txt"></span><BR>
		</td>
	</tr>
</TABLE>
<table width="100%" cellspacing="1" cellpadding="0" class="info_tab2" id="idTB">
	<tr>
		<th width="20%"><%=clas(4)%></th>
		<th width="20%"><%=clas(5)%></th>
		<th width="20%"><%=clas(6)%></th>
		<th width="20%"><%=clas(7)%></th>
		<th></th>
	</tr>
	<TR>
		<TD>&nbsp;<input type="text" name="<%=claslm(4)%>" style="width:90%;" maxlength="10"></td>
		<TD>&nbsp;<input type="text" name="<%=claslm(5)%>" style="width:90%;" maxlength="20"/></td>
		<TD>&nbsp;<INPUT TYPE="text" NAME="<%=claslm(6)%>" style="width:90%;" maxlength="18"></td>
		<TD>&nbsp;<INPUT TYPE="text" NAME="<%=claslm(7)%>" style="width:90%;" maxlength="20"></td>
		<TD>&nbsp;</TD>
	</tr>
	
	</TABLE>
<table width="100%" cellspacing="1" cellpadding="0" class="info_tab2">
	<TR><TD width="20%">行数:<input id="idFirst" name="idFirst" style="height:16px;width:25px;text-align:center;ime-mode:disabled;" value=1 maxlength="3" onkeypress="var k=event.keyCode; if ((k<=57 &&k>=48)) return true;else return false" onpaste="return false" onFocus="this.select();">
	<input type="button" onclick="setRow()" value="设定">
	<input type="button" onclick="addRow()" value=" + "></TD><TD>&nbsp;<input type="submit" value=" 确 认 ">
	</TD></TR>
	</TABLE>
	</FORM>
	<div id="bottom"></div>
<script language="JavaScript">
<!--
	function addRow(){//添加表格的一行
	oTR=$val("idTB").insertRow(idTB.rows.length);
	tmpNum=oTR.rowIndex;
	oTD0=oTR.insertCell(0);
	//oTD.innerText="第" + tmpNum+"行";//在该处添加的HTML代码会原封不动的显示在页面上
	oTD0.innerHTML+="&nbsp;<input type=\"text\" name=\"<%=claslm(4)%>\" maxlength=\"10\" style=\"width:90%;\">";
	oTD1=oTR.insertCell(1);
	oTD1.innerHTML+="&nbsp;<input type=\"text\" name=\"<%=claslm(5)%>\" maxlength=\"20\" style=\"width:90%;\">";
	oTD2=oTR.insertCell(2);
	oTD2.innerHTML+="&nbsp;<INPUT TYPE=\"text\" NAME=\"<%=claslm(6)%>\" maxlength=\"18\" style=\"width:90%;\">";
	oTD3=oTR.insertCell(3);
	oTD3.innerHTML+="&nbsp;<INPUT TYPE=\"text\" NAME=\"<%=claslm(7)%>\" maxlength=\"20\" style=\"width:90%;\">";
	oTD4=oTR.insertCell(4);
	oTD4.innerHTML+="<a href=\"#\" onclick=\"delRow(this.parentElement.parentElement.rowIndex);\">删除</a>";
	$val("idFirst").innerText=$val("idTB").rows.length-1;
	window.location.href="#bottom";
	return true;

}
//-->
</script>
<%
check_auto
end Sub


'****************************************************
'名称:editinfos
'功能:编辑信息
'****************************************************
Sub editinfos()
	If id="" Then errormsg "参数错误!"
	Sql_Lists="lj_id,Col_id,pro_id,cla_id,name,stuid,IdentityNO,con"
	Sql_tables=" admin_stu"
	Sql_Conditions=" id="&id
	sql=Sqlinfo(Sql_Lists,Sql_tables,Sql_Conditions,Sql_Sortings,Sql_Orders,Sql_Additional)
	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_stuid.asp?action=mod" name="edit">
	<TR><TD colspan=2 class="art_tit zq"><A HREF="admin_stuid.asp?action=list">返回<%=nowtit%>列表</A></TD></TR>
	<TR><TD class="zq" width="20%"><%=clas(0)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(0)%>" onchange="checkinfos('lj');" style="width:200px;"><%=my_sqlsel(rs_edit(0,0),"lj")%></SELECT>
		&nbsp;<BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(1)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(1)%>" onchange="checkinfos('Col');" style="width:200px;"><%=my_sqlsel(rs_edit(1,0),"Col")%></SELECT>
		&nbsp;<BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(2)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(2)%>" onchange="checkinfos('pro');" style="width:200px;"><option>请选择...</option></SELECT> 
		&nbsp;<span id="<%=claslm(2)%>_txt"></span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(3)%></TD>
		<TD>&nbsp;<SELECT NAME="<%=claslm(3)%>" style="width:200px;"><option>请选择...</option></SELECT></SELECT>
		&nbsp;<span id="<%=claslm(3)%>_txt"></span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(4)%></TD>
		<TD>&nbsp;<input type="text" name="<%=claslm(4)%>" value="<%=rs_edit(4,0)%>" style="width:200px;" maxlength="10">
		&nbsp;<span id="<%=claslm(4)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(5)%></TD>
		<TD>&nbsp;<input name="<%=claslm(5)%>" type="text" maxlength="20" value="<%=rs_edit(5,0)%>"/ style="width:200px;" maxlength="20">
		&nbsp;<span id="<%=claslm(5)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(6)%></TD>
		<TD>&nbsp;<INPUT TYPE="text" NAME="<%=claslm(6)%>" value="<%=rs_edit(6,0)%>" style="width:200px;" maxlength="18">
		&nbsp;<span id="<%=claslm(6)%>_txt">*</span><BR>
		</td>
	</tr>
	<TR><TD class="zq" width="20%"><%=clas(7)%></TD>
		<TD>&nbsp;<TEXTAREA NAME="<%=claslm(7)%>" ROWS="6" COLS="" style="width:200px;" maxlength="20"><%If rs_edit(7,0)<>"" Then res Replace(rs_edit(7,0),"<;br>;",""),1%></TEXTAREA>
		&nbsp;<span id="<%=claslm(7)%>_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>
<SCRIPT LANGUAGE="JavaScript">
postCols("<%=rs_edit(2,0)%>");
function checkpro(){
setSel2(<%=rs_edit(2,0)%>,$("SELECT")[2]);
}
postalls("<%=rs_edit(0,0)%>","<%=rs_edit(1,0)%>","<%=rs_edit(2,0)%>");
function checkcla(){
setSel2(<%=rs_edit(3,0)%>,$("SELECT")[3]);
}
</SCRIPT>
<%
end sub 

Sub check_auto()
res "<SCRIPT LANGUAGE=""JavaScript"">",1
if Col_id<>0 Then res "postCols("""&Col_id&""");",1
if lj_id<>0 And  Col_id<>0 And  pro_id<>0 Then res "postalls("""&lj_id&""","""&Col_id&""","""&pro_id&""");",1
res "function checkpro(){",1
if pro_id<>0 Then res "setSel2("&pro_id&",$(""SELECT"")[2]);",1
res "}",1
res "function checkcla(){",1
if cla_id<>0 Then res "setSel2("&cla_id&",$(""SELECT"")[3]);",1
res "}",1
res "</SCRIPT>",1
End sub


%>