<!--#include file="userCheck.asp"-->
<!--#include file="conn.asp"-->
<%

'=================如果是评估师就不需要再申请
if request.QueryString("sq")="yes" then    
	set rs=server.createobject("adodb.recordset")  
	sql="select * from member where id="&session("userID23")
	rs.open sql,conn,1,1
	
	if rs("ifpinggushi")="1" then 
		call tiaozhuan("您已经是评估师，不需要再申请！","user_main.asp")		
	elseif rs("ifpinggushi")="-1" then 
		call tiaozhuan("您已经提交了申请，不需要重复提交！","user_main.asp")
	end if
	rs.close
end if

'==============如果还不是评估师就不能修改
if request.QueryString("modify")="yes" then   
	set rs=server.createobject("adodb.recordset")  
	sql="select * from member where id="&session("userID23")  
	
	rs.open sql,conn,1,1
	
	if rs("ifpinggushi")<>"1" then 
		call tiaozhuan("您还不是评估师，不能修改！","user_main.asp")
	end if
	rs.close
end if
'------------------------------------------------------------------------------------------

dim action
action = request.QueryString("action")
if action = "submit" then call tijiao()

set rs=server.createobject("adodb.recordset")  
sql="select * from member where id="&session("userId23") 
rs.open sql,conn,1,1
ifchehang=rs("ifchehang")
%>
<!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>
<title>评估师申请</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="css.css" type="text/css" />
<link href="css/comm.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>
</head>
<body>
<div class="bodyDiv">
<!--#include file="user_top.asp"-->
  <table width="910" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="178" valign="top"><!--#include file="user_left.asp"--></td>
      <td width="732" valign="top">
	  <table width="100%" border="0" cellpadding="2" cellspacing="1" bordercolorlight="#626D78" bordercolordark="#ffffff" bgcolor="#CCCCCC">
        <form action="
		<%if request.QueryString("modify")="yes" then%>
			user_pinggu.asp?action=submit&modify=yes
		<%elseif request.QueryString("sq")="yes" then%>
			user_pinggu.asp?action=submit&sq=yes
		<%else%>
			user_pinggu.asp?action=submit
		<%end if%>
		" method="post" name="frmAnnounce" id="frmAnnounce" onSubmit="return validate()">
          <tr bgcolor="#FFFFFF"> 
            <td height="25" colspan="3" align="right"> 
              <div align="center"><strong>评估师申请</strong></div></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="102" align="right">公司名称:</td>
            <td width="619" height="22" colspan="2"><input name="gsname" type="text" id="gsname" value="<%=rs("gsname")%>" size="25" />
                <font color="#FF0000"> *</font></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td height="22" align="right">联系地址:</td>
            <td height="22" colspan="2"><input name="gsaddress" type="text" id="gsaddress" value="<%if ifchehang="yes" then response.write rs("gslianxi") else response.write rs("address")%>" size="40" />
                <font color="#FF0000"> *</font></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right">邮政编码:</td>
            <td height="22" colspan="2"><input name="gspost" type="text" id="gspost" value="<%if ifchehang="yes" then response.write rs("gscode") else response.write rs("code")%>" size="20" /></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right">联系人&nbsp;:</td>
            <td height="22" colspan="2"><input name="gslinkman" type="text" id="linkman" value="<%if ifchehang="yes" then response.write rs("gsren") else response.write rs("name")%>" size="20" />
                <font color="#FF0000"> *</font></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right">公司电话:</td>
            <td height="22" colspan="2"><input name="gstel" type="text" id="gstel" value="<%=rs("gstel")%>" size="20" />
                <font color="#FF0000"> *</font> </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right">移动电话 :</td>
            <td height="22" colspan="2"><input name="gsmobile" type="text" id="gsmobile" value="<%if ifchehang="yes" then response.write rs("gsmobil") else response.write rs("phone")%>" size="20" />
                <font color="#FF0000"> *</font> </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right">公司传真 :</td>
            <td height="22" colspan="2"><input name="gstran" type="text" id="gstran" value="<%=rs("gsfex")%>" size="20" />
                <font color="#FF0000"> *</font></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right">电子邮件:</td>
            <td height="22" colspan="2"><input name="gsmail" type="text" id="gsmail" value="<%if ifchehang="yes" then response.Write rs("gsemail") else response.write rs("email")%>" size="20" />
                <font color="#FF0000"> *</font> </td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right" valign="top">公司图片:</td>
            <td colspan="2" valign="top"><input name="gsImg" type="text" id="img1" value="<%=rs("gsimg")%>" size="30" maxlength="255" readonly="readonly" /></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right" valign="top">　</td>
            <td height="30" colspan="2"><iframe src="smallimg/upload6.asp" name="Upload" width="100%" height="30" scrolling="No" frameborder="0" id="Upload"></iframe></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td align="right" valign="top">公司简介:</td>
            <td colspan="2"><textarea name="gsexplain" cols="55" rows="8" id="gsexplain"><%if 	rs("gsinfo")<>"" then response.Write toText(rs("gsinfo"))%>
</textarea>
                <font color="#FF0000"> *</font></td>
          </tr>
          

          <tr bgcolor="#FFFFFF"> 
            <td align="right" valign="top">评估师头像:</td>
            <td colspan="2" valign="top"> 
              <input name="pgimg" type="text" id="img1" value="<%=rs("pgimg")%>" size="30" maxlength="255" readonly="readonly" /></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align="right" valign="top">&nbsp;</td>
            <td height="30" colspan="2"><iframe src="smallimg/upload8.asp" name="Upload" width="100%" height="30" scrolling="No" frameborder="0" id="Upload"></iframe></td>
          </tr>
		  <tr bgcolor="#FFFFFF">
		  	<td align="right" valign="top">&nbsp;</td>
		    <td colspan="2">&nbsp;</td>
		  </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="3" align="right" valign="top"> 
              <div align="center"> 
                <input type="submit" name="Submit2" value="确定提交" class="an" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                <input type="reset" name="Submit" value="重新填写" class="an" />
                <font color="#FF0000">*红星号的必须填写！</font><font color="#FF3300"></font></div></td>
          </tr>
        </form>
</table>
	  </td>
    </tr>
    
    <tr>
      <td colspan="2"><!--#include file="model_bottom.asp"--></td>
    </tr>
  </table>
</div>
</body>
</html>
<%
'==========================
'功能：提交信息
function tijiao()
	dim reg
	set reg = new RegExp
	reg.Pattern = "[a-zA-Z]"
	reg.Global  = true
	reg.IgnoreCase = true
	reg.MultiLine = True


	dim strsql
	dim pgimg,gsname,gsaddress,gspost,gslinkman,gstel,gsmobile,gstran,gsmail,gsexplain

	if session("ifpinggushi") = "yes" then call wrong("您已经是评估师，请勿多次申请！") '在login.asp已经增加了该session

	gsname    = trim(request.Form("gsname"))       '公司名称*
	gsaddress = trim(request.Form("gsaddress"))    '公司地址*
	gspost    = trim(request.Form("gspost"))       '公司邮编
	gslinkman = trim(request.Form("gslinkman"))    '联系人*
	gstel     = trim(request.Form("gstel"))        '公司电话*
	gsmobile  = trim(request.Form("gsmobile"))     '公司手机*
	gstran    = trim(request.Form("gstran"))       '公司传真*
	gsmail    = trim(request.Form("gsmail"))       '公司电子邮箱*
	gsexplain = toHTML(request.Form("gsexplain"))  '公司简述*
	gsImg     = request.Form("gsImg")              '公司照片*
	pgimg 	  = request.Form("pgimg")              '评估师照片
		
	if gsname    = "" then call wrong("请填写您的公司名称！")
	if gsaddress = "" then call wrong("请填写您的联系地址！")
	if gslinkman = "" then call wrong("请填写联系人名字！")
	if gstel     = "" then call wrong("请填写您的公司电话！")
	if gsmobile  = "" then call wrong("请填写您的移动电话！")
	if gstran    = "" then call wrong("请填写您的公司传真！")
	if gsmail    = "" then call wrong("请填写您的电子邮件！")
	if gsexplain = "" then call wrong("请填写您的公司简介！")
	if reg.test(gstel)    = true then call wrong("您输入的公司电话信息有误！")
	if reg.test(gsmobile) = true then call wrong("您输入的移动电话信息有误！")
	if reg.test(gstran)   = true then call wrong("您输入的传真信息有误！")
	if instr(gsmail,"@")  = 0 or instr(gsmail,".") = 0 then call wrong("您输入的电子邮件信息有误！")

    strsql = "select * from member where id="& session("userId23") &" order by id desc"
    rs.open strsql,conn,1,3

	   rs("gsname")   = gsname
	   rs("gslianxi") = gsaddress
	   rs("gscode")   = gspost
	   rs("gsren")    = gslinkman
	   rs("gstel")    = gstel
	   rs("gsmobil")  = gsmobile
	   rs("gsfex")    = gstran
	   rs("gsemail")  = gsmail
	   rs("gsinfo")   = toHTML(gsexplain)	   	 
	   rs("gsimg")    = gsImg
	   'rs("ifchehang") = "0"
	   rs("pgimg")  = pgimg	   
	   
	   if request.QueryString("sq")="yes" then  
		   rs("ifpinggushi") = "-1"		   
	   elseif	request.QueryString("modify")="yes" then 
		    rs("ifpinggushi") = "1"	  
	   end if 	   
	   
	 rs.update
	 rs.close
	 
	 if request.QueryString("modify")="yes" then
		 call tiaozhuan("修改成功！","user_main.asp")
	 else
		 call tiaozhuan("申请提交成功，等待管理员审核！","user_main.asp")
	 end if
end function
%>