<!--#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

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) 表示院校名称
CloseRs
Set Cmd = Nothing

'判断会员能否发布
Flag = Tmp(2,0)
If Flag = False Then
 Response.Redirect "../Public/Error.asp?Param=2003"
 Response.End()
End if
'//功能代码
SchoolName              = Tmp(0,0)

 %>
<!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" src="../js/Educate_Lessonadd.js"></script>
<body>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" bgcolor="#FFFFFF">
      <!--#include file="../Header/Educate_User.asp" -->
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td height="4"></td>
        </tr> 
      </table>
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td width="175" valign="top"> 
            <!--#include file="../Lefter/Educate_Lesson.asp" -->
          </td>
          <td width="5">&nbsp;</td>
          <td valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <form action="?action=edit" name="reg" method="post" onSubmit="return reg_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">&nbsp;发布培训课程</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" size="30" maxlength="50"> 
                                <font color="#666666">(请输入课程名称</font>)</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 name=properity class=txtfield id="properity">
                                  <OPTION value=""  selected>--请选择--</OPTION>
                                  <OPTION value="企业内训">企业内训</OPTION>
                                  <OPTION value="资格认证">资格认证</OPTION>
                                  <OPTION value="IT培训">IT培训</OPTION>
                                  <OPTION value="语言培训">语言培训</OPTION>
                                  <OPTION value="学历招生">学历招生</OPTION>
                                  <OPTION value="公开课">公开课</OPTION>
                                </SELECT> </td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 开课时间：</td>
                              <td height="25"> <input name="begindate" type="text" id="begindate" size="16" onclick="SD(this,'document.all.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="enddate" type="text" id="enddate" size="16" onclick="SD(this,'document.all.enddate')" ></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 开课地区：</td>
                              <td height="25"> <!--#include file="../Include/Class_Locus.asp" --></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 开课地点：</td>
                              <td height="25" bgcolor="f9f9f9"> <input name="address" type="text" id="lessonname3" size="30" maxlength="100"></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 课程原价：</td>
                              <td height="25"> <input name="price" type="text" id="price" size="16"></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 网上价格：</td>
                              <td height="25" bgcolor="f9f9f9"> <input name="webprice" type="text" id="webprice" size="16"></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right">主办单位：</td>
                              <td height="25"> <input name="educatename" type="text" id="educatename" size="30" maxlength="50" value="<%= SchoolName %>"></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 培训对象：</td>
                              <td height="25" bgcolor="f9f9f9"> <textarea name="objs" cols="55" rows="5" id="objs"></textarea></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 课程目的：</td>
                              <td height="25"> <textarea name="mudi" cols="55" rows="5" id="mudi"></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="content"></textarea></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"> 其他说明：</td>
                              <td height="25"> <textarea name="other" cols="55" rows="5" id="other"></textarea></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right" bgcolor="f9f9f9"> 
                                <STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 每班人数：</td>
                              <td height="25" bgcolor="f9f9f9"> <input name="number" type="text" id="number" size="6">
                                人 <font color="#666666">(如,50人)</font></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"> 授课语言：</td>
                              <td height="25"> <input name="languages" type="text" id="person3" size="16"> 
                                <font color="#666666">(如,汉语)</font></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right" bgcolor="f9f9f9"> 
                                授课讲师：</td>
                              <td height="25" bgcolor="f9f9f9"> <input name="teacher" type="text" id="languages" size="16"></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"></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" ></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right">传 真：</td>
                              <td height="25"> <input name="fax" type="text" id="currcy4" size="16"  ></td>
                            </tr>
                            <tr bgcolor="f9f9f9"> 
                              <td height="25" align="right">特惠课程：</td>
                              <td height="25"> 
                                <input name="best" type="checkbox" id="best" value="1">
                                设置为特惠课程</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="submit" name="submit" value=" 确 认 发 布 " style="height:30px;"> 
                  </td>
                </tr>
              </form>
            </table></td>
        </tr>
      </table> 
      </td>
  </tr>
</table>
<table width="950" 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()

 Schid              = Session("Educate")(2)
'LessonName,Properity,BeginDate,EndDate,Locus_Area,Locus_City,Address,Price,WebPrice,EducateName,Objs,Teacher,Mudi,Content,Number,Languages,Other,Phone,Fax,Person
 LessonName			= Replace_Text(Request.Form("LessonName"))
 Properity			= Replace_Text(Request.Form("Properity"))
 BeginDate			= Replace_Text(Request.Form("BeginDate"))
 EndDate			= Replace_Text(Request.Form("EndDate"))
 Locus_Area			= Replace_Text(Request.Form("x_suozaidi"))
 Locus_City			= Replace_Text(Request.Form("x_suozaidi1"))
 Address			= Replace_Text(Request.Form("Address"))
 Price				= Replace_Text(Request.Form("Price"))
 WebPrice			= Replace_Text(Request.Form("WebPrice"))
 EducateName		= Replace_Text(Request.Form("EducateName"))
 Objs				= Replace_Text(Request.Form("Objs"))
 Teacher			= Replace_Text(Request.Form("Teacher"))
 Mudi				= Replace_Text(Request.Form("Mudi"))
 Content			= Replace_Text(Request.Form("Content"))
 Number1			= Replace_Text(Request.Form("Number"))
 Languages			= Replace_Text(Request.Form("Languages"))
 Other				= Replace_Text(Request.Form("Other"))
 Phone				= Replace_Text(Request.Form("Phone"))
 Fax				= Replace_Text(Request.Form("Fax"))
 Person				= Replace_Text(Request.Form("Person"))
 Best				= Replace_Text(Request.Form("Best"))
 
 If Objs <> "" Then Objs = Replace(Objs,chr(13),"<br>")
 If Mudi <> "" Then Mudi = Replace(Mudi,chr(13),"<br>")
 If Content <> "" Then Content = Replace(Content,chr(13),"<br>")
 If Other <> "" Then Other = Replace(Other,chr(13),"<br>")
 If Best = "" Then Best = 0
 

 If Session("Nc_Vip") = 1 Then
  Flag = 1
 Else
  Flag = 0
 End if
 
 SQL = "Insert Into [pH_Educate_Lesson] (Schid,LessonName,Properity,BeginDate,EndDate,Locus_Area,Locus_City,Address,Price,WebPrice,EducateName,Objs,Teacher,Mudi,Content,Number,Languages,Other,Phone,Fax,Person,Flag,Best,AddDate) Values ('"&Schid&"','"&LessonName&"','"&Properity&"','"&BeginDate&"','"&EndDate&"','"&Locus_Area&"','"&Locus_City&"','"&Address&"',"&Price&","&WebPrice&",'"&EducateName&"','"&Objs&"','"&Teacher&"','"&Mudi&"','"&Content&"',"&Number1&",'"&Languages&"','"&Other&"','"&Phone&"','"&Fax&"','"&Person&"',"&Flag&","&Best&",Getdate())"
 Conn.Execute(SQL)
 
 '更新培训机构资料
 SQL = "Update [pH_Educate_Base] Set LastUpdate_Time=getdate(),Lessons=Lessons+1 Where Schid='"&Schid&"'"
 Conn.Execute(SQL)
 
 Response.write "<script>alert('您的课程已发布成功!');location.href='Sch_Lesson_Manage.asp';</script>"
 Response.End()
End Sub

'//关闭数据库连接
CloseDB
 %>
