<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="getgoodsimg.aspx.cs" Inherits="TotCms.Web.Admin.label.getgoodsimg" %>

<!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" rel="stylesheet" type="text/css" />
  <script src="../js/common.js" type="text/javascript"></script>
  <link href="../style/global.css" rel="stylesheet" type="text/css" />
  <script src="../../js/jquery-1.5.1.min.js" type="text/javascript"></script>
  <script src="../../js/jquery-ui-1.8.10/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
  <link href="../../js/jquery-ui-1.8.10/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript">
    $(function () {
      $("#dialog:ui-dialog").dialog("destroy");
      $("#dialog-win").dialog({
        autoOpen: false,
        height: 350,
        width: 400,
        modal: true,
        buttons: {
          "确定": function () {
            $(this).dialog("close");
          },
          "取消": function () {
            $(this).dialog("close");
          }
        },
        close: function () {

        }
      });

      $("#selclass").click(function () {
        $("#dialog-win").dialog("open");
      });

    });
    function CloseFrame() {
      $("#dialog-win").dialog("close");
    }
    function GetValue() {
      var ret = '';
      var CategoryId = document.getElementById('CategoryId').value;
      var isrem = document.getElementById('isrem').value;
      var ishot = checkInt(document.getElementById('ishot').value);
      var istop = document.getElementById('istop').value;
      var Sort = document.getElementById('Sort').value;
      var RowsNum = document.getElementById('RowsNum').value;
      var CharMax = document.getElementById('CharMax').value;
      var imgw = document.getElementById('imgw').value;
      var imgh = document.getElementById('imgh').value;
      //int pid,int cid,int rem,int hot,int top,string order,int n,int max
      //LinkStyle=LinkStyle.replace(/\,/g,"");		
      ret = 'GetGoodsImg(0,0,';
      ret += CategoryId + ',';
      ret += isrem + ',';
      ret += ishot + ',';
      ret += istop + ',';
      ret += Sort + ',';
      ret += RowsNum + ',';
      ret += CharMax + ',';
      ret += imgw + ',';
      ret += imgh + ')';
      return ret;
    }
    function retValue() {
      var r = GetValue();
      window.opener.document.form1.Content.value = r;
      window.close();
    }
    function Preview() {
      var r = GetValue();
      r = r.replace('(', ',');
      r = r.replace(')', '');
      r = r.replace('"', '');
      document.getElementById('preframe').src = 'label_privew.aspx?content=' + escape(r);
    }
    function checkInt(obj) {
      var reg = /^(\d{1,4})$/;
      if (obj != "" && obj.match(reg) == null) {
        return 0;
      } else {
        return obj;
      }
    }
    </script>

</head>
<body>
  <div id="dialog-win" title="选择分类" style="display:none;">
	  <iframe src="../Category/Get_Tree.aspx?datamodule=<%=(int)TotCms.FrameWork.Enums.DataModule.Shop %>" width="370" height="350" frameborder="0" scrolling="auto"></iframe>	
   </div>
<form id="form1" runat="server">
<fieldset style="text-align:center; ">
<legend>商品图文标签</legend>
<table width="400" border="0" align="center" cellpadding="1" cellspacing="5">
  <tr>
    <td width="113"><div align="left">栏目:</div></td>
    <td width="268">
      <div align="left">
        <asp:Label ID="CategoryTitle" runat="server" Text="选择栏目"></asp:Label>
        <asp:TextBox ID="CategoryId" runat="server" CssClass="hidden">0</asp:TextBox>
        <input id="selclass" name="selclass" type="button" value="请选择" class="selclass" />  
      </div></td>
  </tr> 
  <tr>
    <td align="left">数量：</td>
    <td align="left">
      <asp:TextBox ID="RowsNum" runat="server">10</asp:TextBox>
            </td>
  </tr>
  <tr>
    <td><div align="left">文字个数限制:</div></td>
    <td>
        <div align="left">
          <asp:TextBox ID="CharMax" runat="server" CssClass="input_num">20</asp:TextBox>
      </div></td>
  </tr>
  <tr>
    <td align="left">推荐：</td>
    <td align="left">
      <asp:DropDownList ID="isrem" runat="server">
        <asp:ListItem Value="0">否</asp:ListItem>
        <asp:ListItem Value="1">是</asp:ListItem>
      </asp:DropDownList>
            </td>
  </tr>
  <tr>
    <td align="left">热点：</td>
    <td align="left">
      <asp:DropDownList ID="ishot" runat="server">
        <asp:ListItem Value="0">否</asp:ListItem>
        <asp:ListItem Value="1">是</asp:ListItem>
      </asp:DropDownList>
            </td>
  </tr>
  <tr>
    <td align="left">置顶：</td>
    <td align="left">
      <asp:DropDownList ID="istop" runat="server">
        <asp:ListItem Value="0">否</asp:ListItem>
        <asp:ListItem Value="1">是</asp:ListItem>
      </asp:DropDownList>
            </td>
  </tr>
  <tr>
    <td><div align="left">排序:</div></td>
    <td><div align="left">   
      <asp:DropDownList ID="Sort" runat="server">
        <asp:ListItem>id</asp:ListItem>
        <asp:ListItem Value="id desc">id降序</asp:ListItem>
        <asp:ListItem Value="id asc">id 升序</asp:ListItem>
        <asp:ListItem Value="Hits desc">点击</asp:ListItem>        
      </asp:DropDownList>
</div></td>
  </tr>
  <tr>
    <td align="left">图宽度：</td>
    <td align="left">
      <asp:TextBox ID="imgw" runat="server" Width="64px">150</asp:TextBox>
    </td>
  </tr>
  <tr>
    <td align="left">图高度：</td>
    <td align="left">
      <asp:TextBox ID="imgh" runat="server" Width="64px">150</asp:TextBox>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <div align="center">
        <input id="Ok" type="submit" value="确定" onclick="retValue()" />
        &nbsp;
        <input type="button"  onclick="window.close();" value="取消" />
    &nbsp;<input id="Button1" type="button" value="预览" onclick="Preview()" /></div></td>
  </tr>
</table>
 
</fieldset>
<fieldset>
  <legend>预览</legend>
  <iframe width="99%" frameborder="0" id="preframe" name="preframe" src="preview.htm"></iframe>
</fieldset>
    </form>
</body>
</html>