<%@ page title="" language="C#" masterpagefile="~/html/MasterPage.master" autoeventwireup="true" inherits="html_EmployeewiesReport, App_Web_fz5gj3qy" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../css/buttoncss.css" type="text/css" rel="Stylesheet"/>
     <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

    <style type="text/css">
     .shadow_five21 {
            background-color: #FFF0DB;      
            -moz-border-radius: 10px;
            -webkit-border-radius: 10px;
            -o-border-radius: 10px;
            -ms-border-radius: 10px;
            border-radius: 10px;
            -moz-box-shadow: 0px 0px 0px #B1A59A;
            -webkit-box-shadow: 0px 0px 0px #B1A59A;
            -o-box-shadow: 0px 0px 0px #B1A59A;
            -ms-box-shadow: 0px 0px 0px #B1A59A;
            box-shadow: 0px 0px 0px #B1A59A;
            padding:10px;
               width: 70%;
            border:5px solid Orange;
        }
        
        
            .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>


      <script type="text/javascript">
        $().ready(function () {

            var user_id = $('input[id$=hf_user_id]').val();
            var designation = $('input[id$=hf_designation]').val();
            var Pageload = $('input[id$=hfpageload]').val();

            if (Pageload == "Yes") {
                $("#<%=lbl_msg.ClientID %>").html("No Data Found.");                
                $('input[id$=hfpageload]').val("");
            }

            $("[id*=lnk_empselected]").click(function () {

                var EID = $(this).closest('tr').find("input[id*=hfEIDid]").val();
                $('input[id$=hf_empID]').val(EID);
                //this.parentNode.parentNode.style.backgroundColor = "#FFCC66";

                var fromdate = $("[id*=txt_from_date]").val();
                var Todate = $("[id*=txt_to_date]").val();

                if (fromdate !== "" && Todate != "") {
                    Bind_employeeWise_reports(fromdate, Todate, user_id, EID);

                } else {

                    var YearNo = $('input[id$=hf_year_no]').val();
                    var MonthNo = $('input[id$=hf_month_no]').val();

                    Bind_monthwiseDetails(MonthNo, YearNo, "", EID);
                }
            }); 


            function Bind_monthwiseDetails(MonthNo, YearNo, pre_next, EID) {
                $.ajax({
                    type: "POST",
                    url: "EmployeewiesReport.aspx/bind_monthWise_report",
                    data: "{Monthno:" + MonthNo + ",YearNo:" + YearNo + ",pre_next:'" + pre_next + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {

                        $.each(msg.d, function () {

                            $('input[id$=hf_year_no]').val(this['yearno']);
                            $('input[id$=hf_month_no]').val(this['monthno']);
                            $('input[id$=hf_from_date]').val(this['startdate']);
                            $('input[id$=hf_todate]').val(this['enddate']);
                            $("#<%=lbl_month_year.ClientID %>").html(this['month_year']);  
                            var endmessage = this['end_msg'];
                            if (endmessage != "") {
                                $("#<%=lbl_end_msg.ClientID %>").html("You have reached at end of records.");
                            }
                            else {
                                $("#<%=lbl_end_msg.ClientID %>").html(" ");
                            }

                            Bind_employeeWise_reports(this['startdate'], this['enddate'], user_id, EID);
                        });
                    }
                });
            }


            function Bind_employeeWise_reports(from_date, to_date, user_id, empid) {

                $.ajax({
                    type: "POST",
                    url: "EmployeewiesReport.aspx/bind_employee_reoprt",
                    data: "{from_date:'" + from_date + "',to_date:'" + to_date + "',user_id:'" + user_id + "',empid:'" + empid + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {
                        //$("#employeewise_report_list").append(response.d);
                        //$("#dvinfo").append(response.d);

                        $("#employeewise_report_list").empty();
                        $.each(response.d, function () {

                            var sub_Sub_stage_desc = "";
                            if (this['sub_Sub_stage_desc'] != "") {
                                sub_Sub_stage_desc = "<div><li style='margin-left:50px;'><a style='color:#0000cc;width:100%;font-weight:100;'> " + this['sub_Sub_stage_desc'] + " </a> </li></div>";
                            }
                           
                            $("#employeewise_report_list").append("<tr><td style = 'width:160px;font-weight:100;'><div><div align = 'left' > " + this['add_date'] + " </div><div align ='right' style='vertical-align:top;'> " + this['total_time'] + " </div></div><br/> <a style='width:50px'> " + this['start_time'] + "  &nbsp;  " + this['end_time'] + " &nbsp;   " + this['Total_tasktime'] + " </td>  <td> <a  style='color:#8a0000;width:200px;'> <b> " + this['CName'] + " </b> </a> <br /><br /> <a  style='color:#6600cc;width:200px;'> <b> " + this['PName'] + " </b></a> </td> <td> <a  style='color:Black;width:100%;'> <b> " + this['Mainstage_name'] + " </b></a>   <ul style='margin-top:-2px;'>   <li> <a  style='color:Black;width:100%;font-weight:100;'> " + this['sub_stage_desc'] + " </a> </li> " + sub_Sub_stage_desc + " </ul> </td><td style='font-weight:100;'>" + this['progress_desc'] + "</td><td align='right' style='font-weight:100;'>" + this['progress_percentages'] + "</td><td align='right'  style='font-weight:100;'>" + this['daily_expenses_cost'] + "</td><td  style='font-weight:100;'> " + this['daily_expenses_description'] + "</td></tr>");

                        });

                        $("#<%=lbl_msg.ClientID %>").html(" ");    

                    },
                    failure: function (response) {
                        alert(response.d);
                    },
                    error: function (response) {
                        alert(response.d);
                    }
                });
            }


            $("#btnshow_employee_wise_reoprt").click(function () {

                var fromdate = $("[id*=txt_from_date]").val();
                var Todate = $("[id*=txt_to_date]").val();
                var EID = $('input[id$=hf_empID]').val();
                
                if (fromdate == "") {
                    alert("Select From Date.");
                }
                else if (Todate == ""){
                    alert("Select To Date.");
                }
                else if (EID == "") {
                    alert("Please Select employee.");
                }
                else {
                    Bind_employeeWise_reports(fromdate, Todate, user_id, EID);
                }

            });

            $("#btnprevius").click(function () {

               $("[id*=txt_from_date]").val("");
               $("[id*=txt_to_date]").val("");
               var EID = $('input[id$=hf_empID]').val();

                if (EID == "") {
                    alert("Please Select employee.");
                }
                else {
                    var YearNo = $('input[id$=hf_year_no]').val();
                    var MonthNo = $('input[id$=hf_month_no]').val();

                    Bind_monthwiseDetails(MonthNo, YearNo, "pre", EID);
                }

            });

            $("#btnnext").click(function () {

                $("[id*=txt_from_date]").val("");
                $("[id*=txt_to_date]").val("");
                var EID = $('input[id$=hf_empID]').val();

                if (EID == "") {
                    alert("Please Select employee.");
                }
                else {
                    var YearNo = $('input[id$=hf_year_no]').val();
                    var MonthNo = $('input[id$=hf_month_no]').val();

                    Bind_monthwiseDetails(MonthNo, YearNo, "next", EID);
                }

            });

        });

    </script>


</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

 <%--<asp:UpdateProgress ID="UpdateProgress2" runat="server"  
                           DynamicLayout="true"  >
                          <ProgressTemplate>
                          <div style="width:100%;">
                              <div class="cssLoadingTimer"  >
                              <p> Please wait...</p>
                                  <img id="Img1111" alt="Loading..." src="../images/Regloader.gif" runat="server" style="margin-top:15px;" align="middle"  />
                                  </div>
                                  
                                  </div>
                          </ProgressTemplate>
                      </asp:UpdateProgress>--%>

<%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>--%>
    <div class="p12" style="float:left; width:200px"  >
      <p style="font-family:Verdana; font-size:14px; margin-top:0px;color:Blue;font-weight:bold;padding-top:5px;">
     <b style="color:White;">&nbsp;&nbsp;&nbsp;&nbsp;Employee wise report
      </p>
   
           </div>
           <br />
           <br />
      
    <asp:Panel ID="pln_show_date_type" runat="server" Height="200px" CssClass="shadow_five21" >

        <div style="width:800px;">
         
                <div style="height:150px;float:left; overflow:scroll; width:300px; ">
        <table width="100%">
          <tr>
            <td class="style25" style="font-weight:100;">
            </td>
            <td align="right" class="style28">
                <%--<asp:Label ID="Label33" runat="server" Font-Names="Verdana" Font-Size="12px" ForeColor="Black" 
                    Text="Select Employee"></asp:Label>--%>
            </td>
            <td><%--<a style="color:Red;">*</a>--%>
            </td>
            <td align="left" class="style26">
              <%--  <asp:DropDownList ID="ddl_employee_name" runat="server" AutoPostBack="true" 
                    AppendDataBoundItems="True">
                                                
                </asp:DropDownList>--%>
                <asp:HiddenField ID="hf_empID" runat="server" />
               
                <asp:GridView ID="gv_employee_list" runat="server" AutoGenerateColumns="false" Width="300px" BackColor="White"
                    HeaderStyle-ForeColor="Black" GridLines="None">  <%-- onrowcommand="gv_employee_list_RowCommand"--%>
                <Columns>
                 <asp:TemplateField HeaderText="Select Employee"  ItemStyle-Width="">
                 <ItemTemplate>       
                     <asp:Label ID="lbl_empid" runat="server" Text='<%# Eval("EID") %>' Visible="false"></asp:Label>                            
                     <a id="lnk_empselected"  style="color:#000099;cursor:pointer;font-size:13px;font-family:Verdana;" >
                     <asp:Label ID="lbl_emp_name" runat="server" Text='<% #Eval("Ename") %>' Font-Bold="false"></asp:Label>
                     </a>

                                <asp:HiddenField runat="server" ID="hfEIDid"  Value='<% # Eval("EID") %>'  />
                </ItemTemplate>
                </asp:TemplateField>
                </Columns>
                
                 <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" CssClass="cssPager" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                
                 </td>
            <td class="style26">
            </td>
        </tr>
        
           
        

        
        </table>
                </div>
                
                <div style="width:370px;float:right;margin-left:0px;">
                
                <table >
                <tr>
                <td colspan="4">
                <div  style="background-color:#990000;width:200px;height:20px;">
                 <asp:Label ID="Label1" runat="server" Text="&nbsp;&nbsp;Select any other period"></asp:Label>
                </div>
                   
                </td>
                </tr>
              
                           <tr>
            <td >
            </td>
            <td align="right" >
                <asp:Label ID="Label34" runat="server" Font-Names="Verdana" Font-Size="12px" ForeColor="Black" 
                    Text="From" ></asp:Label>                 
                   
            </td>
            <td><a style="color:Red;">*</a>
            </td>
            <td align="left" >
                
                <asp:TextBox ID="txt_from_date" runat="server" Height="15px" Width="120px"></asp:TextBox>
                <cc1:CalendarExtender ID="CalendarExtender3" runat="server"
                    Enabled="True" TargetControlID="txt_from_date" Format="dd/MM/yyyy" >
                </cc1:CalendarExtender>
              &nbsp;&nbsp;  <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Enter 'From' Date" 
              Font-Bold="false" ControlToValidate="txt_from_date" ValidationGroup="1" ForeColor="Red"></asp:RequiredFieldValidator>
                             
                
            </td>
          
        </tr>
        <tr>
        <td></td>
         <td align="right">  <asp:Label ID="Label35" runat="server" Font-Names="Verdana" Font-Size="12px"  ForeColor="Black" 
                    Text="To"></asp:Label> 
                    </td>
          <td>
         
           <a style="color:Red;">*</a>         
              
               
          </td>
           <td>
             <asp:TextBox ID="txt_to_date" runat="server" Height="15px" Width="120px"></asp:TextBox>
                <cc1:CalendarExtender ID="CalendarExtender4" runat="server" 
                    Enabled="True" TargetControlID="txt_to_date" Format="dd/MM/yyyy" >
                </cc1:CalendarExtender>
          &nbsp;&nbsp;  <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Enter 'To' Date"
           ControlToValidate="txt_to_date" Font-Bold="false" ValidationGroup="1" ForeColor="Red"></asp:RequiredFieldValidator>

           </td>
        </tr>
      
        
        <tr>
            <td class="style25">
            </td>
            <td align="right" class="style28">
               
            </td>
            <td>
            </td>
            <td align="left" class="style26">
                
              <asp:Button ID="btn_show_employee_wise_reoprt" runat="server"  
                    CssClass="myButton" Width="100px"
                    Text="Show" ValidationGroup="1" onclick="btn_show_employee_wise_reoprt_Click" Visible="false"  />

                 <input type="button" id="btnshow_employee_wise_reoprt" value="Show" name="Show" class="myButton" style="width:100px;" />
             
                <br />
                   <asp:Label ID="lbl_msg" runat="server" Font-Names="Verdana" Font-Size="12px" 
                    ForeColor="#FF3300" Width="200px"></asp:Label>
              <%--  <asp:UpdateProgress ID="UpdateProgress1" runat="server" 
                           DynamicLayout="true">
                          <ProgressTemplate>
                              <div>
                                  <img id="Img1" alt="Loading..." src="../images/Regloader.gif" runat="server" />
                                  </div>
                          </ProgressTemplate>
                      </asp:UpdateProgress>--%>
                  
  
   
             
                
            </td>
         
        </tr>
                
                </table>
                <br /><br />
                   <b> <a style="color:Red;  padding-right:20px; float:right; ">* Indicates Compulsory Fields</a></b>
                </div>
                
                </div>
             
        </asp:Panel>
        <br />
    <asp:Panel ID="pnl_show_Quotation" runat="server" Visible="true">
    
        <asp:HiddenField ID="hf_from_date" runat="server" />
         <asp:HiddenField ID="hf_todate" runat="server" />
        
        <asp:HiddenField ID="hf_date" runat="server" />
          <asp:HiddenField ID="hf_month_no" runat="server" />
            <asp:HiddenField ID="hf_year_no" runat="server" />
            <div style="text-align:left;font-size:18pt;font-weight:bold;margin-left:0px;">
        <asp:Label ID="lbl_month_year" runat="server" Text="" ForeColor="Black" ></asp:Label>
        </div>
        <div style="display:none;">
        <asp:GridView ID="gv_show_employee_reoprt" runat="server" AutoGenerateColumns="False" 
                            GridLines="Both"  Width="100%" AllowPaging="true" PageSize="30"
                            BackColor="LightGoldenrodYellow" BorderColor="Tan" Font-Bold="false"  
            BorderWidth="1px" 
                    CellPadding="2"   Font-Names="Verdana"  Font-Size="12px"
            ForeColor="Black" 
            onpageindexchanging="gv_show_employee_reoprt_PageIndexChanging" 
            onrowdatabound="gv_show_employee_reoprt_RowDataBound" Visible="false"> 
                            
                            <Columns>                    
                               <asp:TemplateField HeaderText="Reoprt Date<br/>Time (Hrs)" HeaderStyle-Width="160px">
                                    <ItemTemplate>
                                    <div>
                                    <div align="left">
                                        <asp:Label ID="lblQuoteSendToPName5" runat="server" Text='<%# Eval("add_date")%>'
                                                Width="80px" ReadOnly="true" ></asp:Label>
                                                </div>
                                                <div align="right" style="vertical-align:top;">
                                                 <asp:Label ID="lbl_emp_total_work_time" runat="server" Text=""
                                                Width="50px" ReadOnly="true" ></asp:Label>
                                                </div>
                                         </div>
                                                <br />
                                                
                                                   <asp:Label ID="lblstart_tim_e" runat="server" Text='<%# Eval("start_time")%>'
                                                Width="50px" ReadOnly="true" ></asp:Label>
                                                
                                                   <asp:Label ID="lbl_end_time" runat="server" Text='<%# Eval("end_time")%>'
                                                Width="50px" ReadOnly="true" ></asp:Label>
                                                
                                                
                                                  <asp:Label ID="lbl_Total_time" runat="server" Text='<%# Eval("Total_time")%>'
                                                Width="50px" ReadOnly="true" ></asp:Label>

                                        
                                    </ItemTemplate>
                                 </asp:TemplateField>  
                                 
                                 <%--  <asp:TemplateField HeaderText="Start Time<br/> End Time<br/> ">
                                    <ItemTemplate>
                                                                       
                                       <asp:Label ID="lbl_start_time" runat="server" Text='<%# Eval("start_time")%>'
                                                Width="100px" ReadOnly="true" ></asp:Label>
                                                  <asp:Label ID="lbl_end_time" runat="server" Text='<%# Eval("end_time")%>'
                                                Width="100px" ReadOnly="true" ></asp:Label>
                                                  <asp:Label ID="lbl_Total_time" runat="server" Text='<%# Eval("Total_time")%>'
                                                Width="100px" ReadOnly="true" ></asp:Label>
                                                
                                    </ItemTemplate>
                                 </asp:TemplateField>    --%>              
                                <asp:TemplateField HeaderText="Customer Name">
                                    <ItemTemplate>
                                      <asp:Label ID="lbl_cust_id" runat="server" Text='<%# Eval("work_progress_id")%>'
                                               Visible="false"></asp:Label>                                    
                                     <asp:Label ID="lbl_cust_name" runat="server" Text='<%# Eval("CName")%>'
                                                Width="200px" ReadOnly="true" ForeColor="#8a0000" Font-Bold="true" ></asp:Label>  <br /><br />
                                                
                                                  <asp:Label ID="lblPGroupName2" runat="server" Text='<%# Eval("PName")%>'
                                                Width="200px" ReadOnly="true" ForeColor="#6600cc" Font-Bold="true" ></asp:Label>                                 
                                         </ItemTemplate>
                                 </asp:TemplateField> 
                                 
                                   <asp:TemplateField HeaderText="Activity<br/> Stage Name<br/> Task Name" HeaderStyle-Width="400px">
                                    <ItemTemplate>
                                        <asp:Label ID="lblPName1" runat="server" Text='<%# Eval("Mainstage_name")%>'
                                                Width="100%" ReadOnly="true" ForeColor="Black"  Font-Bold="true"></asp:Label>
                                               <ul style="margin-top:-2px;">   <li>
                                                 <asp:Label ID="lbl_sub_stage_desc" runat="server" Text='<%# Eval("sub_stage_desc")%>'
                                                Width="100%" ReadOnly="true" ForeColor="Black" ></asp:Label> 
                                                  </li>
                                                  <div id="div_task_name" runat="server">
                                                  <li style="margin-left:50px;">
                                                   <asp:Label ID="lbl_sub_Sub_stage_desc" runat="server" Text='<%# Eval("sub_Sub_stage_desc")%>'
                                                Width="100%" ReadOnly="true"  ForeColor="#0000cc" Font-Bold="false"></asp:Label>    
                                                  </li>
                                                  </div>
                                                  </ul> 
                                              
                                                                       
                                    </ItemTemplate>
                                  </asp:TemplateField>
                                   <asp:TemplateField HeaderText="Progress Dateils">
                                    <ItemTemplate>
                                         <asp:Label ID="lbl_progress" runat="server" Text='<%# Eval("progress_desc")%>'
                                                Width="100%" ReadOnly="true" ></asp:Label>                            
                                    </ItemTemplate>
                                 </asp:TemplateField>
                                 
                                 
                                                                     
                                 <asp:TemplateField HeaderText="Percentage">
                                    <ItemTemplate>
                                      <div align="right">                                      
                                       <asp:Label ID="lblQuoteSendToPName6" runat="server" Text='<%# Eval("progress_percentages")%>'
                                                Width="100%" ReadOnly="true" ></asp:Label>
                                                 </div> 
                                    </ItemTemplate>
                                 </asp:TemplateField>                
                               <asp:TemplateField HeaderText="Expense">
                                    <ItemTemplate>
                                     <div align="right">
                                        <asp:Label ID="lblQuanitity4" runat="server" Text='<%# Eval("daily_expenses_cost")%>' 
                                                Width="100%" ReadOnly="true" ></asp:Label>
                                    </div>
                                    </ItemTemplate>
                                 </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Expenses Description">
                                 <ItemTemplate>
                               
                                  <asp:Label ID="lbl_amount" runat="server" Text='<%# Eval("daily_expenses_description")%>' 
                                                Width="100%" ReadOnly="true" ></asp:Label>
                              
                                 </ItemTemplate>
                                 </asp:TemplateField>
                                                                                 
                                                          
                              
                            </Columns>
                            
                              <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" CssClass="cssPager" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                         
                        </asp:GridView>
            </div>

         <table id="_tbl_employeewise_report" cellpadding="4" border="1" rules="all" style="border-style:solid;border-width:0.2px;border-color:grey;font-family:Verdana;font-size:12px;" width="100%">
<tr style="background-color:#990000; color:white;font-size:12px;">
    <th style="width:160px;">Reoprt Date<br/>Time (Hrs)</th>
    <th style="width:200px;"><b>Customer Name</b></th>
    <th style="width:400px;"><b>Activity<br/> Stage Name<br/> Task Name</b></th>
    <th><b>Progress Dateils</b></th>
    <th><b>Percentage</b></th>
    <th><b>Expense</b></th>
    <th><b>Expenses Description</b></th>
</tr>
<tbody id="employeewise_report_list" style="background-color:LightGoldenrodYellow;color:black;">

</tbody>
</table>  
        
        <div id="dvinfo"></div>


        <br />
                        <div style="width:850px">
                        <div style="width:200px;float:left;">                       
                       
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <asp:Button ID="btn_previus" runat="server" Text="Previous" CssClass="myButton" 
            onclick="btn_previus_Click" Visible="false" />
                            <input type="button" id="btnprevius" value="Previous" name="Previous" class="myButton"  />
             </div>
             <div style="float:right;width:400px;" align="right">
      <asp:Button ID="btn_next" runat="server" Text="Next" CssClass="myButton" 
            onclick="btn_next_Click" Visible="false" />
                 <input type="button" id="btnnext" value="Next" name="Next" class="myButton"  />
                 <br />
                 <asp:Label ID="lbl_end_msg" runat="server" Text="" ForeColor="Green" ></asp:Label>
                 
            </div>
            </div>
    </asp:Panel>
  
  <%-- </ContentTemplate>
 
    </asp:UpdatePanel>--%>
 

     <asp:HiddenField ID="hfpageload" runat="server" />
     <asp:HiddenField ID="hf_user_id" runat="server" />
        <asp:HiddenField ID="hf_designation" runat="server" />

   </asp:Content>

