<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%If Not FRAdminLevel(303) Then Call ErrorMsg()%>
<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 type="text/javascript" src="../inc/Admin.js"></script>
<script language="JavaScript">
<!--
function checkUserExist(theForm){
	if (fnRemoveBrank(companyform.login.value)== "") {
		alert ('请输入会员帐号 ！');
		companyform.login.focus();
		return false;
	}else{
		window.open("checkcmemberuser.asp?login="+companyform.login.value,"","width=340,height=200,scrollbars=no");
	}
	return false;
}
//功能：去掉字符串前后空格
//返回值：去掉空格后的字符串
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.login.value)== "")
	{
	 alert("请输入会员帐号!");
    theForm.login.focus();
    return (false);
	}
	var objv = theForm.login.value;
    var pattern = /^[A-Za-z0-9]{4,20}$/;
    flag = pattern.test(objv);
    if (!flag) 
    {
     alert("会员帐号：要求为4-20个字母或数字！请重新输入。");
     theForm.login.focus();
     return(false);
     }
    if (fnRemoveBrank(theForm.pwd.value)== "")
	{
	 alert("请输入会员密码!");
    theForm.pwd.focus();
    return (false);
	}
	var objv = theForm.pwd.value;
    var pattern = /^[A-Za-z0-9]{4,20}$/;
    flag = pattern.test(objv);
    if (!flag) 
    {
     alert("会员密码：要求为4-20个字母或数字！请重新输入。");
     theForm.login.focus();
     return(false);
     }
	
  if (theForm.pwd.value != theForm.pwd1.value)
  {
    alert("两次输入密码不一致，请重新输入!");
    theForm.pwd.focus();
    return (false);
  }	 
  if (theForm.user_type.value == "")
  {
    alert("请选择会员服务类型!");
    theForm.user_type.focus();
    return (false);
  }
  if (theForm.startdate.value == "")
  {
    alert("请正确填写开始时间!");
    theForm.startdate.focus();
    return (false);
  }
  if (theForm.enddate.value == "")
  {
    alert("请正确填写结束时间!");
    theForm.enddate.focus();
    return (false);
  }
  if (fnRemoveBrank(theForm.comname.value) == "")
  {
    alert("请输入公司名称!");
    theForm.comname.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.trade.value) == "")
  {
    alert("请选择所属行业!");
    theForm.trade.focus();
    return (false);
  }
    if (fnRemoveBrank(theForm.province.value) == "")
  {
    alert("请选择所在省份!");
    theForm.province.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);
	   }
   }
}
function changetype(typeid,endyear,endmonth,endday,outlay)
{
var today;
today=new Date(); 
month=today.getMonth();
year=today.getYear();
day=today.getDate(); 
document.companyform.startdate.value=year+'-'+(month+1)+'-'+day;
document.companyform.enddate.value=endyear+'-'+endmonth+'-'+endday;
}
-->
</script></head>
<body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
  <tr> 
  <th height=25 colspan="2" class="tableHeaderText">添加企业资料</th> 
  </tr>
  <form action="company_save.asp?step=save" 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"><font color="#FF0000"><strong>基本资料</strong></font></td>
      </tr>
      <tr > 
        <td width="20%" align="right"><FONT color=#ff6600>＊</FONT>会员帐号：</td>
        <td width="80%"><input name=login id="login" size=20 maxlength=20> 
        （为字母或数字，4-20个字符） 
          <input name="checkUsername" type="button" class="inputs" onClick="checkUserExist();" value="查看会员帐号是否占用"></td>
      </tr>
      <tr> 
        <td align="right"><FONT color=#ff6600>＊</FONT>会员密码：</td>
        <td> <input name="pwd" type="password" id="pwd" value="" size="20" maxlength="20">          （为字母或数字，4-20个字符）</td>
      </tr>
      <tr> 
        <td align="right"><FONT color=#ff6600>＊</FONT>确认密码：</td>
        <td> <input name="pwd1" type="password" id="pwd1" value="" size="20" maxlength="20"></td>
      </tr>			   
       <tr> 
        <td align="right"><FONT color=#ff6600>＊</FONT>账户初始化点数：</td>
        <td> <input name="consume" type="text" id="consume" value="0" size="20" maxlength="20">
          （为数字）</td>
      </tr>
       <tr>
         <td align="right"><FONT color=#ff6600>＊</FONT>服务类型：</td>
         <td><%sql="select * from JOB_Group where Group_membertype=2"
set rs1=server.createobject("adodb.recordset")
rs1.open sql,conn,1,1
if not rs1.eof then
do while not rs1.eof
response.Write "<input type='radio' name='user_type' value='"&rs1("Group_id")&"' class=checkbox onclick='changetype(this.value,"&year(UserTypeDate(rs1("Group_id")))&","&month(UserTypeDate(rs1("Group_id")))&","&day(UserTypeDate(rs1("Group_id")))&","&UserTypeoutlay(rs1("Group_id"))&")'"
if rs1("Group_IsDefault") then response.Write " checked"
response.Write ">"&rs1("Group_name")
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
%></td>
       </tr>
       <tr>
         <td align="right"><FONT color=#ff6600>＊</FONT>帐户时限：</td>
         <td>从
			<input name="startdate" type="text" size="10" readonly onClick="fPopUpCalendarDlg(startdate);return false" id=startdate value="<%=date()%>">
          <img src="../images/calendar_bnt.gif" style="cursor:hand;" align="absmiddle" onClick="fPopUpCalendarDlg(startdate);return false" width="34" height="21"> &nbsp;&nbsp; 至    
        &nbsp;<input name="enddate" type="text" size="10" readonly onClick="fPopUpCalendarDlg(enddate);return false" id=enddate value="">
        <img src="../images/calendar_bnt.gif" style="cursor:hand;" align="absmiddle" onClick="fPopUpCalendarDlg(enddate);return false" width="34" height="21">		</td>
       </tr>
      <TR > 
        <TD width="16%" height=25 align=right ><FONT color=#ff6600>＊</FONT>公司名称：        </TD>
        <TD width="84%" align=left> <INPUT name=comname id="comname" size=38 maxLength=50>        </TD>
      </TR>
      <TR > 
        <TD height=25 align=right>&nbsp;&nbsp;营业执照：</TD>
        <TD align=left> <INPUT maxLength=50 size=30 name=licence> </TD>
      </TR>
      <TR > 
        <TD height=25 align=right><FONT color=#ff6600>＊</FONT>所属行业： </TD>
        <TD align=left > <select name=trade id="select">
            <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
	  	 response.write"<OPTION value="&rs("trade_id")&">"&rs("trade_name")&"</option>"
		 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)">
		<option value="">选择省</option>
		</select>		
		<select name="capital" onchange="changeCity(document.companyform.capital.options[document.companyform.capital.selectedIndex].value)">
		<option value="">选择市</option>
		</select>
		<select name="city">
		<option value="">选择区</option>
		</select>
	</td>
  </tr>
      <TR > 
        <TD height=25 align=right><FONT color=#ff6600>＊</FONT>公司性质： </TD>
        <TD align=left> <select name="ecoclass" size="1" id="select5">
            <option value="" selected></option>
            <%
       sql="select ecoclass_id,ecoclass_name from job_ecoclass"
       rs.open sql,conn,1,1
       do while not rs.eof
	  	 response.write"<OPTION value="&rs("ecoclass_id")&">"&rs("ecoclass_name")&"</option>"
		 rs.movenext
		 loop
		 rs.close
		 set rs=nothing
		 conn.close
		 set conn=nothing
		%>
        </select> </TD>
      </TR>
      <TR > 
        <TD height=25 align=right>成立日期： </TD>
        <TD align=left><input name="funddate" type="text" size="10" readonly onClick="fPopUpCalendarDlg(funddate);return false" id=funddate value=""><img src="../images/calendar_bnt.gif" style="cursor:hand;" align="absmiddle" onClick="fPopUpCalendarDlg(funddate);return false" WIDTH="34" HEIGHT="21"> </TD>
      </TR>
      <TR > 
        <TD height=25 align=right>注册资金： </TD>
        <TD align=left> <INPUT name=fund id="fund2" size=10>
        万人民币</TD>
      </TR>
      <TR > 
        <TD height=25 align=right>员工人数： </TD>
        <TD > <INPUT 
                  name=workers type=radio class="checkbox" value=少于50人 CHECKED>
          少于<B>50</B>人 
          <INPUT name=workers type=radio class="checkbox" 
                  value=50-200人> 
          <B>50-200</B>人 
          <INPUT name=workers 
                  type=radio class="checkbox" value=200-500人> 
          <B>200-500</B>人 
          <input name=workers type=radio class="checkbox" value=500-1000人> 
          <B>500-1000</B>人 
        <input 
                  name=workers type=radio class="checkbox" value=1000人以上> 
        <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="introduce"></TEXTAREA>        </TD>
      </TR>
      <tr> 
        <td height=25 colspan="2" class="forumRow"><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">        </TD>
      </TR>
      <TR > 
        <TD height=25 align="right" valign="middle">&nbsp;&nbsp;邮&nbsp;&nbsp;&nbsp;编： </TD>
        <TD align=left> <INPUT name=post id="post" size=6 maxLength=6> </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="contact" size=28 maxLength=25>        </TD>
      </TR>
      <TR > 
        <TD height=25 align="right" vAlign=middle><FONT color=#ff6600>＊</FONT>联系电话：</TD>
        <TD align=left> <input name="tel" type="text" id="tel" size="38" maxlength="100">        </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">        </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="fax" size="38" maxlength="100">        </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> </TD>
      </TR>
      <TR > 
        <TD height=25 align="right" valign="middle" noWrap>&nbsp;公司主页： </TD>
        <TD><input name=url id="url" size=38 maxlength=100></TD>
      </TR>
      <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>