<%@ Page Title="" Language="C#"   MasterPageFile="~/helpdesk/Ticket.master" AutoEventWireup="true" CodeBehind="Ticket_New.aspx.cs" Inherits="helpdesk.helpdesk.Ticket_New" %>
<%@ Register src="~/UserControls/HtmlEdit.ascx" tagname="HtmlEdit" tagprefix="uc1" %>
 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
   
<asp:HiddenField runat="server" ID="hf_myemail" />
     

<h4>新问题/修改问题</h4> 
 
    <div class="alert alert-danger">
        <b>说明</b>
        <asp:Label runat="server" ID="lbl_intro"> 
        </asp:Label>

         <asp:PlaceHolder runat="server" ID="pl_admin" Visible="false">
          &nbsp;&nbsp;&nbsp;&nbsp; <a href="###"   onclick="layer.open({ type: 1, area: ['500px', '300px'], content: $('#update_intro') });">修改说明</a>
        </asp:PlaceHolder>

    </div>

    

  <table class="table  table-hover "   >
    
		 
     <tr>
        <th   width="150px">
          	 类别 
        </th>
		  <td colspan="3">
	 			
           <asp:UpdatePanel ID="UpdatePanel1"  UpdateMode="Conditional" runat="server">
     <ContentTemplate>
 
  <asp:DropDownList ID="ddl_category1" runat="server" Width="200" CssClass="form-control inline"  
       AutoPostBack="True" onselectedindexchanged="ddl_category1_SelectedIndexChanged">
    
    </asp:DropDownList>

   <asp:DropDownList ID="ddl_category2" runat="server" CssClass="form-control inline"   Width="200"  AutoPostBack="true"
              onselectedindexchanged="ddl_category2_SelectedIndexChanged"    > 
    </asp:DropDownList>
    

    <asp:DropDownList ID="ddl_category3" runat="server"     CssClass="form-control inline"   Width="200"    >
   </asp:DropDownList>
    
         <a href="javascript:setdefault();">设为默认分类</a>
       
    </ContentTemplate>
    </asp:UpdatePanel>
		 
              
              
               </td>
        </tr>
 
			
	  <tr>
        <th  >
                 标题 
		      </th>
		     <td colspan="3">
        
                 <asp:TextBox ID="txt_title" CssClass="form-control" Width="500px" runat="server"  ></asp:TextBox>
                 <asp:RequiredFieldValidator ControlToValidate="txt_title" Display="Dynamic" ID="RequiredFieldValidator1" runat="server" ErrorMessage="必须填写标题"></asp:RequiredFieldValidator>
             </td>
        </tr>
 
		
		
		  <tr>
        <th  width="150px" >
           优先级  
	    </th>
		     <td>
           <asp:DropDownList ID="ddl_priority" runat="server" Width=200px CssClass="form-control inline" >
           
           </asp:DropDownList> 
                 <a href="###" onclick="sla();return false;">SLA</a>
        
         
         </td>
              <th width="150px">
状态 
              </th>
       
		     <td> 
		         
         <asp:DropDownList ID="ddl_status" runat="server"  CssClass="form-control"  Width="200">
           </asp:DropDownList>    
		     </td>
         
        </tr>
        
         
      
 <tr>
    
   <th>
  联系姓名 
  </th>
  <td>
       
      <asp:TextBox runat="server" ID="txt_contactname"  ClientIDMode="Static" CssClass="form-control  inline" Width="200px"/>  
      <asp:RequiredFieldValidator ControlToValidate="txt_contactname"
      ID="RequiredFieldValidator4"    runat="server"  ErrorMessage="必须填写联系人" Display="Dynamic"></asp:RequiredFieldValidator>
       
      <a href="###" onclick="popusers();"><i class="glyphicon glyphicon-user"></i>  </a>

     </td>
      <th>
联系部门 
      </th>      
          
     <td>

   
            <asp:TextBox ID="txt_contactdept" ClientIDMode="Static"  class="form-control"   Width="200px"    runat="server"></asp:TextBox> 
             <asp:RequiredFieldValidator ControlToValidate="txt_contactdept"
      ID="RequiredFieldValidator6" runat="server"  ErrorMessage="必须填写联系部门"   Display="Dynamic"></asp:RequiredFieldValidator>
     </td> 

      </tr>

      <tr>
          <th>联系电话 </th>

        <td>
  <asp:TextBox runat="server" ID="txt_contacttel" class="form-control" ClientIDMode="Static"    Width="200px"/>  
      <asp:RequiredFieldValidator ControlToValidate="txt_contacttel"
      ID="RequiredFieldValidator7" runat="server"  ErrorMessage="必须填写联系电话"  Display="Dynamic"></asp:RequiredFieldValidator>
         </td> 
            <th>
联系邮件 
            </th>
     <td> 
    <asp:TextBox runat="server" ID="txt_contactemail"  ClientIDMode="Static"  class="form-control"   Width="200px"/>  
    <asp:RequiredFieldValidator ControlToValidate="txt_contactemail" Display="Dynamic"
      ID="RequiredFieldValidator8" runat="server"   ErrorMessage="必须填写联系邮件" ></asp:RequiredFieldValidator>
  
     </td>
       
     </tr>
     
         
        
       <tr>
        <th   >
     问题说明 </th>
       <td colspan="3">
	     <uc1:HtmlEdit ID="txt_contents" runat="server" />
     </td>
        </tr>
 
   </table>
 
	 
 
 <!-- sysinfo -->
	 
<div style="padding-right:50px; width:88%; text-align:right"> 
 <a href="###"  style="color:#000" onclick="$('#adv').toggle();return false;">更多信息▼</a>
</div>  

<div  style="display:none"  id="adv">
<div>
以下信息由系统检测，如果填写，可以帮助技术人员尽快解决问题
</div>



   <table  class="table table-hover"> 
      
	  <tr  >
    
   <th class="edit">
     机器资产编号
    </th>
      <td width="200px" >
        <asp:TextBox runat="server" ID="assettag" Width="200px" CssClass="form-control"  />  
         
      </td>
     
    <th   >
  机器序列编号 
  </th>
    <td  >
   <asp:TextBox runat="server" ID="serial" Width="200px" CssClass="form-control"   /> 
     </td>
       
     </tr>
     
     
     
     <tr>
     <th  >
     操作系统
     </th>
     <td>
        <asp:TextBox runat="server" ID="os"   Width="200px" CssClass="form-control"  /> 
     </td>
     
     <th  class="edit">
     机器名
     </th>
     <td>
      <asp:TextBox runat="server" ID="pcname"  Width="200px" CssClass="form-control"  /> 
     </td>
     
     
     </tr>
     
     
     
     
     
     
     
     
     
         <tr>
     <th  class="edit">
     主板序列号
     </th>
     <td>
        <asp:TextBox runat="server" ID="txt_mainboardserialno"  Width="200px" CssClass="form-control"  /> 
     </td>
     
     <th  class="edit">
    主板制造商
     </th>
     <td>
      <asp:TextBox runat="server" ID="txt_mainboardmanufacturer"  Width="200px" CssClass="form-control"  /> 
     </td> 
     
     </tr>
     
     
     
     
     
     
     
     
     
     
     
      <tr>
     <th  class="edit">
     IP 地址
     </th>
     <td>
        <asp:TextBox runat="server" ID="ip"    Width="200px" CssClass="form-control"  /> 
     </td>
     
     <th  class="edit">
     基于32位体系
     </th>
     <td>
         <asp:TextBox ID="bit32" runat="server"  Width="200px" CssClass="form-control" ></asp:TextBox>
     </td>
     
     
     </tr>
     
     
        <tr>
     <th  class="edit">
     用户
     </th>
     <td>
        <asp:TextBox runat="server" ID="usercheck"  Width="200px" CssClass="form-control"  /> 
     </td>
     
     <th  class="edit">
    浏览器
     </th>
     <td>
      <asp:TextBox runat="server" ID="ie"  Width="200px" CssClass="form-control"  /> 
     </td>
     
     
     </tr>
     
	    
        </table>
 </div>
  




     


     




 <div class="text-center" style="height:100px">
     <asp:Button ID="Button1" runat="server" Text="提交问题"    
         
          OnClientClick=" if(Page_ClientValidate()){ this.value='请等待…';this.disabled=true;} " 
          UseSubmitBehavior="false"   
          onclick="Button1_Click" 
          class="btn   btn-primary"  />


     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <input type="button"

              onclick="window.location='default.aspx';" value="返 回"  class="btn  btn-default" />
    

 
 </div>
 
 
   
 
 
<script>


 function   setdefault()
    {
         _cat1 = $("#<%=ddl_category1.ClientID %>").val();
         _cat2 = $("#<%=ddl_category2.ClientID %>").val();
         _cat3 = $("#<%=ddl_category3.ClientID %>").val(); 

     Cookies.set('_cat1', _cat1, { expires: 30, path: '/' });
     Cookies.set('_cat2', _cat2, { expires: 30, path: '/' });
     Cookies.set('_cat3', _cat3, { expires: 30, path: '/' });
      
    layer.alert('设置默认分类成功，有效期30天。<br>说明：系统默认总是选择第一个分类，如果您提交的类别相对固定，单击设置默认分类后，可以让系统默认选择您当前的分类。')

    }


    function sla()
    {
         layer.alert($("#sla").html());
    }



    function setuser(result) {

        setpopuser(result, '', '', 'txt_contactname', 'txt_contacttel', 'txt_contactemail', '', 'txt_contactdept');
         
    }



</script>
 
 
  
     


















        <div id="sla" style="display:none">
    为了合理利用资源，请根据实际情况设定 优先级：
        <asp:DataList ID="DataList1" runat="server">
        
        <ItemTemplate>
        
      <font color=<%#Eval("color") %>><%#Eval("name") %></font>:我们将在<%#Eval("sla") %>小时内解决
        
        </ItemTemplate>
        </asp:DataList>
        
    </div>












    <asp:PlaceHolder runat="server" ID="pl_update" Visible="false">


    
    <div id="update_intro" style="display:none; text-align:center; margin:10px">

        <asp:TextBox runat="server" ID="txt_intro" ClientIDMode="Static" Height="150px" Width="470"  TextMode="MultiLine" CssClass="form-control"></asp:TextBox>
       <br />
       <input type="button" onclick="save_intro();" value="保存"   class="btn btn-primary" />

    </div>



    <script>
         

        function save_intro()
        {
            $.post("ajax/update_intro.aspx?t=ticket", { txt: escape($("#txt_intro").val()) }) 
            alert("操作成功");
            layer.closeAll();
        }

</script>


    </asp:PlaceHolder>

      
    <script>


        function popusers() {
            Pop('Pop_Users.aspx', 950, 580, '选择人员');
        }




        function setpopuser(result, uid, username, displayname, tel, email, staffcode, dept) {
            result = result.split("!")[0];
            var _result = result.split("$");
            if (uid != "") {
                $('#' + uid).val(_result[0]);
            }
            if (username != "") {
                $('#' + username).val(_result[1]);
            }

            if (displayname != "") {
                $('#' + displayname).val(_result[2]);
            }

            if (tel != "") {
                $('#' + tel).val(_result[3]);
            }


            if (email != "") {
                $('#' + email).val(_result[4]);
            }


            if (staffcode != "") {
                $('#' + staffcode).val(_result[5]);
            }

            if (dept != "") {
                $('#' + dept).val(_result[6]);
            }


        }

    </script>

</asp:Content>
