Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/Mailer/
Upload File :
Current File : /var/www/cesa.co.za/Mailer/mail_template_old2.php

<?php
	require_once ('includes/globals.php');

	$nl_id = intval($_GET['id']);
	
	if (isset($_SESSION['userid'])) {
		$userid = $_SESSION['userid'];
	} else {
		echo "<script>document.location.href='index.php';</script>\n";
	}

	if (isset($_SESSION['database'])) {	
		$sql1 = "SELECT idUser, sTitle, sHeading, dtCreated, dtSent, idPreviousIssue, txtNotes, DATENAME(month, [dtCreated]) as cmonth, DATENAME(year, [dtCreated]) as cyear FROM Newsletter\n".
			"where idNewsletter = " . $nl_id;
		$rsN = $db->Execute($sql1);
	} else {
		echo "<script>document.location.href='index.php';</script>\n";
	}
	$subject_heading = $rsN->fields[1];
	
	/*
	$timestamp = $rsN->fields[3];
	$thisDate = strftime('%B %Y', $timestamp);
	$thisYear = strftime('%Y', $timestamp);
	*/
	$thisYear = $rsN->fields[8];//strftime('%Y', $timestamp);
	$thisDate = $rsN->fields[7] . ' ' .$thisYear; //strftime('%B %Y', $timestamp);
?>			

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo $subject_heading; ?></title>
<style type="text/css">
 ul { margin-left: 2em; padding-bottom:0em; border:0;}
 li { padding-bottom:1em; border:0; margin:0;}
 p { padding-bottom:1em; border:0; margin:0; style="color:#00FF00; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; line-height:14px;"}
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="10" background="images/background.gif">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
	<tr valign="top">
		<td align="center">
			<table border="0" cellpadding="0" cellspacing="0" width="621" height="100%">
				<tr>
					<td colspan="3" style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#FFFFFF;padding-right:6px;padding-bottom:2px;" align="right"><a name="top"></a><?php echo $thisDate; ?></td>
				</tr>
				<tr valign="top">
					<td style="border:1px solid #ffffff;">
						<table border="0" cellpadding="0" cellspacing="0" height="100%">
							<tr>
								<td><img src="images/masthead-pic2.gif" width="621" height="135" border="0"></td>
							</tr>
							<tr valign="top">
								<td>
									<table border="0" cellpadding="0" cellspacing="0" width="100%">
										<tr valign="top">
											<td width="483" style="background-color:#0C96D5;padding-left:14px;padding-right:14px;padding-top:5px;">
												<table border="0" cellpadding="0" cellspacing="0" width="100%">
													<tr>
														<td style="background-color:#FFFFFF;color:#02577E;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;height:24px;border:1px solid #ffffff;padding-left:10px;font-weight:bold;">In this issue:</td>
													</tr>
													<tr valign="top">
														<td style="background-color:#B4E1F6;padding-left:15px;padding-top:4px;padding-bottom:3px;padding-right:15px;border-bottom:1px solid #ffffff;border-left:1px solid #ffffff;border-right:1px solid #ffffff;height:124px;">
															<table border="0" cellpadding="0" cellspacing="0">
															<?php
																$sql2 = "SELECT idSection, sTitle, txtDetail FROM Sections\n".
																	"where idNewsletter = " . $nl_id . "\n";		
																$rsS = $db->Execute($sql2);
																
																while (! $rsS->EOF) {
															?>
															<!---------------Headings Start--------------->
																<tr>
																	<td style="width:20px;height:20px;"><img src="images/bullet.gif" width="10" height="10"></td>
																	<td style="color:#00587E;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;"><a href="#sh<?php echo $rsS->fields[0]; ?>" style="color:#00587E;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;text-decoration:none;"><?php echo $rsS->fields[1]; ?></a></td>
																</tr>
															<!---------------Headings End--------------->
															<?php
																	$rsS->MoveNext();
																}
															?>
															</table>
														</td>
													</tr>
												</table>
											</td>
											<td width="187" bgcolor="#0C96D5"><img src="images/masthead-pic.gif" width="187" height="156"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table border="0" cellpadding="0" cellspacing="0" width="100%">
										<tr>
											<td height="5" bgcolor="#0C96D5"><img src="images/spacer.gif" width="1" height="5"></td>
										</tr>
										<tr>
											<td height="1" bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr valign="top">
								<td style="background-color:#D0ECF8;padding-left:14px;padding-right:14px;padding-top:12px;" height="100%">
									<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
										<?php
											if ($rsN->fields[6]) {
										?>
										<tr>
											<td>
												<div style="margin-left:10px;margin-top:15px;position:relative;float:right;clear:both;">
													<table border="0" cellpadding="0" cellspacing="0" width="200">
														<tr>
															<td style="background-color:#B5E0F3;padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;border:1px solid #ffffff;color:#02577E;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;" align="center">
																<p style="color:#00587E;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;"><strong><?php echo $rsN->fields[6]; ?></strong></p>
															</td>
														</tr>
														<tr>
															<td height="20" bgcolor="#D0ECF8"><img src="images/spacer.gif" width="1" height="20"></td>
														</tr>
													</table>
												</div>
											</td>
										</tr>
										
										<?php
											}
											$sql2 = "SELECT idSection, sTitle, txtDetail FROM Sections\n".
												"where idNewsletter = " . $nl_id . "\n" .
												"order by nOrder";		
											$rsS = $db->Execute($sql2);
											
											while (! $rsS->EOF) {
										?>
										
										<!---------------Article Start--------------->
										<tr>
											<td style="background-color:#0C96D5;height:23px;width:643px;">
												<table border="0" cellpadding="0" cellspacing="0" width="100%">
													<tr>
														<td style="color:#FFFFFF;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;font-weight:bold;padding-left:10px;"><a name="sh<?php echo $rsS->fields[0]; ?>"></a><?php echo $rsS->fields[1]; ?></td>
														<td width="25" align="right"><a href="#top"><img src="images/top-button.gif" width="25" height="23" border="0"></a></td>
													</tr>
												</table>
											</td>
										</tr>
										<?php 
											$sql3 = "SELECT idHeadline, sTitle, txtCopy, sImage, sUrl, sLinkTitle, nOrder FROM Headlines\n".
												"where idSection = " . $rsS->fields[0] . "\n".
												"order by nOrder";		
											$rsH = $db->Execute($sql3);
											while (! $rsH->EOF) {	
										?>
										<tr valign="top">
											<td style="text-align:justify;padding-right:25px;padding-top:10px;color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;"><?php echo $rsH->fields[2]; ?></td>
										</tr>
										<!---------------Article End--------------->
										<?php
												$rsH->MoveNext();	
											}
											$rsS->MoveNext();
										}
										?>
						
										<!---------------Issued By--------------->
										<tr>
											<td style="background-color:#0C96D5;height:23px;width:643px;">
												<table border="0" cellpadding="0" cellspacing="0" width="100%">
													<tr>
														<td style="color:#FFFFFF;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;font-weight:bold;padding-left:10px;">Issued by:</td>
														<td width="25" align="right"><a href="#top"><img src="images/top-button.gif" width="25" height="23" border="0"></a></td>
													</tr>
												</table>
											</td>
										</tr>
										<tr valign="top">
											<td style="padding-right:25px;padding-top:10px;color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;">
												<p style="color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;">
													Graham Pirie<br>
													<strong>South African Association of Consulting Engineers</strong><br>
													E-mail:	jeans@saace.co.za <br>
													Tel:	+27 (11) 463-2022<br>
													Fax:	+27 (11) 463-7383<br>
													P O Box 68482.  Bryanston. 2021<br>
													Website:  <a href="http://www.saace.co.za" target="_blank" style="color:#01577D;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;text-decoration:underline;">www.saace.co.za</a>
												</p>
												<p style="color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;">&nbsp;</p>
											</td>
										</tr>
										<!---------------Disclaimer--------------->
										<tr>
											<td style="background-color:#0C96D5;height:23px;width:643px;">
												<table border="0" cellpadding="0" cellspacing="0" width="100%">
													<tr>
														<td style="color:#FFFFFF;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;font-weight:bold;padding-left:10px;">Disclaimer</td>
														<td width="25" align="right"><a href="#top"><img src="images/top-button.gif" width="25" height="23" border="0"></a></td>
													</tr>
												</table>
											</td>
										</tr>
										<tr valign="top">
											<td style="text-align:justify;padding-right:25px;padding-top:10px;color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;">
												<p style="color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;">This e-mail is for the intended addressee only. If you have received it in error, please notify us by e-mail to the sender. Dissemination or copying is prohibited unless permitted by the sender, and then only by the intended addressee. Whilst reasonable measures are used to guard against the transmission of malicious code, no liability is accepted for its transmission. If this e-mail is not related to the business of the SAACE, it is sent by the abovementioned in their individual capacity and not on behalf of the SAACE.</p>
												<p style="color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;line-height:14px;">&nbsp;</p>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>