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

📄 xyadminedit.asp

📁 一个不错的企业网站源代码!
💻 ASP
字号:
<%@ Language=VBScript%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
Response.Buffer=true
Response.Expires=0
%>
<%
pid=Request.QueryString("pid")
ppid=Request.QueryString("ppid")
scool=Request.QueryString("scool")
if scoolflag="" then
		scoolflag=0
	else
		scoolflag=1
end if		
htmlname=linkxy&"?pid="&pid&"&ppid="&ppid&"&scoolflag="&scoolflag
backhtml=linkadmin&"?pid="&pid&"&ppid="&ppid
creadate=now()
set cn=Server.CreateObject("ADODB.Connection")
set rs1=Server.CreateObject("ADODB.Recordset")
cn.Open mycnstr
%>
<%
if scoolflag=1 then 
		tabname="scool"
		filer=ppid
	else
		tabname="classes"
		filer=pid
end if
if Request.ServerVariables("REQUEST_METHOD")="POST" then
				body=Request.Form("content")
				sqltext2="select * from "+tabname+" where id="+filer
				rs1.Open sqltext2,cn,1,2
				rs1("body")=body	
				rs1("date")=creadate		
				rs1.Update 
				rs1.Close 
				Response.Redirect (backhtml)
end if
		sqltext="select * from scool where id="+ppid
		rs1.Open sqltext,cn,1,1
		scoolname=rs1("name")
		rs1.Close 
		
		sqltext1="select * from "+tabname+" where id="+filer
		rs1.Open sqltext1,cn,1,1
		classname=rs1("name")
		creadate=rs1("date")
		body=rs1("body")
		if tabname="classes" then
				picflag=rs1("picflag")
				picflag1=rs1("picflag1")
			else
				picflag=rs1("picflag")
		end if
		rs1.Close 
%>
<html>
<head>
<title>基本资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size: 12px; color: #000000; font-family: 宋体}
td {font-size: 12px; color: #000000; font-family: 宋体;}
.t1 {font:12px 宋体;color=000000} 
.t2 {font:12px 宋体;color:ffffff} 
.t5 {font:12px 宋体;color:ff6600} 

.bt1 {font:14px 宋体;color=000000} 
.bt2 {font:14px 宋体;color:ffffff} 

A:link {color: #000066}
A:visited {color: #000066}
A:hover {color: #ff0000}

A.r1:link {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:visited {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:hover {font-size:12px;text-decoration:underline;color:#ff6600;}

A.r2:link {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:visited {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:hover {font-size:12px;text-decoration:underline;color:#ff6600;}
-->
</style>
</head>

<body bgcolor=#ffffff topmargin=10>
<form action="<%=htmlname%>" method=post name=editform>
 
 <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr><td>
			<font class=t5>当前位置:<%=scoolname%>→  <%=classname%></font>
			 ←<a href=<%=backhtml%>>返回列表</a>
		</td>
	</td></tr>
	<tr><td><hr size=1></td></tr>
	<tr bgcolor=ffe4c4><td height=20><font class=t1>具体内容</font><br>
	</td></tr>
	<tr><td height=5></td></tr>
 </table>
 <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
	<tr><td width=70 align=right>&nbsp;创建日期:</td><td align=left><font color=000000><%=creadate%></font></td></tr>
	<tr><td>&nbsp;</td></tr>
	<tr><td width=70 align=right></td>
		<td>
			<img src="images\bold.gif" onclick="format('bold')" style="cursor:hand;" title="粗体">
			<img src="images\italicize.gif" onclick="format('italic')" style="cursor:hand;" title="斜体">
			<img src="images\underline.gif"  onclick="format('underline')" style="cursor:hand;" title="下划线">
			<img src="images\center.gif"  onclick="format('center')" style="cursor:hand;" title="居中">
			<img src="images\space.gif"  onclick="format('space')" style="cursor:hand;" title="空格">
		<select name=font style="width:120px" onchange="formatfont(this.options[this.selectedIndex].value)">
			<option value="宋体" selected>宋体
			<option value="楷体_gb2312">楷体GB2312
			<option value="黑体">黑体
			<option value="隶书">隶书
			<option value="Arial">Arial
			<option value="Arial Black">Arial Black
			<option value="Impact">Impact
			<option value="Tahoma">Tahoma
			<option value="Times New Roman">Times New Roman
			<option value="Verdana">Verdana
		</select>				
		<select name=fontsize style="width:50px" onchange="formatsize(this.options[this.selectedIndex].value)">
			<option value="6" >一号
			<option value="5">二号
			<option value="4">三号
			<option value="3">四号
			<option value="2"selected>五号
		</select>				
		<select name=color style="width:70px" onchange="formatcolor(this.options[this.selectedIndex].value)">
			<option style="background-color:black;color=black" value="black">黑色
			<option style="background-color:red;color=red" value="red">红色
			<option style="background-color:blue;color=blue" value="blue">蓝色
			<option style="background-color:green;color=green" value="green">绿色
			<option style="background-color:aqua;color=aqua"  value="aqua">浅绿色
			<option style="background-color:fuchsia;color=fuchsia" value="fuchsia">紫红色
			<option style="background-color:gray;color=gray" value="gray" selected>灰色			
			<option style="background-color:maroon;color=maroon" value="maroon">粟色
			<option style="background-color:navy;color=navy" value="navy">深蓝色
			<option style="background-color:olive;color=olive" value="olive">橄榄色
			<option style="background-color:purple;color=purple" value="purple">紫色
			<option style="background-color:teal;color=teal" value="teal">茶色			
			<option style="background-color:yellow;color=yellow" value="yellow">黄色
		</select>				
		</td></tr>
	<tr>
		<table>
			<td width=70 align=right>内容</td>
			<td><textarea rows=15 cols=60 name=content style="font-family:宋体" ><%=body%></textarea></td>
			<td width=10>&nbsp;</td>
<td valign=top>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr><td width=60></td><td height=10></td></tr>
	<tr>
	<td width=60></td>
	<td align=center>
					<%if picflag=1 then%>
						<img src="./jpg.asp?id=<%=filer%>&tabname=<%=tabname%>&pic=0" border="0"><br><br>
						<a href="Javascript:editimage('<%=filer%>','0')">上传图片</a>
					<%else%>
						<a href="Javascript:editimage('<%=filer%>','0')">点击此处上传图片</a>
					<%end if%>
	</td></tr>
</table>
		

		</table>
	</tr>

</table>	
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr><td width=200></td><td height=10></td></tr>
	<tr>
	<td width=200></td>
	<td align=left>
		<input type="submit" name="submit" value="确认提交">&nbsp;&nbsp;&nbsp;&nbsp;
		<input type=button value='内容预览' name=Button onclick=gopreview() style="">
	</td></tr>
</table>

</form>
<form name=preview method=post action="content_view.asp" target=winview>
	<input type=hidden name=viewtitle value=""><input type=hidden name=viewbody value="">
</form>

</body>
</html>
<script language=Javascript>

	function format(flag)
	{
		switch(flag){
			case "bold":
				begintxt="<b>";
				endtxt="</b>";
				break;
			case "italic":
				begintxt="<i>";
				endtxt="</i>";
				break;
			case "underline":
				begintxt="<u>";
				endtxt="</u>";
				break;
			case "center":
				begintxt="<center>";
				endtxt="</center>";
				break;
			case "space":
				begintxt="&nbsp;";
				endtxt="";
				break;
		}
		dealcontent()
	}

	function formatcolor(newvalue)
	{
		begintxt="<font color="+newvalue+">"
		endtxt="</font>";
		dealcontent()
	}

	function formatfont(newvalue)
	{
		begintxt="<font face="+newvalue+">"
		endtxt="</font>";
		dealcontent()
	}

	function formatsize(newvalue)
	{
		begintxt="<font size="+newvalue+">"
		endtxt="</font>";
		dealcontent()
	}

	function dealcontent()
	{
		
		if ((document.selection)&&(document.selection.type == "Text"))
		{
		var range = document.selection.createRange();
		var ch_text=range.text;
		range.text = begintxt + ch_text + endtxt;
		} 
		else 
		{
		document.editform.content.value=begintxt+document.editform.content.value+endtxt;
		document.editform.content.focus();
		}
	}


	function gopreview()
	{
	document.preview.viewtitle.value=document.editform.title.value;
	document.preview.viewbody.value=document.editform.content.value;
	window.open('content_view.asp', 'winview', 'scrollbars=yes,width=500,height=400');
	document.preview.submit()
	}
	
	function editimage(keyno,pic)
	{
		var str
		str="upload.asp";
		str=str+"?id="+keyno+"&tablename=<%=tabname%>"+"&pic="+pic
		window.open(str,"mywin","toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=auto,width=520,height=400,left=120,top=70")		
	}
</script>




⌨️ 快捷键说明

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