has_orders()) { return(Database::ado_execute_query("DELETE FROM ".Config::$db_tables['contacts']." WHERE id='$this->id' LIMIT 1")); } else { echo 'this contact has orders associated with it and cannot be removed'; return(FALSE); } } function has_orders() { $sel = "SELECT * FROM ".Config::$db_tables['orders']." WHERE contact_id='".$this->id."'"; return (Database::ado_get_record_count($sel, "ContactAdmin::has_orders") > 0) ? TRUE : FALSE; } function on_ml($Contacts) { if(!isset($this->data)) { $this->set_data($Contacts); } return($this->data['mailing_list'] == 'yes' && $this->data['address'] != '' && $this->data['city'] != '' && $this->data['state'] != ''); } function on_eml($Contacts) { if(!isset($this->data)) { $this->set_data($Contacts); } return($this->data['email_list'] == 'yes' && $this->data['email'] != ''); } } ?>