  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: customer.php 184 2005-09-07 14:48:20Z hpdl $ |
| |
| 3 | + | $Id: customer.php 185 2005-09-13 20:30:24Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
7 | 7 | | |
  |
8 | | - | Copyright (c) 2004 osCommerce |
| |
| 8 | + | Copyright (c) 2005 osCommerce |
|
9 | 9 | | |
| |
10 | 10 | | Released under the GNU General Public License |
| |
11 | 11 | | */ |
| |
12 | 12 | | |
| |
13 | 13 | | class osC_Customer { |
  |
14 | | - | var $is_logged_on, |
| |
15 | | - | $id, |
| |
16 | | - | $gender, |
| |
17 | | - | $first_name, |
| |
18 | | - | $last_name, |
| |
19 | | - | $full_name, |
| |
20 | | - | $email_address, |
| |
21 | | - | $default_address_id, |
| |
22 | | - | $country_id, |
| |
23 | | - | $zone_id; |
|
24 | 14 | | |
| |
25 | 15 | | /* Private variables */ |
| |
26 | 16 | | |
| |
|
|
 |
… |
|
156 | 146 | | $this->setGender($Qcustomer->value('customers_gender')); |
| |
157 | 147 | | $this->setFirstName($Qcustomer->value('customers_firstname')); |
| |
158 | 148 | | $this->setLastName($Qcustomer->value('customers_lastname')); |
  |
159 | | - | $this->setFullName(); |
|
160 | 149 | | $this->setEmailAddress($Qcustomer->value('customers_email_address')); |
| |
161 | 150 | | |
| |
162 | 151 | | if (is_numeric($Qcustomer->value('customers_default_address_id')) && ($Qcustomer->value('customers_default_address_id') > 0)) { |
| |
|
|
 |
… |
|
196 | 185 | | return false; |
| |
197 | 186 | | } |
| |
198 | 187 | | |
  |
199 | | - | function isGuest() { |
| |
200 | | - | return !$this->isLoggedOn(); |
| |
201 | | - | } |
| |
202 | | - | |
|
203 | 188 | | function setID($id) { |
  |
204 | | - | $this->id = $id; |
| |
205 | | - | |
|
206 | 189 | | if (is_numeric($id) && ($id > 0)) { |
| |
207 | 190 | | $this->_data['id'] = $id; |
| |
208 | 191 | | } else { |
| |
|
|
 |
… |
|
211 | 194 | | } |
| |
212 | 195 | | |
| |
213 | 196 | | function setDefaultAddressID($id) { |
  |
214 | | - | $this->default_address_id = $id; |
| |
215 | | - | |
|
216 | 197 | | if (is_numeric($id) && ($id > 0)) { |
| |
217 | 198 | | $this->_data['default_address_id'] = $id; |
| |
218 | 199 | | } else { |
| |
|
|
 |
… |
|
229 | 210 | | } |
| |
230 | 211 | | |
| |
231 | 212 | | function setGender($gender) { |
  |
232 | | - | $this->gender = $gender; |
| |
233 | | - | |
|
234 | 213 | | if ( (strtolower($gender) == 'm') || (strtolower($gender) == 'f') ) { |
| |
235 | 214 | | $this->_data['gender'] = strtolower($gender); |
| |
236 | 215 | | } else { |
| |
|
|
 |
… |
|
239 | 218 | | } |
| |
240 | 219 | | |
| |
241 | 220 | | function setFirstName($first_name) { |
  |
242 | | - | $this->first_name = $first_name; |
| |
243 | | - | |
|
244 | 221 | | $this->_data['first_name'] = $first_name; |
| |
245 | 222 | | } |
| |
246 | 223 | | |
| |
247 | 224 | | function setLastName($last_name) { |
  |
248 | | - | $this->last_name = $last_name; |
| |
249 | | - | |
|
250 | 225 | | $this->_data['last_name'] = $last_name; |
| |
251 | 226 | | } |
| |
252 | 227 | | |
  |
253 | | - | function setFullName($fullname = '') { |
| |
254 | | - | if (empty($fullname)) { |
| |
255 | | - | $this->full_name = $this->first_name . ' ' . $this->last_name; |
| |
256 | | - | } else { |
| |
257 | | - | $this->full_name = $fullname; |
| |
258 | | - | } |
| |
259 | | - | } |
| |
260 | | - | |
|
261 | 228 | | function setEmailAddress($email_address) { |
  |
262 | | - | $this->email_address = $email_address; |
| |
263 | | - | |
|
264 | 229 | | $this->_data['email_address'] = $email_address; |
| |
265 | 230 | | } |
| |
266 | 231 | | |
| |
267 | 232 | | function setCountryID($id) { |
  |
268 | | - | $this->country_id = $id; |
| |
269 | | - | |
|
270 | 233 | | $this->_data['country_id'] = $id; |
| |
271 | 234 | | } |
| |
272 | 235 | | |
| |
273 | 236 | | function setZoneID($id) { |
  |
274 | | - | $this->zone_id = $id; |
| |
275 | | - | |
  |
276 | 237 | | $this->_data['zone_id'] = $id; |
| |
277 | 238 | | } |
| |
278 | 239 | | } |