$kurlistesi = ORM::for_table('sys_kurtanim')->where('aktif',1)->where_not_equal('kurkodu','TRY')->find_many(); foreach ($kurlistesi as $kur){ $kurkodu = $kur['kurkodu']; $col = array(); $col["title"] = "Bakiye ".$kur['kurkodu']; $col["name"] = "balance".$kur['kurkodu']; $col["align"] = "right"; $col["search"] = false; $col["hidden"] = true; $col["show"] = array("list"=>true); $col["sortable"] = true; $col["sorttype"] = "number"; $col["on_data_display"] = array("bakiye_goster_dovizli",$kurkodu, ""); $cols[] = $col; } function bakiye_goster_dovizli($data,$kurkodu) { $id = $data['id']; $caribakiye = ORM::for_table('')->raw_query("CALL caribakiyedovizli($id,'1970-01-01','2099-01-01','$kurkodu')")->find_one(); $cb = number_format(($caribakiye['balance']), 2, ',', '.'); $cbyaz = number_format(abs($caribakiye['balance']), 2, ',', '.'); // return $cbyaz; if ($cb > 0.01) return $cbyaz . ' ' . $_c['currency_code'] . ' (B)'; else if ($cb == 0) return $cbyaz . ' ' . $_c['currency_code']; else return $cbyaz . ' ' . $_c['currency_code'] . ' (A)'; } i want to send $kurkodu but it's not work
1 Answers
Hi,
You need to set this variable as global and then use it inside function. e.g.
function bakiye_goster_dovizli($data)
{
global $kurkodu;
//…
}
Your Answer