$total_salary_basic = round(((getSalaryDetail("basic", $emp_id, $date1)) / $day2 ) * $pay_count);
                        $total_lta = round(((getSalaryDetail("leave_travel_allow", $emp_id, $date1) / $day2) * $pay_count));
                        $total_convence = round(((getSalaryDetail("convence", $emp_id, $date1) / $day2) * $pay_count));
                        $total_medical = round((getSalaryDetail("medical", $emp_id, $date1) / $day2) * $pay_count);
                        $total_site = round((getSalaryDetail("site_allowance", $emp_id, $date1) / $day2) * $pay_count);
                        $total_hra = round((getSalaryDetail("hra", $emp_id, $date1) / $day2) * $pay_count);
                        $total_phone = round((getSalaryDetail("phone", $emp_id, $date1) / $day2) * $pay_count);
                        $total_other_allowance = round((getSalaryDetail("other_allowance", $emp_id, $date1) / $day2) * $pay_count);
                        $side_allowance = round((getSalaryDetail("side_allowance", $emp_id, $date1) / $day2) * $pay_count);
                        $other_deductions = round((getSalaryDetail("other_deductions", $emp_id, $date1) / $day2) * $pay_count);
                        $total_earning = round($total_salary_basic) + round($total_lta) + round($total_convence) + round($total_medical) + round($total_hra) + round($side_allowance);
                        $total_pf = round(($total_salary_basic * getAccountDetail('pf_rate', $emp_id)) / 100);
                        $total_esi = round(($total_earning * getAccountDetail('esic_rate', $emp_id)) / 100);
                        $total_advance = getadvance($emp_id, $month, $year);

                        $total_loan = getloanDeduction($emp_id, $month, $year);
                        $prof_tax = getSalaryDetail("professional_tax", $emp_id, $date1);
                        $tds = getSalaryDetail("tds", $emp_id, $date1);
                        $monthDeduction = getSalaryDeduction($emp_id, $month, $year);


                        $sql = "SELECT sum(salary_fine) as salary_fine,sum(salary_damage) as salary_damage,sum(salary_canteen) as salary_canteen ,sum(salary_society_welfare) as salary_society_welfare, sum(salary_electrical) as salary_electrical, sum(salarly_security) as salarly_security ,sum(salary_house_rent) as salary_house_rent FROM mpc_salary_deduction where emp_id  = '" . $emp_id . "' and  MONTH(salary_deduction_date)='" . $month . "' and YEAR(salary_deduction_date) ='" . $year . "'";

                        $result = mysql_query($sql) or die("Error in : " . $sql . "<br>" . mysql_errno() . " : " . mysql_error());
                        if (mysql_num_rows($result) > 0) {
                            $row_salary_deduction = mysql_fetch_array($result);
                        }
                        $total_esi = ceil("$total_esi");
                        $total_deductions = round($total_pf + $total_esi + $total_advance + $other_deductions + $prof_tax + $tds + $total_loan + $monthDeduction);

                        $net_salary = $total_earning - $total_deductions;
																				$i++;
																				
																				}
																						
																				$basic_rate=getSalaryDetail("basic",$emp_id,$date1);
				
																				$total_earning=$total_salary_basic+$total_lta+$total_convence+$total_medical+$total_hra+$side_allowance;
																				$total_pf=($total_salary_basic*getAccountDetail('pf_rate',$emp_id))/100;
																				
																				$total_esi=($total_earning*getAccountDetail('esic_rate',$emp_id))/100;
																				
																				
				
																				$total_advance=getadvance($emp_id,$mm,$yy);
																				
																			    $total_loan=getloanDeduction($emp_id,$mm,$yy);
																				$prof_tax=getSalaryDetail("professional_tax",$emp_id,$date1);
																				$tds=getSalaryDetail("tds",$emp_id,$date1);
																				$monthDeduction=getSalaryDeduction($emp_id,$mm,$yy);
																				
																				$sql = "SELECT sum(salary_fine) as salary_fine,sum(salary_damage) as salary_damage,sum(salary_canteen) as salary_canteen ,sum(salary_society_welfare) as salary_society_welfare, sum(salary_electrical) as salary_electrical, sum(salarly_security) as salarly_security ,sum(salary_house_rent) as salary_house_rent FROM mpc_salary_deduction where emp_id  = '".$emp_id."' and  MONTH(salary_deduction_date)='".$month."' and YEAR(salary_deduction_date) ='".$year."'";
																				
																				$result_fine = mysql_query ($sql) or die ("Error in : ".$sql."<br>".mysql_errno()." : ".mysql_error());
																				if(mysql_num_rows($result_fine)>0)
																				{
																					$row_salary_deduction=mysql_fetch_array($result_fine);
																				}
																			
																			$total_esi=ceil("$total_esi");