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

📄 countedit.asp

📁 一个不错的企业网站源代码!
💻 ASP
字号:
<%@ Language=VBScript%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
Response.Buffer=true
Response.Expires=0
%>
<%
if session("adminusername")="" then
		session("xhy")=1
		Response.Redirect linkwarn
end if
id=Request.QueryString("id")
pid=Request.QueryString("pid")
ppid=Request.QueryString("ppid")
creadate=now()
englishflag=Request.QueryString ("englishflag")
if englishflag="" then
		englishflag=0
	else
		englishflag=cint(englishflag)
end if
if englishflag=0 then
		tabname="count"
	else
		tabname="ecount"	
end if	
htmlname=linkcountedit&"?id="&id&"&pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
backhtml=linkcountadmin&"?pid="&pid&"&ppid="&ppid&"&englishflag="&englishflag
set cn=Server.CreateObject("ADODB.Connection")
set rs1=Server.CreateObject("ADODB.Recordset")
set rs2=Server.CreateObject("ADODB.Recordset")
set rs3=Server.CreateObject("ADODB.Recordset")
cn.Open mycnstr
if ppid<>"" then
		sqltext="select name from scool where id="&ppid
		rs1.Open sqltext,cn,1,1
		if not rs1.EOF then
				scoolname=rs1("name")
		end if
		rs1.Close 
end if
if pid<>"" then
		sqltext="select name from classes where id="&pid
		rs1.Open sqltext,cn,1,1
		if not rs1.EOF then
				classname=rs1("name")
		end if
		rs1.Close 
end if
if pid=13 then
		flag=1 
	else
		flag=0
end if
if id="" then
		id=0
	else
		id=cint(id)
end if
if englishflag=0 then
		classname=classname&"<font color=red>(中文版)</font>"
	else
		classname=classname&"<font color=blue>(中文版)</font>"	
end if
%>

<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
		yx=Request.Form("c1")
		title=trim(Request.Form("title"))
		body=Request.Form("content")
		pl=trim(Request.Form("t1"))
		if pl="" or not isnumeric(pl) then 
				sqltext3="select max(pl) as maxpl from "+tabname
				rs2.Open sqltext3,cn,1,1
				if not rs2.EOF then
						pl=rs2("maxpl")+1
				end if
				rs2.Close 
		end if
		if pl="" or not isnumeric(pl) then pl=1		
		man=trim(Request.Form("t3"))
		email=trim(Request.Form("t4"))
		tel=trim(Request.Form("t5"))
		fax=trim(Request.Form("t6"))
		add=trim(Request.Form("t7"))
		postyb=trim(Request.Form("t8"))
	
		if id=0 then
				sqltext3="select * from "+tabname+" where name='"+title+"'"
				rs2.Open sqltext3,cn,1,1
				if not rs2.EOF then
						err=1
						errtxt="部门:“"&title&"”已存在,请换名重试!"
						title=""
					else					
						sqltext4="select * from "+tabname
						rs1.Open sqltext4,cn,1,2
						rs1.AddNew
						rs1.Update 
						id=rs1("id")
						rs1.Close 
				end if
				rs2.Close 
		end if

		if err<>1 and id<>0 then
				sqltext4="select * from "+tabname+" where id="&id
				rs1.Open sqltext4,cn,1,2
				if not rs1.EOF then
						rs1("name")=title
						rs1("creatdate")=creadate		
						rs1("pl")=pl
						rs1("name")=title
						rs1("body")=body	
						rs1("man")=man
						rs1("email")=email
						rs1("tel")=tel
						rs1("fax")=fax
						rs1("add")=add
						rs1("postyb")=postyb
						if yx="on" then
								rs1("enable")=1
						end if
						if yx="" then
								rs1("enable")=0
						end if
						rs1.Update 
						rs1.Close 
						Response.Redirect backhtml
				end if
		end if
end if

if id<>0 then
		sqltext2="select * from "+tabname+" where id="&id
		rs1.Open sqltext2,cn,1,1
		if not rs1.EOF then
				countname=rs1("name")
				creadate=rs1("creatdate")
				pl=rs1("pl")
				man=rs1("man")
				email=rs1("email")
				tel=rs1("tel")
				fax=rs1("fax")
				add=rs1("add")
				yxx=rs1("enable")
				postyb=rs1("postyb")
				rs1.Close 
		end if
	else
		yxx=1 
end if
%>
<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}
.bt5 {font:14px 宋体;color:0000ff} 

.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 onsubmit="return checkform(editform)">
 
 <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr><td>
		<font class=t5>当前位置:<%=scoolname%>→ <%=classname%>→ <%=countname%> 
		<%if session("adminusername")="xhaiy6411620" then%>
				← <a href="<%=backhtml%>">返回联系我们信息列表</a>
	    <%end if%>
	</td>
	</td></tr>
	<tr><td><hr size=1></td></tr>
	<tr bgcolor=ffe4c4><td height=20><font class=t1>具体内容</font>       <%if editok=1 then Response.Write ("<font color=blue>(修改成功)</font>")%><br>
	</td></tr>
	<tr><td height=5></td></tr>
 </table>
 <div align=center><font size=3 color="red"><b><%=errtxt%></b></font></div>
 <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
	<tr><td width=70 align=right>有效性</td>
		<td>
			<%if yxx=1 then%>
					<input type="checkbox" checked name="c1">
				<%else%>
					<input type="checkbox" name="c1">
			<%end if%>					  	
		&nbsp;&nbsp;创建日期:<font color=000000><%=creadate%></font>
		</td></tr>
	<tr><td width=70 align=right>序号</td><td><input type="text" value="<%=pl%>" name="t1" maxlength=60 size=10><font color=red> 按照此序号由小到大排列</font></td></tr>
	<tr><td width=70 align=right>部门</td>
		<td><input type="text" value="<%=countname%>" name=title maxlength=60 size=25><font color=red>*</font></td></tr>
	<tr><td width=70 align=right>联系人</td><td><input type="text" value="<%=man%>" name="t3" maxlength=60 size=20></td></tr>
	<tr><td width=70 align=right>E-mail</td><td><input type="text" value="<%=email%>" name="t4" maxlength=60 size=30><font color=red>*网站留言将发到此信箱</font></td></tr>
	<tr><td width=70 align=right>联系电话</td><td><input type="text" value="<%=tel%>" name="t5" maxlength=60 size=30><font color=red>*</font></td></tr>
	<tr><td width=70 align=right>传真</td><td><input type="text" value="<%=fax%>" name="t6" maxlength=60 size=30></td></tr>
	<tr><td width=70 align=right>邮编</td><td><input type="text" value="<%=postyb%>" name="t8" maxlength=60 size=30></td></tr>
	<tr><td width=70 align=right>地址</td><td><input type="text" value="<%=add%>" name="t7" maxlength=60 size=60></td></tr>
<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="button" name="button1" value="确认提交" onclick="check1()">&nbsp;&nbsp;&nbsp;&nbsp;
	</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('<%=linkbodyview%>', 'winview', 'scrollbars=yes,width=500,height=400');
	document.preview.submit()
	}

	
</script>
<script language=vbscript>
		sub check1
			dim form1
			set form1=document.editform 
			if form1("title").value="" then
					alert("名称不能为空!")
					form1("title").focus			
				elseif form1("t4").value="" then
						alert("电子信箱地址不能为空!")
						form1("t4").focus
				elseif instr(form1("t4").value,"@")=0 then
						alert("您填写的电子信箱格式不正确")
						form1("t4").focus
				elseif form1("t5").value="" then
						alert("联系电话不能为空!")
						form1("t5").focus
				else
						form1.submit
			end if
			
		end sub

</script>

⌨️ 快捷键说明

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