<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Team_Edit.aspx.cs" Inherits="TotCms.Web.Admin.Shop.Team_Edit" %>
<%@ 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 id="Head1" 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>
    <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: 450,
          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",
          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");
      }
      function DelTr(o) {
        var gids = document.getElementById('Goods').value;
        var arr = gids.split(',');
        var nids = '';
        for (var i = 0; i < arr.length; i++) {
          if (arr[i]!='' && arr[i] != o) {
            nids += arr[i] + ',';
          }
        }
        document.getElementById('Goods').value = nids;
        var tb = document.getElementById('GoodsIds');
        var trs = tb.getElementsByTagName('tr');
        for (var i = 0; i < trs.length; i++) {
          var tr = trs[i];
          if(tr.getAttribute('id')=='tr_'+o){
            tb.deleteRow(tr.rowIndex);
          }          
        }
        
      }
    </script>
    
</head>
<body>
  <div id="dialog-win" title="选择分类" style="display:none;">
	  <iframe src="GetGoods.aspx" 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">
          <asp:Label ID="LbTitle" runat="server" Text=""></asp:Label></td>
    </tr>
    <tr>
      <td class="fields_text" width="100">
        学校：</td>
      <td class="fields_input">
        <asp:TextBox ID="School" runat="server" Width="256px"></asp:TextBox>
     </td>
    </tr>
    <tr>
      <td class="fields_text">
          名称：</td>
      <td class="fields_input">
          <asp:TextBox ID="TeamTitle" runat="server" Width="437px"></asp:TextBox>
                </td>
    </tr>

    <tr>
      <td class="fields_text">
        价格：</td>
      <td class="fields_input">
        <asp:TextBox ID="Price" runat="server">0.00</asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
          ControlToValidate="Price" ErrorMessage="限数字" 
          ValidationExpression="(\d+)\.?(\d*)"></asp:RegularExpressionValidator>
      </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="Goods" runat="server"></asp:TextBox>
          <input id="selclass" name="selclass" type="button" value="请选择" class="selclass" />
          <table id="GoodsIds">
          </table> 
          <script type="text/javascript">
          <asp:Literal ID="LiJs" runat="server"></asp:Literal>
          </script>       
        </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>
