📄 sch_lesson_edit.asp
字号:
<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="../Public/Educate_Cookies.asp" -->
<%
Dim Schid,Username,Tmp,Temp(3)
Dim Cmd,Rs,Action
Param = Replace_Text(Request.QueryString("Param"))
Action = Request.QueryString("action")
If Action = "edit" Then Call Edit_Submit() '//调用保存数据的函数
'//获取会员登陆的标记
If Not IsArray(Session("Educate")) Then
Response.write "<script>alert('-登录后才能进行该操作!-');location.href='../Public/MemberLogin.asp';</script>"
Else
Username = Session("Educate")(0)
Schid = Session("Educate")(2)
End if
'//调用存储过程
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "Edu_Account"
Cmd.CommandType = 4
Cmd.Parameters.Append Cmd.CreateParameter("@Schid",200,1,30)
Cmd.Parameters("@Schid") = Schid
Set Rs = Cmd.Execute
If Rs.Eof Then
CloseRs
Set Cmd = Nothing
CloseDB
Response.write "没有找到会员资料!"
Response.End()
End if
Tmp = Rs.GetRows() '//将数据填充到数组
'//0院校名,1院校性质
'//如 Tmp(0,0) 表示院校名称
Rs.Close
Set Cmd = Nothing
'//功能代码
SchoolName = Tmp(0,0)
Properity = Tmp(1,0)
If School_Memo <> "" Then School_Memo = Replace(School_Memo,"<br>",Chr(13))
SchoolType = Cls_EducateType(Properity)
Set Rs = Conn.Execute("Select * From [pH_Educate_Lesson] Where Schid='"&Schid&"' And Ncid="&Cstr(Param))
Valid = Rs("Valid")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Css/Style.css" type=text/css rel=stylesheet>
<title><%= Cls_WebName %> -- 培训机构管理中心 -- 更改用户名</title>
</head>
<script language="JavaScript" src="../js/jsdate.js"></script>
<script language="JavaScript" >
function theForm_check()
{
if (document.theForm.lessonname.value=="")
{
alert("请输入培训课程的名称!");
document.theForm.lessonname.focus();
return false;
}
if (document.theForm.beginaddr.value=="")
{
alert("请输入开课的地点!");
document.theForm.beginaddr.focus();
return false;
}
if (document.theForm.currcy.value=="")
{
alert("请输入所需的费用!");
document.theForm.currcy.focus();
return false;
}
if (document.theForm.content.value=="")
{
alert("请输入课程的内容!");
document.theForm.content.focus();
return false;
}
if (document.theForm.person.value=="")
{
alert("请输入联系人!");
document.theForm.person.focus();
return false;
}
if (document.theForm.phone.value=="")
{
alert("请输入电话号码!");
document.theForm.phone.focus();
return false;
}
}
</script>
<body>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#FFFFFF">
<!--#include file="../Include/Header.asp" -->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="4"></td>
</tr>
<tr>
<td height="1" bgcolor="#eeeeee"></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="175" valign="top">
<!--#include file="../Public/Educate_Left.asp" -->
</td>
<td width="5"> </td>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25"><img src="../Images/icon.gif" width="11" height="11" align="absmiddle">
<%= SchoolName %> [<%= SchoolType %>]</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form action="?action=edit" name="theForm" method="post" onSubmit="return theForm_check()">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="dddddd">
<tr>
<td bgcolor="#FFFFFF"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="2"></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
<tr>
<td height="25" bgcolor="f5f5f5"><b><font color="#000000"> 培训课程</font></b></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td width="18%" height="25" align="right"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 课程名称:</td>
<td height="25"><input name="lessonname" type="text" id="lessonname" value="<%= Rs("lessonname") %>">
</td>
</tr>
<tr>
<td width="18%" height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 课程性质:</td>
<td height="25" bgcolor="f9f9f9">
<SELECT class=txtfield name=property>
<OPTION value="<%=Rs("Property")%>"><%= Rs("Property") %></OPTION>
<OPTION
value=IT认证>IT认证</OPTION>
<OPTION value=外语培训>外语培训</OPTION>
<OPTION value=电脑技术>电脑技术</OPTION>
<OPTION
value=财会金融>财会金融</OPTION>
<OPTION value=人力资源>人力资源</OPTION>
<OPTION value=市场营销>市场营销</OPTION>
<OPTION value=法律>法 律</OPTION>
<OPTION value=其他>其 他</OPTION>
</SELECT> </td>
</tr>
<tr>
<td height="25" align="right">开课时间:</td>
<td height="25">
<input name="begindate" type="text" id="begindate" size="16" onclick="SD(this,'document.all.begindate')" value="<%= Rs("begindate") %>"></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 开课地点:</td>
<td height="25" bgcolor="f9f9f9"><input name="beginaddr" type="text" id="lessonname3" size="45" value="<%= Rs("beginaddr") %>"></td>
</tr>
<tr>
<td height="25" align="right"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 费 用:</td>
<td height="25">
<input name="currcy" type="text" id="currcy" size="16" value="<%= Rs("currcy") %>"></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="f9f9f9">培训目标:</td>
<td height="25" bgcolor="f9f9f9"><textarea name="mubiao" cols="55" rows="5" id="mubiao"> <%= Rs("mubiao") %></textarea></td>
</tr>
<tr>
<td height="25" align="right">培训对象:</td>
<td height="25">
<textarea name="sudobj" cols="55" rows="5" id="sudobj"><%= Rs("sudobj") %></textarea></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 课程内容:</td>
<td height="25" bgcolor="f9f9f9"><textarea name="content" cols="55" rows="5" id="textarea2"><%= Rs("content") %></textarea></td>
</tr>
<tr>
<td height="25" align="right"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 联系人:</td>
<td height="25">
<input name="person" type="text" id="person" size="16" value="<%= Rs("person") %>"></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 联系电话:</td>
<td height="25" bgcolor="f9f9f9"><input name="phone" type="text" id="currcy3" size="16" value="<%= Rs("phone") %>"></td>
</tr>
<tr>
<td height="25" align="right">传 真:</td>
<td height="25">
<input name="fax" type="text" id="currcy4" size="16" value="<%= Rs("fax") %>"></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT
color=#ff6600>*</FONT></STRONG> 有效期:</td>
<td height="25" bgcolor="f9f9f9">
<select name="valid" id="valid">
<OPTION value=7 <% If Valid = 7 Then Response.Write "Selected" %>>一星期</OPTION>
<OPTION value=15 <% If Valid = 15 Then Response.Write "Selected" %>>半个月</OPTION>
<OPTION value=30 <% If Valid = 30 Then Response.Write "Selected" %>>一个月</OPTION>
<OPTION value=60 <% If Valid = 60 Then Response.Write "Selected" %>>二个月</OPTION>
<OPTION value=90 <% If Valid = 90 Then Response.Write "Selected" %>>三个月</OPTION>
<OPTION value=180 <% If Valid = 180 Then Response.Write "Selected" %>>半年</OPTION>
<OPTION value=0 <% If Valid = 0 Then Response.Write "Selected" %>>长年招生</OPTION>
</SELECT>
</td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="2"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="40" align="center"> <input type="hidden" name="ncid" value="<%= Rs("Ncid") %>">
<input type="submit" name="submit" value=" 保 存 " style="height:30px;">
</td>
</tr>
</form>
</table></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="1" bgcolor="#eeeeee"></td>
</tr>
</table></td>
</tr>
</table>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#FFFFFF">
<!--#include file="../Include/Footer.asp" -->
</td>
</tr>
</table>
</body>
</html>
<%
Sub Edit_Submit()
Ncid = Replace_Text(Request.Form("Ncid"))
Schid = Session("Educate")(2)
'LessonName,Property,Begindate,BeginAddr,Currcy,Mubiao,Sudobj,Content,Person,Phone,Fax,Valid
LessonName = Replace_Text(Request.Form("LessonName"))
Property1 = Replace_Text(Request.Form("Property"))
Begindate = Replace_Text(Request.Form("Begindate"))
BeginAddr = Replace_Text(Request.Form("BeginAddr"))
Currcy = Replace_Text(Request.Form("Currcy"))
Mubiao = Replace_Text(Request.Form("Mubiao"))
Sudobj = Replace_Text(Request.Form("Sudobj"))
Content = Replace_Text(Request.Form("Content"))
Person = Replace_Text(Request.Form("Person"))
Phone = Replace_Text(Request.Form("Phone"))
Fax = Replace_Text(Request.Form("Fax"))
Valid = Replace_Text(Request.Form("Valid"))
If Mubiao <> "" Then Mubiao = Replace(Mubiao,chr(13),"<br>")
If Sudobj <> "" Then Sudobj = Replace(Sudobj,chr(13),"<br>")
If Content <> "" Then Content = Replace(Content,chr(13),"<br>")
'SQL = "Insert Into [pH_Educate_Lesson] (Schid,LessonName,Property,Begindate,BeginAddr,Currcy,Mubiao,Sudobj,Content,Person,Phone,Fax,Valid,AddDate) Values ('"&Schid&"','"&LessonName&"','"&Property1&"','"&Begindate&"','"&BeginAddr&"','"&Currcy&"','"&Mubiao&"','"&Sudobj&"','"&Content&"','"&Person&"','"&Phone&"','"&Fax&"','"&Valid&"',getdate())"
SQL = "Update [pH_Educate_Lesson] Set LessonName='"&LessonName&"',Property='"&Property1&"',Begindate='"&Begindate&"',BeginAddr='"&BeginAddr&"',Currcy='"&Currcy&"',Mubiao='"&Mubiao&"',Sudobj='"&Sudobj&"',Content='"&Content&"',Person='"&Person&"',Phone='"&Phone&"',Fax='"&Fax&"',Valid="&Valid&",AddDate=getdate() Where Schid='"&Schid&"' And Ncid="&Cstr(Ncid)
Conn.Execute(SQL)
Response.write "<script>alert('编辑完成!');location.href='Sch_Lesson.asp';</script>"
Response.End()
End Sub
'//关闭数据库连接
CloseDB
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -