<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla3<>1 then
response.write "<script>alert('操作权限出错，您没有权限操作些功能');history.go(-1);</Script>"
Response.End 
end if%>

<body style="margin:10">
<%=citycss%>
<%sql = "select *  from dlxf_ypxxtwo order by dlxf_date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1%>

<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%count = 0
do while not rs.eof%>
subcat[<%=count%>] = new Array("<%= trim(rs("dlxf_ypxxtwo"))%>","<%= trim(rs("dlxf_ypxxone_id"))%>","<%= trim(rs("dlxf_ypxxtwo_id"))%>");
        <%count = count + 1
        rs.movenext
        loop
        rs.close
        set rs=nothing%>
onecount=<%=count%>;

function changelocation(ypxxone)
    {
    document.addform.ypxxtwo_id.length = 0; 

    var ypxxone_id=ypxxone_id;
    var i;
    document.addform.ypxxtwo_id.options[0] = new Option('请选择小类','');
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == ypxxone)
            { 
                document.addform.ypxxtwo_id.options[document.addform.ypxxtwo_id.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<%sql = "select *  from dlxf_ypaddtwo order by dlxf_date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1%>
<script language = "JavaScript">
var onecount1;
onecount1=0;
subcat1 = new Array();
<%count = 0
do while not rs.eof%>
subcat1[<%=count%>] = new Array("<%= trim(rs("dlxf_addtwo"))%>","<%= trim(rs("dlxf_addone_id"))%>","<%= trim(rs("dlxf_addtwo_id"))%>");
        <%count = count + 1
        rs.movenext
        loop
        rs.close
        set rs=nothing%>
onecount1=<%=count%>;

function changelocation1(addone)
    {
    document.addform.addtwo_id.length = 0; 

    var addone_id=addone_id;
    var i;
    document.addform.addtwo_id.options[0] = new Option('请选择市','');
    for (i=0;i < onecount1; i++)
        {
            if (subcat1[i][1] == addone)
            { 
                document.addform.addtwo_id.options[document.addform.addtwo_id.length] = new Option(subcat1[i][0], subcat1[i][2]);
            }        
        }
        
    }
</script>
<script LANGUAGE=JavaScript>
  function textLimitCheck(thisArea, maxLength){
    if (thisArea.value.length > maxLength){
      alert(maxLength + ' 个字限制. \r超出的将自动去除.');
      thisArea.value = thisArea.value.substring(0, maxLength);
      thisArea.focus();
    }
    /*回写span的值，当前填写文字的数量*/
    messageCount.innerText = thisArea.value.length;
  }
</script>
<script language="JavaScript">
<!--
function checkdata() {
if( addform.scatitle.value =="") {
alert("\商机修改出错，下面是产生错误的可能原因：\n\n·请输入完整的商机标题")
return false;
}
if( addform.sca.value =="" || addform.sca.value.length<20) {
alert("\商机修改出错，下面是产生错误的可能原因：\n\n·请输入不少于20个字符的商机内容")
return false;
}
if( addform.ypxxone_id.value !="") {
if( addform.ypxxtwo_id.value =="") {
alert("\商机修改出错，下面是产生错误的可能原因：\n\n·如果您选择了行业大类，那么其小类必须选择")
return false;
}
}

if( addform.addone_id.value !="") {
if( addform.addtwo_id.value =="") {
alert("\商机修改出错，下面是产生错误的可能原因：\n\n·如果您选择了省，那么其地区必须选择")
return false;
}
}
return true;
}
// -->
</script>
<%sql1="select * from dlxf_sca where dlxf_id="&request("id")
set rs1=server.createobject("adodb.recordset")                     
rs1.open sql1,conn,1,1%>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#6C90D1" bordercolordark="#FFFFFF">
<form name="addform" method="post" action="sca_save.asp" onSubmit="return checkdata()">
<input name="id" type="hidden" value="<%=request("id")%>">

<input name="ypxxone_id_" type="hidden" value="<%=rs1("dlxf_ypxxone_id")%>">
<input name="ypxxtwo_id_" type="hidden" value="<%=rs1("dlxf_ypxxtwo_id")%>">
<input name="addone_id_" type="hidden" value="<%=rs1("dlxf_addone_id")%>">
<input name="addtwo_id_" type="hidden" value="<%=rs1("dlxf_addtwo_id")%>">

<input name="begindate" type="hidden" value="<%=rs1("dlxf_begindate")%>">

<%sql="select * from dlxf_ypxxtwo where dlxf_ypxxtwo_id="&rs1("dlxf_ypxxtwo_id")
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
ypxxone=rs("dlxf_ypxxone")
ypxxtwo=rs("dlxf_ypxxtwo")
rs.close%>
<%sql="select * from dlxf_ypaddtwo where dlxf_addtwo_id="&rs1("dlxf_addtwo_id")
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
addone=rs("dlxf_addone")
addtwo=rs("dlxf_addtwo")
rs.close%>
  <tr>
    <td height=30 align="center" colspan="2"><font color=#666666>带 * 为必填项</font></td>
  </tr>
  <tr>
    <td width="21%" height=30 align=right><font color=red>*</font>商机标题： &nbsp;</td>
	<td width="79%">　<input name="scatitle" type="text" size="35" maxlength="15" value="<%=replace(rs1("dlxf_scatitle"),"""","“")%>"> <font color=#666666>限15个字符</font></td>
  </tr>
  <tr>
    <td height=30 align=right><font color=red>*</font>商机内容： &nbsp;</td>
	<td><p style="line-height:180%">　<textarea name="sca" cols=80 rows=20 onkeyUp="textLimitCheck(this, 2000);" style="display:none"><%=rs1("dlxf_sca")%></textarea><IFRAME ID="eWebEditor1" src="../../oledit/ewebeditor.asp?id=sca&style=s_light" frameborder="0" scrolling="no" width="550" height="350"></IFRAME><br><font color=#666666>　限 20-2000 个字符  已输入 <font color="#CC0000"><span id="messageCount">0</span></font> 个字</font></td>
  </tr>
  <tr>
    <td height=30 align=right>商机分类： &nbsp;</td>
	<td>　<select name="scasort">
<option value=0<%if rs1("dlxf_scasort")=0 then%> selected<%end if%>>不分类</option>
<%sql="select * from dlxf_scasort order by dlxf_date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof%>
<option value="<%=rs("dlxf_id")%>"<%if rs1("dlxf_scasort")=rs("dlxf_id") then%> selected<%end if%>><%=rs("dlxf_scasort")%></option>
<%rs.movenext
wend
rs.Close()%> 
</select></td>
  </tr>
 
  <tr>
    <td height=50 align=right>选择行业： &nbsp;</td>
	<td><p style="line-height:180%">　<%=ypxxone%> > <%=ypxxtwo%><br>　<select name="ypxxone_id" onChange="changelocation(document.addform.ypxxone_id.options[document.addform.ypxxone_id.selectedIndex].value)">
<option value="" selected>请选择大类</option>
                    <%
sql="select * from dlxf_ypxxone order by dlxf_date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof%>
<option value="<%=rs("dlxf_ypxxone_id")%>"><%=rs("dlxf_ypxxone")%></option>
<%rs.movenext
wend
rs.Close()
%> 
</select>
<select name="ypxxtwo_id">
<option selected value="">请选择小类</option>
</select><br><font color=#666666>　如不选则默认为您上次所选的行业</font></td>
  </tr>
  <tr>
    <td height=50 align=right>选择地区： &nbsp;</td>
	<td><p style="line-height:180%">　<%=addone%> > <%=addtwo%><br>　<select name="addone_id" onChange="changelocation1(document.addform.addone_id.options[document.addform.addone_id.selectedIndex].value)">
<option value="" selected>请选择省</option>
                    <%
sql="select * from dlxf_ypaddone order by dlxf_date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof%>
<option value="<%=rs("dlxf_addone_id")%>"><%=rs("dlxf_addone")%></option>
<%rs.movenext
wend
rs.Close()
%> 
</select>
<select name="addtwo_id">
<option selected value="">请选择市</option>
</select><br><font color=#666666>　如不选则默认为您上次所选的地区</font></td>
  </tr>
  <tr>
    <td height=30 align="center" colspan="2"><input type="submit" name="Submit" value="提 交" class="input1"></td>
  </tr>
</form>
</table>
<%rs1.close%>
<script language="javascript"> 
    changelocation(document.addform.ypxxone_id.options[document.addform.ypxxone_id.selectedIndex].value); 
</script>
<script language="javascript"> 
    changelocation1(document.addform.addone_id.options[document.addform.addone_id.selectedIndex].value); 
</script>