<%@ Page Title="" Language="C#" MasterPageFile="~/m/m.Master" AutoEventWireup="true" CodeBehind="Ticket_New.aspx.cs" Inherits="helpdesk.m.Ticket_New" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <link href="css/add.css" rel="stylesheet" />
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>


    <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;
     }
 
     
 </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">
            <div class="feedback">


<p>问题所属分类</p>
     
           
 

           <asp:UpdatePanel ID="up_cat" UpdateMode="Conditional" runat="server"> 
     <ContentTemplate> 
           <ul class="mui-table-view">
            <li class="mui-table-view-cell">问题大类
                  <span class="mui-pull-right">
              <asp:DropDownList ID="ddl_category1" runat="server"   
       AutoPostBack="True" onselectedindexchanged="ddl_category1_SelectedIndexChanged" /> 
    
                      </span>
                </li>

                       <li class="mui-table-view-cell">问题中类 
                              <span class="mui-pull-right">
                    <asp:DropDownList ID="ddl_category2" runat="server"     AutoPostBack="true"
              onselectedindexchanged="ddl_category2_SelectedIndexChanged"    />
                                  </span>
                  </li>

               
                       <li class="mui-table-view-cell">问题小类 
                              <span class="mui-pull-right">
                     <asp:DropDownList ID="ddl_category3" runat="server"         />
                                  </span>
                  </li>


               </ul>
         </ContentTemplate>
             </asp:UpdatePanel>



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

                    <li class="mui-table-view-cell">问题标题<span class="_r">*</span>
				 <span class="mui-pull-right">
                       <asp:TextBox runat="server" ID="txt_title" CssClass="form-control"></asp:TextBox>
              <asp:RequiredFieldValidator ControlToValidate="txt_title" Display="Dynamic" ID="RequiredFieldValidator2" runat="server" ErrorMessage="必须填写标题"></asp:RequiredFieldValidator>

                    </span>
                    </li>

               
                    <li class="mui-table-view-cell">优先级
                        <span class="mui-pull-right">

                   <asp:DropDownList runat="server" ID="ddl_priority">
                       <asp:ListItem Text="low" Value="low"></asp:ListItem>
                         <asp:ListItem Text="medium" Selected="True" Value="medium"></asp:ListItem>
                         <asp:ListItem Text="high" Value="high"></asp:ListItem>
                         <asp:ListItem Text="critical" Value="critical"></asp:ListItem>

                   </asp:DropDownList>

                            </span>

                    </li>


                   <li class="mui-table-view-cell">问题说明<span class="_r">*</span>
                        <span class="mui-pull-right">

                     <asp:TextBox runat="server" ID="txt_contents" TextMode="MultiLine"  Height="120"  
                          Width="200px"></asp:TextBox>
       
             <asp:RequiredFieldValidator ControlToValidate="txt_contents" Display="Dynamic" ID="RequiredFieldValidator1" runat="server" ErrorMessage="必须填写报修内容"></asp:RequiredFieldValidator>
       

                            </span>

                    </li>



                    </ul>

 



                
                <p>故障照片（请不要超过5张）</p>
                <ul class="mui-table-view">
                    <li class="mui-table-view-cell">
                        <div id='image-list' class="row image-list">
                        </div>

                    </li>
                </ul>


                 
                
                 <p>联系人信息</p>

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

                    <li class="mui-table-view-cell">联系人姓名
				 <span class="mui-pull-right">
                     <asp:TextBox runat="server" CssClass="w" ID="txt_contactname"></asp:TextBox>
                  </span>
                    </li>

                      <li class="mui-table-view-cell">联系人部门
				 <span class="mui-pull-right">
                     <asp:TextBox runat="server"  CssClass="w" ID="txt_contactdept"></asp:TextBox>
                  </span>
                    </li>


                      <li class="mui-table-view-cell">联系人电话
				 <span class="mui-pull-right">
                     <asp:TextBox runat="server"   CssClass="w" ID="txt_contacttel"></asp:TextBox>
                  </span>
                    </li>


                    <asp:PlaceHolder runat="server" ID="ph_email" >
                          <li class="mui-table-view-cell">联系人邮件
				 <span class="mui-pull-right">
                     <asp:TextBox runat="server"  CssClass="w" ID="txt_contactemail"></asp:TextBox>
                  </span>
                    </li>
                    </asp:PlaceHolder>

                    </ul>


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


 <input type="button"   value="提交" 
     onclick="_submits2(); return false;" 
       class=" mui-btn mui-btn-block mui-btn-primary" style="padding:10px;" />










                	 
                           
                            </div>


</div>
            </div>
        </div>











  

    <script src="js/attach.js?v=2"></script>





    
    <script>



        function _submits2() {
            var _cat1name = $("#ctl00_ContentPlaceHolder1_ddl_category1 option:selected").text();
            var _cat1id = $("#ctl00_ContentPlaceHolder1_ddl_category1 option:selected").val();

            var _cat2name = $("#ctl00_ContentPlaceHolder1_ddl_category2 option:selected").text();
            var _cat2id = $("#ctl00_ContentPlaceHolder1_ddl_category2 option:selected").val();

            var _cat3name = $("#ctl00_ContentPlaceHolder1_ddl_category3 option:selected").text();
            var _cat3id = $("#ctl00_ContentPlaceHolder1_ddl_category3 option:selected").val();

          
            var _priority = $("#ctl00_ContentPlaceHolder1_ddl_priority").val();


            var _title = $("#ctl00_ContentPlaceHolder1_txt_title").val();
            var _contents = $("#ctl00_ContentPlaceHolder1_txt_contents").val();


            var _contactname = $("#ctl00_ContentPlaceHolder1_txt_contactname").val();
            var _contactdept = $("#ctl00_ContentPlaceHolder1_txt_contactdept").val();
            var _contacttel = $("#ctl00_ContentPlaceHolder1_txt_contacttel").val();
            var _contactemail= $("#ctl00_ContentPlaceHolder1_txt_contactemail").val();


             

            var _img1 = $("#imgdata-1").val();
            var _img2 = $("#imgdata-2").val();
            var _img3 = $("#imgdata-3").val();
            var _img4 = $("#imgdata-4").val();
            var _img5 = $("#imgdata-5").val();



            if (_title == "" || _contents == "") {
                alert("标题和内容不能为空");
                return;
            }



            $.ajax({
                url: "ajax/ticket_new_post.aspx",
                data: {
                    cat1id: _cat1id,  cat1name: _cat1name,  cat2id: _cat2id,  cat2name: _cat2name,  cat3id: _cat3id,
                    cat3name: _cat3name,title:_title,contents:_contents,priority:_priority,
                    contactname: _contactname, contactdept: _contactdept, contacttel: _contacttel, contactemail:_contactemail,
                    img1: _img1, img2: _img2, img3: _img3, img4: _img4, img5: _img5
                },

                type: "post",
                cache: false,
                async: true,
                success: function () {
                    alert("提交成功");
                    window.location = "ticket_my.aspx";
                }


            });




        }






    </script>

</asp:Content>
