<%@ Page Title="" Language="C#" MasterPageFile="~/m/m.Master" ClientIDMode="Static" AutoEventWireup="true" CodeBehind="editbook.aspx.cs" Inherits="Book.m.EditBook" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     
   
    

        <link href="js/jdate/mobiscroll.css" rel="stylesheet" />
       <link href="js/jdate/mobiscroll_date.css" rel="stylesheet" />
       <script src="js/jdate/mobiscroll_date.js"></script>
       <script src="js/jdate/mobiscroll.js"></script>
       <link href="js/icheck/skins/square/blue.css" rel="stylesheet" />
       <script src="js/icheck/icheck.min.js"></script>
       <script src="../javascript/layer_mobile/popwin.js"></script>
       <link href="../javascript/select2/select2.css?a=1" rel="stylesheet" />
       <script src="../Javascript/select2/select2.min.js"></script> 

     
      
    
 


    <style>
     .m20 {
     margin-left:-25px;
     }

     .mui-pull-right input[type=text]  {
      margin-bottom:0px;
      margin-top:0px;
      height:32px;
       width:200px;
       border-radius:0px;
     }
      
          .mui-pull-right select{
       margin-bottom:0px;
       margin-top:0px;
       height:38px;
       width:200px;
       border-radius:0px;
       padding:8px 10px !important;
     }

        .chk label {
         display:inline-block;margin-right:10px;
        }
 </style>




     
    
 <header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			  <h1 class="mui-title">更新预定</h1>
            <a class="mui-icon mui-icon-bars mui-pull-right" href="default.aspx"></a>
 </header>

 

    <div class="mui-content">
        <div class="mui-page">


            <p>基本信息</p>
                <ul class="mui-table-view">

                   <li class="mui-table-view-cell">
                       会议主题 <span class="_r">*</span>

                        <span class="mui-pull-right">
                             <asp:TextBox ID="txt_title"  ClientIDMode="Static"      runat="server"></asp:TextBox>

                      </span>

                    </li>


                 <li class="mui-table-view-cell">
                       与会人数  <span class="_r">*</span>
                       <span class="mui-pull-right">
		             		<div class="mui-numbox" data-numbox-step='1' data-numbox-min='1' data-numbox-max='120'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input class="mui-input-numbox" type="number"  value="<%=num %>" name="total" id="total"   />
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
				              </div>
                           </span>
                    </li>



  <li class="mui-table-view-cell">
      会议日期  <span class="_r">*</span>

       <span class="mui-pull-right">
             <asp:TextBox ID="txt_start" ClientIDMode="Static"     class="form-control"  runat="server"></asp:TextBox>
        </span>

      </li>




  <li class="mui-table-view-cell">
      开始时间  <span class="_r">*</span>

       <span class="mui-pull-right">
           <asp:DropDownList runat="server" ID="ddl_start"  ></asp:DropDownList>
          </span>
      </li>


  <li class="mui-table-view-cell">
      结束时间  <span class="_r">*</span>

       <span class="mui-pull-right">
            <asp:DropDownList runat="server"   ID="ddl_end"></asp:DropDownList>
          </span>
 </li>



   <li class="mui-table-view-cell">
      会议区域  

       <span class="mui-pull-right">
     <asp:DropDownList  runat="server" ID="ddl_area" Enabled="false"  ClientIDMode="Static"></asp:DropDownList>
            
          </span>
 </li>








   <li class="mui-table-view-cell">
      会议室  <span class="_r">*</span>

       <span class="mui-pull-right">
           
    

           <asp:DropDownList runat="server" ID="ddl_room"></asp:DropDownList>
            
          </span>
 </li>




                              

</ul>




<p></p>
             <ul class="mui-table-view">

                 
  <li class="mui-table-view-cell">
      会议属性  <span class="_r">*</span>

       <span class="mui-pull-right chk">


          <asp:RadioButtonList runat="server"   RepeatDirection="Horizontal" ID="rbl_types"> 

          </asp:RadioButtonList>


          </span>
 </li>




                     <li class="mui-table-view-cell">
   重复周期
                         <span  onclick="openRule(); return false;" style="color:#0094ff !important;  font-size:13px; display:inline-block">选择规则   </span>  

    
                               <asp:TextBox runat="server" ID="txt_rule"   onfocus="this.blur(); return false;"   onclick=" return false;" ClientIDMode="Static" 
           CssClass="form-control flat bdc"  /> 
 </li>




     <li class="mui-table-view-cell">
      所需资源  

       <div class=" chk" style="margin-top:5px;">
           	 
           <asp:CheckBoxList runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" ID="cb_other1"></asp:CheckBoxList>
                   
          </div>
 </li>












<li class="mui-table-view-cell">
    
 与会人员  <span  onclick="pop_users(); return false;" style="color:#0094ff !important;  font-size:13px; display:inline-block">点击选择   </span>  
              
    <select id="sel_attend" multiple="multiple" style="width:100%;"  class="select2"></select> 

     
    
    
    
<!-- outlook style -->
<script>

    $("#sel_attend").select2().on("select2-opening", function (e) {
        e.preventDefault();
    });

</script>
     

<!-- /outlook style -->


    
    
    
    
    
              
 </li>


















             <li class="mui-table-view-cell">
      特别需求  

            <div>
              <asp:TextBox runat="server"   TextMode="MultiLine"   Height="60" ID="txt_specialrequire"></asp:TextBox>
           </div>
 </li>


                 </ul>



              <div class="mui-content-padded">

                <asp:Button ID="btnsubmit" 
                    

                       UseSubmitBehavior="false" 
           OnClientClick="if(!checkvalue()) return false;  this.value='please wait…';this.disabled=true; "
           class=" mui-btn mui-btn-block mui-btn-primary" 
            style="padding:10px;" 
                     runat="server" Text="提交" OnClick="btnsubmit_Click" />

          </div>






           </div>
        </div>








    
    
      <asp:HiddenField runat="server" ID="hf_rec" ClientIDMode="Static" />

      
  

     <input id="hf_attend_text" name="hf_attend_text"  type="hidden" value="<%=_hf_attend_text%>" />
     <input id="hf_attend" name="hf_attend"  type="hidden"   value="<%=_hf_attend%>" />

      <input type="text" name="room_type" id="room_type"  style="display:none" value="<%=_hf_types %>"/>
   
         

      



        <script type="text/javascript">



            $(document).ready(function () {


                $("input[type='radio']").iCheck({
                    checkboxClass: 'icheckbox_square-blue',
                    radioClass: 'iradio_square-blue'

                });
                 

                $("#rbl_types_0").on('ifChecked',
                 function () {

                     $("#room_type").val("内部会议;");

                 });


                $("#rbl_types_1").on('ifChecked',
                  function () {
                      $("#room_type").val("外部会议;");
                 });
                 

                $("input[type='checkbox']").iCheck({
                    checkboxClass: 'icheckbox_square-blue',
                    radioClass: 'iradio_square-blue'

                });


            });

        </script>







      <script>

          $(document).ready(function () {

             
                 
            var attendIds = "<%=_hf_attend%>".split(";");
            var attendTexts = "<%=_hf_attend_text%>".split(";");
            var dataAttend = [];
            for (var i = 0; i < attendIds.length; i++) {
                if (attendIds[i] != "") {
                    dataAttend.push({ id: attendIds[i], text: attendTexts[i] });
                } 
            }
                
            
            $("#sel_attend").select2("data", dataAttend);

               

        });

    </script>


     


    <script src="js/book.js"></script>




    
        

    <script>




        function checkvalue() {

            var _temp = getSelect($("#sel_attend").select2("data"));
            $("#hf_attend").val(_temp);


            _temp = getSelectText($("#sel_attend").select2("data"));
            $("#hf_attend_text").val(_temp);



            if ($("#txt_title").val() == "") {
                layer.msg("请填写会议主题");
                return false;
            }



            var result = true;

            //check room avaliable
            var OStart ='<%=ViewState["oStart"]%>';
            var OEnd = '<%=ViewState["oEnd"]%>';
            var ORoomid = '<%=ViewState["oRoomid"]%>';

            var Start =$("#txt_start").val()+" "+$("#ddl_start").val();
            var End = $("#txt_start").val() + " " + $("#ddl_end").val();
            var Roomid = $("#ddl_room").val();

           $.ajax({
                url: "ajax_get_available_room2.aspx",
                data: { OStart:OStart, OEnd:OEnd, Start:Start, End:End,ORoomid:ORoomid,Roomid:Roomid },
                type: "get",
                cache: false,
                async: false,
                success: function (r) {
                    console.log(r);
                    if (r == "1") {
                        
                        result=true;
                    }
                    else {
                        alert("会议室冲突");
                        result=false;
                     
                    }
                   
                }


           });


           return result;

       

             
             
        }




       </script>



 


    <script src="js/dt.js"></script>


     



    

    <asp:Panel runat="server" ID="pn_hide" Visible="false">



       <asp:TextBox runat="server" ID="txt_contactname"  placeholder="姓名"  CssClass="noborder line" />  
       <asp:TextBox runat="server" ID="txt_contactdept"   placeholder="部门"  CssClass="noborder line "/> 
       <asp:TextBox runat="server" ID="txt_contacttel"  placeholder="电话"  CssClass="noborder line"  />  
       <asp:TextBox runat="server" ID="txt_contactemail"   placeholder="邮件"   CssClass="noborder line" />
       <asp:HiddenField runat="server" ID="hf_myemail" />
       <asp:HiddenField runat="server" ID="hf_guid" />
  
    </asp:Panel>

</asp:Content>
