<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="car_addedit.aspx.cs" Inherits="Car.Car.car_addedit" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

       <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  
     <meta name="author" content="http://www.dotnetcms.org" />
    <meta name="keywords" content="启明星公务用车申请系统" />

    <script src="../javascript/jquery-1.9.1.min.js"></script>
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <script src="../bootstrap/js/bootstrap.min.js"></script>

    <script src="../javascript/datepick/moment.min.js"></script>
    <link href="../javascript/datepick/daterangepicker.css" rel="stylesheet" />
    <script src="../javascript/datepick/daterangepicker.js"></script>


        <link href="../javascript/combox/bootstrap-combobox.css" rel="stylesheet" />
    <script src="../javascript/combox/bootstrap-combobox.js"></script>

    <script src="../javascript/layer/layer.js"></script>
    <script src="../javascript/laydate/laydate.js"></script>
    
    <script src="../javascript/car.js"></script>
    <script src="../javascript/common.js" type="text/javascript"></script>
    <link href="../style/btn.css" rel="stylesheet" />
    <script src="../javascript/jquery.cookie.js"></script>
    <link href="../style/car.css" rel="stylesheet" />  
    <link href="../style/patch.css" rel="stylesheet" />

    <style>
        .form-control {
         width:350px; border-radius:0px;
        }
    </style>

</head>
<body style="margin:20px">
    <form id="form1" runat="server">
    <div>
    
       

        <table class="table">
          <tr>
              <th width="100px">车辆品牌</th>
           <td>
           <asp:TextBox ID="txt_carname" placeholder="" ValidationGroup="adds" CssClass="form-control inline"  runat="server"></asp:TextBox>
           <asp:RequiredFieldValidator  ValidationGroup="adds" ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"  ControlToValidate="txt_carname" Display="Dynamic"  ForeColor="red"></asp:RequiredFieldValidator>
            </td>
           

        <th width="100px">车牌号</th>
        <td>
          <asp:TextBox ID="txt_carnum"  CssClass="form-control inline"  runat="server"></asp:TextBox>
         </td>
       </tr>

       <tr>             
          <th>容纳人数</th>
            <td>
 <asp:TextBox ID="txt_num"    CssClass="form-control inline"   runat="server"></asp:TextBox>
       </td> 

              <th>状态</th>

                  
                  <td>

<asp:DropDownList runat="server" ID="ddl_status"  CssClass="form-control inline"   >
    <asp:ListItem Text="在用" Value="在用"></asp:ListItem>
     <asp:ListItem Text="维修" Value="维修"></asp:ListItem>

</asp:DropDownList>
  </td>
           </tr>


            <tr>

 <th>默认司机</th>
  <td> 
       <asp:DropDownList runat="server" ID="ddl_duid" AppendDataBoundItems="true"  CssClass="form-control inline" >
           <asp:ListItem Text="" Value="0"></asp:ListItem>

       </asp:DropDownList>
     </td>

         
 <th>颜色</th>
  <td>
 <asp:TextBox ID="txt_color" CssClass="form-control inline"  runat="server"></asp:TextBox>
       </td>

            </tr>

              
              
             
               
                  
        
 
          <tr>
             <th>
                  备注
             </th>
              <td  colspan="3" >
                 
                <asp:TextBox runat="server" ID="txt_note"  Width="80%" 
                     TextMode="MultiLine" Height="80px"
                     CssClass="form-control" style="display:inline-block"></asp:TextBox>

              </td>
 
          </tr>


            <tr>
                <td align="center" colspan="4">

 <asp:Button ID="btnAdd" CssClass="btn btn-primary btn-sm btn-flat"  ValidationGroup="adds" runat="server" Text="添加车辆" OnClick="btnAdd_Click" />
            
                    
                    
                     <asp:Button ID="btn_edit" CssClass="btn btn-primary btn-sm btn-flat"  ValidationGroup="adds" runat="server" Text="更新" OnClick="btn_edit_Click" />
                  
                       <asp:Button ID="btn_del" CssClass="btn btn-danger btn-sm btn-flat"  
                          CausesValidation="false" OnClientClick="return confirm('确认删除吗？');"
                           runat="server" Text="删除" OnClick="btn_del_click" />
                    
                    
                    
                        </td>

            </tr>
      </table>


       















       <asp:PlaceHolder runat="server" ID="ph_record">



             <div class="padding10 pcont" align="left">
	    <strong>交险记录</strong>
        <a href="###" onclick="showmore(this)" data-div="more1" style="float:right;">新增<span class="caret"></span> </a>


            <div style="margin-top:10px;display:none" id="more1">


 <table class="table">
     <tr>
         <th width="120px">
             保险类型
         </th>
         <td width="330">

                    <select id="insure" class=" form-control combobox">
  <option></option>
<asp:Literal runat="server" ID="lt_options"></asp:Literal>
</select>


         </td>
          
         <th width="120px">
             投保金额
         </th>
         <td width="330px">
             <asp:TextBox runat="server" ID="txt_money" CssClass="form-control"></asp:TextBox>
         </td>
         </tr>

     <tr>
         <th>
             开始日期
         </th>
         <td>
 <asp:TextBox runat="server" ID="txt_begintime" onclick="laydate()" CssClass="form-control"></asp:TextBox>
         </td>
         <th>
             结束日期
         </th>
         <td>
              <asp:TextBox runat="server" ID="txt_endtime" onclick="laydate()"  CssClass="form-control"></asp:TextBox>
         </td>
         </tr>



     <tr>
          <th>
           保险公司名称
         </th>
         <td colspan="3" style="text-align:left"  >
              <asp:TextBox runat="server"  ID="txt_insurename" style=" width:500px; display:inline-block" CssClass="form-control"></asp:TextBox>
          
             

             <asp:Button runat="server" ID="btn_add"   Text="添加" CssClass="btn btn-primary  " OnClick="btn_add1_Click" 
                     />
         </td>
     </tr>

 </table>

</div>

                
    <asp:Repeater runat="server" ID="rpt_insure" EnableViewState="false">
                    <HeaderTemplate>
                        
        <div class="ys0">

                    <table width="100%" class="table" border="0" cellspacing="0" cellpadding="0" align="center" style="border-collapse:collapse;" >
                <tr>
                    <th width="150px">保险类型</th>
                    <th width="90px">投保金额</th>
                    <th width="100px">开始日期</th>                   
                    <th width="120">截止日期</th>
                    <th>单位名称</th>
                     <th width="90px">建立者</th>
                    <th width="60px">状/删</th>
                </tr>

                    </HeaderTemplate>

                    <ItemTemplate>


                          <tr>
                  
                     <td  ><%#Eval("insuretype") %></td>
                     <td  ><%#Eval("money") %></td>
                     <td  ><%# CarHelper.FormatDt(Eval("begintime")) %></td>
                     <td  ><%# CarHelper.FormatDt(Eval("endtime")) %></td>
                     <td><%#Eval("insurename") %></td>
                                <td><%#Eval("username") %></td>
                     <td  >

                             <%# insureState(Eval("endtime")) %> / 

                         <a href="###"  data-type="insure" data-id='<%#Eval("id") %>' class="remove">删</a>

                     </td>

                </tr>

                    </ItemTemplate>
               
                    <FooterTemplate>
                          </table>
                        </div>
                    </FooterTemplate>
                    
                     </asp:Repeater>

            

</div>
  
                











            <!--  汽车年检 -->
            
                <br /><br />
                
            <div class="padding10 pcont" align="left">
	<strong>年检记录</strong>
       <a href="###" onclick="showmore(this)" data-div="more2" style="float:right;">新增<span class="caret"></span> </a>


                  <div style="margin-top:10px;display:none" id="more2">

                       

                      <table class="table">
     <tr>
         <th width="120px">
             年检人
         </th>
         <td width="330">

              <asp:TextBox runat="server" ID="txt_njusername" CssClass="form-control"></asp:TextBox>

         </td>
          
         <th width="120px">
             费用
         </th>
         <td width="330px">
             <asp:TextBox runat="server" ID="txt_money2" CssClass="form-control"></asp:TextBox>
         </td>
         </tr>

     <tr>
         <th>
            年检日期
         </th>
         <td>
 <asp:TextBox runat="server" ID="txt_njdate" onclick="laydate()" CssClass="form-control"></asp:TextBox>
         </td>
         <th>
           年检有效期
         </th>
         <td>
              <asp:TextBox runat="server" ID="txt_expiredate" onclick="laydate()"  CssClass="form-control"></asp:TextBox>
         </td>
         </tr>



     <tr>
          <th>
           备注
         </th>
         <td colspan="3" style="text-align:left"  >
              <asp:TextBox runat="server"  ID="TextBox1" style=" width:500px; display:inline-block" CssClass="form-control"></asp:TextBox>
          
             

             <asp:Button runat="server" ID="btn_add2"   Text="添加" CssClass="btn btn-primary  " 
                  onclick="btn_add2_Click"
               
                     />
         </td>
     </tr>

 </table>

                      </div>








             
    <asp:Repeater runat="server" ID="rpt_nj" EnableViewState="false">
                    <HeaderTemplate>
                        
        <div class="ys0">

                    <table width="100%" class="table" border="0" cellspacing="0" cellpadding="0" align="center" style="border-collapse:collapse;" >
                <tr>
                    <th width="150px">年检人</th>
                        <th width="80px">费用</th>
                    <th width="120px">检测日期</th>
                    <th width="130px">年检有效期</th>                   
                    <th width="200">备注</th> 
                     <th width="90px">建立者</th>
                    <th width="60px">状/删</th>
                </tr>

                    </HeaderTemplate>

                    <ItemTemplate>


                          <tr>
                  
                     <td  ><%#Eval("njusername") %></td>
                     <td  ><%#Eval("money") %></td>
                     <td  ><%# CarHelper.FormatDt(Eval("njdate")) %></td>
                     <td  ><%# CarHelper.FormatDt(Eval("expiredate")) %></td>
                     <td><%#Eval("note") %></td>
                                <td><%#Eval("username") %></td>
                     <td  >

                             <%# insureState(Eval("expiredate")) %> / 

                         <a href="###" data-id='<%#Eval("id") %>' data-type="nj" class="remove">删</a>

                     </td>

                </tr>

                    </ItemTemplate>
               
                    <FooterTemplate>
                          </table>
                        </div>
                    </FooterTemplate>
                    
                     </asp:Repeater>

              
    












               
            </div>
      
            
            
            
            
             
            


            
            
         


<script type="text/javascript">





    function showmore(o) {
        
        var _div = $(o).data("div");
        $("#" + _div).toggle();
      
        var key = $("#" + _div).css("display");
         Cookies.set("display"+_div, key, { expires: 30 });
    }


    if (Cookies.get("displaymore1") == undefined || Cookies.get("displaymore1") == "none") {
        $("#more1").hide();
    }
    else {
        $("#more1").show();
    }

    if (Cookies.get("displaymore2") == undefined || Cookies.get("displaymore2") == "none") {
        $("#more2").hide();
    }
    else {
        $("#more2").show();
    }




    $(document).ready(function () {
         $('.combobox').combobox({ appendId: "sel" });
    });
 
</script>

    
            
           


        <script>
         
          




            $(document).ready(
                
                function()
                {
                    $(".remove").click(
                        
                        function()
                        { 
                            var isdel = confirm("确定删除吗");
                            if (isdel)
                            { 
                                var _id = $(this).data("id");
                                var _type = $(this).data("type");
                                $.get("ajax/car_insure_nj.aspx?id=" + _id + "&type=" + _type);
                                $(this).parent().parent().remove();
                            }
                        
                        }
                        
                        
                        
                        
                        );
                
                
                }
                
                
                
                );



              
        </script>
   
           
           
           
            </asp:PlaceHolder>


















    </div>
    </form>
</body>
</html>
