 <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="22"
	dir="../err.asp" 
 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../rolecheck.asp"-->

<SCRIPT language=JavaScript>
function setSubjectText(){
   var keywords = form.keywords.value;
   for(i=0;i<keywords.length;i++){keywords=keywords.replace(',','，');}
    if(form.keywords2.value){
        for(i=0;i<form.keywords2.value.length;i++){form.keywords2.value=form.keywords2.value.replace(',','，');}
        keywords+=','+form.keywords2.value;
    }
    if(form.keywords3.value){
        for(i=0;i<form.keywords3.value.length;i++){form.keywords3.value=form.keywords3.value.replace(',','，');}
        keywords+=','+form.keywords3.value;
    }    
    form.p_z_Z_Keywords.value = keywords

  //  return true;
	document.form.submit()
    }
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 	



</SCRIPT>
<script language = "JavaScript"> 
sall=new Array();
<%
Dim i
i=0
set rs=conn.execute("select * from Yixiang_class_2")
do while not rs.eof
%>
sall[<%=i%>]=new Array("<%=rs("typename")%>","<%=rs("sortid")%>","<%=rs("typeid")%>");
<%
i=i+1
rs.movenext
loop
rs.close
%>
function changeselect(selvalue)  
   { 
      document.form.typeid.length=0;  
      var selvalue=selvalue;
      var i;
      for(i=0;i<sall.length;i++) 
	{
	    if(sall[i][1]==selvalue) 
      		{
  	var newOption1=new Option(sall[i][0],sall[i][2]);
	document.all.typeid.add(newOption1);
		}
	}
}
</script><LINK href="../css/style.css" rel=stylesheet type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<table width="98%" border="0" cellspacing="0" cellpadding="0"  align=center class="tableBorder"> 
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">专项商机管理 </th> 
  </tr> 
  <tr> 
     <td colspan="2"  height="20" ><font color="#666666">温馨提示：①类别直接与发布的信息相关联，删除类别可能会影响到以前发布的专项商机信息。</font></td> 
  </tr> 
  <tr> 
     <td width="12%" height=25 class="forumRowHighlight"> <B>操作选项</B></td> 
     <td width="88%" class="forumRowHighlight"><a href="index.asp">管理专项商机</a> | <a href="add_vipinfo.asp">添加专项商机</a> | <a href="type.asp">管理商机类别</a> | <a href="class_ok.asp?action=add_class_1">添加专项类别</a> | [<a href="javascript:location.reload()">刷新页面</a>]</td> 
  </tr> 
</table>
<%
if Chkrequest(request("vipinfo_id")) then
vipinfo_id=request("vipinfo_id")
else
response.Redirect("/login/chklogin.asp?login=4")
response.end
end if
sql="select * from Yixiang_vipinfo where vipinfo_id="&vipinfo_id&""
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof then 
response.Redirect("index.asp")
response.end
else

sid=rs("sortid")
tid=rs("typeid")
tid2=rs("typeid_2")
set rs3=conn.execute("select Yixiang_class_2.*,Yixiang_class_1.sort,Yixiang_class_1.sortid as aaaa from Yixiang_class_2,Yixiang_class_1 where Yixiang_class_2.typeid="&rs("typeid")&" and Yixiang_class_1.sortid=Yixiang_class_2.sortid")
 %>


  <TABLE width=100% 
border=0 align="center" cellPadding=0 cellSpacing=0 class="tableBorder">
    <TBODY>
       <FORM method="post" action="Save_Edit.asp" Name="form" >
<input type="hidden" name="vipinfo_id" value="<%=vipinfo_id%>"> <TR>
          <TD align=middle>
	  <table border="0" width="100%" cellspacing="1"> 
                          <tr> 
                            <td width="15%" class=forumRow>信息主题：</td> 
                            <td width="85%" class=forumRow> <input name="showname" type="text" style="border-style: solid; border-width: 1" value="<%=rs("vipshowname")%>" size="45" maxlength="20"> 
                              <font color="#CC3300"> * </font>                              </td> 
                          </tr> 
                          
                          <tr>
                            <td class=forumRow>是否推荐：</td>
                            <td width="85%" class=forumRow><%if rs("tjhome")="0" then%><input type="checkbox" name="checkbox" value="1"><%else%><input name="checkbox" type="checkbox" value="1" checked><%end if%></td>
                          </tr> 
                          
                          <tr> 
                            <td width="15%" class=forumRow>有 效 期：</td> 
                            <td width="85%" class=forumRow> <select size="1" name="period" class="f11" style="border-style: solid; border-width: 1"> 
<option value="一周" <% if rs("vipperiod")="一周" then %> selected <% end if %>>一周</option>
<option value="半月" <% if rs("vipperiod")="半月" then %> selected <% end if %>>半月</option>
<option value="一个月" <% if rs("vipperiod")="一个月" then %> selected <% end if %>>一个月</option>
<option value="三个月" <% if rs("vipperiod")="三个月" then %> selected <% end if %>>三个月</option>
<option value="六个月" <% if rs("vipperiod")="六个月" then %> selected <% end if %>>六个月</option>
<option value="一年" <% if rs("vipperiod")="一年" then %> selected <% end if %>>一年</option>
<option value="长期" <% if rs("vipperiod")="长期" then %> selected <% end if %>>长期</option>
</select> 
                              <font color="#CC3300"> *</font></td> 
                          </tr> 
						  <tr> 
                            <td width="15%" class=forumRow>价格说明：</td> 
                            <td width="85%" class=forumRow> <input name="jgsm" type="text" style="border-style: solid; border-width: 1" value="<%=rs("vippricetems")%>" size="20"> 
                              <font color="#CC3300"> *</font></td> 
                          </tr>
						  <tr> 
                            <td width="15%" class=forumRow>交易类别：</td> 
                            <td width="85%" class=forumRow> 
 <select name="type" size="1"> 
 <%
set rs1=conn.execute("select * from Yixiang_vipinfo_class")
do while not rs1.eof
%>
<option  value='<%=rs1("typeid")%>'  <%if rs1("typeid")=cint(rs("viptype")) then response.Write("selected") end if%>><%=rs1("type")%></option> 
<%
rs1.movenext
loop
rs1.close
%>
</select> 
                              <font color="#CC3300"> *</font></td> 
                          </tr> 
						   <tr> 
                            <td class=forumRow>上传图片：</td> 
                            <td class=forumRow>  
														 <!----------------------------------------------------文件上传----------------------------------------------->
  <iframe id="d_file" frameborder="0" src="../../inc/upload.asp?tMode=8&istwo=0&utype=vipinfo" width="300" height="40" scrolling="no"></iframe>
  <!--------------------------------------------------------------------------->
				<br />  <input type="hidden" name="picture" size="50" value="<%=rs("Picture")%>">
				<input type="hidden" name="oldpic" value="<%=rs("Picture")%>"  size="50"/>
                          <br>
                         <input type="radio" name="cimg" value="1" checked> <b><font color="red">▲</font></b>使用原有图片
                          | <input type="radio" name="cimg" value="2"><b><font color="red">◆</font></b>删除原有图片使用重新上传的图片
                          </td> 
                          </tr>
						  <tr> 
                            <td class=forumRow>所属网站行业类别：</td> 
                            <td class=forumRow>	
	<div style=" float:left; width:120px;">
	<SELECT id=topCatFormKey 
                  style="WIDTH: 120px" onchange=onChangeTopCategory() size=8 
                  name=topCatFormKey>
    </SELECT>
	</div> 
	<div style=" float:left; width:120px;display:<%if sad<1 or sad=1 then%>none<%end if%>;">
    <SELECT id=secondCatFormKey 
                  style="WIDTH: 120px" onchange=onChangeSecondCategory() size=8 
                  name=secondCatFormKey>
    </SELECT> 
	</div>
	
	<div style="width:120px;display:<%if sad<2 or sad=2 then%>none<%end if%>;">
    <SELECT id=leafCatFormKey 
                  style="WIDTH: 120px" onchange=onChangeLeafCategory() size=8 
                  name=leafCatFormKey>
    </SELECT>
	</div>
	 <input name="topCatFormKeyValue" type="hidden" id="topCatFormKeyValue" value="<%=sid%>">
	  <input name="secondCatFormKeyValue" type="hidden" id="secondCatFormKeyValue" value="<%=tid%>">
	  <input name="leafCatFormKeyValue" type="hidden" id="leafCatFormKeyValue" value="<%=tid2%>">
<SCRIPT language=JavaScript src="<%=HOPE_InstallDir%>js/changehope.js"></SCRIPT>
<SCRIPT language=JavaScript src="<%=HOPE_InstallDir%>js/allCategorys.js"></SCRIPT>
<SCRIPT language=JavaScript>
//调用initTopCategoryForm函数向列表中加入数据
initTopCategoryForm();
</SCRIPT>
                              *</font>
</td> 
                          </tr> 
                          <tr> 
                            <td class=forumRow>关 键 字：</td>
                            <td width="85%" class=forumRow><%
				keywords=rs("keywords")
				if keywords<>"" then
				  if instr(keywords,",")>0 then
				     kwarry=split(keywords,",")
					 if ubound(kwarry)=1 then
				           response.write"<INPUT maxLength=8 size=20 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=20 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=20 name=keywords3>"
				           elseif ubound(kwarry)=2 then
				           response.write"<INPUT maxLength=8 size=20 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=20 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=20 value='"&kwarry(2)&"' name=keywords3>"
                           elseif ubound(kwarry)>2 then
				           response.write"<INPUT maxLength=8 size=20 value='"&kwarry(0)&"' name=keywords>, <INPUT maxLength=8 size=20 value='"&kwarry(1)&"' name=keywords2>, <INPUT maxLength=8 size=20 value='"&kwarry(2)&"' name=keywords3>"
                     end if
				  else
				  response.write"<INPUT maxLength=8 size=10 value='"&keywords&"' name=keywords>, <INPUT maxLength=8 size=10 name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
                  end if
				else
				response.write"<INPUT maxLength=8 size=10 name=keywords>, <INPUT maxLength=8 size=10 name=keywords2>, <INPUT maxLength=8 size=10 name=keywords3>"
				end if
				%>
                           <INPUT type=hidden    name=p_z_Z_Keywords> </td> 
                          </tr> 
                         
                          <tr>
                            <td class=forumRow>信息内容：</td>
                            <td class=forumRow>
							
							
							
							
							
							
							<textarea rows="10" cols="80" name="content" style="display:none" id="conter"><%=rs("vipcontent")%></textarea>
							
							<iframe ID="eWebEditor1" src="../../editor/ewebeditor.asp?id=content&style=standard&originalfilename=d_originalfilename &savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="617" HEIGHT="450"></iframe>
							
							
							
                              <a href="javascript:admin_Size(-5,'conter')"><img src="../images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:admin_Size(5,'conter')"><img src="../images/plus.gif" unselectable="on" border='0'></a>
							</td>
                          </tr> 
						  
      </table></td>
    </tr>
	  <tr>
      <th height=23 align=left>联系信息</th>
    </tr>
	<tr>
      <td><table width="100%" height="121" border="0" cellpadding="2" cellspacing="1" bordercolor="#111111" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" id="AutoNumber1" style="border-collapse: collapse">
<tr>
<td width="15%" valign="top" height="22" class=forumRow>
<p align="right">联 系 人：</td>
<td width="34%" valign="top" height="22" class=forumRow>
<input name="linkman" type="text" class="f11" value="<%=rs("lxr")%>" size="21" maxlength="20">
<font color="#CC3300"> 
*</font></td>
<td width="16%" valign="top" height="22" class=forumRow>
<p align="right">联系电话：</td>
<td width="35%" valign="top" height="22" class=forumRow>
<input name="phone" type="text" value="<%=rs("phone")%>" size="21" maxlength="15" >
<font color="#CC3300"> 
*</font></td>
</tr>
<tr>
<td width="15%" valign="top" height="19" class=forumRow>
<p align="right">公司名称：</td>
<td width="34%" valign="top" height="19" class=forumRow><input name="company" type="text" value="<%=rs("gsmc")%>" size="21" maxlength="20" /></td>
<td width="16%" valign="top" height="19" class=forumRow>
<p align="right">联系地址：</td>
<td width="35%" valign="top" height="19" class=forumRow>
<input name="address" type="text" value="<%=rs("gsdz")%>" size="21" maxlength="50">
<font color="#CC3300"> 
*</font></td>
</tr>
<tr>
<td width="15%" valign="top" height="22" class=forumRow>
<p align="right">所在区域：</td>
<td width="34%" valign="top" height="22" class=forumRow><input name="country" type="text" value="<%=rs("country")%>" size="21" maxlength="20" />
  <font color="#CC3300"> 
*</font></td>
<td width="16%" valign="top" height="22" class=forumRow>
<p align="right">所属城镇：</td>
<td width="35%" valign="top" height="22" class=forumRow>
<input name="city" type="text" value="<%=rs("city")%>" size="21" maxlength="20">
<font color="#CC3300"> 
*</font></td>
</tr>
<tr>
<td width="15%" valign="top" height="19" class=forumRow>
<p align="right">电子邮件：</td>
<td width="34%" valign="top" height="19" class=forumRow>
<input name="email" type="text" value="<%=rs("email")%>" size="21" maxlength="30">
<font color="#CC3300"> 
*</font></td>
<td width="16%" valign="top" height="19" class=forumRow>
<p align="right">邮政编码：</td>
<td width="35%" valign="top" height="19" class=forumRow><input name="postcode" type="text" value="<%=rs("post")%>" size="16" maxlength="10"> 
<font color="#CC3300">&nbsp;</font></td>
</tr>
<tr>
<td width="15%" valign="top" height="19" class=forumRow>
<p align="right">公司传真：</td>
<td width="34%" valign="top" height="19" class=forumRow>
<input name="fax" type="text" value="<%=rs("fax")%>" size="21" maxlength="15"></td>
<td width="16%" valign="top" height="19" class=forumRow>
<p align="right">公司网址：</td>
<td width="35%" valign="top" height="19" class=forumRow>
<input name="web" type="text" value="<%=rs("weburl")%>" size="21" maxlength="20" ></td>
</tr>
</table></td>
	</tr>
	<tr>
      <td class="forumRow">
	  <TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
              <TBODY>
              <TR>
  <TD height="30" align=center noWrap><INPUT class=subbutton style="WIDTH: 160px" onclick=javascript:setSubjectText() type=button value=一切完成，确定修改！ name=Post>        </TD></TR></TBODY></TABLE></td></tr></form></table><Br>
				
            
        </TD>
      </TR></TBODY></TABLE>


<script>

        //category methods
        function Category(id,title) {
                this.id = id;
                this.title=title;
                this.boardlist=new Array();
                this.addBoard=addBoard;
                this.getOptions = getOptions;
        }        
        
        function addBoard(board) {
                this.boardlist = this.boardlist.concat(board);
        }
        
        function getOptions() {
                var tmp = new Array();
                for(var i=0; i < this.boardlist.length;i++) {
                        var b = this.boardlist[i];
                        tmp[i]= b.getOption();
                }
                return tmp;
        }
        
        //board methods
        function Board(catid,id,title,total) {                
                this.catid=catid;
                this.id=id;
                this.title=title;
                this.getOption=getOption;
        }
                
        function getOption() {
                return new Option(this.title,this.id);                
        }
                
        function changeCategory(list) {
        if (list.selectedIndex<=0) {
                catForm.options[0].selected=true;
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                                        
         }
        else {
                var boards = catArr[list.selectedIndex-1].getOptions();
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                
                for (var i=0;i<boards.length;i++) {
                        boardForm.options[i+1]=boards[i];
                }
                }
                boardForm.options[0].selected=true;
        }
                
        function selectBoard(catid,bid,list) {
                var isExist = false; //是否是叶子类目
                for(var i=0;i<catForm.length;i++) {
                        if (catForm.options[i].value==catid) {
                                //alert("get Category");
                                catForm.options[i].selected=true;
                                changeCategory(catForm);
                                break;                        
                        }                        
                }                                
                for(var i=0;i<boardForm.length;i++) {
                        if (boardForm.options[i].value==bid) {
                                //alert("get Board");
                                boardForm.options[i].selected=true;  
                                isExist = true;                              
                                break;
                        }                        
                }   
                
                if (!isExist) {//如果是二级类目，则下拉框只显示该二级类目下所有类目                   
                    var boards = catArr[catForm.selectedIndex-1].getOptions();
                    var len = boardForm.options.length;
                    for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                    }     
                    var locate = 1;           
                    for (var i=0;i<boards.length;i++) {                                                              
                        if(boards[i].text.indexOf(bid) == 0){
                            boardForm.options[locate]=boards[i];
                            locate++;
                        }                                                
                    }
                
                    boardForm.options[0].selected=true;   
                }            
        }        

        //static methods        
        var catArr = new Array();
        var cur;   
		//init catform
        var catForm = document.form.p_z_Z_RootCategory;
        var boardForm = document.form.p_z_Z_CategoryId1;
        
        
        
        function showCategorys() {
            var catId = catForm.value
            if(boardForm.value){
                catId = boardForm.value
            }else if(catForm.value){
                catId = catForm.value
            }
            window.open('/tradeinfo/smalllist.asp?sortid='+catId,'newwin','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500')            
        }
        for (var i=0;i<catArr.length;i++) {
                catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
        }
  
                      function initRootCategorys(){
	    for (var i=0;i<catArr.length;i++) {
		 catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
	    }
	}  
        //init                
</script>
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<!--#include file="../copy.asp" -->