<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="TotCms.Web.Admin.Shop.Edit" ValidateRequest="false" %>
<%@ Register src="../UI/main_top.ascx" tagname="main_top" tagprefix="uc1" %>
<%@ Register assembly="TotCms.Controls" namespace="TotCms.Controls" tagprefix="cc1" %>
<!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">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>修改商品</title>
    <link href="../style/global.css" rel="stylesheet" type="text/css" />
    <script src="../js/common.js" type="text/javascript"></script>
    <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
    <link href="../../swfupload/swfupload.css" rel="stylesheet" type="text/css" />
    <script src="../../swfupload/swfupload.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/handlers.js"></script>
    <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">
      var swfu;
       $(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");
        });

        //swf upload
        swfu = new SWFUpload({
          // Backend Settings
          upload_url: "../UploadFace/UploadImg.aspx?issmall=1",
          post_params: {
            "ASPSESSID": "<%=Session.SessionID %>"
          },

          // File Upload Settings
          file_size_limit: "200 MB",
          file_types: "*.*",
          file_types_description: "files",
          file_upload_limit: "0",    // Zero means unlimited

          // Event Handler Settings - these functions as defined in Handlers.js
          //  The handlers are not part of SWFUpload but are part of my website and control how
          //  my website reacts to the SWFUpload events.
          file_queue_error_handler: fileQueueError,
          file_dialog_complete_handler: fileDialogComplete,
          upload_progress_handler: uploadProgress,
          upload_error_handler: uploadError,
          upload_success_handler: uploadSuccess,
          upload_complete_handler: uploadComplete,

          // Button settings
          button_image_url: "../UploadFace/Images/XPButtonUploadText_61x22.png",
          button_placeholder_id: "spanButtonPlaceholder",
          button_width: 61,
          button_height: 22,
          button_text: '<span class="button"></span>',
          button_text_style: '.button { font-family: 宋体; font-size: 14px; } .buttonSmall { font-size: 12px; }',
          button_text_top_padding: 1,
          button_text_left_padding: 5,

          // Flash Settings
          flash_url: "../../swfupload/swfupload.swf", // Relative to this file

          custom_settings: {
            upload_target: "divFileProgressContainer",
            upload_returnobjid: "Photo"
          },

          // Debug Settings
          debug: false
        });
      });
      function CloseFrame() {
        $("#dialog-win").dialog("close");
      }
    </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">
    <div>
    
      <uc1:main_top ID="main_top1" runat="server" />
    
    </div>
    <table style="width:100%;" border="0" cellpadding="0" cellspacing="1" 
      class="black_border">
      <tr class="suphead">
        <td colspan="2">修改商品</td>
    </tr>
    <tr>
      <td class="fields_text" width="100">
        选择栏目：</td>
      <td class="fields_input">
        <asp:TextBox ID="CategoryId" runat="server" CssClass="hidden"></asp:TextBox>
          <asp:Label ID="CategoryTitle" runat="server" CssClass="category"></asp:Label>
          <input id="selclass" name="selclass" type="button" value="请选择" class="selclass" />          
     </td>
    </tr>
    <tr>
      <td class="fields_text">
          名称：</td>
      <td class="fields_input">
          <asp:TextBox ID="ShopTitle" runat="server" Width="437px"></asp:TextBox>
                </td>
    </tr>
    <tr>
      <td class="fields_text">
          价格：</td>
      <td class="fields_input">
          原价：<asp:TextBox ID="MPrice" runat="server" Width="53px">0.00</asp:TextBox>
&nbsp;现价：<asp:TextBox ID="Price" runat="server" Width="51px">0.00</asp:TextBox>
          <asp:RegularExpressionValidator ID="RegularExpressionValidator1" 
              runat="server" ControlToValidate="Price" ErrorMessage="限数字" 
              ValidationExpression="\d+\.?\d*"></asp:RegularExpressionValidator>
          折扣：<asp:TextBox ID="Discount" runat="server" Width="36px">1</asp:TextBox>
          <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
            ErrorMessage="限数字" ValidationExpression="\d+\.?\d*" 
            ControlToValidate="Discount"></asp:RegularExpressionValidator>
                (请填写1以下的数字)</td>
    </tr>
    <tr>
      <td class="fields_text">
        星级：</td>
      <td class="fields_input">
        <asp:DropDownList ID="Stars" runat="server">
          <asp:ListItem Value="5">★★★★★</asp:ListItem>
          <asp:ListItem Value="4">★★★★</asp:ListItem>
          <asp:ListItem Value="3">★★★</asp:ListItem>
          <asp:ListItem Value="2">★★</asp:ListItem>
          <asp:ListItem Value="1">★</asp:ListItem>
        </asp:DropDownList>
&nbsp;库存量：<asp:TextBox ID="Nums" runat="server">1</asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
          ControlToValidate="Nums" ErrorMessage="限数字" ValidationExpression="(\d+)"></asp:RegularExpressionValidator>
      </td>
    </tr>
    <tr>
      <td class="fields_text">
        作者：</td>
      <td class="fields_input">
        <asp:TextBox ID="Author" runat="server"></asp:TextBox>
        出版社：<asp:TextBox ID="Press" runat="server"></asp:TextBox>
        出版日期：<asp:TextBox ID="PubDate" runat="server"></asp:TextBox>
      </td>
    </tr>
    <tr>
      <td class="fields_text">
        其它：</td>
      <td class="fields_input">
        版次<asp:TextBox ID="Banchi" runat="server"></asp:TextBox>
        页数<asp:TextBox ID="PageNum" runat="server"></asp:TextBox>
        字数<asp:TextBox ID="ZiNum" runat="server"></asp:TextBox>
        <br />
        印刷时间<asp:TextBox ID="PrintDate" runat="server"></asp:TextBox>
        开本<asp:TextBox ID="Kaiben" runat="server"></asp:TextBox>
        纸张<asp:TextBox ID="Paper" runat="server"></asp:TextBox>
        <br />
        印次<asp:TextBox ID="YinChi" runat="server"></asp:TextBox>
        Isbn<asp:TextBox ID="Isbn" runat="server"></asp:TextBox>
        包装<asp:TextBox ID="Package" runat="server"></asp:TextBox>
        重量<asp:TextBox ID="Weight" runat="server"></asp:TextBox>
      </td>
    </tr>
    <tr>
      <td class="fields_text">
        缩略图：</td>
      <td class="fields_input">
        <asp:TextBox ID="Photo" runat="server"></asp:TextBox>
        <span id="spanButtonPlaceholder"></span>
        <div id="divFileProgressContainer"></div>
      </td>
    </tr>
    <tr>
      <td class="fields_text">
        点击：</td>
      <td class="fields_input">
        <asp:TextBox ID="Hits" runat="server"></asp:TextBox>
      </td>
    </tr>
    <tr>
      <td class="fields_text">
          编辑推荐：</td>
      <td class="fields_input">
          <asp:TextBox ID="EditorRm" runat="server" TextMode="MultiLine"></asp:TextBox>
          </td>
    </tr>
    
    <tr>
      <td class="fields_input" colspan="2">
        <div class="line22">详细内容：</div>
        <asp:TextBox ID="Content" runat="server" CssClass="hidden" 
          TextMode="MultiLine"></asp:TextBox>
          <!-- This div will hold the editor. -->
	        <div id="editor"></div>
          <script type="text/javascript">
		      //<![CDATA[
			      // Replace the <textarea id="Content"> with an CKEditor instance.
			      var editor = CKEDITOR.replace( 'Content',
			      {
            filebrowserBrowseUrl : '../ckfinder/ckfinder.html',//启用浏览功能
            filebrowserImageBrowseUrl : '../ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : '../ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : '../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
            } 
            );
		      //]]>
		      </script>
          </td>
    </tr>
    <tr>
      <td class="fields_input" colspan="2">
        <div class="line22">作者简介：</div>
        <asp:TextBox ID="AuthorDesc" runat="server" TextMode="MultiLine"></asp:TextBox>
        <script type="text/javascript">
		//<![CDATA[

          // Replace the <textarea id="editor"> with an CKEditor
          // instance, using default configurations.
          CKEDITOR.replace('AuthorDesc',
				{
				  toolbar:
					[
						['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink']
					],
				  height: 70
				});
 
		//]]>
		</script>

      </td>
    </tr>    
    <tr>
      <td class="fields_input" colspan="2">
        <div class="line22">目录：</div>
        <asp:TextBox ID="Directory" runat="server" TextMode="MultiLine"></asp:TextBox>
        <script type="text/javascript">
		//<![CDATA[

          // Replace the <textarea id="editor"> with an CKEditor
          // instance, using default configurations.
          CKEDITOR.replace('Directory',
				{
				  toolbar:
					[
						['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink']
					],
				  height: 70
				});
 
		//]]>
		</script>
      </td>
    </tr>    
    <tr>
      <td class="fields_text">
          自定义字段：</td>
      <td class="fields_input">
      <div id="CustomFields" runat="server"></div>
      </td>
    </tr>    
    
    
    <tr>
      <td align="center" colspan="2">
                    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="修改" />
                    &nbsp;</td>
    </tr>
    </table>    

    </form>
    </body>
</html>
