Forum Moderators: coopster
function deduction()
{
include("connect.php");
$result = odbc_exec($conn,"select t0.emp_id,t0.amount,t1.id,t1.name,t2.name,t1.updcode from paytrnh t0
inner join trans t1 on t0.tran_id = t1.id
inner join person t2 on t0.emp_id = t2.id
where t0.emp_id ='837496' and t0.pay_date = '02/02/2010' and t1.updcode ='D'
");
if($result > 0)
{
$rdata = '<table cellpadding="2" cellspacing="2">';
$counter = 0;
while (odbc_fetch_array($result))
{
$Dname = odbc_result($result,4);
$amount = number_format(odbc_result($result,2),2);
$rdata .= '<tr><td>'.$Dname.'<td> <td>'.$amount.'</td>';
}
$rdata .='</tr></table>';
}
return $rdata;
}
6,631.07
$a = floatval(getTotalearning());
$a = preg_replace('/,/', '', $a);
$b = floatval(getTotaldeduction());
$b = preg_replace('/,/', '', $b);
$c = $a - $b;
echo number_format($c, '2', '.', ',');