  |
55 | 55 | | |
| |
56 | 56 | | function numberOfEntries() { |
| |
57 | 57 | | global $osC_Database, $osC_Customer; |
  |
| 58 | + | |
|
58 | 59 | | static $total_entries; |
| |
59 | 60 | | |
  |
60 | | - | if (is_numeric($total_entries) === false) { |
| |
| 61 | + | if ( !is_numeric($total_entries) ) { |
|
61 | 62 | | $Qaddresses = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id'); |
| |
62 | 63 | | $Qaddresses->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); |
| |
63 | 64 | | $Qaddresses->bindInt(':customers_id', $osC_Customer->getID()); |
| |
64 | 65 | | $Qaddresses->execute(); |
| |
65 | 66 | | |
| |
66 | 67 | | $total_entries = $Qaddresses->valueInt('total'); |
  |
67 | | - | } else { |
| |
68 | | - | $total_entries = 0; |
  |
69 | 68 | | } |
| |
70 | 69 | | |
| |
71 | 70 | | return $total_entries; |