<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_ShopLPlist, 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 %>';
        var pid='<%=pid %>';
        function update(id_,i){
            var txtname=document.getElementById('txt_name'+i).value;
            var txtdmax=document.getElementById('txt_dmax'+i).value;
            var txtsj=document.getElementById('txt_sj'+i).value;
            var txtvipj=document.getElementById('txt_vipj'+i).value;
            var txtsort=document.getElementById('txt_sort'+i).value;
            var txtday=document.getElementById('txt_day'+i).value;
            window.location.href="ShopLPm.aspx?txtname="+escape(txtname)+"&txt_dmax="+txtdmax+"&txt_vipj="+txtvipj+"&txt_sj="+txtsj+"&id="+id_+"&txt_sort="+txtsort+"&txt_day="+txtday+"&type=update&page="+page+"&pid="+pid;
        }
        function del(id){
            if (confirm("确认要删除？")) {
                window.location.href="ShopLPm.aspx?id="+id+"&type=delete&page="+page+"&pid="+pid;
            }
        }
        function updates(){
             var form =document.forms[0];
            var flag=false;
            for(i=0;i<form.elements.length;i++)
            {
                if(form.elements[i].type=="text")
                {
                    if(form.elements[i].value==""){
                        document.getElementById("msg").innerHTML="以下填写不能为空！";
                        flag=false;
                        break;
                    }else{
                        flag=true;
                    }
                }
            }
            if(flag){
                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="ShopLPm.aspx?strid="+strid+"&type=dels&page="+page+"&pid="+pid;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" method="post" action="shoplevellist.aspx">
       <script>header(1,1,"images/");</script>
   
    <!--面包屑-->
    <div class="blank clearfix"></div>
    <div class="tab-mainbody3">
        <div class="tab-mainbody4">
        <div class="functionHandleArea clearfix">
               <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='ShopLPadd.aspx?pid=<%=pid %>';return false;" src="images/bt_add.gif" align="absmiddle">
                <input type="image" title=" 返回 " onclick="location.href='ShopLevellist.aspx';return false;" src="images/bt_bak.gif" align="absmiddle">
                <span id="msg" class="msg2"></span>
        </div>
        <div id="datalist">
                    <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list">
                    <tr>
                        <th style="width: 7%; cursor: pointer;" title="全选" onclick="AllChecked()">
                            选择</th>
                        <th style="width: 20%">
                            价格名称</th>
                        <th style="width: 10%">
                            使用天数
                        </th>
                        <th style="width: 12%">
                            销售价(元)
                        </th>
                        <th style="width: 12%">
                            优惠价(元)
                        </th>
                        <th style="width: 10%">
                            排序
                        </th>
                        <th style="width: 13%">
                            商品上架天数
                        </th>
                        <th style="width:15%">
                            操作
                        </th>
                    </tr>
                    <%for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                      {%>
                    <tr>
                        <td class="row">
                            <input type="checkbox" value="<%=ds.Tables[0].Rows[i]["id"] %>" />
                            <input type="hidden" id="hidden_id<%=i %>" name="hidden_id<%=i %>" value="<%=ds.Tables[0].Rows[i]["id"] %>" />
                        </td>
                        <td class="row">
                            <input type="text" id="txt_name<%=i %>" name="txt_name<%=i %>" value="<%=ds.Tables[0].Rows[i]["Pricename"] %>"
                                class="input" style="width:150px;" />
                        </td>
                        <td class="row">
                            <input type="text" id="txt_dmax<%=i %>" name="txt_dmax<%=i %>" value="<%=ds.Tables[0].Rows[i]["MaxDay"] %>"
                                class="input" style="width:60px;" onblur="value=value.replace(/[^\d]/g,'')"  onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />
                        </td>
                        <td class="row">
                            <input type="text" style="width:100px;" id="txt_sj<%=i %>" name="txt_sj<%=i %>" value="<%=ds.Tables[0].Rows[i]["SellingPrice"] %>"
                                class="input" />
                        </td>
                        <td class="row">
                            <input type="text" style="width:100px;" id="txt_vipj<%=i %>" name="txt_vipj<%=i %>" value="<%=ds.Tables[0].Rows[i]["vipPrice"] %>"
                                class="input" />
                        </td>
                        <td class="row">
                            <input type="text" style="width:60px;" id="txt_sort<%=i %>" name="txt_sort<%=i %>" value="<%=ds.Tables[0].Rows[i]["Lsort"] %>"
                                class="input" onblur="value=value.replace(/[^\d]/g,'')"  onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />
                        </td>
                        <td class="row">
                            <input type="text" style="width:60px;" id="txt_day<%=i %>" name="txt_day<%=i %>" value="<%=ds.Tables[0].Rows[i]["Csjdays"] %>"
                                class="input" onblur="value=value.replace(/[^\d]/g,'')"  onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />
                        </td>
                        <td class="row">
                             <a href="javascript:del(<%=ds.Tables[0].Rows[i]["id"] %>)">
                                删除</a>&nbsp;|&nbsp;<a href="javascript:update(<%=ds.Tables[0].Rows[i]["id"] %>,<%=i %>)">修改</a>
                        </td>
                    </tr>
                    <%} %>
                    <tr>
                    <td colspan="8" 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>
                    </tr>
                </table>
            <script type="text/javascript">tdshowm("list");</script>
        </div></div>
    </div>
    </form>
</body>
</html>
