\<%@ page language="C#" autoeventwireup="true" inherits="Tjmanage, LebiMall" enableviewstate="false" %>
<%@ 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 runat="server">
    <title><%=model.Title %>-商城推荐</title>
    <meta name="description" content=<%=model.Description %> />
    <meta name="keywords" content=<%=model.Keywords %> />
    <meta name="generator" content="LBMall 3.0.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link href="images/css/css3.css" rel="stylesheet" type="text/css" />
    <link href="images/css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="images/js/shopjs.js"></script>
    <link href="images/css/shopcss.css" rel="stylesheet" type="text/css" />
    <!--[if lte IE 6]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(images/css/ie6.css); /* ]]> */</style><![endif]-->
    <!--[if gte IE 7]><STYLE type=text/css media=screen>@import url(images/css/ie7.css);</STYLE><![endif]-->
    <script type="text/javascript">
        var smax='<%=smax %>';
        function getHidden_value(id){
            var list=document.getElementsByName("chkItem");
            var hidden_value="";
            var countc=document.getElementById("hidden2").value;
            for(var i=0;i<list.length;i++){
           
                if(list[i].checked){
                    countc++;
                    hidden_value+=list[i].value+",";
                }
            }
            if(hidden_value==""){
                document.getElementById("msgerror").innerHTML="请选择推荐的产品！";
                if(id==0){
                    return true;
                }else{
                    return false;
                }
            }
            if(smax==0){
                document.getElementById("msgerror").innerHTML="您办理的服务不能推荐产品！";
                return false;
            }
            else if(countc>smax){
                document.getElementById("msgerror").innerHTML="您办理的服务只能推荐"+smax+"件产品！";
                return false;
            }
            else
            {
                 document.getElementById("msgerror").innerHTML="";
                 document.getElementById("hidden3").value=countc;
                 document.getElementById("hidden1").value=hidden_value;
                 return true;
            }
        }
        function search2(){
            var texts2=document.getElementById("ser2").value;
            var select_v2=document.getElementById("Select3").value;
            window.location="list.aspx?tid="+select_v2+"&titlec="+escape(texts2);
        }
    </script>

</head>
<body>

     <div id="top-menu02">
        <div id="top-menu">
            <div class="right">
                <script type="text/javascript">indexhead();</script>
            </div>
        </div>
    </div>
    <div id="top">
        <div id="logo">
            <a href="http://<%=Request.Url.Host %><%=model.WebPath %>/">
                <img src="Upload/WebAdminImages/<%=model.Logoimg %>" border="0" /></a></div>
    </div>
    <div id="sp-menu">
        <ul>
            <li><a href="http://<%=Request.Url.Host %><%=model.WebPath %>/">首页</a></li>
            <%for (int i = 0; i < ds_tab.Tables[0].Rows.Count; i++){ %>
            <li><%if (model.Tab == "1"){ %>
                <a href="<%= ds_tab.Tables[0].Rows[i]["tdirname"]%>/" target="_blank"><%= ds_tab.Tables[0].Rows[i]["tname"]%></a>
                <%}else{%>
                <a href="TopTab.aspx?type=<%= ds_tab.Tables[0].Rows[i]["tdirname"]%>" target="_blank"><%= ds_tab.Tables[0].Rows[i]["tname"]%></a>
                <%} %></li>
            <%} %>
            <li><a href="http://<%=Request.Url.Host %><%=model.WebPath %>/News/" target="_blank">资讯</a></li>
        </ul>
        <p>
            <span><a href="ShopCoupon.aspx">优惠券</a></span></p>
    </div>
    <div id="contenter2">
        <div id="contenter">
            <script type="text/javascript">
                shopLeft();
            </script>
            <div class="nav-tabs">
                <ul class="tabs">
                    <li><a href="Recommend.aspx">橱窗推荐</a></li>
                </ul>
                <ul class="tabs">
                    <li class="selected"><a href="Tjmanage.aspx">首页推荐</a></li>
                </ul>
            </div>
            <div id="right">
                <div class="page-title">
                    <a class="back" href="#" onclick="javascript:window.history.back();"><span>返回上一页</span></a>
                    <h2 class="shop clearfix">
                        商城推荐
                    </h2>
                </div>
                <div class="contenter">
                    <form id="Form1" runat="server">
                        <div>
                            <div>
                                已推荐的产品</div>
                            <input type="hidden" runat="server" id="hidden1" name="hidden1"/>
                            <input type="hidden" runat="server" id="hidden2" name="hidden2"/>
                            <input type="hidden" runat="server" id="hidden3" name="hidden3"/>
                            <%if (ds.Tables[0].Rows.Count != 0)
                              {
                                  for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                  { %>
                            <div class="shelve_bg">
                                <div class="shelve_img_pa">
                                    <a href="detail.aspx?cid=<%=ds.Tables[0].Rows[i]["id"] %>">
                                        <img src="Upload/commodity/<%=ds.Tables[0].Rows[i]["cmin_img"] %>" class="shelve_img" /></a></div>
                                <div class="shelve_content_bg">
                                    编号：<%=getStr(ds.Tables[0].Rows[i]["cno"].ToString())%></div>
                                <div class="shelve_content_bg">
                                    名称：<%=getStr(ds.Tables[0].Rows[i]["cname"].ToString())%>&nbsp;&nbsp;&nbsp;</div>
                                <div style="clear: both;">
                                </div>
                            </div>
                            <%}
                          }
                          else
                          {%>
                            <p style="color: #404040;">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您还没有设置商城推荐商品</p>
                            <%} %>
                            <span style="color: Red ;" id="msgerror"></span>
                        </div>
                        <div style="float: left;">
                            <div style="width: 750px; margin-top: 10px;">
                                <div style="float: left;">
                                    推荐</div>
                                <div style="float: right;">
                                    <asp:Button ID="Button1" runat="server" Text="推荐" OnClientClick="return getHidden_value(1);"
                                        OnClick="Button1_Click" />
                                </div>
                            </div>
                            <input type="hidden" runat="server" id="hiddenId" value='' />
                            <div style="clear: both;">
                                <%if (ds.Tables[1].Rows.Count != 0)
                                  { %>
                                <%for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                                  { %>
                                <div class="shelve_bg">
                                    <div class="shelve_img_pa">
                                        <a href="detail.aspx?cid=<%=ds.Tables[1].Rows[i]["id"] %>">
                                            <img src="Upload/commodity/<%=ds.Tables[1].Rows[i]["cmin_img"] %>" class="shelve_img" /></a></div>
                                    <div class="shelve_content_bg">
                                        编号：<%=getStr(ds.Tables[1].Rows[i]["cno"].ToString())%></div>
                                    <div class="shelve_content_bg">
                                        名称：<%=getStr(ds.Tables[1].Rows[i]["cname"].ToString())%></div>
                                    <div class="shelve_content_bg">
                                        是否推荐：<input type="checkbox" value="<%=ds.Tables[1].Rows[i]["id"] %>" name="chkItem" onclick="return getHidden_value(0)";/>
                                    </div>
                                    <div style="clear: both;"></div>
                                </div>
                                <%} %>
                                <%} %>
                                             </div>
                        </div>
                        <div class="fenyes">
                            <webdiyer:AspNetPager CssClass="pages" CurrentPageButtonClass="cpb" ID="AspNetPager1"
                                runat="server" RecordCount="228" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页"
                                PrevPageText="上一页" PageSize="15" onclick='javascript:window.location.href="Tjmanage.aspx?count_sort="+escape(document.getElementById("hidden3").value)+"&list_id="+escape(document.getElementById("hidden1").value);' NumericButtonCount="5" Width="352px" UrlPaging="True">
                            </webdiyer:AspNetPager>
                        </div>
                    </form>
                </div>
            </div>

            <div id="footer">
                <div id="copyright">
                    <div class="search">
                        <div class="search-left">
                            <div class="search-left-title">
                                搜索：</div>
                            <div class="search-left-form">
                                <input type="text" runat="server" id="ser2" size="30" /></div>
                            <div class="search-left-list">
                                <select id="Select3" runat="server">
                                </select>
                            </div>
                            <div class="search-left-button">
                                <img src="images/search-buttom.gif" width="60" height="20" onclick="search2()" /></div>
                        </div>
                        <div class="search-right">
                            <div runat=server id="div_s2"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="copyright" runat="server" id="copr"></div>       
        </div>
    </div>
</body>
</html>
