<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="train_info.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/cinfo.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	End If
	action=ReplaceBadChar(Trim(Request.QueryString("action")))
	if action="save" then
		tid=ReplaceBadChar(int(Request.Cookies("admin_train_id")))
		id=ReplaceBadChar(int(Request.Form("id")))
		tsname=ReplaceBadChar(Trim(Request.Form("tsname")))
		type_max=ReplaceBadChar(Trim(Request.Form("type_max")))
		hukouprovince=ReplaceBadChar(int(Trim(Request.Form("hukouprovince"))))
		hukoucapital=ReplaceBadChar(int(Trim(Request.Form("hukoucapital"))))
		lasttime=ReplaceBadChar(Trim(Request.Form("lasttime")))
		price=ReplaceBadChar(Trim(Request.Form("price")))
		introduction=Trim(Request.Form("introduction"))
		object=Trim(Request.Form("object"))
		lxfs=Trim(Request.Form("lxfs"))
		area=ReplaceBadChar(Trim(Request.Form("hukoucity")))
			
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="select * from train_subject where id="&id&" and tid="&tid&""
		rs.open sql,conn,2,3
		if not rs.eof then
			zhuangtai=rs("zhuangtai")
			rs("tsname")=tsname
			rs("type_max")=type_max
			rs("province")=hukouprovince
			rs("city")=hukoucapital
			rs("area")=area
			rs("lasttime")=lasttime
			rs("price")=price
			rs("introduction")=introduction
			rs("object")=object
			rs("lxfs")=lxfs
			rs.update
			
			if zhuangtai=1 then

				response.redirect "train_html.asp?viewurl=view_train_subject.asp?id="&id&"&createurl="&id&".html&backurl=whkc.asp"
				
			else
			
				response.write"<SCRIPT language=JavaScript>alert('您的操作已经完成，现在为您返回');"
				response.write"this.location.href='whkc.asp';</SCRIPT>"
				response.end
				
			end if
			
		else
			response.write"<SCRIPT language=JavaScript>alert('非法操作');"
			response.write"javascript:history.go(-1);</SCRIPT>"
			response.end
		end if
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
	end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title><%=homename%>--机构管理中心首页</title>
<link href="images/Style_company.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    <!--
    var Browser_isIE = window.ActiveXObject ? true : false;
    var GpArray = new Array("index.asp","manage.asp", "pwd.asp", "publish_new.asp", "whkc.asp", "sign.asp?type=ask", "sign.asp?type=join", "tmoney.asp", "mail_box.asp", "../html/train/<%=Request.Cookies("admin_train_id")%>/", "pay_list.asp","Card_list.asp","login_out.asp");
    function MO_0(obj)
    {
        obj.className = "menu_td2";
    }
    
    function MU_0(obj)
    {
        obj.className = "menu_td";
    }
    function Gp(pIndex)
    {
        location.href = GpArray[pIndex];
    }
    function Gout()
    {
        if(confirm("提示：确定要退出系统？")){ location.href = "login_out.asp";}
    }
function check()
{
    if(document.info.tsname.value==""){
		document.info.tsname.focus();
    	alert("请输入课程名称！");
	return false;
  }
    if(document.info.type_max.value=="") {
	document.info.type_max.focus();
    alert("请选择所属类别！");
	return false;
  }
   if(document.info.hukouprovince.value=="") {
	document.info.hukouprovince.focus();
    alert("对不起，请选择开课地区的省份！");
	return false;
  }
   if(document.info.hukoucapital.value=="") {
	document.info.hukoucapital.focus();
    alert("对不起，请选择开课地区的城市！");
	return false;
  }
  if(document.info.lasttime.value=="") {
	document.info.lasttime.focus();
    alert("对不起，请输入有效期！");
	return false;
  }
  if(document.info.price.value=="") {
	document.info.price.focus();
    alert("对不起，请输入课程报价！");
	return false;
  }
  if(document.info.introduction.value=="") {
	document.info.introduction.focus();
    alert("对不起，请输入主要课程！");
	return false;
  }
  if(document.info.object.value=="") {
	document.info.object.focus();
    alert("对不起，请输入适用对象！");
	return false;
  }
  if(document.info.lxfs.value=="") {
	document.info.lxfs.focus();
    alert("对不起，请输入报名方式！");
	return false;
  }
}
//功能：去掉字符串前后空格
//返回值：去掉空格后的字符串
function fnRemoveBrank(strSource)
{
 return strSource.replace(/^\s*/,'').replace(/\s*$/,'');
}
function GethukouCapital(capitalid)
{
document.frames["hukoucapitalframe"].location.replace("../inc/gethukoucapital.asp?capitalid="+capitalid);
}
function GethukouCity(cityid)
{
document.frames["hukoucityframe"].location.replace("../inc/gethukoucity.asp?cityid="+cityid);
}
function String.prototype.lenB()
{
return this.replace(/[^\x00-\xff]/g,"**").length;
}
-->
</script>
<iframe height=0 width=0 src="" id="hukoucapitalframe"></iframe>
<iframe height=0 width=0 src="" id="hukoucityframe"></iframe>
<style type="text/css">
    .menu_span {line-height:31px;padding:12px 5px 12px 48px; margin-left:15px;}
</style>
</head>
<body>
    <div id="body">
    <div id="top">
    <div class="top_logo"></div>
    <div class="top_gochat"><img src="images/c_chat.gif" /> <font id="KfChatState" color="white">您的帐号状态(<b><% If hideuser=0 Then Response.Write("公开") else Response.Write("隐藏")%></b>)</font><font color="white"> 审核状态(<b><% If zhuangtai=1 Then Response.Write("已审核") else Response.Write("未审核")%></b>)</font></div>
    <div class="top_userinfo">用户名：<u><%= Request.Cookies("admin_train_name") %></u>　　机构名称：<u><%= Request.Cookies("train_name") %></u>　　登陆次数：<%= dlnum %></div>
    <div class="img_logout"><input type="button" value="" class="btn_out" onclick="Gout()" title="退出" /></div>
    </div>
    <div id="main">
    <div id="left">
    <div id="left_menu" class="m_c">
    <div class="part_title">功 能 菜 单</div>
    <div style="width:100%;line-height:18px; margin-bottom:5px;">
    <table cellpadding="0" cellspacing="4" border="0" width="95%" style="text-align:left; margin:0 auto;">
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(0)">
            <span class="menu_span" style="background:url(images/c_menu_def_s.gif) 0px 6px no-repeat;">管理首页</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(1)">
            <span class="menu_span" style="background:url(images/c_menu_0_s.gif) 0px 6px no-repeat;">基本设置</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(2)">
            <span class="menu_span" style="background:url(images/c_menu_1_s.gif) 0px 6px no-repeat;">帐号维护</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(3)">
        <span class="menu_span" style="background:url(images/c_menu_lw_s.gif) 0px 6px no-repeat;color:#C33;">发布课程</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(4)">
        <span class="menu_span" style="background:url(images/c_menu_addr_s.gif) 0px 6px no-repeat;">课程管理</span></td>
    </tr>
    <tr>
        <td style="background-color:#F0F0F0;" height="1"></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(5)">
            <span class="menu_span" style="background:url(images/c_menu_2_s.gif) 0px 6px no-repeat;">咨询列表</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(6)">
            <span class="menu_span" style="background:url(images/c_menu_3_s.gif) 0px 6px no-repeat;">报名列表</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(7)">
            <span class="menu_span" style="background:url(images/c_menu_4_s.gif) 0px 6px no-repeat;">帐户管理</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(8)">
            <span class="menu_span" style="background:url(images/c_menu_5_s.gif) 0px 6px no-repeat;">站内信箱</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(9)">
            <span class="menu_span" style="background:url(images/c_menu_style_s.gif) 0px 6px no-repeat;">机构预览</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(10)">
            <span class="menu_span" style="background:url(images/new_1.jpg) 0px 6px no-repeat;">支付记录</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(11)">
            <span class="menu_span" style="background:url(images/new_2.jpg) 0px 6px no-repeat;">购卡记录</span></td>
    </tr>
    <tr>
        <td class="menu_td" onmouseover="MO_0(this)" onmouseout="MU_0(this)" onclick="Gp(12)">
            <span class="menu_span" style="background:url(images/c_menu_6_s.gif) 0px 6px no-repeat;">退出系统</span></td>
    </tr>
    </table>
    </div>
    </div>
    <div style="margin-top:10px;">技术支持：<a href="http://www.wishcn.com" target="_blank" title="网愿科技">网愿科技</a></div>
    </div>
    <div id="right">
<div class="part_title">&nbsp; >> <%= Request.Cookies("admin_train_name") %> 欢迎进入-培训会员管理中心首页</div>
    <table cellpadding="3" cellspacing="0" border="1" rules="all" bordercolor="#6699cc" width="100%" class="tde">
      <thead>
        <tr class="tde_head">
          <td align="left" height="23px">&nbsp;发布课程&nbsp;(带<font color="#FF0000">*</font>的为必填项目)</td>
        </tr>
      </thead>
      <tbody>
        <tr class="tde_head">
          <td>
<%
	tid=ReplaceBadChar(Request.Cookies("admin_train_id"))
	id=ReplaceBadChar(int(Trim(Request.QueryString("id"))))
	if id="" then
		response.write"<SCRIPT language=JavaScript>alert('非法操作');"
		response.write"this.location.href='whkc.asp';</SCRIPT>"
		response.end
	end if
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="select * from train_subject where tid="&tid&" and id="&id&""
	rs.open sql,conn,1,1
	if rs.eof then
		response.write"<SCRIPT language=JavaScript>alert('非法操作');"
		response.write"this.location.href='whkc.asp';</SCRIPT>"
		response.end
	else
%>
		  <form action="?action=save" method="post" name="info" onsubmit="return check()">
		  <input name="id" type="hidden" value="<%= Trim(Request.QueryString("id")) %>" />
		  <table width="100%" height="100%" border="0" bordercolor="#F9F9F9">
            <tr>
              <td width="16%" height="23" align="center">课程名称</td>
              <td colspan="2"><input name="tsname" type="text" class="input" id="tsname" size="60" value="<%= rs("tsname") %>"> 
                &nbsp;<font color="#FF0000">*</font></td>
              </tr>
            <tr>
              <td height="24" align="center">所属类别</td>
              <td colspan="2" valign="middle">
<select name="type_max" size="1" id="type_max" style="width:77px ">
<option value="" selected>类别名称</option>
<%
	set rs1=server.createobject("adodb.recordset")
	sql1="select * from train_subject_type where mid=0 order by stime desc"
	rs1.open sql1,conn,1,1
	do while not rs1.eof
	if rs1("id")=rs("type_max") then
		response.write"<OPTION value="&rs1("id")&" selected>"&rs1("type_name")&"</option>"
	else
		response.write"<OPTION value="&rs1("id")&">"&rs1("type_name")&"</option>"
	end if
	rs1.movenext
	loop
	rs1.close
	set rs1=nothing
%>
			</select>
&nbsp;<font color="#FF0000">*</font>
               </td>
              </tr>
            <tr>
              <td width="16%" height="23" align="center">开课地区</td>
              <td colspan="2"> <select name="hukouprovince" size="1" id="select" onChange=GethukouCapital(this.options[this.selectedIndex].value) style="width:77px ">
<%
	set rs_job=server.createobject("adodb.recordset")
	job_sql="select * from job_provinceandcity where fid=0 order by date desc"
	rs_job.open job_sql,conn,1,1
	do while not rs_job.eof
	if rs_job("id")=rs("province") then
		response.write"<OPTION value="&rs_job("id")&" selected>"&rs_job("province_city")&"</option>"
	else
		response.write"<OPTION value="&rs_job("id")&">"&rs_job("province_city")&"</option>"
	end if
	rs_job.movenext
	loop
	rs_job.close
	set rs_job=nothing
%>
			</select><span id="load300"></span> <span id="chukoucapital">
<select name=hukoucapital id="select" onchange=GethukouCity(this.options[this.selectedIndex].value) style="width:77px ">
<%
	set rs_job1=server.createobject("adodb.recordset")
	job_sql1="select * from job_provinceandcity where fid="&int(rs("province"))&" order by date desc"
	rs_job1.open job_sql1,conn,1,1
	do while not rs_job1.eof
	if rs_job1("id")=rs("city") then
		response.write"<OPTION value="&rs_job1("id")&" selected>"&rs_job1("province_city")&"</option>"
	else
		response.write"<OPTION value="&rs_job1("id")&">"&rs_job1("province_city")&"</option>"
	end if
	rs_job1.movenext
	loop
	rs_job1.close
	set rs_job1=nothing
%>
</select></span>
                          <span id="load400"></span> <span id="chukoucity">
                          <select name=hukoucity id="hukoucity">
                            <option value="" selected>县级地区</option>
<%
	set rs_job=server.createobject("adodb.recordset")
	gzdd1=rs("city")
	if gzdd1&"a"="a" then gzdd1=1000
	sql="select * from job_provinceandcity where fid="&gzdd1&""
	rs_job.open sql,conn,1,1
	do while not rs_job.eof
	if int(rs("area"))=int(rs_job("id")) then
		response.write"<OPTION value="&rs_job("id")&" selected>"&rs_job("province_city")&"</option>"
	else
		response.write"<OPTION value="&rs_job("id")&">"&rs_job("province_city")&"</option>"
	end if
	rs_job.movenext
	loop
	rs_job.close
	set rs_job=nothing
%>
                       </select>
                        </span>&nbsp;<font color="#FF0000">*</font></td>
              </tr>
            <tr>
              <td height="25" align="center">有效期</td>
              <td colspan="2"><input name="lasttime" type="text" class="input" id="lasttime" size="20" value="<%= rs("lasttime") %>">
                 &nbsp;<font color="#FF0000">*</font>&nbsp;&nbsp;<font color='blue'><=【<font color='green' onclick="document.info.lasttime.value='长期有效'" style="cursor:hand;">长期有效</font>】<font color="#FF0000"><font color='blue'>||</font><font color='blue'>【<font color='green' onclick="document.info.lasttime.value='2007年8月15日'" style="cursor:hand;">2007年8月15日</font>】 </font></td>
            </tr>
            <tr>
              <td height="22" align="center">课程报价</td>
              <td colspan="2"><input name="price" type="text" class="input" id="price" size="20" value="<%= rs("price") %>"> 
                &nbsp;<font color="#FF0000">* &nbsp;<font color='blue'><=【<font color='green' onclick="document.info.price.value='咨询机构'" style="cursor:hand;">咨询机构</font>】</font><font color="#FF0000"><font color='blue'>||</font><font color='blue'>【<font color='green' onclick="document.info.price.value='40元/课'" style="cursor:hand;">40元/课</font>】</font></font></font></td>
              </tr>
            <tr>
              <td height="79" align="center">详细信息</td>
              <td colspan="2"><textarea name="introduction" rows="8" style="width: 500px;font-size: 12px;display:none;" cols="20"><%= rs("introduction") %></textarea><iframe ID="Editor" name="Editor" src="../HtmlEditor/index.html?ID=introduction" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:130px;width:500px"></iframe> &nbsp;<font color="#FF0000">*</font></td>
              </tr>
            <tr>
              <td height="79" align="center">适用对象</td>
              <td colspan="2"><textarea name="object" rows="8" style="width: 500px;font-size: 12px;display:none;" cols="20"><%= rs("object") %></textarea><iframe ID="Editor" name="Editor" src="../HtmlEditor/index.html?ID=object" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:130px;width:500px"></iframe>
                &nbsp;<font color="#FF0000">*</font></td>
              </tr>
            <tr>
              <td height="79" align="center">报名方式</td>
              <td colspan="2"><textarea name="lxfs" rows="8" style="width: 500px;font-size: 12px;display:none;" cols="20"><%= rs("lxfs") %></textarea><iframe ID="Editor" name="Editor" src="../HtmlEditor/index.html?ID=lxfs" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:130px;width:500px"></iframe>
                &nbsp;<font color="#FF0000">*</font></td>
              </tr>
            <tr>
              <td height="33" align="center">&nbsp;</td>
              <td width="63%" align="center">
                <input name="Submit" type="submit" class="INPUT_index" id="Submit" style="height:23px;width:70px;" value="  修    改  " />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Reset" type="button" class="INPUT_index" id="Reset" style="FONT-SIZE: 12px; FONT-FAMILY: 宋体; HEIGHT: 23px;width:70px;" value="  取   消  " onClick="javascript:window.location.href='index.asp';"/></td>
              <td width="21%">&nbsp;</td>
            </tr>
          </table>
		  </form>
<%
	End If
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>
		  </td>
        </tr>
      </tbody>
    </table>
    </div>
    </div>
    </div>
</body>
</html>
