$lid=intval($_GET['leaveid']);
$sql = "SELECT erf.id as rid,tblemployees.FirstName,tblemployees.LastName,tblemployees.EmpId,tblemployees.id,tblemployees.Gender,tblemployees.Phonenumber,tblemployees.EmailId,erf.RDEPT,erf.NNEED,erf.PSTN,erf.DNEED,erf.RREQ,erf.NREQ,erf.ELVL,erf.CLNT,erf.SLRY,erf.BSIC,erf.TNPO,erf.QLTY,erf.EJBD from erf
join tblemployees on erf.empid=tblemployees.id
join dealer on erf.DEALER_ID=erf.DEALER_ID
where erf.id=:rid";
$query = $dbh -> prepare($sql);
$query->bindParam(':lid',$lid,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)