  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="no"
	dir="no" 


 %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../rolecheck.asp"-->
<link rel="stylesheet" type="text/css" href="../css/style.css">
 <%
 id=request("id")
Set rs= Server.CreateObject("ADODB.Recordset") 
sql="select * from Websen_post where id="&id
rs.open sql,conn,1,3
if not rs.eof then
sd=rs("postname")
%>
<script language="JavaScript" src="../../js/calendar.js"> </script>
<style type="text/css">
<!--
body,td,tr { font-size:12px}
.STYLE2 {font-size: 12px}
-->
 </style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
if not isempty(request("selAnnounce")) then
	idlist=request("selAnnounce")
	if instr(idlist,",")>0 then
		dim idarr
		idArr=split(idlist)
		dim log_id
		for i = 0 to ubound(idarr)
			log_id=clng(idarr(i))
			call deleteannounce(log_id)
		next
	else
		call deleteannounce(clng(idlist))

	end if
end if

'if request("action")="" then
'response.write "<script language='javascript'>"
'response.write "alert('您提交的信息不符合规范！');"
'response.write"javascript:history.back(-1)<'/SCRIPT>"
'response.end
'end if
 action=request("action")
 keywords=replace_text(request.Form("keywords"))
%>
<%
if action="" then
 sql="select * from websen_post order by id desc"
else
sql="select * from websen_post where "
if action="0" then
  	sql=sql&"flag=0"
elseif action="1" then
	sql=sql&"flag=1 "
end if
end if
if keywords<>"" then sql=sql&" and postname like '%"&keywords&"%' order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
msg_per_page=20 '定义每页显示记录条数
%>
<!--#include file="../../inc/headpage.asp"-->
<table width="98%" border="0" cellspacing="0" cellpadding="0"  align=center class="tableBorder">
<tr> 
<th class="tableHeaderText" colspan=2 height=25> 会员供求管理</th>
</tr>
<tr>
<td   colspan=2> <span class="STYLE2"><FONT color="#666666">温馨提示： ①任何的删除操作都是不可逆的，执行删除时请慎重。 
 ②点击品牌信息查看或修改该条供求详细信息。 
③点击公司名查看或者修改用户"企业信息"。</font></span></td>
</tr>
<FORM name=searchForm action="postmanage.asp" method=post>
<tr>
<td width="19%" height=25 class="forumRowHighlight">
  <span class="STYLE2"><B>管理操作选项</B>  </span></td>
<td width="81%" class=forumRowHighlight STYLE2>关键字：<input name="keywords" type="text" value="<%=keyword%>">
&nbsp;类型：
<select name="action">
 <option value="0">待审品牌</option>
 <option value="1">已审品牌</option>
 
</select>
<input type="submit" value="立刻查找" id=submit name=submit> </td>
</tr>
</form><tr><td height="1" bgcolor="#CCCCCC" colspan="2"></td></tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=content_border>
    <tbody>
        <tr>
            <td style="background-position: right 50%; background-image: url(/member/modify/i../mages/bg1.gif);
                background-repeat: repeat-y; background-color: #ffffff" valign="top" align="center"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="content_border">
                    <tr>
                        <td>
                            
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>&nbsp;
                                  </td>
                                    <td>
                                        <font color="#FF0000">
                                            <%
                                                  response.write"<br>"
                                                  if request("action") ="add" then 
                                                  call post()
                                                  end if
                                                  response.write"<br>"
                                            %></font></td>
                                </tr>
                            </table>
                            <form action="edit_save.asp?id=<%=id%>" name="form" method="post">
                            <table border="0" width="100%" cellpadding="4" cellspacing="0" align="center" bgcolor="#4296CE">
                                <tr>
                                    <td align="center">品牌信息</td>
                                </tr>
                            </table>
                            <table width="100%" border="0" align="center" cellpadding="3" cellspacing="2" class="tableBorder">
                                <tr>
                                    <td width="126" align="right" bgcolor="#EFF7FF" class="C">
                                        <font color="#FF0000">*</font> 品牌名称：</td>
                                    <td valign="top" bgcolor="#EEF7FD">
                                  <input name="postname" size="60"  maxlength="50" value="<%=rs("postname")%>">                                  </td>
                                </tr>
                                <tr>
                                    <td width="126" align="right" bgcolor="#EFF7FF" class="C">
                                        英文名称：</td>
                                    <td valign="top" bgcolor="#EEF7FD">
                                  <input name="englishname" size="60" value="<%=rs("englishname")%>" maxlength="50">                                  </td>
                                </tr>
								<tr>
          <td align="right" bgcolor="#F4FBFF" id="adsrc_text">品牌图片地址：</td>
          <td height="17" bgcolor="#EEF7FD">
		  	
        
        <INPUT name=picture type="text" value="<%=rs("logo")%>" size=30>                                               
	  图片或FLASH地址 <input type="checkbox" name="logo" value="1" onClick="shan()">
      <a href="javascript:;" onClick="shan()">我要上传</a>	 </td>   
  </tr>
  <script language="vbscript">
sub shan()
if ss.style.display="" then
ss.style.display="none"
else
ss.style.display=""
end if
end sub
</script>
  <tr id=ss style="display:none">
    <td height="25" align="right" bgcolor="#F4FBFF">上传品牌图片：</td>
    <td bgcolor="#EEF7FD">
	<!----------------------------------------------------文件上传----------------------------------------------->
  <iframe id="d_file" frameborder="0" src="../../inc/upload.asp?tMode=5&istwo=0&utype=guser&guser=<%=rs("user")%>" width="300" height="40" scrolling="no"></iframe>
  <!--------------------------------------------------------------------------->	</td>
  </tr>
                                <tr>
                                    <td width="126" align="right" bgcolor="#EFF7FF" class="C">
                                        相关品牌：</td>
                                    <td valign="top" bgcolor="#EEF7FD">
                                  <input name="postxx" size="60" value="<%=rs("postxx")%>" maxlength="50">                                  </td>
                                </tr>
                                <tr>
                                    <td class="C" bgcolor="#EFF7FF" align="right">
                                        <font color="#ff0000">*</font> 品牌类别：</td>
                                    <td bgcolor="#EEF7FD">
                                      	<select name="p_z_Z_RootCategory" onChange="changeCategory(this)"   > 
                                              <option selected>--请选择行业大类--</option> 
                                        </select> 
                                        <select name="p_z_Z_CategoryId1" maxlength="80"> 
                                              <option value="0" selected>--请选择行业子类--</option> 
                                  </select>                                  </td>
                                </tr>
								<script language = "JavaScript" src = "../../file_ico/file_js.js" type="text/javascript"></script>
                                <tr>
                                    <td align="right" bgcolor="#EFF7FF" class="C">
                                        品牌介绍：<br />
                                        (3000字节)</td>
                                    <td valign="top" bgcolor="#EEF7FD">
                            <textarea name="post_info" cols="60" rows="8"><%=rs("post_info")%></textarea>                                  </td>
                                </tr>
                                <tr>
                                    <td align="right" bgcolor="#EFF7FF" class="C">
                                        加盟条件及流程：<br />
                                        (1000字节)</td>
                                    <td valign="top" bgcolor="#EEF7FD">
                             <textarea name="condition" cols="60" rows="8" ><%=rs("condition")%></textarea>                                  </td>
                                </tr>
                                <script language="JavaScript" src="../../file_ico/file_js.js" type="text/javascript"></script>
                                <tr>
                                    <td width="126" rowspan="2" valign="middle" bgcolor="#EFF7FF" class="C" align="right">
                                        产品图片：</td>
                                    <td width="942" height="14" bgcolor="#EEF7FD">
             <input name="draw" type="text" size="40" maxlength="48" onClick="lookmagic(1)" id="magicfacepic(1)" readonly value="<%=rs("drawalt")%>">
                                        <font onclick="lookmagic(1)" style="cursor: hand">选择图片</font>&nbsp;
                                        <a href="javascript:win=window.open('../../member/myfiles.asp','contact','left=100,top=100,width=650,height=500,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');win.focus();">统一上传图片</a>&nbsp;
                                        <div id="magicframe(1)" style="visibility: hidden; position: absolute; width: 10;
                                            left: 2px; top: 479px;">
                                            <iframe src="../../member/inc_file.asp?action=1&usename=<%=rs("username")%>" width="380" height="260" frameborder="0" scrolling="no">
                                            </iframe>
                                        </div>
                                  </td>
                                </tr>
                                <tr>
                                    <td height="14">
                                        <span class="C">(为了你网页不变形,图片最大尺寸请在<span style="color: red;">650*650</span>之内)</span></td>
                                </tr>
                                <input type='hidden' name='p_z_Z_Picsample' value="">
                                <input type="hidden" value="0" name="picsample_0">
                                
                            </table>
                            <br>
                            <table border="0" width="100%" cellpadding="4" cellspacing="0" align="center" bgcolor="#4296CE"
                                style="border-bottom: #E7E7E7 5 solid;">
                                <tr>
                                    <td width="180" align="center" class="M">
                                        <font color="#ffffff">联系资料</font></td>
                                    <td bgcolor="#FFFFFF">&nbsp;
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#f6f6f6" colspan="2">
                                    </td>
                                </tr>
                            </table>
                            <table width="100%" align="center" bordercolordark="#eeeeee" cellspacing="2" border="0"
                                cellpadding="3">
                                <tr>
                                    <td bgcolor="#EFF7FF" width="180" class="C" align="right">
                                        <font color="#FF0000">*</font> 联系人：</td>
                                    <td bgcolor="#ffffde" valign="top">
                         <input name="linkman" size="30" value="<%=rs("linkman")%>"maxlength="16">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        公司名称：</td>
                                    <td bgcolor="#ffffde" valign="top">
                         <input name="company" value="<%=rs("company")%>" size="45" maxlength="50">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        <font color="#FF0000">*</font> 国家或地区：</td>
                                    <td bgcolor="#ffffde" valign="top">
                                        <select style="width: 90px" onChange="javascript:changeCountry1(this);" name="country1">
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        省/州：</td>
                                    <td bgcolor="#ffffde" valign="top">
                                        <select name="province" style="width: 60px" onChange="changeProvince(this);" name="province">
                                            <option value="" selected>省份</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        城 市：</td>
                                    <td bgcolor="#ffffde" valign="top">
                                        <select name="city">
                                            <option value="" selected>地级城市</option>
                                        </select>

                                        <script language="javascript" src="../../js/area1.js" purpose="INITIALIZER"></script>

                                        <script language="javascript">
<!--
    //设置国家1的缺省值
    for (var i=0;i<5;i++){
	    if (country1form.options[i].value == '<%=Replace_Text(request.form("country1"))%>'){
		    country1form.options[i].selected=true;
		}
	}

    for (var i=0;i<catArr1.length;i++) {
		catform.options[i+1]=new Option(catArr1[i].title,catArr1[i].id);
		//设置省选择框的选择值
		if(catform.options[i+1].value == '<%=Replace_Text(request.form("province"))%>'){
	        	catform.options[i+1].selected=true;
	        }
	}
	changeProvince(catform);
	var len = boardform.options.length;
	for (var i=0;i<len;i++) {
		//设置城市选择框的选择值
		if(boardform.options[i].value == '<%=Replace_Text(request.form("city"))%>') {
		    boardform.options[i].selected=true;
		}
	}

-->
                                        </script>

                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        <font color="#FF0000">*</font> 联系地址：</td>
                                    <td bgcolor="#ffffde" valign="top">
                               <input name="address" value="<%=rs("address")%>" size="45"  maxlength="50">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        邮 编：</td>
                                    <td valign="top" bgcolor="#ffffde">
                                <input name="code" value="<%=rs("code")%>" size="16" maxlength="16">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        <font color="#FF0000">*</font> 固定电话：</td>
                                    <td valign="top" bgcolor="#ffffde">
                                 <input name="phone" size="30" value="<%=rs("phone")%>" maxlength="32">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        传 真：</td>
                                    <td valign="top" bgcolor="#ffffde">
                                  <input name="fax" value="<%=rs("fax")%>" size="30" maxlength="32">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        移动电话：</td>
                                    <td bgcolor="#ffffde" valign="top">
                                 <input name="mobile" size="30" maxlength="32" value="<%=rs("mobile")%>">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        电子邮件：</td>
                                    <td bgcolor="#ffffde" valign="top">
                                  <input name="email" size="45"  maxlength="50" value="<%=rs("email")%>">
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#EFF7FF" class="C" align="right">
                                        网 址：</td>
                                    <td bgcolor="#ffffde" valign="top">
                             <input name="homepage" value="<%=rs("web")%>" size="45"  maxlength="50">
                                    </td>
                                </tr>
                            </table>
                            <br>
                            <table width="100%" align="center">
                                <tr>
                                    <td align="center" height="50">
                                        <input type="submit" value="确定修改！" name="Post" class="C">
										<input type="hidden" name="postid" value="<%=id%>">
                                    </td>
                                </tr>
                            </table>
                          </form>
                      </td>
                    </tr>
                </table>
                <br>
                <br>
</table>

<%
rs.close
set rs=nothing
end if
%>
<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);
        }
        changeCategory(catForm);
        //设置初始值  vilia wang 2004-3-29日添加
        catid = document.form.catId.value;
         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;                        
                        }                        
                }    
function initRootCategorys(){
	    for (var i=0;i<catArr.length;i++) {
		 catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
	    }
	}  
        //init                
</script>
<script src="../../js/allCategorys.js"></script>
<script>
initRootCategorys(); 
</script>


 <script language="JavaScript">
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" src="../../js/calendar.js"> </script>