<?php 
 

function calEmpLeaveRange($eid,$k)
{
  global $db;
  $s=new db_query();
	 $sql="select * from emp_leave_apply where empid='".$eid."' and approve_status!='C' and '".$k."' BETWEEN approved_date_from AND approved_date_to";
 $r=db_query($sql,$db);
$arr=array();
     $n=DB_num_rows($r);
 return ($n);

}

?>