<%@ Page Title="" Language="C#" MasterPageFile="~/m/m.Master" ClientIDMode="Static" AutoEventWireup="true" CodeBehind="addbook.aspx.cs" Inherits="Book.m.AddBook" %>
<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> 

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


    <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>


    <div style="display:none"> 
      <asp:HiddenField runat="server" ID="hf_myemail" />
      <asp:TextBox runat="server" ID="txt_contactname"    CssClass="noborder line" />  
      <asp:TextBox runat="server" ID="txt_contactdept"     CssClass="noborder line "/> 
      <asp:TextBox runat="server" ID="txt_contacttel"   CssClass="noborder line"  />  
      <asp:TextBox runat="server" ID="txt_contactemail"   CssClass="noborder line" />  
   </div>
     
    
 <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="2" 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"  onchange="GetRoomList();"></asp:DropDownList>
          </span>
      </li>


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

       <span class="mui-pull-right">
            <asp:DropDownList runat="server"  onchange="GetRoomList();" 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" onchange="GetRoomList();" ClientIDMode="Static"></asp:DropDownList>
     </span>
 </li>








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

       <span class="mui-pull-right">
           
     <select name="ddl_room" id="ddl_room"  > 
    </select>


            
          </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 type="text" id="roomid" style="display:none" name="roomid"/>  

     <input id="hf_attend_text" name="hf_attend_text"  type="hidden"  />
     <input id="hf_attend" name="hf_attend"  type="hidden" />

    <input type="text" name="room_type" id="room_type" style="display:none" value="内部会议"/>

        

    <script>



        function GetRoomList() {

            var start = $("#txt_start").val() + " " + $("#ddl_start").val();
            var end = $("#txt_start").val() + " " + $("#ddl_end").val();

            var roomlist = $("#ddl_room");
            roomlist.empty();

            $.ajax({
                url: "ajax_get_available_room.aspx",
                data: { start: start, end: end, aid: $("#ddl_area").val() },
                cache: false,
                async: false,
                dataType: 'json',

                success: function (data) {
                    if (data) {
                        var count = data.length;

                        $("#ddl_room").append("<option value='0'>==请选择会议室==</option>");

                        for (i = 0; i < count; i++) {
                            $("#ddl_room").append($("<option value='" + data[i].roomid + "'>" + data[i].roomname + "</option>"));

                        }
                    }
                },

                error: function (msg) {
                    console.log(msg);
                    //alert(msg);
                    alert("系统发生错误");
                }

            });
        }

         




        GetRoomList();

         
    </script>
                     











        <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 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;
            }

           _temp= $("#ddl_room").val();
           $("#roomid").val(_temp);

            if ($("#roomid").val() == "" || $("#roomid").val() == "0") {
                layer.msg("请选择会议室");
                return false;
            }


            return true;
        }


       

       </script>



 


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


</asp:Content>
