<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/Commoncode.asp"-->
<!--#include file="../inc/CommonFunction.asp"-->
<%SQLin
link="company_uploadlogo.asp"%>
<!--#include file="checkcmember.asp" -->
<%
sUploadDir=UpFilesPath("Company")
step=trim(request("step"))
picture_id=trim(request("id"))
if step<>"" then
	select case step
	case "del"
	Set rs= Server.CreateObject("ADODB.RecordSet")
	sql="select Member_logo from job_Member where Member_login='"&Cmember_login&"'"
	rs.open sql,conn,1,1
	company_logo=rs("company_logo")
	rs.close
	set rs=nothing
	if company_logo<>"" and not isnull(company_logo) then      '原来有logo
	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 where Member_login='"&Cmember_login&"'")
end select
response.redirect link
response.end
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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>企业LOGO上传-企业会员中心--<%=SiteTitle%></title>
<link href="../member/css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
<!--
function getFileExtension(filePath) { //v1.0
  fileName = ((filePath.indexOf('/') > -1) ? filePath.substring(filePath.lastIndexOf('/')+1,filePath.length) : filePath.substring(filePath.lastIndexOf('\\')+1,filePath.length));
  return fileName.substring(fileName.lastIndexOf('.')+1,fileName.length);
}
function checkFileUpload(form,extensions) { //v1.0
  document.MM_returnValue = true;
  if (extensions && extensions != '') {
    for (var i = 0; i<form.elements.length; i++) {
      field = form.elements[i];
      if (field.type.toUpperCase() != 'FILE') continue;
      if (field.value == '') {
        alert('文件框中必须保证已经有文件被选中!');
        document.MM_returnValue = false;field.focus();break;
      }
      if (extensions.toUpperCase().indexOf(getFileExtension(field.value).toUpperCase()) == -1) {
        alert('这种文件类型不允许上传!.\n只有以下类型的文件才被允许上传: ' + extensions + '.\n请选择别的文件并重新上传.');
        document.MM_returnValue = false;field.focus();break;
  } } }
}
//-->
</script></head>
<body>
<div class="memmenul">
<div class="leftmenutit"><span>企业LOGO上传</span></div>
<table width="98%" border="0" cellspacing="0" cellpadding="0" class="mtable" align="center">
  <tr>
    <td class="tdcolor">所传LOGO一律为JPG、JPEG或GIF格式。如果您没有扫描仪，可以将LOGO邮寄给我们，我们免费为您服务。</td>
  </tr>
<%
Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select * from JOB_Member where Member_login='"&Cmember_login&"'"
rs.open sql,conn,1,1
%>
  <tr>
    <td align="center">
<%					
if rs("Member_logo")<>"" then
%>
<a href="<%=sUploadDir&rs("Member_logo")%>" target="_blank"><img height="60" src="<%=sUploadDir&rs("Member_logo")%>" width="160" border="0" style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid" /></a><br />
<%else%>
<img height="60" src="<%=sUploadDir%>/nologo.gif" width="160" border="0" style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid" />
<%end if
rs.close
set rs=nothing%>	</td>
  </tr>
<form action="photosave.asp" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="checkFileUpload(this,'GIF,JPG,JPEG');return document.MM_returnValue">
  <tr>
    <td>请选择上传LOGO：<input name="attachment" type="file" class="inputs" id="attachment" />
            <input name="b122" type="submit" class="inputs" value="上传LOGO" /></td>
  </tr>
 </form>
  <tr>
    <td>（您可以在上面预览公司的LOGO；如果LOGO显示超出区域，说明LOGO太大。）</td>
  </tr>
  <tr>
    <td><font color="#FF0000">如何使您的LOGO显示达到最佳效果？</font></td>
  </tr>
  <tr>
    <td> 1、将照片尺寸设置为<strong>160(宽)*60(高)</strong>像素。（LOGO标准尺寸）</td>
  </tr>
  <tr>
    <td>2、LOGO大小不能超过<strong>100</strong>K。</td>
  </tr>
</table>
</div>
<%CloseConn%>