In neues Modul ausgelagert
Bernd Wurst authored 6 years ago
|
6) Bernd Wurst <bernd@schokokeks.org>
7) Hanno Böck <hanno@schokokeks.org>
8)
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10)
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12) http://creativecommons.org/publicdomain/zero/1.0/
13)
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
16)
17) require_once('inc/debug.php');
18) require_role(array(ROLE_CUSTOMER));
19)
20) function get_handles() {
21) $cid = (int) $_SESSION['customerinfo']['customerno'];
22) $result = db_query("SELECT id, state, lastchange, nic_handle, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id FROM kundendaten.handles WHERE customer=? ORDER BY id", array($cid));
23) $ret = array();
24) while ($handle = $result->fetch()) {
25) $ret[$handle['id']] = $handle;
26) }
27) DEBUG($ret);
28) return $ret;
29) }
30)
31)
32) function get_kundenhandles() {
33) $cid = (int) $_SESSION['customerinfo']['customerno'];
34) $result = db_query("SELECT handle_kunde, handle_extern, handle_rechnung FROM kundendaten.kunden WHERE id=?", array($cid));
35) $res = $result->fetch();
36) $ret = array("kunde" => $res['handle_kunde'],
37) "extern" => $res['handle_extern'],
38) "rechnung" => $res['handle_rechnung']);
39) return $ret;
40) }
41)
|