<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/cinfo.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/money.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	useflag=3
%>
<!--#include file="flag.asp"-->
<%
	action=Trim(Request.QueryString("action"))
	if action="add" then
		uname=Trim(Request.Form("uname"))
		email=Trim(Request.Form("email"))
		pwd1=Trim(Request.Form("pwd"))
		pwd=mistake(pwd1)
		question=Trim(Request.Form("question"))
		answer=Trim(Request.Form("answer"))
		
		cname=Trim(Request.Form("cname"))
		cxz=Trim(Request.Form("cxz"))
		trade=Trim(Request.Form("trade"))
		fund=Trim(Request.Form("fund"))
		cypic=Trim(Request.Form("cypic"))
		yuangong=Trim(Request.Form("yuangong"))
		fdate=Trim(Request.Form("fdate"))
		address=Trim(Request.Form("address"))
		area=Trim(Request.Form("hukouprovince"))
		zpnum=Trim(Request.Form("hukoucapital"))
		pname=Trim(Request.Form("pname"))
		phone=Trim(Request.Form("phone"))
		fax=Trim(Request.Form("fax"))
		zip=Trim(Request.Form("zip"))
		http=Trim(Request.Form("http"))
		jianj=Trim(Request.Form("jianj"))
		faren=Trim(Request.Form("faren"))
		pic=Trim(Request.Form("pic"))
		hukoucity=Trim(Request.Form("hukoucity"))
	
		if yuangong="" then fax="未知"
		if fund="" then fund="未知"
		if faren="" then faren="未知"
		if fax="" then fax="未知"
		if http="" then http="http://"
		if pic="" then pic="upimages/company/nocypic.gif"
		
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="select * from company where uname='"&uname&"'"
		rs.open sql,conn,2,3
		if rs.eof then
		
			rs.addnew
			
			rs("uname")=uname
			rs("pwd")=pwd
			rs("question")=question
			rs("answer")=answer
			rs("email")=email
			rs("fen")=csetup1
			rs("dian")=csetup
			rs("jobnum")=jobnum
			rs("gj")=0
			rs("cname")=cname
			rs("cxz")=cxz
			rs("trade")=trade
			rs("fund")=fund
			rs("cypic")=cypic
			rs("yuangong")=yuangong
			rs("fdate")=fdate
			rs("address")=address
			rs("area")=area
			rs("shisus")=hukoucity
			rs("zpnum")=zpnum
			rs("pname")=pname
			rs("phone")=phone
			rs("fax")=fax
			rs("zip")=zip
			rs("http")=http
			rs("jianj")=jianj
			rs("faren")=faren
			rs("pic")=pic
			rs("idate")=date()

			rs.update
			
			response.write"<SCRIPT language=JavaScript>alert('企业用户注册成功，现在为您返回');"
			response.write"this.location.href='Admin_company.asp';</script>"
			response.end
			
		else
		
			response.write"<SCRIPT language=JavaScript>alert('该用户名已存在，请重来');"
			response.write"javascript:history.go(-1)</SCRIPT>"
			response.end
			
		end if
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
	end if
%>
<html>
<head>
<title>添加企业资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=Include/style.css rel=stylesheet type="text/css">
<SCRIPT src="../inc/fPopUpCalendarDlg.js"></SCRIPT>
<script language="JavaScript" type="text/javascript" src="../inc/keyfilter.js"></script>
<script language="JavaScript">
<!--
//功能：去掉字符串前后空格
//返回值：去掉空格后的字符串
function fnRemoveBrank(strSource)
{
 return strSource.replace(/^\s*/,'').replace(/\s*$/,'');
}
function GethukouCapital(capitalid)
{
document.frames["hukoucapitalframe"].location.replace("../inc/gethukoucapital.asp?capitalid="+capitalid);
}
function GethukouCity(cityid)
{
document.frames["hukoucityframe"].location.replace("../inc/gethukoucity.asp?cityid="+cityid);
}
function String.prototype.lenB()
{
return this.replace(/[^\x00-\xff]/g,"**").length;
}
function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
function checkUserExist(theForm){
	if (fnRemoveBrank(userinfo.uname.value)== "") {
		alert ('请输入会员帐号 ！');
		userinfo.uname.focus();
		return false;
	}else{
		window.open("checkUser.asp?usertype=company&login="+userinfo.uname.value,"","width=340,height=200,scrollbars=no");
	}
	return false;
}
function checkuserinfo()
{
   if(document.userinfo.uname.value == "") {
	document.userinfo.uname.focus();
    alert("对不起，请填写用户名！");
	return false;
  }
   if(document.userinfo.pwd.value == "") {
	document.userinfo.pwd.focus();
    alert("对不起，请填写密码！");
	return false;
  }
   if(document.userinfo.pwd1.value == "") {
	document.userinfo.pwd1.focus();
    alert("对不起，请填写确认密码！");
	return false;
  }
    if(document.userinfo.pwd.value != document.userinfo.pwd1.value) {
	document.userinfo.pwd.focus();
	document.userinfo.pwd.value = '';
	document.userinfo.pwd1.value = '';
    alert("两次输入的密码不同，请重新输入！");
	return false;
  }
   if(document.userinfo.email.value =="") {
	document.userinfo.email.focus();
    alert("对不起，请填写电子邮件地址！");
	return false;
  }
   if(document.userinfo.question.value =="") {
	document.userinfo.question.focus();
    alert("对不起，请填写密码提问！");
	return false;
  }
   if(document.userinfo.answer.value=="") {
	document.userinfo.answer.focus();
    alert("对不起，请填写密码提问的答案！");
	return false;
  }
   if(document.userinfo.cname.value=="") {
	document.userinfo.cname.focus();
    alert("对不起，请填写公司名称！");
	return false;
  }
   if(document.userinfo.cname.value=="") {
	document.userinfo.cname.focus();
    alert("对不起，请填写公司类型！");
	return false;
  }
   if(document.userinfo.trade.value=="") {
	document.userinfo.trade.focus();
    alert("对不起，请填写行业类别！");
	return false;
  }
   if(document.userinfo.fdate.value=="") {
	document.userinfo.fdate.focus();
    alert("对不起，请填写成立日期！");
	return false;
  }
   if(document.userinfo.address.value=="") {
	document.userinfo.address.focus();
    alert("对不起，请填写地址！");
	return false;
  }
   if(document.userinfo.hukouprovince.value=="") {
	document.userinfo.hukouprovince.focus();
    alert("对不起，请填写所在城市！");
	return false;
  }
   if(document.userinfo.pname.value=="") {
	document.userinfo.pname.focus();
    alert("对不起，请填写联系人！");
	return false;
  }
   if(document.userinfo.phone.value=="") {
	document.userinfo.phone.focus();
    alert("对不起，请填写联系电话！");
	return false;
  }
   if(document.userinfo.zip.value=="") {
	document.userinfo.zip.focus();
    alert("对不起，请填写邮政编码！");
	return false;
  }
   if(document.userinfo.zip.value=="") {
	document.userinfo.zip.focus();
    alert("对不起，请填写邮政编码！");
	return false;
  }
}
//-->
</script>
<iframe height=0 width=0 src="" id="hukoucapitalframe"></iframe>
<iframe height=0 width=0 src="" id="hukoucityframe"></iframe>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
   <tr> 
  <th height=25 colspan="6" class="tableHeaderText">添加企业资料</th> 
  </tr>
  <form action="?action=add" method="post" name="userinfo" onSubmit="return checkuserinfo()">
    <TBODY>
      <TR > 
        <TD height=25 colSpan=6 align=left class="amrow"><FONT color=#333333>（注：带</FONT><FONT color=#ff6600>＊</FONT><FONT color=#b00000><FONT color=#333333>号为必填项）</FONT></FONT>        </TD>
      </TR>
      <tr > 
        <td height=25 colspan="6" class="huiby"><font color="#FF0000"><strong>基本资料</strong></font></td>
      </tr>
      <tr > 
        <td height="25" colspan="6" class="huiby">
            <table border="0" width="100%" align="center">
              <tr> 
                <td width="16%" align="right">会员帐号：</td>
                <td width="84%"><input name="uname" id="uname" maxlength=20 onKeyPress="keyFilter('1234567890abcdefghijklmnopqrstuvwxyz_')" onpaste="return false" onMouseOver="focus();select();" style="IME-MODE: disabled;width:130px">
                  <FONT color=#ff6600>＊</FONT> （为字母或数字，4-20个字符） 
                <input name="checkUsername" type="button" value="查看会员帐号是否占用" onClick="checkUserExist();" ></td>
              </tr>
              <tr> 
                <td align="right">会员密码：</td>
                <td><input name="pwd" type="password" id="pwd" value="" maxlength="20" style="width:130px">
                  <FONT color=#ff6600>＊</FONT> （为字母或数字，4-20个字符）</td>
              </tr>
			  <tr> 
                <td align="right">确认密码：</td>
                <td><input name="pwd1" type="password" id="pwd1" value="" style="width:130px" maxlength="20"></td>
              </tr>
			  <tr> 
                <td align="right">邮&nbsp;&nbsp;&nbsp;箱：</td>
                <td><input name="email" type="text" id="email" value="" style="width:130px" maxlength="20">                 
                   <FONT color=#ff6600>＊</FONT> （邮箱需要验证，请正确填写）</td>
              </tr>
              <tr> 
                <td align="right">密码提示问题：</td>
                <td><input name="question" type="text" id="question" value="" style="width:130px" maxlength="20">
                  <FONT color=#ff6600>＊</FONT> （忘记密码的提示问题答案，用于取回本站的密码）</td>
              </tr>
              <tr> 
                <td align="right">密码提示问题的答案：</td>
                <td><input name="answer" type="text" id="answer" value="" style="width:130px" maxlength="20">
                  <FONT color=#ff6600>＊</FONT> </td>
              </tr>
            </table>
			</td>
      </tr>
      <TR> 
        <TD height=25 align=right class="amrow" width="12%"><FONT color=#ff6600>＊</FONT>公司名称：</TD>
        <TD width="22%" align=left class="amrow"><input type="text" name="cname" style="width: 145px;font-size: 12px;" value="" size="10"></TD>
        <TD width="12%" align=right class="amrow"><span class="huiby"><font color="#ff6600">＊</font>公司类型：</span></TD>
        <TD align=left class="amrow" width="20%"><span class="huiby">
          <select name="cxz" style="width: 120px;font-size: 12px;">
              <option value="国有企业" selected>国有企业</option>
              <option value="外资企业">外资企业</option>
              <option value="合资企业">合资企业</option>
              <option value="私营企业">私营企业</option>
              <option value="民营企业">民营企业</option>
              <option value="股份制企业">股份制企业</option>
              <option value="集体企业">集体企业</option>
              <option value="集体事业">集体事业</option>
              <option value="乡镇企业">乡镇企业</option>
              <option value="行政机关">行政机关</option>
              <option value="社会团体">社会团体</option>
              <option value="事业单位">事业单位</option>
              <option value="跨国企业(集团)">跨国企业(集团)</option>
              <option value="其它">其它</option>
          </select></span></TD>
        <TD width="12%" align=right class="amrow"><span class="huiby"><font color="#ff6600">＊</font>行业类别：</span></TD>
        <TD align=left class="amrow" width="22%"><span class="huiby">
<select name="trade">
<%
	call listcompany("")
%>
</select></span></TD>
      </TR>
      <TR align="right" > 
        <TD height=25 class="huiby">注册资金<span class="amrow">：</span></TD>
        <TD align="left" class="huiby"><input type="text" name="fund" maxlength=25 style="width: 80px;font-size: 12px;" value="" size="20">
                  <select name="cypic" style="width: 80px;font-size: 12px;">
                    <option value="万人民币">万人民币</option>
                    <option value="万美元">万美元</option>
                    <option value="万港币">万港币</option>
                    <option value="万欧元">万欧元</option>
                  </select></TD>
        <TD class="huiby"><span class="amrow">员工数量：</span></TD>
        <TD align="left" class="huiby"><input type="text" name="yuangong" maxlength=25 style="width: 80px;font-size: 12px;" value="" size="20">（人）</TD>
        <TD align=right class="huiby"><font color="#ff6600">＊</font>成立日期<span class="amrow">：</span></TD>
        <TD align="left" class="huiby"><input type="text" maxlength=20 name="fdate" style="width: 100px;font-size: 12px;" value="" size="20"></TD>
      </TR>
      <TR > 
        <TD height=25 align=right class="amrow"><span class="huiby"><font color="#ff6600">＊</font>地&nbsp;&nbsp;&nbsp;&nbsp;址：</span></TD>
        <TD align=left class="amrow" ><span class="huiby"><input type="text" name="address" maxlength=100 style="width: 145px;font-size: 12px;" size="20" value=""></span></TD>
        <TD align=right class="amrow" ><span class="huiby"><font color="#ff6600">＊</font>所在城市：</span></TD>
        <TD align=left class="amrow" ><span class="huiby"><select name="hukouprovince" size="1" id="select11" onChange=GethukouCapital(this.options[this.selectedIndex].value)>
                            <option value="" selected>省份</option>
<%
	set rs=server.createobject("adodb.recordset")
	sql="select * from job_provinceandcity where fid=0 order by date desc"
	rs.open sql,conn,1,1
	do while not rs.eof
	response.write"<OPTION value="&rs("id")&">"&rs("province_city")&"</option>"
	rs.movenext
	loop
	rs.close
	set rs=nothing
%>
			</select>
			<span id="load300"></span> <span id="chukoucapital">
                          <select name=hukoucapital id="select12" onchange=GethukouCity(this.options[this.selectedIndex].value)>
                            <option value="" selected>地级市</option>
                          </select>
                          </span><span id="load400"></span>
<span id="chukoucity">
<select name=hukoucity id="hukoucity">
<option value="" selected>县级地区</option>
</select>
</span></TD>
        <TD align=right class="amrow" ><font color="#ff6600">＊</font>联&nbsp;系&nbsp;人： </TD>
        <TD align=left class="amrow" ><span class="huiby"><input type="text" name="pname" maxlength=20 style="width: 120px;font-size: 12px;" value="" size="20"></span></TD>
      </TR>
      <TR > 
        <TD height=25 align=right class="huiby"><span class="amrow"><font color="#ff6600">＊</font><span class="mem_coinfo">联系电话</span>：</span></TD>
        <TD align=left class="huiby"><input name="phone" type="text" style="width: 145px;font-size: 12px;" value=""  maxlength=90 size="20"></TD>
        <TD align=right class="huiby">传真号码： </TD>
        <TD align=left class="huiby"><input type="text" name="fax" maxlength=20 style="width: 120px;font-size: 12px;" value="" size="20"></TD>
        <TD align=right class="huiby"><font color="#ff6600">＊</font>邮政编码<span class="amrow">：</span></TD>
        <TD align=left class="huiby"><input type="text" name="zip" maxlength=6 style="width: 100px;font-size: 12px;" value="" size="20"></TD>
      </TR>
      <TR > 
        <TD height=25 align=right class="amrow">法人代表：</TD>
        <TD align=left class="amrow"><input name="faren" type="text" id="faren" style="width: 120px;font-size: 12px;" value="" size="20" maxlength=50></TD>
        <TD align=right class="amrow">公司网站：</TD>
        <TD align=left class="amrow"><input type="text" name="http" maxlength="100" style="width: 120px;font-size: 12px;" value="" size="20"></TD>
        <TD align=right class="amrow"><span class="huiby">营业执照：</span></TD>
        <TD align=left class="amrow"><span class="huiby">
          <input name="pic" type="text" id="pic" style="width: 85px;font-size: 12px;" value="" size="15" maxlength=50>
          <a href="JavaScript:openScript('../upfile/uploadads.asp',320,210)"><font color="red">上传执照</font></a></span></TD>
      </TR>
	  <tr align="right"> 
        <td height=25 colspan="6" align="left" class="forumRow"><font color="#FF0000"><strong>其他信息</strong></font></td>
      </tr>
      <TR > 
        <TD height=25 align=right valign="middle" class="huiby"><FONT color=#ff6600>＊</FONT>公司简介：</TD>
        <TD colspan="5" align=left class="huiby"><textarea name="jianj" rows="8" style="width: 500px;font-size: 12px;display:none;" cols="20"></textarea><iframe ID="Editor" name="Editor" src="../HtmlEditor/index.html?ID=jianj" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:130px;width:100%"></iframe></TD>
      </TR>
      <TR > 
        <TD height=25 colspan="6" align="center"> <input name="submitdd" type="submit" class="Anbut1" value=" 添 加 "> 
          <input name="reset" type="reset" class="Anbut1" value=" 还 原 "> </TD>
      </TR>
    </TBODY>
  </form>
</TABLE>
</body>
</html>
