  |
17 | 17 | | |
| |
18 | 18 | | $Qaddresses = $osC_Database->query('select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from :table_address_book where customers_id = :customers_id order by firstname, lastname'); |
| |
19 | 19 | | $Qaddresses->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
  |
20 | | - | $Qaddresses->bindInt(':customers_id', $osC_Customer->id); |
| |
| 20 | + | $Qaddresses->bindInt(':customers_id', $osC_Customer->getID()); |
|
21 | 21 | | $Qaddresses->execute(); |
| |
22 | 22 | | |
| |
23 | 23 | | return $Qaddresses; |
| |
|
|
 |
… |
|
29 | 29 | | $Qentry = $osC_Database->query('select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id, entry_telephone, entry_fax from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); |
| |
30 | 30 | | $Qentry->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
| |
31 | 31 | | $Qentry->bindInt(':address_book_id', $id); |
  |
32 | | - | $Qentry->bindInt(':customers_id', $osC_Customer->id); |
| |
| 32 | + | $Qentry->bindInt(':customers_id', $osC_Customer->getID()); |
|
33 | 33 | | $Qentry->execute(); |
| |
34 | 34 | | |
| |
35 | 35 | | return $Qentry; |
| |
|
|
 |
… |
|
41 | 41 | | $Qentry = $osC_Database->query('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); |
| |
42 | 42 | | $Qentry->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
| |
43 | 43 | | $Qentry->bindInt(':address_book_id', $id); |
  |
44 | | - | $Qentry->bindInt(':customers_id', $osC_Customer->id); |
| |
| 44 | + | $Qentry->bindInt(':customers_id', $osC_Customer->getID()); |
|
45 | 45 | | $Qentry->execute(); |
| |
46 | 46 | | |
| |
47 | 47 | | if ($Qentry->numberOfRows() === 1) { |
| |
|
|
 |
… |
|
58 | 58 | | if (is_numeric($total_entries) === false) { |
| |
59 | 59 | | $Qaddresses = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id'); |
| |
60 | 60 | | $Qaddresses->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
  |
61 | | - | $Qaddresses->bindInt(':customers_id', $osC_Customer->id); |
| |
| 61 | + | $Qaddresses->bindInt(':customers_id', $osC_Customer->getID()); |
|
62 | 62 | | $Qaddresses->execute(); |
| |
63 | 63 | | |
| |
64 | 64 | | $total_entries = $Qaddresses->valueInt('total'); |
| |
|
|
 |
… |
|
77 | 77 | | if (is_numeric($id)) { |
| |
78 | 78 | | $Qab = $osC_Database->query('update :table_address_book set customers_id = :customers_id, entry_gender = :entry_gender, entry_company = :entry_company, entry_firstname = :entry_firstname, entry_lastname = :entry_lastname, entry_street_address = :entry_street_address, entry_suburb = :entry_suburb, entry_postcode = :entry_postcode, entry_city = :entry_city, entry_state = :entry_state, entry_country_id = :entry_country_id, entry_zone_id = :entry_zone_id, entry_telephone = :entry_telephone, entry_fax = :entry_fax where address_book_id = :address_book_id and customers_id = :customers_id'); |
| |
79 | 79 | | $Qab->bindInt(':address_book_id', $id); |
  |
80 | | - | $Qab->bindInt(':customers_id', $osC_Customer->id); |
| |
| 80 | + | $Qab->bindInt(':customers_id', $osC_Customer->getID()); |
|
81 | 81 | | } else { |
| |
82 | 82 | | $Qab = $osC_Database->query('insert into :table_address_book (customers_id, entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id, entry_telephone, entry_fax) values (:customers_id, :entry_gender, :entry_company, :entry_firstname, :entry_lastname, :entry_street_address, :entry_suburb, :entry_postcode, :entry_city, :entry_state, :entry_country_id, :entry_zone_id, :entry_telephone, :entry_fax)'); |
| |
83 | 83 | | } |
| |
84 | 84 | | $Qab->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
  |
85 | | - | $Qab->bindInt(':customers_id', $osC_Customer->id); |
| |
| 85 | + | $Qab->bindInt(':customers_id', $osC_Customer->getID()); |
|
86 | 86 | | $Qab->bindValue(':entry_gender', ((ACCOUNT_GENDER > -1) && isset($data['gender']) && (($data['gender'] == 'm') || ($data['gender'] == 'f'))) ? $data['gender'] : ''); |
| |
87 | 87 | | $Qab->bindValue(':entry_company', (ACCOUNT_COMPANY > -1) ? $data['company'] : ''); |
| |
88 | 88 | | $Qab->bindValue(':entry_firstname', $data['firstname']); |
| |
|
|
 |
… |
|
132 | 132 | | $Qupdate = $osC_Database->query('update :table_customers set customers_default_address_id = :customers_default_address_id where customers_id = :customers_id'); |
| |
133 | 133 | | $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS); |
| |
134 | 134 | | $Qupdate->bindInt(':customers_default_address_id', $id); |
  |
135 | | - | $Qupdate->bindInt(':customers_id', $osC_Customer->id); |
| |
| 135 | + | $Qupdate->bindInt(':customers_id', $osC_Customer->getID()); |
|
136 | 136 | | $Qupdate->execute(); |
| |
137 | 137 | | |
| |
138 | 138 | | if ($Qupdate->affectedRows() === 1) { |
| |
|
|
 |
… |
|
149 | 149 | | $Qdelete = $osC_Database->query('delete from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); |
| |
150 | 150 | | $Qdelete->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
| |
151 | 151 | | $Qdelete->bindInt(':address_book_id', $id); |
  |
152 | | - | $Qdelete->bindInt(':customers_id', $osC_Customer->id); |
| |
| 152 | + | $Qdelete->bindInt(':customers_id', $osC_Customer->getID()); |
  |
153 | 153 | | $Qdelete->execute(); |
| |
154 | 154 | | |
| |
155 | 155 | | if ($Qdelete->affectedRows() === 1) { |