function delZone($domain)
{
if ($this->isDomain($domain)) {
$domainid = $this->db->quote($this->domainId($domain));
$this->db->Execute("DELETE FROM records_a WHERE domainid = {$domainid}");
$this->db->Execute("DELETE FROM records_cname WHERE domainid = {$domainid}");
$this->db->Execute("DELETE FROM records_mx WHERE domainid = {$domainid}");
$this->db->Execute("DELETE FROM domains WHERE domainid = {$domainid}");
$letter = substr($domain, 0, 1);
$zonefile = $this->path . "/{$letter}/" . $domain;
if (file_exists($zonefile)) {
unlink($zonefile);
}
$this->writeConf();
$this->reloadZone();
}
}