<!--#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/sql.asp"-->
<%
	End If
	action=ReplaceBadChar(Trim(Request.QueryString("action")))
	if action="save" then
		tname=ReplaceBadChar(Request.Cookies("admin_train_name"))
		train_name=ReplaceBadChar(Trim(Request.Form("school_name")))
		train_type=ReplaceBadChar(Trim(Request.Form("school_type")))
		province=ReplaceBadChar(int(Trim(Request.Form("hukouprovince"))))
		city=ReplaceBadChar(int(Trim(Request.Form("hukoucapital"))))
		address=ReplaceBadChar(Trim(Request.Form("address")))
		code=ReplaceBadChar(Trim(Request.Form("postcode")))
		weburl=ReplaceBadChar(Trim(Request.Form("site")))
		introduction=Trim(Request.Form("introduce"))
		subject=Trim(Request.Form("course_intro"))
		tea_intro=Trim(Request.Form("teacher_intro"))
		lx_person=ReplaceBadChar(Trim(Request.Form("linkman")))
		phone=ReplaceBadChar(Trim(Request.Form("phone")))
		fax=ReplaceBadChar(Trim(Request.Form("fax")))
		email=ReplaceBadChar(Trim(Request.Form("email")))
		area=ReplaceBadChar(Trim(Request.Form("hukoucity")))
		if fax="" then fax="未填写"
		if code="" then code="未填写"
		if weburl="" then weburl="未填写"
			
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="select * from train where tname='"&tname&"'"
		rs.open sql,conn,2,3
		if not rs.eof then
			rs("train_name")=train_name
			rs("train_type")=train_type
			rs("province")=province
			rs("city")=city
			rs("area")=area
			rs("address")=address
			rs("code")=code
			rs("weburl")=weburl
			rs("introduction")=introduction
			rs("subject")=subject
			rs("tea_intro")=tea_intro
			rs("lx_person")=lx_person
			rs("phone")=phone
			rs("email")=email
			rs("fax")=fax
			rs.update
			response.redirect "train_main_html.asp"
		else
			response.write"<SCRIPT language=JavaScript>alert('非法操作');"
			response.write"this.location.href='tlogin.asp';</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.school_name.value==""){
		document.info.school_name.focus();
    	alert("请输入机构名称！");
	return false;
  }
    if(document.info.school_type.value=="") {
	document.info.school_type.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.address.value=="") {
	document.info.address.focus();
    alert("对不起，请选择机构的地址！");
	return false;
  }
  
if(document.info.email.value.length!=0)
  {
    if (document.info.email.value.charAt(0)=="." ||        
         document.info.email.value.charAt(0)=="@"||       
         document.info.email.value.indexOf('@', 0) == -1 || 
         document.info.email.value.indexOf('.', 0) == -1 || 
         document.info.email.value.lastIndexOf("@")==document.info.email.value.length-1 || 
         document.info.email.value.lastIndexOf(".")==document.info.email.value.length-1)
     {
      alert("Email地址格式不正确！");
      document.info.email.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空！");
   document.info.email.focus();
   return false;
   }
   
  if(document.info.introduce.value=="") {
	document.info.introduce.focus();
    alert("对不起，请输入机构介绍！");
	return false;
  }
  if(document.info.course_intro.value=="") {
	document.info.course_intro.focus();
    alert("对不起，请输入主要课程！");
	return false;
  }
  if(document.info.teacher_intro.value=="") {
	document.info.teacher_intro.focus();
    alert("对不起，请输入师资介绍！");
	return false;
  }
  if(document.info.linkman.value=="") {
	document.info.linkman.focus();
    alert("对不起，请输入联系人！");
	return false;
  }
  if(document.info.phone.value=="") {
	document.info.phone.focus();
    alert("对不起，请输入联系电话！");
	return false;
  }
}
//-->
</script>
<script language="JavaScript">
<!--
//功能：去掉字符串前后空格
//返回值：去掉空格后的字符串
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 GetCapital(capitalid)
{
document.frames["capitalframe"].location.replace("../inc/getcapital.asp?capitalid="+capitalid);
}
function GetCity(cityid)
{
document.frames["cityframe"].location.replace();
}
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>
<iframe height=0 width=0 src="" id="capitalframe"></iframe>
  <iframe height=0 width=0 src="" id="cityframe">  </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;color:#C33;">基本设置</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;">发布课程</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>
<%
	tname=ReplaceBadChar(Request.Cookies("admin_train_name"))
	id=ReplaceBadChar(int(Request.Cookies("admin_train_id")))
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="select * from train where tname='"&tname&"' and id="&id&""
	rs.open sql,conn,1,1
	if rs.eof then
		response.write"<SCRIPT language=JavaScript>alert('非法操作');"
		response.write"this.location.href='../tlogin.asp';</SCRIPT>"
		response.end
	else
%>
		  <form action="?action=save" method="post" name="info" onsubmit="return check()">
		  <table width="100%" height="100%" border="0" bordercolor="#F9F9F9">
            <tr>
              <td width="16%" height="23" align="center">机构名称</td>
              <td colspan="2"><input name="school_name" type="text" class="input" id="school_name" value="<%= rs("train_name") %>" size="60"> 
                &nbsp;<font color="#FF0000">*</font></td>
              </tr>
            <tr>
              <td height="24" align="center">机构类别</td>
              <td colspan="2" valign="middle">
			  <select name="school_type" id="school_type" check_str="机构类别">
              <option value='电脑培训' <% If rs("train_type")="电脑培训" Then Response.Write("selected")%>>电脑培训</option>
                <option value='职业技能' <% If rs("train_type")="职业技能" Then Response.Write("selected")%>>职业技能</option>
                  <option value='资格认证' <% If rs("train_type")="资格认证" Then Response.Write("selected")%>>资格认证</option>
                    <option value='学历招生' <% If rs("train_type")="学历招生" Then Response.Write("selected")%>>学历招生</option>
                    <option value='企业管理' <% If rs("train_type")="企业管理" Then Response.Write("selected")%>>企业管理</option>
                    <option value='语言培训' <% If rs("train_type")="语言培训" Then Response.Write("selected")%>>语言培训</option>
                    <option value='家教中心' <% If rs("train_type")="家教中心" Then Response.Write("selected")%>>家教中心</option>
                    <option value='少儿培训' <% If rs("train_type")="少儿培训" Then Response.Write("selected")%>>少儿培训</option>
                    <option value='艺术健身' <% If rs("train_type")="艺术健身" Then Response.Write("selected")%>>艺术健身</option>
                    <option value='出国留学' <% If rs("train_type")="出国留学" Then Response.Write("selected")%>>出国留学</option>
                    <option value='其它培训' <% If rs("train_type")="其它培训" Then Response.Write("selected")%>>其它培训</option>
                    </select>
&nbsp;<font color="#FF0000">*</font>                &nbsp;&nbsp;所在地区
                <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("province")=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 id="load300"></span> <span id="chukoucapital">
                          <select name=hukoucapital id="select" onchange=GethukouCity(this.options[this.selectedIndex].value) style="width:77px ">
<%
	set rs_cityname=createobject("adodb.recordset")
	cityname_sql="select * from JOB_provinceandcity where fid=" & rs("province") & " order by date desc"
	rs_cityname.open cityname_sql,Conn
	do while not rs_cityname.eof
	if rs("city")=rs_cityname("id") then
		response.write"<OPTION value="&rs_cityname("id")&" selected>"&rs_cityname("province_city")&"</option>"
	else
		response.write"<OPTION value="&rs_cityname("id")&">"&rs_cityname("province_city")&"</option>"
	end if
	rs_cityname.movenext
	loop
	rs_cityname.close
	set rs_cityname=nothing
%>
                          </select></span>
                          &nbsp;<span id="load400"></span> <span id="chukoucity">
                          <select name="hukoucity" id="hukoucity">
                            <option value="" selected>县级地区</option>
<%
	set rs_job=server.createobject("adodb.recordset")
	gzdd1=int(rs("area"))
	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 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><font color="#FF0000">*</font></td>
              </tr>

            <tr>
              <td height="25" align="center">机构地址</td>
              <td colspan="2"><input name="address" type="text" class="input" id="address" value="<%= rs("address") %>" size="60">
                 &nbsp;<font color="#FF0000">*</font>&nbsp;&nbsp;&nbsp;邮政编码
                 <input name="postcode" type="text" class="input" id="postcode" style="ime-mode:disabled" value="<% if rs("code")="未填写" then Response.Write("") else Response.Write(rs("code"))%>" size="8" /></td>
              </tr>
            <tr>
              <td height="22" align="center">机构网站</td>
              <td colspan="2"><input name="site" type="text" class="input" id="site" value="<% if rs("weburl")="未填写" then Response.Write("") else Response.Write(rs("weburl"))%>" size="40"> 
                &nbsp;<font color="#FF0000">(请勿加上http://)</font>&nbsp;&nbsp; &nbsp;&nbsp;电子邮件
                <input name="email" type="text" class="input" id="email" value="<% =rs("email")%>" size="30" /></td>
              </tr>
            <tr>
              <td height="79" align="center">机构介绍</td>
              <td colspan="2" width="550"><textarea name="introduce" 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=introduce" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:130px;width:500px"></iframe><font color="#FF0000">*</font></td>
              </tr>
            <tr>
              <td height="79" align="center">主要课程</td>
              <td colspan="2"width="550"><textarea name="course_intro" rows="8" style="width: 500px;font-size: 12px;display:none;" cols="20"><%= rs("subject") %></textarea><iframe ID="Editor" name="Editor" src="../HtmlEditor/index.html?ID=course_intro" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:130px;width:500px"></iframe><font color="#FF0000">*</font></td>
			 </tr>
            <tr>
              <td height="79" align="center"> 师资介绍</td>
              <td colspan="2" width="550"><textarea name="teacher_intro" rows="8" style="width: 500px;font-size: 12px;display:none;" cols="20"><%= rs("tea_intro") %></textarea><iframe ID="Editor" name="Editor" src="../HtmlEditor/index.html?ID=teacher_intro" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:130px;width:500px"></iframe><font color="#FF0000">*</font></td>
             </tr>
            <tr>
              <td height="29" align="center">联 系 人</td>
              <td colspan="2"><input name="linkman" type="text" class="input" id="linkman" value="<%= rs("lx_person") %>" size="20">
                <font color="#FF0000">*</font>&nbsp;&nbsp;&nbsp;&nbsp;联系电话 
                <input name="phone" type="text" class="input" id="phone" style="ime-mode:disabled" value="<%= rs("phone") %>" size="20" />
                &nbsp;<font color="#FF0000">*</font>&nbsp;&nbsp;传　　真
                <input name="fax" type="text" class="input" id="fax" style="ime-mode:disabled" value="<% if rs("fax")="未填写" then Response.Write("") else Response.Write(rs("fax"))%>" size="20" /></td>
              </tr>
            <tr>
              <td height="25" 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>
