require_once('db_admin.inc.phtml');
require_once('/var/www/vhosts/sure-tools.co.uk/httpsdocs/_pro_modules/includes/cmspro/template_fetch.phtml');
if($id=='')
{
$header='';
$footer='';
$defaultpath='published';
template_fetch(&$header,&$footer,$defaultpath);
print $header;
?>
mysql_select_db("mail_man");
$result = $db->select("SELECT id, subject FROM surco_letters WHERE published='1' ORDER by datetime desc");
if(!empty($result))
{
while(list(,$row)=each($result))
{
print "- $row[subject]
";
}
}
?>
print $footer;
}
else
{
mysql_select_db("mail_man");
$out = $db->count("SELECT body FROM surco_letters WHERE id='$id'");
if(isset($_GET[fn]))
{
$out = ereg_replace("#first_name#", base64_decode($_GET[fn]), $out);
}
print $out;
}
?>