<%@ page language="C#" autoeventwireup="true" masterpagefile="~/html/MasterPage.master" inherits="ShowExpenses, App_Web_fz5gj3qy" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <%-- <link href="../CSS/style.css"type="text/css" rel="Stylesheet" />--%>
    <link href="../CSS/ForButton.css"type="text/css" rel="Stylesheet" />
   
  <script type="text/javascript" src="../js/JScript.js"></script>

     <link href="../css/buttoncss.css" type="text/css" rel="Stylesheet"/>
 <style type="text/css">
      
     .style2
     {
         width: 22px;
     }
     .style3
     {
     }
     .style4
     {
         height: 9px;
     }
     .style5
     {
         height: 9px;
         width: 282px;
     }
     .style6
     {
         width: 282px;
     }
     .style7
     {
         height: 9px;
         width: 22px;
     }
     .style8
     {
         width: 280px;
     }
     .style9
     {
         width: 20px;
     }
     .style10
     {
     }
     .style11
     {
         width: 24px;
     }
     .style12
     {
         height: 22px;
     }
     .style13
     {
         height: 22px;
     }
     .style14
     {
         width: 20px;
         height: 22px;
     }
      .contactpanelcss1
        {
         width: 98%;
         margin: 0px;
         background-color: White;
          border:5px solid Orange;
         padding: 0px;
         margin-top: 0px;
     }
      .contactpanelcss
        {
        	width:100%;
        	  margin: 0px;
         background-color: White;
         border: 5px solid #8AE2FF;
         padding: 0px;
         margin-top: 0px;
        	     	   	
        }
         .categorypanel
        {
        	background-color:#FFF0DB;
        	border:2px solid black;
        		} 

   .cssLoadingTimer
        {        	
        	/* filter:alpha(opacity=90);       	
        	opacity:0.7; */        	
        	text-align:center; 
        	position:fixed; 
        	margin:5% 0% 0px 30%; 
        	background-color:White;
          
        	width:300px;
        	height:150PX;
        	 background-color:#ffebcc;
        	
        
        }  

     </style>
      <style type="text/css">

    .regular-checkboxnew {
   -webkit-appearance: none;

	background-color: #ffffe6;
	border: 1px solid #cacece;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05);
	
	border-radius: 3px;
	display: inline-block;
	position: relative;
	width: auto;
	overflow:auto;
	
            top: 0px;
            left: 0px;
            height:400px;
            overflow:auto;
            font-size:12px;
            font-family:Verdana;
        }
      
         
          .WatermarkCss {
            color: grey;
        }
  .categorypanel
        {
        	background-color:White;
        	
        		}
        		
        		 .myButton2 {
        
        -moz-box-shadow:inset 0px 1px 0px 0px #ffe0b5;
        -webkit-box-shadow:inset 0px 1px 0px 0px #ffe0b5;
        box-shadow:inset 0px 1px 0px 0px #ffe0b5;
        
        background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #e88b09), color-stop(1, #c47c18));
        background:-moz-linear-gradient(top, #e88b09 5%, #c47c18 100%);
        background:-webkit-linear-gradient(top, #e88b09 5%, #c47c18 100%);
        background:-o-linear-gradient(top, #e88b09 5%, #c47c18 100%);
        background:-ms-linear-gradient(top, #e88b09 5%, #c47c18 100%);
        background:linear-gradient(to bottom, #e88b09 5%, #c47c18 100%);
        filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e88b09', endColorstr='#c47c18',GradientType=0);
        
        background-color:#e88b09;
        
        -moz-border-radius:7px;
        -webkit-border-radius:7px;
        border-radius:7px;
        
        border:1px solid #c97e1c;
        
        display:inline-block;
        color:#ffffff;
        font-family:Trebuchet MS;
        font-size:17px;
        font-weight:bold;
        padding:6px 6px;
        text-decoration:none;
        
        text-shadow:0px 1px 0px #8f7f24;
        cursor:pointer;
        
    }
    
     .modelbackground
        {
        	background-color:Gray;
	        filter:alpha(opacity=50);
	       /*opacity:0.4;*/
        }
        
        .backgrnd
        {
        	background-color:#e88b09;
        }
            
#divwidth1
{
    width: auto !important;
    height:180px !important;
    overflow:auto;
}
#divwidth1 div
{
    width: auto !important;
}
#div_width1
{
    width: auto !important;
    height:180px !important;
    overflow:auto;
}
#div_width1 div
{
    width: auto !important;
}

   #div_code
{
    width: 100px !important;
    height:180px !important;
    overflow:auto;
}
#div_code div
{
    width: auto !important;
}
.completionList {
        border:solid 1px #006699;
        margin:3px;
        padding:3px;
        height: 180px;
        overflow:auto;
        color : windowtext;
        background-color:#ffffe6;  
           font-family:Verdana;
    font-size:13px; 
    color : windowtext;

	cursor : 'default';  
	
  } 
        .listItem {
   cursor : 'default';  
    color: Maroon;
 
    
        } 
        .itemHighlighted {
   	background-color: #ffff99;
        cursor:pointer;
        }

    
        .auto-style4 {
            width: 172px;
        }
        .auto-style5 {
            width: 218px;
        }

        	         
#dv_gpname
{
    width: auto !important;
    height:180px !important;
    overflow:auto;
}
#dv_gpname div
{
    width: auto !important;
}
    
 </style>
       <script type="text/javascript">

           $().ready(function () {

                   $("[id*=lnkattach]").click(function () {
                   $("#<%=lblheading.ClientID %>").html("Show Attachments");

                   $find("mpm2").show();
                   Show_DoctorsAttachments();
                   });       
              
                   function Show_DoctorsAttachments() {
                      var user_id = $('input[id$=hf_user_id]').val();
              
                      var UploadedEID = "83";
                      //var UploadedEID = $('input[id$=hf_employee_id]').val();
                    //  alert(UploadedEID);
                      $.ajax({
                      type: "POST",
                      url: "ShowExpenses.aspx/show_attachments",
                      data: "{user_id:'" + user_id + "',UploadedEID:'" + UploadedEID + "'}",
                      contentType: "application/json; charset=utf-8",
                      dataType: "json",
                      success: function OnSuccess(response) {
                          alert(response);
                          $("#Attachemts_list").empty();
                          var xmlDoc = $.parseXML(response.d);
                          var xml = $(xmlDoc);
                          var customers = xml.find("QuotationAttach");

                          $.each(customers, function () {

                              var customer = $(this);
                              //alert(customers);
                              if ($(this).find("Name").text() == "") {
                                  $("#Attachemts_list").append("<tr><td><a target='_blank' href=" + $(this).find("DocumentName").text() + ">" + $(this).find("DocumentName").text() + "</a></td></tr>");
                              }
                              else {
                                  $("#Attachemts_list").append("<tr><td><a target='_blank' href=" + $(this).find("DocumentName").text() + ">" + $(this).find("DocumentName").text() + "</a></td></tr>");
                                   }
                          });

                          var rowCount1 = $('#_attachemts_table >tbody >tr').length;
                          if (rowCount1 == 1) {
                              $("#div_attachments").hide();

                              $('#<%=lbl_no_of_attachments.ClientID%>').html("No Records Found!");

                               } else {

                                   $('#<%=lbl_no_of_attachments.ClientID%>').html("");
                                   $("#div_attachments").show();
                               }
                           },
                           error: function (result) {
                               alert("Error");  //This one is executing
                           }
                       });
                   }

           });
      </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <asp:HiddenField ID="hf_from_date_enquiry" runat="server" />
        <asp:HiddenField runat="server" ID="hf_user_id" />
        <asp:HiddenField runat="server" ID="hf_employee_id" />
        <asp:HiddenField ID="hf_date" runat="server" />
        <asp:HiddenField ID="hf_month_no" runat="server" />
        <asp:HiddenField ID="hf_year_no" runat="server" />
        <asp:HiddenField ID="hf_todate_enquiry" runat="server" />
        <asp:HiddenField ID="hf_date_enquiry" runat="server" />
        <asp:HiddenField ID="hf_month_no_enquiry" runat="server" />
        <asp:HiddenField ID="hf_year_no_enquiry" runat="server" />
     <asp:HiddenField ID="hf_enq_quo_records_count" runat="server" />
    <asp:Panel ID="Panel1" runat="server" >  <%--BorderStyle="Groove"--%>
   <table width="100%">
    <tr>
            <td align="justify" valign="middle">
                <asp:Label ID="Label5" runat="server" Text="Show Expenses" CssClass="p12" 
                    Height="23px" Width="50%" ForeColor="White" Font-Bold="True" 
                    Font-Size="18px"></asp:Label>
             </td>
        </tr>

       
        <tr>
            <td class="style26">
              <asp:Label ID="lblCurrentmonth" runat="server" Font-Bold="True"  Width="150px"
                     Font-Size="16px" Font-Names="Verdana" ForeColor="#CC0000"></asp:Label></td>
            
            <td align="right" class="style27">
                  
                <asp:Label ID="Label13" runat="server" CssClass="lb" Font-Names="Verdana" 
                    Font-Size="14px" Text="Select Employee"></asp:Label>
            </td>
            <td class="style28"><a style="color:Red;">*</a>
                &nbsp;</td>
            <td align="left" class="style26">
                <asp:DropDownList ID="ddlEName" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="SqlDataSource4" DataTextField="EName" AutoPostBack="true" DataValueField="EID" OnSelectedIndexChanged="ddlEName_SelectedIndexChanged">
                </asp:DropDownList>
                <br />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="ddlEName" ErrorMessage="Please Select Employee" 
                    InitialValue="-Select-" ValidationGroup="1" ForeColor="Red"></asp:RequiredFieldValidator>
                <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:Project_monitorConnectionString %>" 
                    SelectCommand="SELECT distinct [EID], [EName] FROM [EmployeeMaster] where ([user_id] = @user_id and working_status=1 ) order by EName">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="User_id" Name="user_id" 
                            SessionField="User_id" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td class="style26">

                 <asp:TextBox ID="txtFrmEmp" runat="server"  
                Width="90px" Font-Size="12px" AutoPostBack="true"></asp:TextBox>
  <cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender5" runat="server" TargetControlID="txtFrmEmp" WatermarkText="From date" WatermarkCssClass="watermarkcss" ></cc1:TextBoxWatermarkExtender>

                 <cc1:CalendarExtender ID="CalendarExtender3" runat="server"
                    Enabled="True" TargetControlID="txtFrmEmp" Format="dd-MM-yyyy">
                </cc1:CalendarExtender>
                 <asp:TextBox ID="txtToEmp" runat="server" AutoPostBack="true"   Width="90px" Font-Size="12px"  ></asp:TextBox>
 <cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender6" runat="server" TargetControlID="txtToEmp" WatermarkText="To date" WatermarkCssClass="watermarkcss" ></cc1:TextBoxWatermarkExtender>

                 <cc1:CalendarExtender ID="CalendarExtender4" runat="server"
                    Enabled="True" TargetControlID="txtToEmp" Format="dd-MM-yyyy">
                </cc1:CalendarExtender>
               
                &nbsp;</td>
        </tr>
       
  
        <tr>
            <td style="align-content:center"> 
                &nbsp;</td>
            <td align="right" class="style27">
                &nbsp;</td>
            <td class="style28">
                &nbsp;</td>
            <td align="left" class="style26">
              
            </td>
            <td class="style26">
               
                  <asp:Button ID="btnPreEmp" runat="server" CssClass="myButton" 
                    Text="Previous Month" ValidationGroup="1" Width="110px" OnClick="btnPreEmp_Click"/>
                  <asp:Button ID="btnNxtEmp" runat="server" CssClass="myButton" 
                    Text="Next Month" ValidationGroup="1" Width="90px"  OnClick="btnNxtEmp_Click"   />
                  <asp:Label ID="lbl_reoprt_end_records" runat="server" Text="" ForeColor="Green"></asp:Label>
            </td>

        </tr>
       <tr>
                    <td class="style26" colspan="5" align="center">
                    <asp:Panel ID="Panel4" runat="server" CssClass="contactpanelcss" Width="100%">
                    <div style="overflow: scroll;height:400px;">
                    <asp:Label ID="lblView" runat="server" Font-Names="Verdana" Font-Size="14px" ForeColor="#FF3300"></asp:Label>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None" 
                            BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" 
                            CellPadding="2" Font-Names="Verdana" Font-Size="12px" 
                            ForeColor="Black" >  
                        
                            <Columns>
                            <asp:TemplateField HeaderText="Date" HeaderStyle-Width="80px">
                                    <ItemTemplate>
                                      <center>
                                         <asp:Label ID="lblRowid" runat="server" Text='<%# Eval("add_date")%>' Width="100px"></asp:Label>
                                      </center>
                                    </ItemTemplate>
                                 
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Employee Name">
                                    <ItemTemplate>
                                        <center>
                                          <asp:TextBox ID="lblename" runat="server"  Width="120px" ReadOnly="true" CssClass="font" Text='<%# Eval("EName")%>'></asp:TextBox>  
                                        </center>
                                    </ItemTemplate>
                                 <EditItemTemplate>
                 <asp:DropDownList ID="ddlenam" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="SqlDataSource11" DataTextField="EName" DataValueField="EID">
                 </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource11" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:Project_monitorConnectionString %>" 
                    SelectCommand="SELECT [EID], [EName] FROM [EmployeeMaster] where ([user_id] = @user_id) order by EName">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="User_id" Name="user_id" 
                            SessionField="User_id" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                                 </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Food" HeaderStyle-Width="80px">
                                    <ItemTemplate>
                                        <center>
                                          <asp:TextBox ID="lblSubmittedDate" runat="server" Text='<%# Eval("daily_expenses_cost")%>' 
                                                Width="80px" ReadOnly="true" CssClass="font"></asp:TextBox>  
                                        </center>
                                    </ItemTemplate>
                                 <EditItemTemplate>
                                   <asp:TextBox ID="txtsdate" runat="server" Text='<%# Eval("daily_expenses_cost")%>' 
                                             ReadOnly="true"    Width="120px" CssClass="font"></asp:TextBox>
                                 </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Food Expenses Description" HeaderStyle-Width="120px">
                                    <ItemTemplate>
                                        <center>
                                          <asp:TextBox ID="lbldaily_expenses_description" runat="server" Text='<%# Eval("daily_expenses_description")%>' 
                                                Width="120px" ReadOnly="true" CssClass="font"></asp:TextBox>  
                                        </center>
                                    </ItemTemplate>
                                 <EditItemTemplate>
                                   <asp:TextBox ID="txtdaily_expenses_description" runat="server" Text='<%# Eval("daily_expenses_description")%>' 
                                             ReadOnly="true"    Width="120px" CssClass="font"></asp:TextBox>
                                 </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Travel" HeaderStyle-Width="80px">
                                    <ItemTemplate>
                                       <center>
                                        <asp:TextBox ID="lblTA" runat="server" Text='<%# Eval("daily_travel_cost")%>' 
                                                Width="80px" ReadOnly="true" CssClass="font"></asp:TextBox>  
                                         
                                       </center>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                    <asp:TextBox ID="txtassign" runat="server" Text='<%# Eval("daily_travel_cost")%>' 
                                                Width="150px" CssClass="font"></asp:TextBox>  
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Travel Expenses Description">
                                    <ItemTemplate>
                                       <center>
                                        <asp:TextBox ID="lbldaily_travel_description" runat="server" Text='<%# Eval("daily_travel_description")%>' 
                                                Width="150px" ReadOnly="true" CssClass="font"></asp:TextBox>  
                                         
                                       </center>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                    <asp:TextBox ID="txtdaily_travel_description" runat="server" Text='<%# Eval("daily_travel_description")%>' 
                                                Width="150px" CssClass="font"></asp:TextBox>  
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Material Purchase">
                                    <ItemTemplate>
                                       <center>
                                        <asp:TextBox ID="lblMC" runat="server" Text='<%# Eval("daily_mtrl_cost")%>' 
                                                Width="150px" ReadOnly="true" CssClass="font"></asp:TextBox>  
                                         
                                       </center>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                    <asp:TextBox ID="txtassign" runat="server" Text='<%# Eval("daily_mtrl_cost")%>' 
                                                Width="150px" CssClass="font"></asp:TextBox>  
                                    </EditItemTemplate>
                                </asp:TemplateField>
                               <asp:TemplateField HeaderText="Material Purchase Expenses Description">
                                    <ItemTemplate>
                                       <center>
                                        <asp:TextBox ID="lbldaily_mtrl_description" runat="server" Text='<%# Eval("daily_mtrl_description")%>' 
                                                Width="150px" ReadOnly="true" CssClass="font"></asp:TextBox>  
                                       </center>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                       <asp:TextBox ID="txtdaily_mtrl_description" runat="server" Text='<%# Eval("daily_mtrl_description")%>' Width="150px" CssClass="font"></asp:TextBox>  
                                    </EditItemTemplate>
                                </asp:TemplateField>

                                  <asp:TemplateField HeaderText="TotalExpenses" HeaderStyle-Width="100px">
                                    <ItemTemplate>
                                      <center>
                                         <asp:TextBox ID="lblTotalExpenses" runat="server" Width="100px" ReadOnly="true" CssClass="font" Text='<%# Eval("TotalExpenses")%>'></asp:TextBox> 
                                       </center>
                                    </ItemTemplate>                                                                   
                                </asp:TemplateField>
       <asp:TemplateField HeaderText="Attachments"  ItemStyle-Width="60px">
                            <ItemTemplate>
           <asp:LinkButton ID="lnkattach" runat="server" CommandName="Attachment" Text="Attachment">
           </asp:LinkButton>
                            </ItemTemplate>
                           </asp:TemplateField>
                         <asp:CommandField ShowEditButton="false"/>           
                         </Columns>
                            
                    <FooterStyle BackColor="LightGoldenrodYellow" />
                    <PagerStyle BackColor="LightGoldenrodYellow" ForeColor="#FFC46A" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#FFCF88" ForeColor="GhostWhite" />
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" Height="30px" />
                    <AlternatingRowStyle BackColor="#F8F4DA" />
                    </asp:GridView>


          
                    </div>
                    </asp:Panel>
              &nbsp;</td>
                    </tr>
       
   
     </table>
   
     </asp:Panel>
        <div>
<asp:Button ID="Button1" runat="server" style="display:none" />
<cc1:modalpopupextender ID="ModalPopupExtender1" runat="server"  BehaviorID="mpm2" TargetControlID="Button1" PopupControlID="pnl" CancelControlID="img22" BackgroundCssClass="modelbackground"  Enabled="True"></cc1:modalpopupextender>

        <asp:Panel ID="pnl" runat="server" BackColor="White" Width="40%" style="border:Solid 2px #D46900; display:none;height:520px;overflow-y:scroll;">
        <table width="100%"  cellpadding="0" cellspacing="0" >
        <tr class="backgrnd">
        <td style="height:10%; color:White; font-weight:bold;padding:3px; font-size:larger; font-family:Calibri" align="left">
        <asp:Label runat="server" ID="lblheading"></asp:Label>
        </td>
                     <td style=" color:White; font-weight:bold;padding:3px; font-size:larger" align="right">  
                         <a id="img22"><img src="Images/Close.png" align="right" /></a>
                         <asp:HiddenField ID="hfS_P_I_D" runat="server"/>
                     </td>
        </tr>
               
                 <tr><td align="center" style="width:100%;" >  
                     <div id="dv_attachments" align="center"  style="width:100%;display:none;margin-top:0px;">
                                <table>
                           
                                   
                                    <tr><td colspan="3" align="center"><br />
                                           <asp:Label runat="server" ID="lbl_attch_record" ForeColor="Green" Font-Bold="true" Text=""></asp:Label>
                                        <br />
                                         <script type="text/javascript">
                                             $(document).ready(function () {
                                                 $('#<%= lbl_attch_record.ClientID %>').fadeOut(10000, function () {
                                                     $(this).html(""); //reset the label after fadeout
                                                 });
                                             });
                                                    </script>
                                        </td></tr>
                                    <tr><td colspan="3" align="center">
                                        <asp:Label runat="server" ID="lbl_no_of_attachments" ForeColor="Green" Font-Bold="true" Text=""></asp:Label>
                                        
                                        <br />
                                          <div id="div_attachments"> 	
                                         <table id="_attachemts_table" style="border-style:solid;border-width:0.5px;border-color:blue;" >
<tr style="background-color:#507CD1; color:white;"><th>Attachment Name</th></tr>
<tbody id="Attachemts_list" style="background-color:white;">

</tbody>
</table>
                                              </div>
                                        </td></tr>
                         </table>
                      </div>
                     </td></tr>

                <tr><td><br /></td></tr>


            </table>
            <asp:HiddenField runat="server" ID="hf_chk_flag" />
              <asp:HiddenField runat="server" ID="hf_upload" />
               <asp:HiddenField runat="server" ID="hf_name_type" />
            </asp:Panel>
    </div>
                  
    </asp:Content>