<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../../inc/CommonFunction.asp"-->
<!--#include file="../checkvalid.asp" -->
<%
If Not FRAdminLevel(303) Then
	Call ErrorMsg()
End If
company_id=clng(trim(request("id")))
keyword=trim(request("keyword"))
segment=trim(request("segment"))
operate=trim(request("operate"))
group=trim(request("group"))
page=trim(request("page"))
company_name=CheckStr(trim(request("comname")))

set rs=server.createobject("ADODB.Recordset")
sql="select member_name from job_member where member_name='"&company_name&"' and member_id<>"&company_id
rs.open sql,conn,1,1
if not rs.eof then
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
 Response.Write ("<script language=JavaScript>{alert('错误：此公司已存在！');location.href = 'javascript:history.go(-1)';}</script>")
 Response.End
end if
rs.close
set rs=nothing

company_introduce=CheckStrbox(request("introduce"))
If lenmix(company_introduce)>=8000 Then 
response.write "<script language=javascript>alert('错误：公司简介太长了，要求不多于8000个字符!！');location.href='javascript:history.back()';</script>"
response.end 
end if
if trim(request("url"))<>"" then
	company_url=CheckStr(trim(request("url")))
	dd=strcomp("http://",left(company_url,7),1)
	if dd<>0 then
		response.write "<script language=javascript>alert('错误：网址必须以 http:// 开头!！');location.href='javascript:history.back()';</script>"
	 response.end 
	end if
end if

company_licence=CheckStr(trim(request("licence")))
company_trade=cint(trim(request("trade")))

company_provinceid=cint(trim(request("province")))
company_capitalid=cint(trim(request("capital")))
company_cityid=cint(trim(request("city")))

company_ecoclass=CheckStr(trim(request("ecoclass")))
if request("funddate")<>"" then company_founddate=request("funddate")
if trim(request("fund"))<>"" then company_fund=trim(request("fund"))
company_workers=CheckStr(trim(request("workers")))
company_address=CheckStr(trim(request("address")))
company_post=CheckStr(trim(request("post")))
company_contact=CheckStr(trim(Request("contact")))
company_tel=trim(Request("tel"))
company_mobile=trim(Request("mobile"))
company_fax=trim(Request("fax"))
company_email=CheckStr(trim(request("email")))


sql="select * from job_member where member_id="&company_id
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.eof then 
rs("member_name")=company_name
rs("member_provinceid")=company_provinceid
rs("member_capitalid")=company_capitalid
rs("member_cityid")=company_cityid
rs("member_licence")=company_licence
rs("member_trade")=company_trade
rs("member_ecoclass")=company_ecoclass
rs("member_founddate")=company_founddate
rs("member_fund")=company_fund
rs("member_workers")=company_workers
rs("member_introduce")=company_introduce
rs("member_address")=company_address
rs("member_post")=company_post
rs("member_contact")=company_contact
rs("member_tel")=company_tel
rs("member_mobile")=company_mobile
rs("member_fax")=company_fax
rs("member_email")=company_email
rs("member_emailshowflag")=company_emailshowflag
rs("member_url")=company_url
rs.update
rs.close
end if
if cint(request("resetcontactinfo"))=1 then
conn.execute("update job_c_hire set hire_comname='"&company_name&"', hire_address='"&company_address&"' ,hire_post='"&company_post&"' ,hire_contact='"&company_contact&"' ,hire_tel='"&company_tel&"' ,hire_fax='"&company_fax&"' ,hire_email='"&company_email&"' where company_id="&company_id)
end if
'更新静态页面
set rsuc=conn.execute("select * from JOB_Channel where ChannelID=2")
	UseCreateHTML=rsuc("UseCreateHTML")
set rsuc=nothing
if  CreateHTML=1 and UseCreateHTML<>0 then
	Call CompanyContentHtml(company_id) '生成企业介绍页面
	Call HireListContentHtml(company_id) '生成企业职位列表页面
end if
conn.close
set conn=nothing
response.redirect "cmember_searchlist.asp?page="&page&"&keyword="&keyword&"&segment="&segment&"&operate="&operate&"&group="&group&""
response.end
%>