<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%sUploadDir=UpFilesPath("Company")
If Not FRAdminLevel(303) Then Call ErrorMsg()
company_id=trim(request("id"))
step=trim(request("step"))

if step<>"" then
	select case step
	 case "del"
	  Set rs= Server.CreateObject("ADODB.RecordSet")
	  sql="select Member_logo from JOB_Member where Member_id="&company_id
	  rs.open sql,conn,1,1
	   company_logo=rs("Member_logo")
	  rs.close
	  set rs=nothing
	  if company_logo<>"" and not isnull(company_logo) then      '原来有图片
	  set fileobject=server.createobject("scripting.filesystemobject")
	  path=Server.MapPath(sUploadDir&company_logo)
	  response.Write(path)
	  if fileobject.fileexists(path) then
	   set afile=fileobject.getfile(path)
	   afile.delete
	  end if
	 end if
	 conn.execute("update JOB_Member set Member_logo=null,Member_logostatus=0 where Member_id="&company_id) 
	 response.redirect "company_uploadlogo.asp?id="&company_id
	 response.End()
	case "savelogo"
		company_logo=trim(request("picture"))
		if company_logo="" then
			response.Write("<script>window.opener.location.reload();window.close();</script>")
			response.end
		end if
		Set rs= Server.CreateObject("ADODB.RecordSet")
		sql="select * from JOB_Member where Member_id="&company_id
		rs.open sql,conn,1,3
		If Not(rs.Eof) Then
			if rs("Member_logo")<>"" then 
				set fileobject=server.createobject("scripting.filesystemobject")
				path=Server.MapPath(sUploadDir) & "\" & rs("Member_logo")
				if fileobject.fileexists(path) then
					set afile=fileobject.getfile(path)
					afile.delete
				end if
			else
				if AdminLogCheckReg=1 then
					rs("Member_logostatus")=0
				else
					rs("Member_logostatus")=1
				end if 
				rs("Member_logocommand")=0
				rs("Member_logostartdate")=null
				rs("Member_logoenddate")=null
				rs.update
			end if
			rs("Member_logo")=company_logo
			rs.update
		End If
		rs.close
		set rs=nothing
	end select
	response.Write("<script>alert(""企业Logo修改成功!"");window.opener.location.reload();window.close();</script>")
	response.end
end if
%>
<%sql="select * from JOB_Member where Member_id="&company_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
If Not(rs.EOF) Then
	Member_login=rs("Member_login")
	Member_name=rs("Member_name")
	Member_logo=rs("Member_logo")
End If
rs.close
set rs=nothing

%>
<html>
<head>
<title>企业Logo上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/style<%=sk%>.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../inc/input.js"></script>
</head>
<body>
<div align="center">

    <table width="100%" border="0" cellpadding="0" cellspacing="1"  align="center"  class="tableBorder">
      <tr> 
        <th height=25 class="tableHeaderText" colspan="3"> 企业Logo审核</th>
      </tr>	 
	  <TR> 
        <TD height=25 colSpan=3 align=left><FONT color=#333333>（注：带</FONT><FONT color=#ff6600>＊</FONT><FONT color=#b00000><FONT color=#333333>号为必填项）</FONT></FONT>        </TD>
      </TR>
      <tr> 
        <td width="18%" height="25"> <div align="right">会员登录帐号：</div></td>
        <td width="64%"><input name="keyword1" type="text" id="keyword1" size="20" maxlength="50" value="<%=Member_login%>" disabled></td>
        
	
		<td width="18%">&nbsp;</td>
      </tr>
      <tr> 
        <td height="25"> <div align="right">企业名称：</div></td>
        <td><input name="keyword2" type="text" id="keyword2" size="20" maxlength="50" value="<%=Member_name%>" disabled></td>
        <td width="18%">&nbsp;</td>
      </tr>
      <tr> 
        <td><div align="right">企业Logo：</div></td>
        <td><TABLE width=110 border=0 align="center" cellPadding=0 cellSpacing=0>
		<TBODY>
		  <TR> 
			<TD align=middle> 
			  <%											  
			  if Member_logo<>"" then
			  %>
			  <A href="<%=sUploadDir&Member_logo%>" target=_blank><IMG height=60 src="<%=sUploadDir&Member_logo%>" width=196 border=0></a> 
			  <%else%>
			  <IMG height=60 src="<%=sUploadDir%>/nologo.gif" width=196 border=0> 
			  <%
			  end if%>
			</TD>
		  </TR>
		</TBODY>
        </TABLE></td>
        <td width="18%"><%
		if Member_logo<>"" then
		%>
<INPUT name='btnDel' type='button' class="inputs" onClick="location.href='company_uploadlogo.asp?step=del&id=<%=company_id%>'" value='删除'>
		<%end if
		%>
        </td>
      </tr>
      
      <tr> 
       <form name="form1" action="?id=<%=company_id%>&step=savelogo" method="post">
                              <TD height=28  colspan="3">
<div align="center"><STRONG><font color="#FF3300">请选择上传logo：</font></STRONG> 
<input name="picture" type="text" id="picture" value="<%=Member_logo%>" size="25" maxlength="255">
<input name="upfile" type="button" class="inputs" onClick="window.open('../inc/job_up.asp?fromForm=form1&fromEdit=picture&saveTo=<%=sUploadDir%>&showPath=','','status=no,scrollbars=no,top=80,left=200,width=420,height=165')" value="浏览文件"> 
<input name="b122" type="submit" class="inputs" value="保存修改">
         </div></TD>
        </form>
      </tr>
  </table>
</div>
</body>
</html>
<%
conn.close
set conn=nothing
%>