mysql_query("update `domains` set `deleted`=NOW() where `id`='$id'");
$dres = mysql_query("select * from `domlink` where `domid`='$id'");
$dres = mysql_query(
"select `domaincerts`.`id`
from `domaincerts`
where `domaincerts`.`domid` = '$id'
union distinct
select `domaincerts`.`id`
from `domaincerts`, `domlink`
where `domaincerts`.`id` = `domlink`.`certid`
and `domlink`.`domid` = '$id'");
while($drow = mysql_fetch_assoc($dres))
while($drow = mysql_fetch_assoc($dres))
mysql_query("update `domaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$drow['certid']."' and `revoked`=0 and UNIX_TIMESTAMP(`expire`)-UNIX_TIMESTAMP() > 0");
$body .= _("You are receiving this email as you are the listed contact for:")."\n\n";
$body .= _("You are receiving this email as you are the listed contact for:")."\n\n";
$body .= $row['subject']."\n\n";
$body .= $row['subject']."\n\n";
$body .= sprintf(_("Your certificate is set to expire in approximately %s days time, you can renew this by going to the following URL:"), $row['daysleft'])."\n\n";
$body .= sprintf(_("Your certificate with the serial number %s is ".
"set to expire in approximately %s days time. You can ".
$body .= _("You are receiving this email as you are the listed contact for:")."\n\n";
$body .= _("You are receiving this email as you are the listed contact for:")."\n\n";
$body .= $row['subject']."\n\n";
$body .= $row['subject']."\n\n";
$body .= sprintf(_("Your certificate is set to expire in approximately %s days time, you can renew this by going to the following URL:"), $row['daysleft'])."\n\n";
$body .= sprintf(_("Your certificate with the serial number %s is ".
"set to expire in approximately %s days time. You can ".