<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Public/Person_Cookies.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<% 
Dim Rs,Cmd,Tmp,Action
Dim Perid,UserName,UserType,Edus,ZyClass
Action = Request.QueryString("action")
If Action <> "" Then 
 Select Case Action
  Case "submit"
   Call Submit()  '//跳转到保存数据的函数
  Case "deledus"
   Call DelEdus() '//跳转到删除教育经历的函数
  Case "deltrains"
   Call DelTrains() '//跳转到删除教育经历的函数   
 End Select
End if


If IsArray(Session("Person")) Then
 Perid = Session("Person")(2)
 UserName = Session("Person")(0)
Else
 Session.Abandon() 
 Response.write "<script>alert('-登录后才能进行该操作！-');location.href='../Public/MemberLogin.asp';</script>"
End if

'//调用存储过程
Set Cmd = Server.Createobject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "Per_Education"
Cmd.CommandType = 4
Cmd.Parameters.Append Cmd.CreateParameter("@Perid",200,1,30)
Cmd.Parameters("@Perid") = Perid
Set Rs = Cmd.Execute

If Rs.Eof Then
 CloseRs
 Set Cmd = Nothing
 CloseDB
 Response.write "没有找到会员资料！"
 Response.End()
End if
Tmp = Rs.GetRows() '//将数据填充到数组
'//0毕业学校,1学历,2毕业年份,3专业类别,4专业名称,5姓名,6会员类型
'//如：Tmp(1,0)表示 用户的姓名
CloseRs
Set Cmd = Nothing
'//功能代码
RealName = Tmp(5,0)
UserType = Cls_Usertype(Tmp(6,0))
Edus = Tmp(1,0)
ZyClass = Tmp(3,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/Person_education.js"></script>
<body>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td>
      <!--#include file="../Header/Person_Resume.asp" -->
    </td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td><table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="4"></td>
        </tr></table>
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="175" valign="top">
            <!--#include file="../Lefter/Person_Basicinfo.asp" -->
          </td>
          <td width="5">&nbsp;</td>
          <td valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <form action="?action=submit" name="edit" method="post" onSubmit="return form_check();">
                <tr> 
                  <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
                      <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="0" cellspacing="0">
                            <tr> 
                              <td width="18%" height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 毕业院校：</td>
                              <td height="25"><input name="lastschool" type="text" id="lastschool" size="30" maxlength="30" style="width:160px;" value="<%= Tmp(0,0) %>"></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="edus" id="edus" style="width:60px;">
                                  <option value="10" <% If Edus = 10 Then Response.write "Selected" %>>小学</option>
                                  <option value="20" <% If Edus = 20 Then Response.write "Selected" %>>初中</option>
                                  <option value="30" <% If Edus = 30 Then Response.write "Selected" %>>高中</option>
                                  <option value="40" <% If Edus = 40 Then Response.write "Selected" %>>中专</option>
                                  <option value="50" <% If Edus = 50 Then Response.write "Selected" %>>专科</option>
                                  <option value="60" <% If Edus = 60 Then Response.write "Selected" %>>本科</option>
                                  <option value="70" <% If Edus = 70 Then Response.write "Selected" %>>硕士</option>
                                  <option value="80" <% If Edus = 80 Then Response.write "Selected" %>>博士</option>
                                  <option value="90" <% If Edus = 90 Then Response.write "Selected" %>>博士后</option>
                                </select> </td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 毕业年份：</td>
                              <td height="25"><input name="byear" type="text"  size="4" maxlength="4" style="width:60px;" value="<%= Tmp(2,0) %>">
                                年</td>
                            </tr>
                            <tr> 
                              <td height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 专业类别：</td>
                              <td height="25" bgcolor="f9f9f9">
                                <!--#include file="../Include/Class_ZyClass.asp" -->
                              </td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 专业名称：</td>
                              <td height="25"><input name="speciality" type="text" size="30" maxlength="30" style="width:120px;" value="<%= Tmp(4,0) %>"></td>
                            </tr>
                          </table>
                          <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"> <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr> 
                                    <td width="50%"><b><font color="#000000">教育经历</font></b></td>
                                    <td width="50%" align="right"><a href="per_Education_add.asp?param=addedus"><u>添加教育经历</u></a></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table>
                          <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="2" cellspacing="1" bgcolor="eeeeee">
                            <tr align="center" bgcolor="f9f9f9"> 
                              <td width="22%" height="22">起止时间</td>
                              <td width="20%" height="22">毕业学校</td>
                              <td width="8%" height="22">学 历</td>
                              <td width="20%" height="22">专 业</td>
                              <td width="16%" height="22">证 书</td>
                              <td width="12%" height="22">操 作</td>
                            </tr>
                            <% 
SQL = "Select Ncid,SchoolName,Edus,Speciality,Begin_Year,Begin_Month,End_Year,End_Month,CertName From [pH_Person_Education] Where Perid='"&Perid&"' And Username='"&Username&"' And Type=1"
Set Rs = Conn.Execute(SQL)
While Not Rs.Eof
 Ncid          = Rs("Ncid")
 SchoolName    = Rs("SchoolName")
 Edus          = Cls_Edus(Rs("Edus")) '//输出学历的函数
 Speciality    = Rs("Speciality")
 Begin_Year    = Rs("Begin_Year")
 Begin_Month   = Rs("Begin_Month") 
 End_Year      = Rs("End_Year")
 End_Month     = Rs("End_Month")
 CertName      = Rs("CertName")
 BeginAndEndTime = Begin_Year&"年"&Begin_Month&"月-"&End_Year&"年"&End_Month&"月"
 %>
                            <tr bgcolor="#FFFFFF"> 
                              <td height="22"><%= BeginAndEndTime %></td>
                              <td height="22"><%= SchoolName %></td>
                              <td height="22" align="center"><%= Edus %></td>
                              <td height="22"><%= Speciality %></td>
                              <td height="22"><%= CertName %></td>
                              <td height="22" align="center"><a href="?action=deledus&paramid=<%= Ncid %>" onClick="return confirm('是否需要删除该信息');"><u>删除</u></a> 
                                <a href="Per_Education_Edit.asp?param=editedus&paramid=<%= Ncid %>"><u>编辑</u></a></td>
                            </tr>
                            <% 
 Rs.Movenext
Wend
Rs.Close
 %>
                          </table>
                          <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td height="4"></td>
                            </tr>
                          </table>
                          <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
                            <tr> 
                              <td height="25" bgcolor="f5f5f5"> <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr> 
                                    <td width="50%"><b><font color="#000000">培训经历</font></b></td>
                                    <td width="50%" align="right"><a href="per_Education_add.asp?param=addtrains"><u>添加培训经历</u></a></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table>
                          <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="2" cellspacing="1" bgcolor="eeeeee">
                            <tr align="center" bgcolor="f9f9f9"> 
                              <td width="22%" height="22">起止时间</td>
                              <td width="22%" height="22">培训机构</td>
                              <td width="22%" height="22">课 程</td>
                              <td height="22">证 书</td>
                              <td width="12%" height="22">操 作</td>
                            </tr>
                            <% 
SQL = "Select Ncid,SchoolName,Edus,Speciality,Begin_Year,Begin_Month,End_Year,End_Month,CertName From [pH_Person_Education] Where Perid='"&Perid&"' And Username='"&Username&"' And Type=2"
Set Rs = Conn.Execute(SQL)
While Not Rs.Eof
 Ncid          = Rs("Ncid")
 SchoolName    = Rs("SchoolName")
 Speciality    = Rs("Speciality")
 Begin_Year    = Rs("Begin_Year")
 Begin_Month   = Rs("Begin_Month") 
 End_Year      = Rs("End_Year")
 End_Month     = Rs("End_Month")
 CertName      = Rs("CertName")
 BeginAndEndTime = Begin_Year&"年"&Begin_Month&"月-"&End_Year&"年"&End_Month&"月"
 %>
                            <tr bgcolor="#FFFFFF"> 
                              <td height="22"><%= BeginAndEndTime %></td>
                              <td height="22"><%= SchoolName %></td>
                              <td height="22"><%= Speciality %></td>
                              <td height="22"><%= CertName %></td>
                              <td height="22" align="center"><a href="?action=deltrains&paramid=<%= Ncid %>"  onClick="return confirm('是否需要删除该信息');"><u>删除</u></a> 
                                <a href="Per_Education_Edit.asp?param=edittrains&paramid=<%= Ncid %>"><u>编辑</u></a></td>
                            </tr>
                            <% 
 Rs.Movenext
Wend
CloseRs
 %>
                          </table>
                          <table width="99%" border="0" cellspacing="0" cellpadding="0">
                            <tr> 
                              <td width="18%" height="30" align="right">保存后返回：</td>
                              <td height="30"> <select name="prevurl">
                                  <option value="1">-工作经历-</option>
                                  <option value="2">-教育/培训-</option>
                                  <option value="3">-会员中心-</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 name="perid" type="hidden" id="perid" value="<%= Perid %>"> 
                    <input type="submit" name="Submit" value=" 保存教育/培训数据 " style="height:30px;"> 
                  </td>
                </tr>
              </form>
            </table></td>
        </tr>
      </table>

<!--#include file="../Include/Footer.asp" -->
	  </td>
  </tr>
</table>

</body>
</html>
<% 
Sub Submit()
 Call Check_url()    '防止外部站点提交数据
 '//提交数据
 Perid                = Session("Person")(2)
 LastSchool           = Replace_Text(Request.Form("LastSchool"))
 Edus                 = Replace_Text(Request.Form("Edus"))
 Byear                = Replace_Text(Request.Form("Byear"))
 ZyClass              = Replace_Text(Request.Form("ZyClass"))
 Speciality           = Replace_Text(Request.Form("Speciality"))
 
 SQL = "Update [pH_Person_Info] Set LastSchool='"&LastSchool&"',Edus="&Edus&",Byear="&Byear&",ZyClass='"&ZyClass&"',Speciality='"&Speciality&"' Where Perid='"&Perid&"'"
 Conn.Execute(SQL)
 
 '//更改最后修改时间
 SQL = "Update [pH_Person_Base] Set LastUpdate_Time=getdate() Where Perid='"&Perid&"'"
 Conn.Execute(SQL)
 
 CloseDB
 'Response.redirect "Per_Education.asp"
  Prevurl = Request.Form("prevurl")
 Select Case Prevurl
  Case "1":Response.Redirect "Per_Works.asp"
  Case "2":Response.Redirect "Per_Education.asp"
  Case "3":Response.Redirect "User_Center.asp"
 End Select
End Sub

Sub DelEdus()
 Call Check_url()    '防止外部站点提交数据
 '//提交数据
 Perid                = Session("Person")(2)
 Ncid                = Replace_Text(Request("paramid"))
 Check_Id(Ncid)
 
 SQL = "Delete From [pH_Person_Education] Where Perid='"&Perid&"' And Ncid="&Cstr(Ncid)
 Conn.Execute(SQL)

 '//更改最后修改时间
 SQL = "Update [pH_Person_Base] Set LastUpdate_Time=getdate() Where Perid='"&Perid&"'"
 Conn.Execute(SQL)
 
 CloseDB
 Response.redirect "Per_Education.asp"

End Sub

Sub DelTrains() '//删除培训经历
 Call Check_url()    '防止外部站点提交数据
 '//提交数据
 Perid                = Session("Person")(2)
 Ncid                = Replace_Text(Request("paramid"))
 Check_Id(Ncid)
 
 SQL = "Delete From [pH_Person_Education] Where Perid='"&Perid&"' And Ncid="&Cstr(Ncid)
 Conn.Execute(SQL)

 '//更改最后修改时间
 SQL = "Update [pH_Person_Base] Set LastUpdate_Time=getdate() Where Perid='"&Perid&"'"
 Conn.Execute(SQL)
 
 CloseDB
 Response.redirect "Per_Education.asp"

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