myaccounts->getAllAccountsTable(3);
?>
db->where("status", 1)->where("(accategory_id = 2 OR accategory_id = 3)");
$CI->db->where("status", 1)->where("accategory_id = 3");
$CI->db->order_by("account_name ASC");
$Accounts = $CI->db->get("tbl_accounts")->result();
foreach ($Accounts as $Account) {
$Account->Group = $CI->db->query("select * from tbl_acgroups where acgroup_id=(select acgroup_id from tbl_accategories where accategory_id = $Account->accategory_id)")->row();
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
}
?>
";
$html .= "";
$html .= "Sn Account Account Group Dr Cr Balance Action ";
$html .= "";
$sn = 0;
$BalanceTotal = 0;
foreach ($Accounts as $Account) : $sn++;
$balance = getBalance($Account->account_id);
$BalanceTotal += $balance;
// pre($Account);
$html .= "" . $sn . " " . $Account->account_name . " " . $Account->Category->accategory_name . " " . (($balance >= 0) ? myCurrency($balance) : "") . " " . (($balance < 0) ? myCurrency(abs($balance)) : "") . " " . (myCurrency($balance)) . " ";
endforeach;
$html .= "";
$html .= "Total " . (($BalanceTotal > 0) ? myCurrency(abs($BalanceTotal)) : "") . " " . (($BalanceTotal < 0) ? myCurrency(abs($BalanceTotal)) : "") . " " . myCurrency($BalanceTotal) . " ";
$html .= "\n";
$html .= "
";
$html .= '';
echo $html;
?>