<!--#include file="conn.asp"-->
<!--#include file="check.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
		type1=ReplaceBadChar(Trim(Request.Form("type")))
		id=int(ReplaceBadChar(Trim(Request.Form("id"))))
		if type1="edu" then
		
			pid=int(ReplaceBadChar(Request.Cookies("admin_person_id")))
			school=ReplaceBadChar(trim(request.Form("school")))
			if school="" then
				Response.Write ("<script language=JavaScript>{alert('错误：院校名称不能为空!');location.href = 'javascript:history.go(-1)';}</script>")
				Response.End
			end if
					
			introduction=ReplaceBadChar(Trim(Request.Form("introduction")))
			If len(introduction)>=8000 Then 
				response.write "<script language=javascript>alert('错误：专业描述太长了，要求不多于8000个字符!！');location.href='javascript:history.back()';</script>"
				response.end 
			end if
			
			start_year=int(ReplaceBadChar(trim(request("start_year"))))
			start_month=int(ReplaceBadChar(trim(request("start_month"))))
			end_year=int(ReplaceBadChar(trim(request("end_year"))))
			end_month=int(ReplaceBadChar(trim(request("end_month"))))
			if end_year=0 then end_year=year(date())
			if end_month=0 then end_month=month(date())
			zy=ReplaceBadChar(trim(request("zye")))
			zy_name=ReplaceBadChar(trim(request("zy_name")))
			xueli=ReplaceBadChar(trim(request("edu")))
			'把信息存入教育表person_edu
			
			sql="select * from person_edu where id="&id&" and pid="&pid&""
			set rs=server.CreateObject("adodb.recordset")
			rs.open sql,conn,2,3
			if rs.eof then
				response.write "<script language=javascript>alert('非法操作，请重来');location.href='javascript:history.back()';</script>"
				response.end 
			else
				rs("start_year")=start_year
				rs("start_month")=start_month
				rs("end_year")=end_year
				rs("end_month")=end_month
				rs("zy")=zy
				rs("zy_name")=zy_name
				rs("xueli")=xueli
				rs("introduction")=introduction
				rs("school")=school
				rs.update
				response.write"<SCRIPT language=JavaScript>alert('您的操作已完成');"
				response.write"javascript:window.close();</SCRIPT>"
				response.end
			end if
			rs.close
			set rs=nothing
			
		else
		
			pid=int(ReplaceBadChar(Request.Cookies("admin_person_id")))
			train_name=ReplaceBadChar(trim(request.Form("train_name")))
			if train_name="" then
				Response.Write ("<script language=JavaScript>{alert('错误：培训机构名称不能为空!');location.href = 'javascript:history.go(-1)';}</script>")
				Response.End
			end if
					
			introduction=ReplaceBadChar(Trim(Request.Form("detail")))
			If len(introduction)>=8000 Then 
				response.write "<script language=javascript>alert('错误：详细描述太长了，要求不多于8000个字符!！');location.href='javascript:history.back()';</script>"
				response.end 
			end if
			
			start_year=int(ReplaceBadChar(trim(request("start_year"))))
			start_month=int(ReplaceBadChar(trim(request("start_month"))))
			end_year=int(ReplaceBadChar(trim(request("end_year"))))
			end_month=int(ReplaceBadChar(trim(request("end_month"))))
			if end_year=0 then end_year=year(date())
			if end_month=0 then end_month=month(date())
			subject=ReplaceBadChar(trim(request("subject")))
			zhengshu=ReplaceBadChar(trim(request("zhengshu")))
			address=ReplaceBadChar(trim(request("address")))
			'把信息存入教育表person_edu
			
			sql="select * from person_train where id="&id&" and pid="&pid&""
			set rs=server.CreateObject("adodb.recordset")
			rs.open sql,conn,2,3
			if rs.eof then
				response.write "<script language=javascript>alert('非法操作，请重来');location.href='javascript:history.back()';</script>"
				response.end 
			else
				rs("start_year")=start_year
				rs("start_month")=start_month
				rs("end_year")=end_year
				rs("end_month")=end_month
				rs("subject")=subject
				rs("zhengshu")=zhengshu
				rs("address")=address
				rs("introduction")=introduction
				rs("train_name")=train_name
				rs.update
				response.write"<SCRIPT language=JavaScript>alert('您的操作已完成');"
				response.write"javascript:window.close();</SCRIPT>"
				response.end
			end if
			rs.close
			set rs=nothing
		end if
		conn.close
		set conn=nothing

	End If
%>
<HTML>
<HEAD>
<TITLE><%=homename%>-个人会员</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="../company/images/css.css" type=text/css rel=stylesheet>
</HEAD>
<BODY topmargin="10" leftmargin="10" rightmargin="10">
<script language="JavaScript">
<!--
//功能：去掉字符串前后空格
//返回值：去掉空格后的字符串
function fnRemoveBrank(strSource)
{
 return strSource.replace(/^\s*/,'').replace(/\s*$/,'');
}
function String.prototype.lenB()
{
return this.replace(/[^\x00-\xff]/g,"**").length;
}
function Juge(theForm)
{
  if (fnRemoveBrank(theForm.start_year.value) == "0")
  {
    alert("请选择时间!");
    theForm.start_year.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.start_month.value) == "0")
  {
    alert("请选择时间!");
    theForm.start_month.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.school.value) == "")
  {
    alert("请输入学校名称!");
    theForm.school.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.zye.value) == "")
  {
    alert("请选择专业类列表!");
    theForm.zye.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.zy_name.value) == "")
  {
    alert("请输入专业名称!");
    theForm.zy_name.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.edu.value) == "")
  {
    alert("请选择学历!");
    theForm.edu.focus();
    return (false);
  }
 }
function Juge1(theForm)
{
  if (fnRemoveBrank(theForm.start_year.value) == "0")
  {
    alert("请选择培训时间!");
    theForm.start_year.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.start_month.value) == "0")
  {
    alert("请选择培训时间!");
    theForm.start_month.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.train_name.value) == "")
  {
    alert("请输入培训机构!");
    theForm.train_name.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.address.value) == "")
  {
    alert("请输入培训地点!");
    theForm.address.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.subject.value) == "")
  {
    alert("请输入培训课程!");
    theForm.subject.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.zhengshu.value) == "")
  {
    alert("请输入获得证书!");
    theForm.zhengshu.focus();
    return (false);
  }
 }
 -->
</script>
<%
	id=int(ReplaceBadChar(Trim(Request.QueryString("id"))))
	pid=int(ReplaceBadChar(Request.Cookies("admin_person_id")))
	type1=Trim(Request.QueryString("type"))
	if type1="edu" then
		keyword="person_edu"
	else
		keyword="person_train"
	end if
	
	set rs=server.createobject("adodb.recordset")
	user_sql="select * from "&keyword&" where id="&id&" and pid="&pid&""           
	rs.open user_sql,conn,1,1
	if rs.eof then
		response.write "<script language=javascript>alert('非法操作');location.href='javascript:history.back()';</script>"
		response.end
	else
		If type1="edu" Then
%>

<form name="theForm" action="?action=save" method="post" onSubmit="return Juge(this)">
<input name="id" type="hidden" value="<%= Trim(Request.QueryString("id")) %>">
<input name="type" type="hidden" value="<%= Trim(Request.QueryString("type")) %>">
<TABLE cellSpacing="1" cellPadding="0" width="100%" bgColor="#0EBDF6" border="0">
  <TR>
    <TD bgColor="#ffffff"><TABLE width="100%" border="0" align="center" cellPadding="6" cellSpacing="0">
      <TBODY>
        <TR>
          <TD align=left colSpan=2 height=34 bgColor="#0EBDF6"><b><FONT color=#ffffff>（注：带<FONT color=#ff6600>＊</FONT>号为必填项）</FONT> </b></TD>
        </TR>
        <TR>
          <TD width="16%" height="30" align="right"><FONT color=#ff6600>＊</FONT>时间：</TD>
          <TD width="84%">从
            <select name="start_year" id="select">
<%
	for i=year(date())-70 to year(date())
	if i=rs("start_year") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
                </select>
                <select name="start_month" id="select">
<%
	for i=1 to 12
	if i=rs("start_month") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
                </select>
            到
            <select name="end_year" id="select">
<%
	for i=year(date())-70 to year(date())
	if i=rs("end_year") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
            </select>
            <select name="end_month" id="select">
<%
	for i=1 to 12
	if i=rs("end_month") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
            </select>
            (后两项不填表示至今) </TD>
        </TR>
        <TR bgcolor="#efefef">
          <TD width="16%" height="30" align="right"><FONT color=#ff6600>＊</FONT>学校：</TD>
          <TD width="84%"><INPUT name="school" id="school" size=50 maxLength=50 value="<%= rs("school") %>">
          </TD>
        </TR>
        <TR>
          <TD width="16%" height="30" align="right"><FONT color=#ff6600>＊</FONT>专业：</TD>
          <TD width="84%"><SELECT NAME=zye>
            <OPTION VALUE="0">请选择您所学的专业</OPTION>
<%
	call listzhy(rs("zy"))
%>
          </SELECT>
            &nbsp;&nbsp;
            <input name="zy_name" type="text" value="<%= rs("zy_name") %>"></TD>
        </TR>
        <TR bgcolor="#efefef">
          <TD width="16%" height="30" align="right"><FONT color=#ff6600>＊</FONT>学历：</TD>
          <TD width="84%"><select name="edu">
            <OPTION value="博士" <% If rs("xueli")="博士" Then Response.Write("selected")%>>博士</option>
            <OPTION value="硕士" <% If rs("xueli")="硕士" Then Response.Write("selected")%>>硕士</option>
            <OPTION value="大学本科" <% If rs("xueli")="大学本科" Then Response.Write("selected")%>>大学本科</option>
            <OPTION value="大专" <% If rs("xueli")="大专" Then Response.Write("selected")%>>大专</option>
            <OPTION value="中专" <% If rs("xueli")="中专" Then Response.Write("selected")%>>中专</option>
            <OPTION value="职高/技校" <% If rs("xueli")="职高/技校" Then Response.Write("selected")%>>职高/技校</option>
            <OPTION value="高中" <% If rs("xueli")="高中" Then Response.Write("selected")%>>高中</option>
            <OPTION value="初中" <% If rs("xueli")="初中" Then Response.Write("selected")%>>初中</option>
          </select>
          </TD>
        </TR>
        <TR>
          <TD width="16%" height="30" align="right">&nbsp;</TD>
          <TD width="84%"><FONT color=#993300>专业描述您可以填写您所学专业包括什么课程，您的毕业设计等等。 </FONT></TD>
        </TR>
        <TR bgcolor="#efefef">
          <TD width="16%" align="right" vAlign=top>专业描述：</TD>
          <TD width="84%"><TEXTAREA name="introduction" cols=55 id="introduction" style="HEIGHT: 150px"><%= rs("introduction") %></TEXTAREA>
          </TD>
        </TR>
      </TBODY>
    </TABLE>
        <br class="br">
        <TABLE width="98%" border=0 align="center" cellPadding=6 cellSpacing=0 bgColor=#f1b5a1>
          <TBODY>
            <TR>
              <TD bgColor=#ffffff align="center"><INPUT name=Save type=submit class="inputa3" value=保　存>
                &nbsp;
                <INPUT name=Exit type=button class="inputa3" value=返　回 回>
              </TD>
            </TR>
          </TBODY>
      </TABLE></TD>
  </TR>
</TABLE>
</form>
<% Else %>
<form name="theForm" action="?action=save" method="post" onSubmit="return Juge1(this)">
<input name="id" type="hidden" value="<%= Trim(Request.QueryString("id")) %>">
<input name="type" type="hidden" value="<%= Trim(Request.QueryString("type")) %>">
<TABLE cellSpacing="1" cellPadding="0" width="100%" bgColor="#0EBDF6" border="0">
 <TR>
     <TD bgColor="#ffffff"><TABLE width="100%" border="0" align="center" cellPadding="6" cellSpacing="0">
       <TBODY>
         <TR>
           <TD align=left colSpan=2 height=34 bgColor="#0EBDF6"><b><FONT color=#ffffff>（注：带<FONT color=#ff6600>＊</FONT>号为必填项）</FONT> </b></TD>
         </TR>
         <TR>
           <TD width="16%" height="30" align="right"><FONT color=#ff6600>＊</FONT>培训时间：</TD>
           <TD width="84%">从
             <select name="start_year" id="select">
<%
	for i=year(date())-70 to year(date())
	if i=rs("start_year") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
                </select>
                <select name="start_month" id="select">
<%
	for i=1 to 12
	if i=rs("start_month") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
                </select>
            到
            <select name="end_year" id="select">
<%
	for i=year(date())-70 to year(date())
	if i=rs("end_year") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
            </select>
            <select name="end_month" id="select">
<%
	for i=1 to 12
	if i=rs("end_month") then
		response.write "<option value="&i&" selected>"&i&"</option>"
	else
		response.write "<option value="&i&">"&i&"</option>"
	end if
	next
%>
            </select>
            (后两项不填表示至今) </TD>
         </TR>
         <TR bgcolor="#efefef">
           <TD width="16%" height="30" align="right"><FONT color=#ff6600>＊</FONT>培训机构：</TD>
           <TD width="84%"><INPUT name="train_name" id="train_name" size=50 maxLength=50 value="<%= rs("train_name") %>"></TD>
         </TR>
         <TR bgcolor="#efefef">
           <TD width="16%" height="30" align="right" bgcolor="#FFFFFF"><FONT color=#ff6600>＊</FONT>培训地点：</TD>
           <TD width="84%" bgcolor="#FFFFFF"><INPUT name="address" id="address" size=50 maxLength=50 value="<%= rs("address") %>"></TD>
         </TR>
         <TR>
           <TD width="16%" height="30" align="right" bgcolor="#EFEFEF"><FONT color=#ff6600>＊</FONT>培训课程：</TD>
           <TD width="84%" bgcolor="#EFEFEF"><INPUT name="subject" id="subject" size=50 maxLength=50 value="<%= rs("subject") %>"></TD>
         </TR>
         <TR bgcolor="#efefef">
           <TD width="16%" height="30" align="right" bgcolor="#FFFFFF"><FONT color=#ff6600>＊</FONT>获得证书：</TD>
           <TD width="84%" bgcolor="#FFFFFF"><INPUT name="zhengshu" id="zhengshu" size=50 maxLength=50 value="<%= rs("zhengshu") %>"></TD>
         </TR>

         <TR bgcolor="#efefef">
           <TD width="16%" align="right" vAlign=top bgcolor="#EFEFEF">专业描述：</TD>
           <TD width="84%" bgcolor="#EFEFEF"><TEXTAREA name="introduction" cols=55 id="introduction" style="HEIGHT: 150px"><%= rs("introduction") %></TEXTAREA></TD>
         </TR>
       </TBODY>
     </TABLE>
<br class="br">
<TABLE width="98%" border=0 align="center" cellPadding=6 cellSpacing=0 bgColor=#f1b5a1>
        <TBODY>
          <TR>
            <TD bgColor=#ffffff align="center"> 
                <INPUT name=Save type=submit class="inputa3" value=保　存>
                &nbsp;
                <INPUT name=Exit type=button class="inputa3" value=返　回 回>
			</TD>
          </TR>
        </TBODY>
      </TABLE>
	 </TD>
 </TR>
</TABLE>
</form>
<%
		End If
	end if
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>
</BODY>
</html>
