Your IP : 216.73.217.79


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

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

	$nl_id = intval($_GET['pid']);
	$s_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 FROM Newsletter\n".
			"where idNewsletter = " . $nl_id;
		$rsN = $db->Execute($sql1);
		
		$sql2 = "SELECT idSection, sTitle, txtDetail FROM Sections\n".
			"where idSection = " . $s_id . "\n";		
		$rsS = $db->Execute($sql2);
		
		$sql3 = "SELECT idHeadline, sTitle, txtCopy, sImage, sUrl, sLinkTitle, nOrder FROM Headlines\n".
			"where idSection = " . $s_id . "\n".
			"order by nOrder";		
		$rsH = $db->Execute($sql3);		
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>Email template control panel</title>
	<link rel="stylesheet" type="text/css" href="stylesheet/default_styles.css">
	<script language="JavaScript">
	function n_window(theurl) {
		// set width and height
		var the_width=700;
		var the_height=680;
		// set window position
		var from_top=40;
		var from_left=100;
		// set other attributes
		var has_toolbar='no';
		var has_location='no';
		var has_directories='no';
		var has_status='no';
		var has_menubar='no';
		var has_scrollbars='no';
		var is_resizable='no';
		// atrributes put together
		var the_atts='width='+the_width+',height='+the_height+',top='+from_top+',screenY='+from_top+',left='+from_left+',screenX='+from_left;
		the_atts+=',toolbar='+has_toolbar+',location='+has_location+',directories='+has_directories+',status='+has_status;
		the_atts+=',menubar='+has_menubar+',scrollbars='+has_scrollbars+',resizable='+is_resizable;
		// open the window
		window.open(theurl,'',the_atts);
	}
</script>
</head>

<body bgcolor="#D0ECF8" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<td height="10" bgcolor="#016694"><img src="images/spacer.gif" width="1" height="10"></td>
	</tr>
	<tr>
		<td height="2" bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="2"></td>
	</tr>
	<tr>
		<td height="2" bgcolor="#016694"><img src="images/spacer.gif" width="1" height="2"></td>
	</tr>
	<tr>
		<td height="30"><img src="images/spacer.gif" width="1" height="30"></td>
	</tr>
	<tr>
		<td class="paddingLeft20">
			<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
				<tr>
					<td valign="top" align="middle">
						<table border="0" cellpadding="0" cellspacing="5">
							<tr>
								<td height="10"></td>
							</tr>
							<tr>
								<td><input type="button" value="Create new article" class="button" onClick="javascript:document.location = 'addArticle.php?pid=<?php echo $rsS->fields[0]; ?>&t=<?php echo $s_id; ?>&s=<?php echo $nl_id; ?>';"></td>
							</tr>					
						</table>
					</td>
				</tr>
				<tr>
					<td><hr></td>
				</tr>
				<tr>
					<td height="10"></td>
				</tr>
				<tr>
					<td class="blackType"><strong><?php echo $rsN->fields[1]; ?> - Current articles.</strong><br><br></td>
				</tr>
				<tr>
					<td valign="top">
						<table border="0" cellspacing="2" cellpadding="4">
		<?php
			while (! $rsH->EOF) {
		?>
							<tr>
								<td width="60"></td>
								<td class="blackTypeBold"><?php echo $rsH->fields[1]; ?></td>
								<td> - <input type="button" value="Edit" class="button" onClick="document.location = 'addArticle.php?id=<?php echo $rsH->fields[0]; ?>&t=<?php echo $s_id; ?>&s=<?php echo $nl_id; ?>';"></td>
								<td><input type="button" value="Delete" class="button" onClick="document.location = 'destroyArticle.php?id=<?php echo $rsH->fields[0]; ?>&t=<?php echo $s_id; ?>&s=<?php echo $nl_id; ?>'"></td>
							</tr>
		<?php
				$rsH->MoveNext();
			}
		?>
						</table>
					</td>
				</tr>
				<tr>
					<td height="10"></td>
				</tr>
				<tr>
					<td><hr></td>
				</tr>
				<tr>
					<td valign="top" align="middle">
						<table border="0" cellpadding="0" cellspacing="5">
							<tr>
								<td><input type="button" value="Back" class="button" onClick="javascript:document.location='manageSections.php?id=<?php echo $nl_id; ?>';"></td>
								<td width="20"></td>
								<td><input type="button" value="Refresh list" class="button" onClick="javascript:document.location='manageNewsletter.php?id=<?php echo $s_id; ?>&pid=<?php echo $nl_id; ?>';"></td>
								<td width="20"></td>
								<td><input type="button" value="Order articles" class="button" onClick="javascript:document.location='orderNewsletter.php?id=<?php echo $s_id; ?>&pid=<?php echo $nl_id; ?>';"></td>
							</tr>					
						</table>
					</td>
				</tr>
				<tr>
					<td class="blackType">
						<strong>Article listing</strong><br>
						<br>
						The list above indicates the articles assigned to the section <strong><?php echo $rsS->fields[1]; ?></strong> of newsletter <strong><?php echo $rsN->fields[1]; ?></strong>.
						<ul>
							<li><strong>Edit</strong> - Change the article title, copy and link.</li>
							<li><strong>Delete</strong> - Remove the article from this section.</li>
						</ul>
					</td>
				</tr>
				<tr>
					<td height="100%"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>