<!--#include file="Common/inc_usercheck.asp"-->
<!--#include file="Common/Inc_DatConn.asp"-->
<!--#include file="Common/Inc_Function.asp"-->
<!--#include file="ipcode.asp"-->
<%
if changechr(Request("bbaction"))="save" then
id=changechr(Request("id"))
	Dim editinfo
            set editinfo = Server.CreateObject("ADODB.Recordset")
			editinfo.Open "Dat_Information Where MemberKey="&Session("intMemberKey")&" and InfoKey = "&id,Conn,3,3
	editinfo("InfoAdd") = changechr(Request.Form("sheng"))
	editinfo("smalldq") = changechr(Request.Form("shi"))
			editinfo("InfoClass") = changechr(Request.Form("InfoClass"))
			editinfo("Topic") = changechr(Request.Form("Topic"))
			editinfo("Content") =Request.Form("Content")
			editinfo("ContactMan") = changechr(Request.Form("ContactMan"))
			editinfo("CompanyName") = changechr(Request.Form("CompanyName"))
			editinfo("Add") = changechr(Request.Form("Add"))
			editinfo("Postalcode") = changechr(Request.Form("Postalcode"))
			editinfo("Tel") = changechr(Request.Form("Tel"))
			editinfo("qq") = changechr(Request.Form("qq"))
			editinfo("Homepage") = changechr(Request.Form("Homepage"))
			editinfo("Email") = changechr(Request.Form("Email"))
			editinfo("dl") = changechr(Request.Form("BigClassName"))
	editinfo("xl") = changechr(Request.Form("SmallClassName"))
		editinfo("jg") = changechr(Request.Form("jg"))
	editinfo("pic") =replace(UCase(Request.Form("pic")),gqwebdir&"UPLOAD","Upload")
	editinfo("UploadFiles") =replace(UCase(Request.Form("UploadFiles")),gqwebdir&"UPLOAD","Upload")
	editinfo("State") = 0

			editinfo.Update
			editinfo.Close
			set editinfo = nothing
Response.write("<script>alert(""修改成功"");location.href=""me.asp"";</script>")
Response.end
end if
set rss=server.createobject("adodb.recordset")
sqls = "select * from SmallClass order by sj desc"
rss.open sqls,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rss.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rss("id"))%>","<%=trim(rss("dl"))%>","<%= trim(rss("smallclassname"))%>");
        <%
        count = count + 1
        rss.movenext
        loop
        rss.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.editinfo.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.editinfo.SmallClassName.options[document.editinfo.SmallClassName.length] = new Option(subcat[i][2], subcat[i][0]);
            }        
        }
    }    

</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户中心 - <% =strSiteName%></title>
<meta name="Keywords" content="重庆信息网" />
<meta name="Description" content="重庆信息网" />
<link href="imger/css.css" type="text/css" rel="stylesheet">
<style type="text/css">
<!--
.STYLE11 {
	color: #FF0000;
	font-size: 14px;
}
.STYLE12 {font-size: 14px}
-->
</style>
<script language="javascript">
<!--
function IsDigit(){
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
// -->
</script>
<script language="javascript">
//检查email的合法性
function checkemail(inputstr){
	if(inputstr.indexOf('@') != -1 && inputstr.indexOf('.')!= -1)
		return true;
	else 
   		return false;	
}
//检验表单的合法性
function editinfoForm() {
	if (document.editinfo.sheng.value == "0") {
		alert("\请选择信息面向的地区！");
		document.editinfo.InfoAdd.focus();
	}
	else if (document.editinfo.Topic.value == "") {
		alert("\请填写信息主题！");
		document.editinfo.Topic.focus();
	}
	else if (document.editinfo.Content.value == "") {
		alert("\请填写信息内容！");
		document.editinfo.Content.focus();
	}
	<%if strhylx<>1 then%>
	else if (document.editinfo.ContactMan.value == "") {
		alert("\请填写联系人！");
		document.editinfo.ContactMan.focus();
	}
	<%end if%>
	else if (document.editinfo.Tel.value == "") {
		alert("\请填写联系电话！");
		document.editinfo.Tel.focus();
	}
		else if (document.editinfo.Email.value == "") {
		alert("\请填写联系 E-Mail！");
		document.editinfo.Email.focus();
	}
	else if (document.editinfo.Email.value == "" || !checkemail(document.editinfo.Email.value)) {
		alert("\E-Mail 填写错误，请填写有效的信箱！");
		document.editinfo.Email.focus();
	}
	else {
        return true;
    }
    return false;
}
</script>
<%
			Dim inff
			Dim rsd
			Dim sql

			inff=changechr(Request("Id"))
			set rsd = Server.CreateObject("ADODB.Recordset")
						sql = "Select * From Dat_Information Where infoKey = "&inff
						rsd.Open sql,Conn,1,1
							if rsd.eof and rsd.bof  then 
		response.write "<script>alert('对不起，该信息并不存在，请返回！');window.close();</Script>"
		response.end
	else
if rsd("MemberKey")=Session("intMemberKey") then%>
</head>
<body>
<!--#include file="head.asp"-->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="f2f2f2">
  <tr>
    <td width="26%" valign="top"><table width="100%" border="0" cellpadding="9" cellspacing="1" bgcolor="#e6e6e6">
        <tr>
          <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><img src="imger/user.gif" width="172" height="37"></td>
            </tr>
            <tr>
              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
			  <tr>
			    <td width="100%" height="23" class="F16"><span class="STYLE11">·</span><a href="add.asp"><span class="STYLE2">信息发布</span></a></td>
			  </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
			  <tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="me.asp"><span class="STYLE2">信息管理</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
			  <tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="edit_user.asp"><span class="STYLE2">资料维护</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
						<tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="Feedback.asp"><span class="STYLE2">留言反馈</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
						<tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="sjgj.asp"><span class="STYLE2">会员升级</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
						<tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="logout.asp"><span class="STYLE2">安全退出</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
                  </table></td>
            </tr>
          </table></td>
        </tr>
      </table>
    </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#e6e6e6">
      <tr>
        <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="10" cellpadding="0">
          <tr>
            <td height="24" background="imger/09.gif"><span class="STYLE6">≡</span> <span class="STYLE2"><b>您的位置：</b></span><span class="STYLE4">首页 &gt;&gt; 会员中心</span></td>
          </tr>
          <tr>
            <td><table border="0" cellpadding="0" cellspacing="0" width="99%" height="64">
    <form action="?bbaction=save" name="editinfo" method="POST" OnSubmit="return editinfoForm()">
      <input type="hidden" name="id" size="15" value="<%=inff%>" maxlength="40">
      <tr>
      <td height="25" align="center" colspan="2">
      <font color="#FF0000">[注]信息修改以后将需要重新审核才能显示</font></td>
    </tr>
      <tr>
      <td width="80" height="25" align="right">
      选择分类：</td>
      <td width="273" height="25" align="left"><%
		set rsb=server.createobject("adodb.recordset")
        sqlb = "select * from BigClass order by sj desc"
        rsb.open sqlb,conn,1,1
		if rsb.eof and rsb.bof then
			response.write "请先添加栏目。"
		else
		%>
						<select name="BigClassName" onChange="changelocation(document.editinfo.BigClassName.options[document.editinfo.BigClassName.selectedIndex].value)" size="1">
      <%
		    do while not rsb.eof
		    dim selclass
		    selclass=cstr(rsb("id"))
			%>
                      <option <%if rsd("dl") =selclass then Response.Write "selected" end if%> value="<%=trim(rsb("id"))%>"><%=trim(rsb("BigClassName"))%></option>
                      <%
		        rsb.movenext
    	    loop
		end if
        rsb.close
			%>
                    </select> <select name="SmallClassName">
                      <option value="" selected>不指定小类</option>
                      <%
           set rsss=server.createobject("adodb.recordset")
			sqlss="select * from SmallClass where dl='"&rsd("dl")&"' order by sj desc"
			rsss.open sqlss,conn,1,1
			if not(rsss.eof and rsss.bof) then
				do while not rsss.eof
				xlid=rsss("id")
				%>
                      <option <%if rsd("xl") =cstr(xlid) then Response.Write "selected" end if%> value="<%=rsss("id")%>"><%=rsss("SmallClassName")%></option>
                      <%
			    	rsss.movenext
				loop
			end if
	        rsss.close
			%>
</td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      面向地区：</td>
      <td width="273" height="25" align="left">
      <%
set rs=server.createobject("adodb.recordset")
sql = "select * from fysmallmxdq order by sj desc"
rs.open sql,conn,1,1
%>
<SCRIPT language = "JavaScript">
var onenumdq;
onenumdq=0;
subcat1dq = new Array();
        <%
        numdq = 0
        do while not rs.eof 
        %>
subcat1dq[<%=numdq%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("dl"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        numdq = numdq + 1
        rs.movenext
        loop
        rs.close
        %>
onenumdq=<%=numdq%>;

function changelocation1dq(shengid)
    {
    document.editinfo.shi.length = 0; 

    var shengid=shengid;
    var n;
    for (n=0;n < onenumdq; n++)
        {
            if (subcat1dq[n][1] == shengid)
            { 
                document.editinfo.shi.options[document.editinfo.shi.length] = new Option(subcat1dq[n][0], subcat1dq[n][2]);
            }        
        }
        
    }    
                      </SCRIPT>
                              <%
dim num
sql = "select * from mxdq order by sj desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%>
<SELECT name="sheng" onChange="changelocation1dq(document.editinfo.sheng.options[document.editinfo.sheng.selectedIndex].value)" size="1">
                                <OPTION selected value="0">==省份==</OPTION>
                                <%do while not rs.eof
%>
                                <OPTION value="<%=trim(rs("Name"))%>" <%if rsd("InfoAdd") =""&rs("Name")&"" then Response.Write "selected" end if%>><%=trim(rs("Name"))%></OPTION>
                                <%
        rs.movenext
        loop
	    end if
        rs.close
%>
                              </SELECT>
                              <SELECT name="shi">
                                <OPTION selected value="0">==市地==</OPTION>
                                <%
           set rsss=server.createobject("adodb.recordset")
			sqlss="select * from fysmallmxdq where dl='"&rsd("InfoAdd")&"' order by sj desc"
			rsss.open sqlss,conn,1,1
			if not(rsss.eof and rsss.bof) then
				do while not rsss.eof
				%>
                      <option <%if rsd("smalldq") =""&rsss("SmallClassName")&"" then Response.Write "selected" end if%> value="<%=rsss("smallclassname")%>"><%=rsss("SmallClassName")%></option>
                      <%
			    	rsss.movenext
				loop
			end if
	        rsss.close
			%>
                              </SELECT></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      选择供求：</td>
      <td width="273" height="25" align="left">
      <select size="1" name="InfoClass">
<%call  gqlx(1,rsd("InfoClass"))%>
</select></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      主&nbsp;&nbsp;&nbsp; 题：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="Topic" size="50" maxlength="200" value="<% = rsd("Topic")%>">&nbsp;<font color="#FF0000">**</font></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right" valign="middle">
      相关价格：</td>
      <td height="25" align="left">
						<input type="text" name="jg" size="12" maxlength="8" value="<% = rsd("jg")%>">元(注：0表示面议)</td>
    </tr><tr>
                      <td height="25">详细内容：<br><br>支持HTML<br>换行输入<font color=red>&lt;br&gt;</font><br>空格输入<font color=red>&amp;nbsp;</font></td>                             
                      <td height="25" valign="middle">
						<textarea rows="13" name="Content" cols="50" class="face"><%=replace(rsd("Content"),"{%gqwebdir%}",gqwebdir)%></textarea>&nbsp;<font color="#FF0000">**</font>
</td>
                    </tr>
    <%if rsd("ContactMan")<>"" then%>
    <tr>
      <td width="80" height="25" align="right">
      联 系 人：</td>
      <td width="273" height="25" align="left">
      <input name="ContactMan" type="text" size="20" maxlength="20" value="<% = rsd("ContactMan")%>">&nbsp;<font color="#FF0000">**</font></td>
    </tr><%else%>
    <tr>
      <td width="80" height="25" align="right">
      企业名称：</td>
      <td width="273" height="25" align="left">
      <input name="CompanyName" type="text" size="40" maxlength="200" value="<% = rsd("CompanyName")%>"></td>
    </tr><%end if%>
    <tr>
      <td width="80" height="25" align="right">
      联系地址：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="Add" size="40" maxlength="200" value="<% = rsd("Add")%>">&nbsp;<font color="#FF0000">**</font></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      邮&nbsp;&nbsp;&nbsp;&nbsp;编：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="Postalcode" size="20" maxlength="6" value="<% = rsd("Postalcode")%>"></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      腾讯QQ：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="qq" size="20" value="<% = rsd("qq")%>" ONKEYPRESS="event.returnValue=IsDigit();"></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      电&nbsp;&nbsp;&nbsp;&nbsp;话：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="Tel" size="20" maxlength="20" value="<% = rsd("Tel")%>">&nbsp;<font color="#FF0000">**</font></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      传&nbsp;&nbsp;&nbsp;&nbsp;真：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="Fax" size="20" maxlength="20" value="<% = rsd("Fax")%>"></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      网站网址：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="Homepage" size="20" maxlength="50" value="<% = rsd("Homepage")%>"></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      电子信箱：</td>
      <td width="273" height="25" align="left">
      <input type="text" name="Email" size="20" maxlength="50" value="<% = rsd("Email")%>">&nbsp;<font color="#FF0000">**</font></td>
    </tr>
    <tr>
      <td width="80" height="25" align="right">
      有 效 期：</td>
      <td width="273" height="25" align="left">
              <%
              dim t
        if rsd("InfoDate") = "1" then
			t="&nbsp;一天"
		elseif rsd("InfoDate") = "3" then
			t="&nbsp;三天"
		elseif rsd("InfoDate") = "7" then
			t="&nbsp;一星期"
		elseif rsd("InfoDate") = "15" then
			t="&nbsp;半个月"
		elseif rsd("InfoDate") = "30" then
			t="&nbsp;一个月"
		elseif rsd("InfoDate") = "60" then
			t="&nbsp;两个月"
		elseif rsd("InfoDate") = "90" then
			t="&nbsp;一个季度"
        elseif rsd("InfoDate") = "182" then
			t="&nbsp;半年"
		else
			t="&nbsp;一年"
		end if
        %>
      <input type="text" name="InfoDate" size="20" maxlength="50" value="<% =t%>" readonly="ture"></td>
    </tr>
    <tr>
      <td width="80" height="25" valign="middle" align="right">
      是否推荐：</td>
      <td width="273" height="25" align="left">&nbsp;<%if rsd("tj")=1 then%>是<%else%>否<%end if%>
      　</td>
    </tr>
    <tr>
      <td width="353" height="35" colspan="2">
      <p align="center"><input type="submit" value="提交修改" name="Submit" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重新填写" name="Reset" class="Button">      　</td>
    </tr>
    </form>
  </table></td>
          </tr>
          
        </table></td>
      </tr>
    </table>      </td>
  </tr>
</table>
<!--#include file="boot.asp"-->
</body>
</html><%
end if
end if
rsd.Close
set rsd = nothing%>
