<%@ page language="C#" autoeventwireup="true" inherits="se.WebAdmin_SearchKeyList, LebiMall" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>关键字管理</title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/checked.js"></script>
     <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/tipswindown.js" type="text/javascript"></script>
    <script src="js/topHead.js" type="text/javascript"></script>
    <script type="text/javascript">
        var page='<%=page %>';
        function update(i,id_){
            var txtname=document.getElementById('txt_name'+i).value;
            var txturl=document.getElementById('txt_url'+i).value;
            var txtsort=document.getElementById('txt_sort'+i).value;
            var txttype=document.getElementById('type_'+i).value;
            
            window.location.href="SearchKeym.aspx?txt_name="+escape(txtname)+"&txt_url="+escape(txturl)+"&txt_sort="+escape(txtsort)+"&txt_type="+escape(txttype)+"&id="+id_+"&type=update&page="+page;
        }
        function del(id){
            if (confirm("确认要删除？")) {
                window.location.href="SearchKeym.aspx?id="+id+"&type=del&page="+page;
            }
        }
        function updates(){
            document.getElementById("form1").submit();
        }
        function dels(){
            var form =document.forms[0];
            var strid="";
            if (confirm("确认要删除？")) {
                for(i=0;i<form.elements.length;i++)
                {
                    if(form.elements[i].type=="checkbox")
                    {
                        if(form.elements[i].checked==true){
                            strid+=form.elements[i].value+",";
                        }
                    }
                }
                if(strid!="")
                window.location.href="SearchKeym.aspx?strid="+strid+"&type=dels&page="+page;
            }
        }
        function select(){
            var strkey=document.getElementById("strkey").value;
            var type=document.getElementById("Select1").value;
            window.location.href="SearchKeyList.aspx?strkey="+escape(strkey)+"&type="+type+"&page=1";
        }
        function SetType(){
            var li=document.getElementById("Select1");
            var st="<%=stype %>";
            for(i=0;i<li.length;i++){
                if(li[i].value==st){
                    li[i].selected=true;
                }
            }
        }
    </script>
</head>
<body onload="SetType()">
<form id="form1" runat="server">
<script>header(6,8,"images/");</script>
   
    <!--面包屑-->
    <div class="blank clearfix"></div>
    
    <!--功能区-->
   <div class="tabmenus mainwidth">
        <ul>
            <li class="current"><a href="SearchKeyList.aspx"><span>关键字管理</span></a></li>
            <li><a href="SearchKeyAdd.aspx"><span>关键字添加</span></a></li>
        </ul>
    </div>
    <div class="tab-mainbody">
        <div class="tab-mainbody2">
        <div class="functionHandleArea clearfix">
             <table cellpadding="0" cellspacing="0"  style="padding:3px 0 3px 4px" >
                        <tr>
                            <td >
                            <select id="Select1" style="width:80px;">
                        <option value="0">属性</option>
                        <option value="1">内链</option>
                        <option value="2">外链</option>
                    </select>          
                    <input type=text class=input id="strkey"  runat="server" /><input type="button" class="btn-search"  title=" 查询 " onclick="location.href='javascript:select()';return false;" align="absmiddle"> 

           </td></tr><tr style="height:30px;"><td>
                 
           <input type="image" title=" 保存 " onclick="updates();return false;" src="images/bt_app.gif" align="absmiddle">
                <input type="image" title=" 删除 " onClick="dels();return false;" src="images/bt_delete.gif" align="absmiddle">
                <input type="image" title=" 添加 " onclick="location.href='SearchKeyAdd.aspx';return false;" src="images/bt_add.gif" align="absmiddle">
                <span id="msg" class="msg2"></span>
            </td></tr></table>
        </div>
        <div id="datalist">
        <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list">
            <tr>
                <th style="width: 5%; cursor:pointer;" title="全选" onclick="AllChecked()">
                    选择</th>
                <th style="width: 30%">
                    名称
                </th>
                <th style="width: 12%">
                    属性    
                </th>
                <th style="width: 28%">
                    链接
                </th>
                <th style="width: 15%">
                    序号
                </th>
                <th style="width: 10%">
                    操作
                </th>
            </tr>
            <%for (int i = 0; i < ds.Tables[0].Rows.Count; i++){%>
            <tr >
                <td > 
                    <input type="checkbox" value="<%=ds.Tables[0].Rows[i]["id"] %>" name="check_" />
                    <input type="hidden" id="hidden_id<%=i %>" name="hidden_id<%=i %>" value="<%=ds.Tables[0].Rows[i]["id"] %>" />
                </td>
                <td >
                    <input type="text" id="txt_name<%=i %>" name="txt_name<%=i %>" value="<%=ds.Tables[0].Rows[i]["sname"] %>"
                                class="input" style="width:300px;"  />
                </td>
                <td >
                    <select id="type_<%=i %>" name="type_<%=i %>" style="font-size:10px; width:60px;">
                        <option value="1" <%if(ds.Tables[0].Rows[i]["stype"].ToString() == "1"){ %> selected <%} %>>内链 </option>
                        <option value="2" <%if(ds.Tables[0].Rows[i]["stype"].ToString() == "2"){ %> selected <%} %>>外链 </option>
                    </select>
                </td>
                <td >
                   <input type="text" id="txt_url<%=i %>" name="txt_url<%=i %>" value="<%=ds.Tables[0].Rows[i]["surl"] %>"
                                class="input" style="width:200px;"  />
                </td>
                <td >
                    <input type="text" id="txt_sort<%=i %>" name="txt_sort<%=i %>" value="<%=ds.Tables[0].Rows[i]["sort"] %>"
                                class="input" style="width:30px;"  />
                </td>
                <td >
                    <a href="javascript:del(<%=ds.Tables[0].Rows[i]["id"] %>)">删除</a>&nbsp;|&nbsp; 
                    <a href="#" onclick="update(<%=i %>,<%=ds.Tables[0].Rows[i]["id"] %>);">修改</a>
                </td>
            </tr>
            <%} %>
            <tr>
                <td colspan="6" class="list-foot">
                    <div style="float: left; padding-top: 3px;">
                    </div>
                    <div id="divAsp" runat="server" style="float: right; padding-top: 3px;">
                        <webdiyer:AspNetPager CssClass="pages" CurrentPageButtonClass="cpb" ID="AspNetPager1"
                            runat="server" RecordCount="228" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页"
                            PrevPageText="上一页" PageSize="20" UrlPaging="True" CustomInfoClass="pages1" CurrentPageButtonPosition="Center" ShowBoxThreshold="50"
                            ShowFirstLast="true" NumericButtonCount="4" BackColor="Transparent" ShowDisabledButtons="False" EnableViewState="False">
                        </webdiyer:AspNetPager>
                    </div>
                </td>
            </tr>
        </table>
        <script type="text/javascript">tdshowm("list");</script>
    </div>
</div></div>
</form>
</body>
</html>
