public static function getFormData($id = null, $edit = false) { global $lC_Database; $result = array(); $result['cData'] = array(); if (isset($id) && $id != null) { if ($edit === true) { $result['cData'] = lC_Countries_Admin::getData($id); } else { $Qcheck = $lC_Database->query('select count(*) as total from :table_address_book where entry_country_id = :entry_country_id'); $Qcheck->bindTable(':table_address_book', TABLE_ADDRESS_BOOK); $Qcheck->bindInt(':entry_country_id', $id); $Qcheck->execute(); if ($Qcheck->valueInt('total') > 0) { $result['rpcStatus'] = -2; $result['totalAddressBookEntries'] = $Qcheck->valueInt('total'); } $Qcheck = $lC_Database->query('select count(*) as total from :table_zones_to_geo_zones where zone_country_id = :zone_country_id'); $Qcheck->bindTable(':table_zones_to_geo_zones', TABLE_ZONES_TO_GEO_ZONES); $Qcheck->bindInt(':zone_country_id', $id); $Qcheck->execute(); if ($Qcheck->valueInt('total') > 0) { $result['rpcStatus'] = -3; $result['totalZones'] = $Qcheck->valueInt('total'); } } } return $result; }