<!--#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,ContactKeep,ResumeKeep,PhotoKeep,ContactStr,ResumeStr,PhotoStr
Action = Request.QueryString("action")
If Action = "submit" Then 
 Call Submit() 
Elseif Action = "del" Then
 Call Del_Submit() 
Elseif Action = "delphoto" Then
 Call DelPhoto_Submit() '//跳转到删除的函数  
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>"
 Response.End()
End if

'//调用存储过程
Set Cmd = Server.Createobject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "Per_VideoResume"
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(0,0)表示 用户的姓名
CloseRs
Set Cmd = Nothing
'//功能代码
RealName = Tmp(0,0)
UserType = Cls_Usertype(Tmp(1,0))
Nc_Video          = Tmp(2,0)
Video_Flag        = Tmp(3,0)
Video_Date        = Tmp(4,0)
Video_EndDate     = Tmp(5,0)
Video_File        = Tmp(6,0)
Video_PhotoUrl	  = Tmp(7,0)
'判断会员是否有视频简历
Video_Str = ""
If Nc_Video = True Then
 Video_FlagStr = "" '视频简历的属性
 Select Case Video_Flag
  Case 0:Video_FlagStr = "公开中"
  Case 1:Video_FlagStr = "<font color=#666666>对会员公开</font>"
  Case 2:Video_FlagStr = "<font color=#ff0000>屏蔽中</font>"
 End Select
 If DateDiff("d",Video_Date,Date()) >= 0 And DateDiff("d",Video_EndDate,Date()) <= 0 Then
  Video_Str = "您的视频简历开通时间："&Formatdatetime(Video_Date,2)&"截止时间："&Formatdatetime(Video_EndDate,2)&" <a href=?action=del>删除视频简历</a>"
 Elseif DateDiff("d",Video_EndDate,Date()) > 0  Then
  Video_Str = "您的视频简历截止，截止时间："&Formatdatetime(Video_EndDate,2)&" <a href=?action=del>删除视频简历</a>"
 End if

ElseIf Nc_Video = False And Video_File <> "" Then
 Video_Str = "您录制的视频简历暂时没有通过网站审核，<a href=?action=del>点击这里删除简历重新录制</a>"
Else
 Video_Str = "您还没有制作视频简历，<a href=Per_Rec_Record.asp target=_blank>点击这里在线拍摄视频简历</a>"
End if

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

<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_Video.asp" -->
          </td>
          <td width="5">&nbsp;</td>
          <td valign="top">
           
            <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"><table width="99%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="50%"><b><font color="#000000">&nbsp;视频简历</font></b></td>
                              <td width="50%" align="right">
							  <a href="Per_Rec_Record.asp" target="_blank"><u><font color="#FF0000">在线录制简历</font></u></a>
							  </td>
                            </tr>
                          </table>
                          
                        </td>
                      </tr>
                    </table>
                    <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td height="25" align="left">&nbsp;<%= Video_Str %></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"><b><font color="#000000">&nbsp;简历预览</font></b></td>
                      </tr>
                    </table>
                    <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <% If Video_File <> "" Then %>
					<tr align="left"> 
                        <td height="25" colspan="2" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td height="5"></td>
                            </tr>
                            <tr>
                              <td align="center"> 
                                <TABLE borderColor=#e8e8e8 
                                align=center border=10>
                                  <TBODY>
                                    <TR> 
                                      <TD bgColor=#999999><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="240" height="200">
                                          <param name="movie" value="../Include/Class_flvplayer.swf?file=../UpLoadFiles/VideoFile/<%= Video_File %>">
                                          <param name="quality" value="high">
                                          <embed src="../Include/Class_flvplayer.swf?file=../UpLoadFiles/VideoFile/<%= Video_File %>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="240" height="200"></embed></object></TD>
                                    </TR>
                                  </TBODY>
                                </TABLE></td>
                            </tr>
                            <tr>
                              <td height="5"></td>
                            </tr>
                          </table></td>
                      </tr>

                      <% Else %>
                      <tr align="left"> 
                        <td height="25" colspan="2">&nbsp;您还没有制作视频简历，<a href=Per_Rec_Record.asp target=_blank>点击这里在线拍摄视频简历</a></td>
                      </tr>
                      <% End if %>
                    </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 height="2"></td>
                      </tr>
                    </table>
					 <% If Nc_Video = True Then %>
                  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td valign="top"><table width="98%" border="0" align="center" cellspacing="0" class="text01">
                          <form name="form" method="post" action="Per_Rec_PhotoUp.asp" enctype="multipart/form-data" >
                            <tr> 
                              <td>请上传您的照片：</td>
                            </tr>
                            <tr> 
                              <td> <input type="hidden" name="filepath" value="../Uploadfiles/PersonVideoPhoto"> 
							   <input type="hidden" name="back" value="1">
                                <input type="hidden" name="act" value="upload"> 
                                <input name="filename" style="font-family: 宋体; font-size: 12px" type="file" size="38"> 
                              </td>
                            </tr>
                            <tr> 
                              <td> 
                                <input type="button" name="Submit22" value="删除照片"  onClick="location.href='?action=delphoto';">
                                <input name="Send2" style="font-family: 宋体; font-size: 12px" type="submit" value="上传照片"></td>
                            </tr>
                          </form>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td>上传说明<font color="#666666">：</font></td>
                          </tr>
                          <tr> 
                            <td>所传照片一律为<font face="Verdana">JPG</font>、<font face="Verdana">JPEG</font>、或<font face="Verdana">GIF</font>格式 
                              ;</td>
                          </tr>
                          <tr> 
                            <td><span style="font-family: 宋体; font-size: 12px">相片大小不能超过100K 
                              ; </span></td>
                          </tr>
                          <tr> 
                            <td><span style="font-family: 宋体; font-size: 12px">照片应该处理成大小为80 
                              x 75 像素 .</span></td>
                          </tr>
                        </table></td>
                      <td width="35%" height="170" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td height="4"></td>
                          </tr>
                          <tr> 
                            <td align="center"> 
                              <% 

 If Video_PhotoUrl <> Null or Video_PhotoUrl <> "" Then
  Response.write "<img src=""../UpLoadFiles/PersonVideoPhoto/"&Video_PhotoUrl&""" width=""80"" height=""75"" class=photoborder>"
 End if

 %>
                            </td>
                          </tr>
                          <tr> 
                            <td height="4"></td>
                          </tr>
                        </table> </td>
                    </tr>
                  </table>
                  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="25" align="left" bgcolor="f9f9f9"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 简历属性：当前属性为<u><%= Video_FlagStr %></u>;</td>
                    </tr>
                    <tr> 
                      <td height="25" align="right"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <form action="?action=submit" name="theForm" method="post">
                            <tr> 
                              <td height="25"> <input type="radio" name="flag" value="0" <% If Video_Flag = 0 Then Response.write "Checked" %>>
                                完全公开 ;</td>
                            </tr>
                            <tr> 
                              <td height="25"> <input type="radio" name="flag" value="1" <% If Video_Flag = 1 Then Response.write "Checked" %>>
                                只对企业会员公开 ;</td>
                            </tr>
                            <tr> 
                              <td height="25"> <input type="radio" name="flag" value="2" <% If Video_Flag = 2 Then Response.write "Checked" %>>
                                完全屏蔽 ;</td>
                            </tr>
                            <tr> 
                              <td height="25"><input type="submit" name="Submit" value=" 保 存 设 置 " ></td>
                            </tr>
                          </form>
                        </table></td>
                    </tr>
                  </table>
                    <% ElseIf Nc_Video = False And Video_File <> "" Then %>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td>&nbsp;您录制的视频简历暂时没有通过网站审核，<a href=?action=del>点击这里删除简历重新录制</a></td>
                      </tr>
                    </table>
					<% Else %>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td>&nbsp;您还没有制作视频简历，<a href=Per_Rec_Record.asp target=_blank>点击这里在线拍摄视频简历</a></td>
                      </tr>
                    </table>
					<% End if %>
					</td>
                </tr>
              
            </table> </td>
        </tr>
      </table>

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

</body>
</html>
<% 
Sub Submit()
 Call Check_url()    '防止外部站点提交数据
 '//提交数据
 Perid                = Session("Person")(2) 
 Flag                 = Replace_Text(Request.Form("flag"))
 
 SQL = "Update [pH_Person_Info] Set Video_Flag="&Flag&" 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_VideoResume.asp"
End Sub


Sub Del_Submit()'删除简历

 Perid                = Session("Person")(2) 
 Set Rs = Conn.Execute("Select Video_File From [pH_Person_Info] Where Perid='"&Perid&"'")
 If Rs(0) = Null or Rs(0) = "" Then
    CloseRs
    CloseDB
    Response.redirect "Per_VideoResume.asp"
	Response.End()
 Else
     '//删除文件
    Set Fso = Server.createobject("Scripting.FileSystemObject")
	If Fso.FileExists(Server.Mappath("../UpLoadFiles/VideoFile/"&Rs(0))) Then
	   Fso.DeleteFile(Server.Mappath("../UpLoadFiles/VideoFile/"&Rs(0)))
	End if
	
	SQL = "Update [pH_Person_Info] Set Nc_Video=0,Video_Date=Null,Video_EndDate=Null,Video_File=Null,Video_PhotoUrl=Null Where Perid='"&Perid&"'"
    Conn.Execute(SQL)
	CloseDB
    Response.write "<script>alert('-已经成功的删除您的视频简历！-');location.href='Per_VideoResume.asp';</script>"
	Response.End()
 End if

End Sub


Sub DelPhoto_Submit()      '//删除照片函数
 '//提交数据
 Perid                = Session("Person")(2)
 Set Rs = Conn.Execute("Select Video_PhotoUrl From [pH_Person_Info] Where Perid='"&Perid&"'")
 If Rs(0) = Null or Rs(0) = "" Then
    CloseRs
    CloseDB
    Response.redirect "Per_VideoResume.asp"
 Else
     '//删除图片文件
    Set Fso = Server.createobject("Scripting.FileSystemObject")
	If Fso.FileExists(Server.Mappath("../UpLoadFiles/PersonVideoPhoto/"&Rs(0))) Then
	   Fso.DeleteFile(Server.Mappath("../UpLoadFiles/PersonVideoPhoto/"&Rs(0)))
	End if
	
	SQL = "Update [pH_Person_Info] Set Video_PhotoUrl=Null Where Perid='"&Perid&"'"
    Conn.Execute(SQL)
	
    '//更改最后修改时间
    SQL = "Update [pH_Person_Base] Set LastUpdate_Time=getdate() Where Perid='"&Perid&"'"
    Conn.Execute(SQL)
 
	CloseRs
    CloseDB
    Response.redirect "Per_VideoResume.asp"
 End if
End Sub

 %>
