<%@ Language=VBScript %>
<%
Function CLen(HzStr)
L = len(HzStr)
For n=1 to L
If Asc(mid( HzStr,n,1))<0 Then HzNum = HzNum + 1
Next
Clen = L + HzNum
End Function

If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Instr(1, Request("id"), "'", 1)>0 then
	ef=True
	ec="产品类型有非法字符！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf request.form("subtype")="" And (request.form("zbdwzjtype"&request.form("unit_code"))="" Or request.form("zbdwzjtype"&request.form("unit_code"))="0") Then
'	ef=True
'	ec="主办单位证件类型必须选择！"
ElseIf Request.form("mobile")="" And Request.form("mobileuni")="" And request.form("subtype")=""  Then
'	ef=True
'	ec="移动或联通的手机号必须输入一个！"
elseIf session("canmoneyK")="" Then
	ef=True
	ec="您没有此操作的权限。"
elseif clen(request.form("principal"))>49 then
	ef=True
	ec="内容超长了:"&request.form("principal")
elseif clen(request.form("work_phone"))>49 then
	ef=True
	ec="内容超长了:"&request.form("work_phone")
ElseIf Request.form("subtype")<>"单独保存这部分" And Request.form("work_phone")<>"" And InStr(Request.form("work_phone"),"86-0")<1 then
	ef=True
	ec="办公电话格式不正确！"
ElseIf Request.form("mobileton")<>"" And InStr(Request.form("mobileton"),"86-0")<1 Then
	ef=True
	ec="小灵通格式不正确！"
End if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Host where id='"&Request("id")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="不存在的虚拟主机ID！"
end if
end if

if not ef then
if dsph("beianstatus")="等待审核" then
'	ef=True
'	ec="处于等待审核状态不能修改！"
elseif dsph("beianstatus")="备案成功" then
'	ef=True
'	ec="处于备案成功状态不能修改！"
'空，未录入数据
'用户已录入数据
'管理员录入数据
'管理员已审核'用户需补充数据
'已提交工信部
'备案审核未通过
'备案成功
end if
end if

if not ef Then
dsph("unit")=request.form("unit")
dsph("unit_code")=request.form("unit_code")
dsph("unit_id")=request.form("unit_id")
dsph("investor")=request.form("investor")
dsph("province_code")=request.form("province_code")
dsph("city_code")=request.form("city_code")
dsph("county_code")=request.form("county_code")
dsph("address")=request.form("address")
dsph("principal")=request.form("principal")
dsph("principal_id_type")=request.form("principal_id_type")
dsph("principal_id_num")=request.form("principal_id_num")
dsph("work_phone")=request.form("work_phone")
dsph("mobile")=request.form("mobile")
dsph("email")=request.form("email")
dsph("web_name")=request.form("web_name")
dsph("web_index")=request.form("web_index")
dsph("web_domain")=request.form("web_domain")
dsph("web_ip")=request.form("web_ip")
dsph("working_type")=request.form("working_type")
'if isnull(dsph("beianstatus")) then
'dsph("beianstatus")="管理员录入数据"
'else
dsph("beianstatus")=request.form("beianstatus")
'end if

dsph("ICP_logname")=request.form("ICP_logname")
dsph("ICP_logpass")=request.form("ICP_logpass")
dsph("ICP_SN")=request.form("ICP_SN")

dsph("ISP_ID")=request.form("ISP_ID")
dsph("entertype_ID")=request.form("entertype_ID")
dsph("Serverplace_ID")=request.form("Serverplace_ID")

dsph("isdyIP")=request.form("isdyIP")


dsph("zbdwzjtype")=request.form("zbdwzjtype"&request.form("unit_code"))
dsph("mobileuni")=request.form("mobileuni")
dsph("mobileton")=request.form("mobileton")

dsph.update
dsph.close
set dsph=nothing
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD align="left"><table height="59"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="7" background="img/midtop.gif">&nbsp;</td>
          <td width="90" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="admicp.asp"><font color="#FFFFFF"><strong>备案管理</strong></font></a><a href="admsql.asp"><font color="#FFFFFF"></font></a></td>
          <td width="5" background="img/midtop2.gif">&nbsp;</td>
        </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF">
	 <table width="65%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
	<br>
<DIV class="tableborder">

<br><br>
保存成功。
<br><br>
</div>
	
	</td>
  </tr>
</table> 

      </TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>
<%=htmlwrite("html10")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
