<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!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>
    <title>ProductList</title>
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/Setting.js" type="text/javascript"></script>
    <link href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Content/Site.css" rel="stylesheet"
        type="text/css" />
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/jquery-1.4.1-vsdoc.js"
        type="text/javascript"></script>
    <script src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/Common.js" type="text/javascript"></script>
    <link href="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/messagetipthem1/css/style.css"
        rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/Scripts/MessageTip.js"></script>
    <style type="text/css">
        .picBorder
        {  
            width:160px;
            height:120px; 
            padding:5px;
        }
        .introBorder
        {
            width:430px;
            height:120px; 
            padding:5px;
        }
        .buttonBorder
        {
            border:2px solid #4EB0AE;
            height:22px; 
            width:100px;
            padding-top:5px;
            text-align:center;
            cursor:pointer;
        }
        
        .lineDiv
        {
            height:1px;
            background-color:#4EB0AE;    
        }
        
        .selectDiv
        {
            padding:5px;
            cursor:pointer;
        }
        .selectDivSelected
        {
            padding:5px;
            cursor:pointer;
            color:#ffffff;
            background-color:#4EB0AE;
        }
        .selectDivBottomLine
        {
            border-bottom:1px solid #4EB0AE;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            iframeAutoFit();

            $("#selectTypeTypeID").val($("#SelectType").val());
            $("#PdtName").val($("#SearchStr").val());
            //排序
            var orderType = $("#OrderType").val();
            $("#orderType" + orderType).attr("class", "selectDivSelected");
        });

        function selectType(type) {
            //alert(type);
            $("#ChangeType").val("New");
            $("#SelectType").val(type);
            $("#f1").submit();
        }

        function SearchName() {
            $("#f1").submit();
        }

        function selectOrder(type) {
            $("#OrderType").val(type);
            $("#f1").submit();
        }

        function share(title, url) {
            var shareUrl = "http://v.t.sina.com.cn/share/share.php?title=" + title + "&pic=" + url + "&url=" + url + "&searchPic=false";
            window.open(shareUrl);
        }

        function showAlert() {
            alert("请登录观众中心进行预登记，登录后可享受更多互动功能！");
            window.open("http://prereg.petfairasia.com/PFA/index/index?exhid=1");
        }
    </script>
</head>
<body>
    <div>
        <center>
            <form id="f1" name="f1" method="post" action="">
            <table width="700px" border="0" cellpadding="0" cellspacing="0" style="font-family:Arial">
                <tr>
                    <td style="width:700px" valign="top">
                        <table width="700px" border="0" cellpadding="0" cellspacing="0" style="font-family:Arial">
                            <tr>
                            <td>
                                <table>
                                    <tr>
                                        <td align="left">
                                        <strong><font color="#4EB0AE">欢迎进入InnovAction“宠物新风尚”在线商贸系统</font></strong><br />
                                        <br />
                                        <font color="#4EB0AE">一手信息</font>——第一时间获得各大品牌最新产品<br />
                                        <font color="#4EB0AE">高效观展</font>——助您展前规划好您的参观行程<br />
                                        <font color="#4EB0AE">贸易配对</font>——展前联系您感兴趣展商，促成展中商贸接洽<br />
                                        <font color="#4EB0AE">幸运抽奖</font>——选择您感兴趣的5款新品，赢取小米手机<br />
                                    </td>
                                    <td>
                                        <a href="http://prereg.petfairasia.com/PFA/index/index?exhid=1" target="_blank"><img src="<%=FamousFurnitureExpo.Models.Helper.VRoot %>/DataFile/ExhSettingFiles/<%=Request["ExhID"] %>/pdtshow.jpg" border="0"></a>
                                    </td>
                                    </tr>
                                </table>
                            </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="right">     
                                    <table border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="padding-bottom:3px">
                                                新品搜索：<input id="PdtName" type="text" maxlength="100" size="23" style="width:120px;height:20px" class="text" name="PdtName"/><input type="button" value="搜索" onclick="SearchName();" />&nbsp;&nbsp;&nbsp;&nbsp; 
                                            </td>
                                            <td align="left" style="padding-bottom:3px">
                                                版块选择：
                                            </td>
                                            <td align="left" style="padding-bottom:3px">
                                    <select id="selectTypeTypeID" name="selectTypeTypeID" style="font-family:Arial; font-size: 12px;" onchange="selectType(this.value)">
                                      <option value="">--请选择--</option>  
                                <% 
                                    System.Data.DataTable dtProductType = ViewData["TypeData"] as System.Data.DataTable;
                                    if(dtProductType!=null&&dtProductType.Rows.Count > 0)
                                    {   
                                        foreach (System.Data.DataRow drProductType in dtProductType.Rows)
                                        {
                                            string typID = drProductType["TypID"].ToString();
                                            string typName = drProductType["TypName"].ToString();
                                %>
                                           <option value="<%=typID %>"><%=typName %></option>
                                           <%-- <td><div id="selectType<%=typID %>" class="selectDiv" onclick="selectType(<%=typID %>)"><%=typName %></div></td>--%>
                                <%    
                                        }
                                    }        
                                %>
                                </select>
                                        </td>


                                        </tr>
                                    </table>
                                    
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="right">
                                    <table border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>排序方式：</td>
                                            <td><div id="orderType0" onclick="selectOrder(0);" class="selectDiv">人气最高 TOP 20</div></td>
                                            <td><div id="orderType1" onclick="selectOrder(1);" class="selectDiv">最新更新 TOP 20</div></td>
                                            <td><div id="orderType3" onclick="selectOrder(3);" class="selectDiv">查看所有</div></td>
                                            <%--<td><div onclick="selectOrder(2);" class="selectDiv">最佳推荐</div></td>--%>
                                        </tr>
                                    </table>
                                    <div class="selectDivBottomLine"></div>
                                </td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td align="left">
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <%
                                    System.Data.DataTable dtProduct = ViewData["Data"] as System.Data.DataTable;    
                                    if (dtProduct!=null&&dtProduct.Rows.Count > 0)
                                    {
                                        foreach (System.Data.DataRow dr in dtProduct.Rows)
                                        {
                                            string comID = dr["ComID"].ToString();
                                            string id = dr["ID"].ToString();
                                            string img = FamousFurnitureExpo.Models.Helper.GetWebConfig("ActorImageVRoot") + dr["FilSPath"].ToString().Replace("\\", "/");
                                            string imgBig = FamousFurnitureExpo.Models.Helper.GetWebConfig("ActorImageVRoot") + dr["FilPath"].ToString().Replace("\\", "/");
                                            string PdtName = dr["PdtName"].ToString();
                                            string intro = Server.HtmlEncode(dr["PdtIntro"].ToString()).Replace("\n", " ").TrimStart('$').TrimEnd('$').Replace("$$$", "。").Replace("$$", "。").Replace("$", "。").Replace("&lt;", "<").Replace("&gt;", ">");
                                            string introLong = "";
                                            string introShort = "";
                                            if (intro.Length > 115)
                                            {
                                                introLong = intro.Replace("<br>", " ");
                                                introShort = intro.Substring(0, 115) + "...";
                                            }
                                            else
                                            {
                                                string[] Arrintro = intro.Replace("<br>", "#").Split('#');
                                                if (Arrintro.Length > 2)
                                                {
                                                    introShort = Arrintro[0] + "<br>" + Arrintro[1] + "<br>...";
                                                    introLong = intro.Replace("<br>", " ");
                                                }
                                                else
                                                {
                                                    introShort = intro;
                                                }
                                            }

                                            string atrName = dr["AtrName"].ToString();
                                            string bthCode = dr["BthCode"].ToString();
                                            string atrid = dr["AtrID"].ToString();
                                            string shareIntro = Server.UrlEncode("我关注了" + atrName + "公司的" + PdtName + "产品，")
                                            + Server.UrlEncode("现在就@亚洲宠物展") + ""
                                            + Server.UrlEncode("，抢先了解#InnovAction宠物新风尚#各大品牌最新产品，在线投票赢好礼！www.petfairasia.com");
                                %>
                                        <tr>
                                            <td style="padding-bottom:8px;">
                                                
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td align="center" valign="top" rowspan="2">
                                                            <div class="picBorder" style="margin-right:5px;">
                                                                <a title="点击看原图" href="<%=imgBig %>" target="_blank">
                                                                    <img alt="" src="<%=img %>" style="border:0px;" />
                                                                </a>
                                                            </div>
                                                        </td>
                                                        <td align="left">
                                                            <div style="padding:5px;">
                                                                公司：<%=atrName %>&nbsp;&nbsp;&nbsp;&nbsp;<br />
                                                                展位号：<%=bthCode %><br />
                                                                新品名称：<%=PdtName%>
                                                            </div>
                                                        </td>
                                                        <td rowspan="2" style="width:110px">
                                                            <table border="0" cellpadding="0" cellspacing="0">
                                                                <tr>
                                                                    <td><div class="buttonBorder" onclick="showAlert();" style="margin-left:5px; margin-bottom:5px;">投票并收藏</div></td>
                                                                </tr>
                                                                <tr>
                                                                    <td><div class="buttonBorder" onclick="showAlert();" style="margin-left:5px; margin-bottom:5px;">发起预约</div></td>
                                                                </tr>
                                                                <tr>
                                                                    <td><div class="buttonBorder" onclick="share('<%=shareIntro %>','<%=imgBig %>')" style="margin-left:5px;">分享至微博</div></td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div title="<%=introLong %>" class="introBorder">
                                                                产品描述：<br><%=introShort %>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <div id="line" class="lineDiv"></div>
                                            </td>
                                        </tr>
                                <%
                                        }
                                %>
                                        <tr><td>&nbsp;</td></tr>
                                        <tr>
                                            <td>
                                                <script type="text/javascript">
                                                    PagerPost.Display("<%=ViewData["Page"] %>","<%=ViewData["PageSize"] %>","<%=ViewData["TotalNum"] %>","f1");
                                                </script>
                                            </td>
                                        </tr>
                                <%
                                    }
                                    else
                                    { 
                                %>
                                        <tr>
                                            <td>
                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td align="center" style="padding:6px">暂无产品信息</td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                <%    
                                    }
                                %>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>

            </table>
            <input type="hidden" id="ChangeType" name="ChangeType" />
            <input type="hidden" id="SelectType" name="SelectType" value="<%=ViewData["SelectType"] %>" />
            <input type="hidden" id="OrderType" name="OrderType" value="<%=ViewData["OrderType"] %>" />
            <input type="hidden" id="SearchStr" name="SearchStr" value="<%=ViewData["SearchStr"] %>" />
            
            </form>
        </center>
    </div>
</body>
</html>
