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


       <script> 
           document.body.onclick = function () {
               $("#result").hide();
           }

    </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="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="_r">*</span>

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






   <li class="mui-table-view-cell" style="<% =(pc_count=="0")?" display:none ":"" %> ">
      可用笔记本 

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


            
          </span>
 </li>







  <li class="mui-table-view-cell" style="<% =(projector_count=="0")? "display:none ":"" %> ">
      可用投影仪   

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




      <li class="mui-table-view-cell">
      会议属性  

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


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

          </asp:RadioButtonList>


          </span>
 </li>
                          

</ul>




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

                 

     <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="openPop('attend'); 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>

               
   <style>
                  #result {
                 
                  }
                  #result li {
                   list-style-type:none; line-height:30px;
                    width:200px;padding:3px;
                  }

                   #result li:hover {
                   list-style-type:none; line-height:30px; background-color:#2d6077;color:#ffffff;

                  }
              </style>
              
 

 <div  > 
   <div id="result" style="display:none; position:relative; background-color:#ffffff; z-index:200;  left:-30px; top:0px;">
       <ul>
          
       </ul>
   </div>
</div>
   






              
              <script>


                  $(".select2-input").blur(
                      function () {
                          $("#result").hide();
                      }
                 );


                  $(".select2-input").keyup(
                      function () {
                          var _v = $(this).val();

                          if (_v != "") {
                              $.ajax({
                                  url: "../book/data.aspx",
                                  data: { key: _v },
                                  cache: false,
                                  async: true,
                                  dataType: 'json',

                                  success: function (data) {

                                      $("#result ul").html("");

                                      var c = data.length;

                                      if (c == 0) {
                                          $("#result").hide();
                                      }

                                      for (var i = 0; i < c; i++) {
                                          $("#result ul").append("<li>" + data[i].text + "(" + data[i].id + ")</li>");
                                      }



                                      $("#result ul").on("click", "li", function () {

                                          var temp = $(this).html();
                                          displayname = temp;
                                          loginname = temp.split("(")[0];
                                          text = displayname;

                                          var DATA = $("#sel_attend").select2("data")
                                          DATA.push({ id: loginname, text: text });

                                          $("#sel_attend").select2("data", DATA);

                                          $("#result").hide();

                                      });

                                      $("#result").show();

                                  }



                              });



                          }
                          else {
                              $("#result").hide();

                          }



                      });

              </script>

 

               








<!-- /outlook style -->


    
    
    
    
    
              
 </li>

</ul>

            <p></p>

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

   <li class="mui-table-view-cell">
      额外通知 
            <div>
           <asp:TextBox runat="server" placeholder="通知人员邮件列表"   TextMode="MultiLine"   Height="60" ID="txt_notice"></asp:TextBox>
           </div>
 </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" OnClientClick=" if(!IsSel()) return false;"   
                        class=" mui-btn mui-btn-block mui-btn-primary" 
                                style="padding:10px;" 
                     runat="server" Text="提交" OnClick="btnsubmit_Click" />

             </div>


             

           </div>
   </div>






    <input type="hidden" name="meetingtype" value="内部会议" id="meetingtype" />



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





    <script>

 



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

            var _roomid = $("#ddl_room").val();
            if (_roomid ==0) {
                alert("请选择会议室");
                return false;
            }
          


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

          

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

          return true; 

        }
    </script>
                     






  



      

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

    <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="邮件" Width="250" CssClass="noborder line" />
      <asp:HiddenField runat="server" ID="hf_myemail" />
 </asp:Panel>













     







  <script type="text/javascript">



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

                });


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

                });



                $("input[type='radio']").on('ifClicked', function (e) {

                    if (e.currentTarget.id == "rbl_types_1") {
                        $("#meetingtype").val("外部会议");
                    }
                    else {
                        $("#meetingtype").val("内部会议");
                    }

                });


            });

       
 
</script>

     
     

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

    <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: encodeURIComponent(start), end: encodeURIComponent(end), t: "room", aid: $("#ddl_area").val() },
                cache: true,
                async: true,
                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) {
                    
                    alert("系统发生错误");
                }

            });




            
            var pclist = $("#ddl_pc");
            pclist.empty();



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

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

                        $("#ddl_pc").append($("<option value='0'>==无需笔记本==</option>"));

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

                        }
                    }
                },

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

            });










            var projectorlist = $("#ddl_projector");
            projectorlist.empty();



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

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

                        $("#ddl_projector").append($("<option value='0'>==无需投影仪==</option>"));

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

                        }
                    }
                },

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

            });


        }





        GetRoomList();

    </script>



    

</asp:Content>
