3 class AccountName extends DatabaseTable {
5 public function __construct($id)
8 parent::__construct('account_names', $id);
10 parent::__construct('account_names', $id, 'blz_kto');
13 public function getAccounts($currency, $display=false)
15 if ($currency == "eur")
18 $table = "account_dm";
20 $sql = sprintf("SELECT DISTINCT %s.blz_kto,name FROM %s JOIN account_names using(blz_kto)%s ORDER BY name",
22 $display === false ? '' : ' WHERE display = '.$display);
23 return $this->db->fetchObjectList($sql);
26 public function name()
31 $both = explode (":", $this->data->blz_kto);
33 return sprintf ("%s (BLZ %s, Konto %s)", $this->data->name, $both[0], $both[1]);
35 return sprintf ("%s (%s)", $this->data->name, $this->data->blz_kto);