<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%
If Not FRAdminLevel(303) Then
	Call ErrorMsg()
End If%>
<html>
<head>
<title>修改企业资料</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>
<script language="javascript" src="../Inc/Admin.js"></script><script language="JavaScript">
<!--
//功能：去掉字符串前后空格
//返回值：去掉空格后的字符串
function fnRemoveBrank(strSource)
{
 return strSource.replace(/^\s*/,'').replace(/\s*$/,'');
}
function String.prototype.lenB()
{
return this.replace(/[^\x00-\xff]/g,"**").length;
}
function Juge(theForm)
{
  if (fnRemoveBrank(theForm.comname.value) == "")
  {
    alert("请输入公司名称!");
    theForm.comname.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.trade.value) == "")
  {
    alert("请选择所属行业!");
    theForm.trade.focus();
    return (false);
  }
    if (fnRemoveBrank(theForm.province.value) == "")
  {
    alert("请选择所在省份!");
    theForm.province.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.licence.value) != "")
  {
	  var objv = fnRemoveBrank(theForm.licence.value);
	  var pattern = /^[0-9]+$/;
	  flag = pattern.test(objv);
	  if(!flag)
	  {
		alert("营业执照：要求为数字!请重新输入。");
		theForm.licence.focus();
		return (false);
	   }
   }
  if (fnRemoveBrank(theForm.ecoclass.value) == "")
  {
    alert("请选择公司性质!");
    theForm.ecoclass.focus();
    return (false);
  }
if (fnRemoveBrank(theForm.fund.value) != "")
{
  var objv = fnRemoveBrank(theForm.fund.value);
  var pattern = /^[0-9]+$/;
  flag = pattern.test(objv);
  if(!flag)
  {
    alert("注册资金：要求为数字!请重新输入。");
    theForm.fund.focus();
    return (false);
   }
}
   if (fnRemoveBrank(theForm.introduce.value) == "")
  {
    alert("请输入公司简介!");
    theForm.introduce.focus();
    return (false);
  }
  if ((theForm.introduce.value).lenB()>=8000)
  {
	 alert("公司简介太长了，要求不多于8000个字符!");
	 theForm.introduce.focus();
	 return (false);
  }
  if (fnRemoveBrank(theForm.address.value) == "")
  {
    alert("请输入通信地址!");
    theForm.address.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.post.value) != "")
  {
	  var objv = fnRemoveBrank(theForm.post.value);
	  var pattern = /^[0-9]+$/;
	  flag = pattern.test(objv);
	  if(!flag||objv.length<6)
	  {
		alert("邮政编码：要求为6位数字!请重新输入。");
		theForm.post.focus();
		return (false);
	   }
   }
  if (fnRemoveBrank(theForm.contact.value) == "")
  {
    alert("请输入联系人!");
    theForm.contact.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.tel.value) == "")
  {
    alert("请输入联系电话!");
    theForm.tel.focus();
    return (false);
  }
    if (fnRemoveBrank(theForm.tel.value) != "")
  {
	  var objv = fnRemoveBrank(theForm.tel.value);
	  var pattern = /^[0-9-\s]+$/;
	  flag = pattern.test(objv);
	  if(!flag)
	  {
		alert("电话号码：要求为数字0-9和-的组合!请重新输入。");
		theForm.tel.focus();
		return (false);
	   }
   }
  if (fnRemoveBrank(theForm.mobile.value) != "")
  {
	  var objv = fnRemoveBrank(theForm.mobile.value);
	  var pattern = /^[0-9]+$/;
	  flag = pattern.test(objv);
	  if(!flag||objv.length<11)
	  {
		alert("手机号码：要求为11位数字!请重新输入。");
		theForm.mobile.focus();
		return (false);
	   }
   }
   if (fnRemoveBrank(theForm.fax.value) != "")
  {
	  var objv = fnRemoveBrank(theForm.fax.value);
	  var pattern = /^[0-9-\s]+$/;
	  flag = pattern.test(objv);
	  if(!flag)
	  {
		alert("传真号码：要求为数字0-9和-的组合!请重新输入。");
		theForm.fax.focus();
		return (false);
	   }
   }
  var objv = fnRemoveBrank(theForm.email.value);
  var pattern = /^([a-zA-Z0-9_-])+(\.([a-zA-Z0-9_-])+)*@([a-zA-Z0-9_-])+(\.([a-zA-Z0-9_-])+)+$/;
  flag = pattern.test(objv);
  if(!flag)
  {
    alert("电子邮件：格式不正确！请重新输入。");
	theForm.email.focus();
	return (false); 
  }
if (fnRemoveBrank(theForm.url.value) != "")
  {
	  if(theForm.url.value.indexOf("http://")==-1)
	  {
		alert("公司主页：必须包括“http://”，请完整填写。");
		theForm.url.focus();
		return (false);
	   }
   }
 }
-->
</script></head>
<body>
<%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"))
set rst=server.createobject("ADODB.Recordset")
sql="select * from job_member where member_id="&company_id
rst.open sql,conn,1,1
%> 
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tableBorder"  align="center">
  <tr> 
  	<th height=25 colspan="2" class="tableHeaderText">修改企业资料</th> 
  </tr>
  <form action="company_update.asp?id=<%=company_id%>&keyword=<%=keyword%>&page=<%=page%>&segment=<%=segment%>&operate=<%=operate%>&group=<%=group%>" method="POST" name="companyform" onSubmit="return Juge(this)">
    <TBODY>
      <TR > 
        <TD height=25 colSpan=2 align=left><FONT color=#333333>（注：带</FONT><FONT color=#ff6600>＊</FONT><FONT color=#b00000><FONT color=#333333>号为必填项）</FONT></FONT>        </TD>
      </TR>
      <tr > 
        <td height=25 colspan="2" class="huibg"><font color="#FF0000"><strong>基本资料</strong></font></td>
      </tr>
      <TR > 
        <TD align=right width="16%" height=25><FONT color=#ff6600>＊</FONT>公司名称：        </TD>
        <TD align=left width="84%"> <INPUT name=comname id="comname" size=38 maxLength=50 value="<%=rst("member_name")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD height=25 align=right>&nbsp;&nbsp;营业执照：</TD>
        <TD align=left> <INPUT maxLength=50 size=30 name=licence value="<%=rst("member_licence")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD height=25 align=right><FONT color=#ff6600>＊</FONT>所属行业： </TD>
        <TD align=left> <select name=trade id="select2">
            <option value=""></option>
            <%
	  Set rs= Server.CreateObject("ADODB.RecordSet")
       sql="select trade_id,trade_name from job_trade"
       rs.open sql,conn,1,1
       do while not rs.eof
	   if rst("member_trade")=rs("trade_id") then
	  	response.write"<OPTION value="&rs("trade_id")&" selected>"&rs("trade_name")&"</option>"
	   else
	    response.write"<OPTION value="&rs("trade_id")&">"&rs("trade_name")&"</option>"
	   end if
		 rs.movenext
		 loop
		 rs.close
		%>
        </SELECT> </TD>
      </TR>
	  
	  <tr>
    <td align="right"><font color="#ff6600">＊</font>所在地区：</td>
    <td><select name="province" size="1" id="select5" onChange="changeProvince(document.companyform.province.options[document.companyform.province.selectedIndex].value)">
		<%if rst("member_provinceid")<>"" then%>
		<option value="<%=rst("member_provinceid")%>"><%=Hireworkadds(rst("member_provinceid"))%></option>
		<%else%>
		<option value="">选择省</option>
		<%end if%>
		</select>		
		<select name="capital" onchange="changeCity(document.companyform.capital.options[document.companyform.capital.selectedIndex].value)">
		<%if rst("member_capitalid")<>"" then%>
		<option value="<%=rst("member_capitalid")%>"><%=Hireworkadds(rst("member_capitalid"))%></option>
		<%else%>
		<option value="">选择市</option>
		<%end if%>
		</select>
		<select name="city">
		<%if rst("member_cityid")<>"" then%>
		<option value="<%=rst("member_cityid")%>"><%=Hireworkadds(rst("member_cityid"))%></option>
		<%else%>
		<option value="">选择区</option>
		<%end if%>
		</select>
	</td>
  </tr>
	
      <TR > 
        <TD height=25 align=right><FONT color=#ff6600>＊</FONT>公司性质： </TD>
        <TD align=left> <select name="ecoclass" size="1" id="select6">
            <option value="" selected></option>
            <%
       sql="select ecoclass_id,ecoclass_name from job_ecoclass"
       rs.open sql,conn,1,1
       do while not rs.eof
	   if rst("member_ecoclass")=rs("ecoclass_id") then
	  	response.write"<OPTION value="&rs("ecoclass_id")&" selected>"&rs("ecoclass_name")&"</option>"
	   else
	    response.write"<OPTION value="&rs("ecoclass_id")&">"&rs("ecoclass_name")&"</option>"
	   end if
		 rs.movenext
		 loop
		 rs.close
		 set rs=nothing
		%>
        </select> </TD>
      </TR>
      <TR > 
        <TD height=25 align=right>成立日期： </TD>
        <TD align=left>
        <input name="funddate" type="text" size="10" onClick="fPopUpCalendarDlg(funddate);return false" readonly id=funddate value="<%=rst("member_founddate")%>"><img src="../images/calendar_bnt.gif" style="cursor:hand;" align="absmiddle" onClick="fPopUpCalendarDlg(funddate);return false" WIDTH="34" HEIGHT="21"></span> 
		</TD>
      </TR>
      <TR > 
        <TD height=25 align=right>注册资金： </TD>
        <TD align=left> <INPUT name=fund id="fund" size=10 value="<%=rst("member_fund")%>">
        万人民币</TD>
      </TR>
      <TR > 
        <TD height=25 align=right>员工人数： </TD>
        <TD height=20> <INPUT name=workers type=radio class="checkbox" value=少于50人 <%if rst("member_workers")="少于50人" then response.write "checked" end if%>>
          少于<B>50</B>人 
          <INPUT name=workers type=radio class="checkbox" value=50-200人 <%if rst("member_workers")="50-200人" then response.write "checked" end if%>> 
          <B>50-200</B>人 
          <INPUT name=workers type=radio class="checkbox" value=200-500人 <%if rst("member_workers")="200-500人" then response.write "checked" end if%>> 
          <B>200-500</B>人 
          <input name=workers type=radio class="checkbox" value=500-1000人 <%if rst("member_workers")="500-1000人" then response.write "checked" end if%>> 
          <B>500-1000</B>人 
          <input name=workers type=radio class="checkbox" value=1000人以上 <%if rst("member_workers")="1000人以上" then response.write "checked" end if%>> 
        <B>1000</B>人以上</TD>
      </TR>
      <TR > 
        <TD height=25 align="right" vAlign=top><FONT color=#ff6600>＊</FONT>公司简介：</TD>
        <TD><TEXTAREA name=introduce cols=72 rows=11 class=fieldtext id="textarea"><%=ChangeStrbox(rst("member_introduce"))%></TEXTAREA> 
        </TD>
      </TR>
      <tr > 
        <td height=25 colspan="2"><font color="#FF0000"><strong>联系方式</strong></font></td>
      </tr>
      <TR > 
        <TD height=25 align=right valign="middle"><FONT color=#ff6600>＊</FONT>通讯地址：        </TD>
        <TD align=left><input name="address" type="text" size="38" maxlength="50" value="<%=rst("member_address")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD height=25 align="right" valign="middle">&nbsp;&nbsp;邮&nbsp;&nbsp;&nbsp;编： </TD>
        <TD align=left> <INPUT name=post id="post2" size=6 maxLength=6 value="<%=rst("member_post")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD width="16%" height=25 align="right" vAlign=middle><FONT color=#ff6600>＊</FONT>联 
          系 人：</TD>
        <TD width="84%" align=left> <INPUT name=contact id="contact2" size=28 maxLength=25 value="<%=rst("member_contact")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD height=25 align="right" vAlign=middle><FONT color=#ff6600>＊</FONT>联系电话：</TD>
        <TD align=left> <input name="tel" type="text" id="tel2" size="38" maxlength="100" value="<%=rst("member_tel")%>"> 
        </TD>
      </TR>
      <TR >
        <TD height=25 align="right" vAlign=middle>手机号码：</TD>
        <TD align=left> <input name="mobile" type="text" id="mobile" size="38" maxlength="11" value="<%=rst("member_mobile")%>">        </TD>
      </TR>
      <TR > 
        <TD height=25 align=right valign="middle">&nbsp;&nbsp;传&nbsp;&nbsp;&nbsp;真：</TD>
        <TD align=left> <input name="fax" type="text" id="fax2" size="38" maxlength="100" value="<%=rst("member_fax")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD height=25 align=right vAlign=middle><FONT color=#ff6600>＊</FONT>电子邮件：</TD>
        <TD align=left vAlign=top> <INPUT maxLength=100 size=38 name=email value="<%=rst("member_email")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD height=25 align="right" valign="middle" noWrap>&nbsp;公司主页： </TD>
        <TD><INPUT name=url id="url" size=38 maxLength=100 value="<%=rst("member_url")%>"> 
        </TD>
      </TR>
      <TR > 
        <TD height=25><FONT color=#d84d45>&nbsp;&nbsp; </FONT>&nbsp; </TD>
        <TD colSpan=2 ><FONT color=#000000> 
          <INPUT name=resetcontactinfo 
                        type=checkbox class="checkbox" id="resetcontactinfo" value=1>
          同步更新所有招聘信息中的联系方式<br>
        （选中此选项后,所有该公司发布的招聘信息中的联系方式也将同时更改为此联系方式。） </FONT></TD>
      </TR>
      <%
	  rst.close
	  set rst=nothing
	  conn.close
	  set conn=nothing
	  %>
      <TR > 
        <TD height=25 colspan="2" align="center"> <input name="submitdd" type="submit"  class=inputs  value=" 修 改 "> 
        <input name="reset" type="reset" class=inputs value=" 还 原 "> </TD>
      </TR>
    </TBODY>
  </form>
</TABLE>
</body>
<script language = "JavaScript" src="../../js/GetProvince.js"></script>
<script language = "JavaScript">
function changeProvince(selvalue)
{
document.companyform.capital.length=0; 
document.companyform.city.length=0;
var selvalue=selvalue;	  
var j,d,mm;
d=0;
for(j=0;j<provincearray.length;j++) 
	{
		if(provincearray[j][1]==selvalue) 
		{
			if (d==0)
			{
			mm=provincearray[j][2];
			}
		var newOption2=new Option(provincearray[j][0],provincearray[j][2]);
		document.all.capital.add(newOption2);
		d=d+1;	
		}		
		if(provincearray[j][1]==mm) 
		{		
			var newOption3=new Option(provincearray[j][0],provincearray[j][2]);
			document.all.city.add(newOption3);
		}			
	}
}
function changeCity(selvalue)  
{ 
	document.companyform.city.length=0;  
	var selvalue=selvalue;
	var j;
	for(j=0;j<provincearray.length;j++) 
	{
		if(provincearray[j][1]==selvalue) 
		{
			var newOption4=new Option(provincearray[j][0],provincearray[j][2]);
			document.all.city.add(newOption4);
		}
	}
}
function selectprovince() 
{ 
	var j;
	for(j=0;j<provincearray.length;j++) 
	{
		if(provincearray[j][1]==0) 
		{
			var newOption4=new Option(provincearray[j][0],provincearray[j][2]);
			document.all.province.add(newOption4);
		}
	}
}
selectprovince();
</script>