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

📄 edit.asp

📁 学生档案与成绩管理(1)学生档案管理:记录每个学生的档案信息
💻 ASP
字号:
<!-- #include file = "../include/asphead.asp" -->
<!-- #include file = "../include/function.asp" -->
<!-- #include file = "../include/calendar.asp" -->
<%CheckUser()%>
<link href="../include/main.css" rel="stylesheet" type="text/css">
<script src="../include/function.js" type="text/javascript"></script>
<script src="check.js" type="text/javascript"></script>
<script src="expandcheck.js" type="text/javascript"></script>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--

function window_onload() 
{
	AttachLimitPrompt();
	if(document.frmData.RefreshByBaseSheet.value>0)
		HasChange();
	
}

function GoToView()
{
	var discard;
	discard=true;
	if(frmData.btnCancel.value!="关闭")
		if(HasChanged==true)
			discard=confirm("您已经输入了一些信息,但尚未保存。放弃您所作的输入吗?");
			
	if(discard==true)
	{
		document.frmData.target ="_self";
		document.frmData.action="view.asp?SheetAndRowID="+frmData.SheetID.value+JoinChar+frmData.RowID.value+JoinChar+frmData.RowIDs.value;
		document.frmData.submit();
	}
}
function GoToHistory()
{
	var discard;
	discard=true;
	if(frmData.btnCancel.value!="关闭")
		if(HasChanged==true)
			discard=confirm("您已经输入了一些信息,但尚未保存。放弃您所作的输入吗?");
	if(discard==true)
	{
		document.frmData.target ="_self";
		document.frmData.action="historyframe.asp?SheetAndRowID="+frmData.SheetID.value+JoinChar+frmData.RowID.value+JoinChar+frmData.RowIDs.value;
		document.frmData.submit();
	}
}
function GoToRefDetail()
{
	var discard;
	discard=true;
	if(frmData.btnCancel.value!="关闭")
		if(HasChanged==true)
			discard=confirm("您已经输入了一些信息,但尚未保存。放弃您所作的输入吗?");
	if(discard==true)
	{
		document.frmData.target ="_self";
		document.frmData.action="refdetail.asp?SheetAndRowID="+frmData.SheetID.value+JoinChar+frmData.RowID.value+JoinChar+JoinChar+frmData.RowIDs.value;
		document.frmData.submit();
	}
}

function ViewRef(SheetID,FieldID,FieldValue) {
	var RefString;
	RefString=SheetID+JoinChar+FieldID+JoinChar+FieldValue;
	var myScreen,myTop,myLeft;
	myTop=window.screenTop-44;
	myLeft=window.screenLeft+14;
	myScreen="dialogwidth:640px;dialogheight:480px;dialogtop:"+myTop+"px;dialogleft:"+myLeft+"px;Status:0;center:1;resizable=1;"
	window.showModalDialog ("viewframe3.asp?Target=viewref.asp?RefString="+RefString,"",myScreen);
}

function SaveSheetData(target) {
	if(LocalDC() && GeneralDC())
	{
		SavePrompt();
		parent.window.returnValue = true;
		document.frmData.target ="SaveArea";
		document.frmData.action=target;
		document.frmData.submit();
	}
}

function CancelSheetData() {
	if(HasChanged==true)
	{
		discard=confirm("您已经输入了一些信息,但尚未保存。放弃您所作的输入吗?");
		if(discard==true)
		{
			parent.window.close();
		}
	}
	else
	{
		parent.window.close();
	}
}

//-->
</script>
<%

	dim WExcel
	set WExcel=server.CreateObject("WExcel.Sheet")

	dim AttachOnlyImage,AttachMaxSize
	WExcel.GetAttachLimit AttachOnlyImage,AttachMaxSize
	
	dim SheetAndRowID,Parts,SheetID,RowID,RowIDs
	dim RefreshByBaseSheet,RefFieldCount
	RefreshByBaseSheet=0
	if Request.QueryString("RefreshByBaseSheet")<>"" then
		RefreshByBaseSheet=cint(Request.QueryString("RefreshByBaseSheet"))
	end if
	if RefreshByBaseSheet>0 then
		'来自于编辑页面刷新,通常是根据所选主表记录,需要显示引用的主表字段
		'保留页面当前输入的数据,仅引用字段从主表的数据库获取,此字段标明哪个主表引起的刷新
		dim myRequest,Err
		Result=WExcel.BuildUploadRequest(Request.BinaryRead(Request.TotalBytes),myRequest,Err)
		SheetID=myRequest.Item("SheetID").Item("Value")
		RowID=myRequest.Item("RowID").Item("Value")
		RowIDs=myRequest.Item("RowIDs").Item("Value")
	else
		'数据都从数据库获取
		SheetAndRowID=Request.QueryString("SheetAndRowID")
		Parts=split(SheetAndRowID,JoinChar)
		SheetID=Parts(0)
		RowID=Parts(1)
		RowIDs=""
		if(ubound(Parts)>=2) then 
			RowIDs=Parts(2) 
		end if
	end if

	dim NewRecord,strBody,strScript,Result,Exist
	NewRecord="0"
	Exist=WExcel.SheetExist(cint(UserID),cint(SheetID))
	CheckErr
	if Exist=false then
		Response.Redirect "/hcgis/notfound.asp?Name=数据表&Depth=2"
	end if
	Exist=WExcel.SheetDataExist(cint(UserID),cint(SheetID),clng(RowID))
	CheckErr
	if Exist=false then
		Response.Redirect "/hcgis/notfound.asp?Name=记录&Depth=2"
	end if

	dim HasRefDetail
	HasRefDetail=WExcel.HasRefDetail(cint(UserID),cint(SheetID))
	CheckErr

	dim ErrDesc,LockMainSheet
	ErrDesc=""
	Result=WExcel.GetSheetEditPage(cint(UserID),cint(SheetID),cstr(NewRecord),cstr(RefreshByBaseSheet),strBody,strScript,RefFieldCount,clng(RowID),myRequest)
	if Result<>0 then
		ErrDesc="系统未授予您修改本记录的权限。"
	else
		Result=WExcel.CheckMainForModify(cint(UserID),cint(SheetID),clng(RowID),LockMainSheet)
		if Result=false then
			ErrDesc="不允许修改,由于对应的主表记录(" & LockMainSheet & ")已锁定修改权限,系统自动锁定子记录的修改权限。"
		end if
	end if
	Response.Write strScript
	CheckErr

%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	</head>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="overflow-x: hidden" onload="return window_onload()">
		<form METHOD="post" name="frmData" ENCTYPE="multipart/form-data">
			<%if HasRefDetail then%>
				<table width="100%" border=0 cellPadding=0 cellSpacing=0>
					<tr height=5>
						<td colspan="11">
					</tr>
					<tr>
						<td height=1 rowspan="3" valign="bottom" width="8%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>

						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/leftoff.gif" width=11></td>
						<td height=1 valign="center" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/rightoff.gif" width=11></td>

						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/leftoff.gif" width=11></td>
						<td height=1 valign="center" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/rightoff.gif" width=11></td>

						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/lefton.gif" width=11></td>
						<td height=1 valign="center" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/righton.gif" width=11></td>

						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/leftoff.gif" width=11></td>
						<td height=1 valign="center" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/rightoff.gif" width=11></td>

						<td height=1 rowspan="3" valign="bottom" width="47%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
					</tr>
					<tr>
						<td height=20 valign=bottom bgcolor="#E0E0E0" style="cursor:hand" onclick="return GoToView();">预览</td>
						<td height=20 valign=bottom bgcolor="#E0E0E0" style="cursor:hand" onclick="return GoToRefDetail();">子表</td>
						<td height=20 valign=bottom>修改</td>
						<td height=20 valign=bottom bgcolor="#E0E0E0" style="cursor:hand" onclick="return GoToHistory();">历史</td>
					</tr>
					<tr>
						<td height=1 rowspan="3" valign="bottom"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" valign="bottom"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td></td>
						<td height=1 rowspan="3" valign="bottom"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
					</tr>
				</table>
			<%else%>
				<table width="100%" border=0 cellPadding=0 cellSpacing=0>
					<tr height=5>
						<td colspan="11">
					</tr>
					<tr>
						<td height=1 rowspan="3" valign="bottom" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>

						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/leftoff.gif" width=11></td>
						<td height=1 valign="center" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/rightoff.gif" width=11></td>

						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/lefton.gif" width=11></td>
						<td height=1 valign="center" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/righton.gif" width=11></td>

						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/leftoff.gif" width=11></td>
						<td height=1 valign="center" width="10%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td height=1 rowspan="3" width="1%"><IMG height=22 src="../images/rightoff.gif" width=11></td>

						<td height=1 rowspan="3" valign="bottom" width="54%"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
					</tr>
					<tr>
						<td height=20 valign=bottom bgcolor="#E0E0E0" style="cursor:hand" onclick="return GoToView();">预览</td>
						<td height=20 valign=bottom>修改</td>
						<td height=20 valign=bottom bgcolor="#E0E0E0" style="cursor:hand" onclick="return GoToHistory();">历史</td>
					</tr>
					<tr>
						<td height=1 rowspan="3" valign="bottom"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
						<td></td>
						<td height=1 rowspan="3" valign="bottom"><IMG height=1 src="../images/promptline.gif" width="100%"></td>
					</tr>
				</table>
			<%end if%>
			<%if ErrDesc="" then%>
				<table width="100%" border=0 CELLSPACING=0 CELLPADDING="0">
					<tr height=10>
						<td colspan=5></td>
					</tr>
					<tr height=312 valign="top">
						<td colspan=5>
							<table width="99%" border=0 CELLSPACING="1" CELLPADDING="0">
								<%=strBody%>
							</table>
						</td>
					</tr>
					<tr height=30 valign=bottom>
						<td colspan=5><p id=Prompt></p></td>
					</tr>
					<tr height=40 valign=bottom>
						<td colspan="5">
							<table width="100%">
								<tr>
									<td width="25%"></td>
									<td width="25%"><input id="btnSave" type="button" value="确定" name="btnSave" style="cursor:hand; WIDTH: 50px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return SaveSheetData('save.asp')"></td>
									<td width="25%"><input id="btnCancel" type="button" value="取消" name="btnCancel" style="cursor:hand; WIDTH: 50px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return CancelSheetData()"></td>
									<td width="25%"></td>
								</tr>
							</table>
						</td>
					</tr>
					<img style="visibility:hidden;position:absolute;" id=dumy name=dumy onreadystatechange=OnImageLoad(srcElementName) onerror=OnImageError(srcElementName)>
					<input TYPE="hidden" NAME="AttachOnlyImage" value="<%=AttachOnlyImage%>">
					<input TYPE="hidden" NAME="AttachMaxSize" value="<%=AttachMaxSize%>">
				</table>
			<%else%>
				<table width="60%" border=0 CELLSPACING=0 CELLPADDING="0" align=center>
					<tr height=312 valign="center">
						<td><%=ErrDesc%></td>
					</tr>
					<tr height=40 valign=bottom>
						<td>
							<p align=center>
								<input id="btnCancel" type="button" value="关闭" name="btnCancel" style="cursor:hand; WIDTH: 50px; HEIGHT: 24px" LANGUAGE="javascript" onclick="parent.window.close();">
							</p>
						</td>
					</tr>
				</table>
			<%end if%>
			<input TYPE="hidden" NAME="Result" value="<%=Result%>">
			<input TYPE="hidden" NAME="NewRecord" value="<%=NewRecord%>">
			<input TYPE="hidden" NAME="CoID" value="<%=CoID%>">
			<input TYPE="hidden" NAME="SheetID" value="<%=SheetID%>">
			<input TYPE="hidden" NAME="RowID" value="<%=RowID%>">
			<input TYPE="hidden" NAME="EditBeginTime" value="<%=now()%>">
			<input TYPE="hidden" NAME="RefreshByBaseSheet" value="<%=RefreshByBaseSheet%>">
			<input TYPE="hidden" NAME="RefFieldCount" value="<%=RefFieldCount%>">
			<input TYPE="hidden" NAME="RowIDs" value="<%=RowIDs%>">
			<iframe id="SaveArea" name="SaveArea" style="visibility:hidden" width="0" height="0" frameborder="0" src="">
			</iframe>
		</form>
	</body>                                                                                                           
</html>

⌨️ 快捷键说明

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