Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/Mailer/
Upload File :
Current File : /var/www/cesa.co.za/Mailer/manageSections.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 FROM Newsletter\n".
			"where idNewsletter = " . $nl_id;

		$rsN = $db->Execute($sql1);
		
		$sql2 = "SELECT idSection, sTitle, txtDetail FROM Sections\n".
			"where idNewsletter = " . $nl_id . "\n".
			"order by nOrder";		
		$rsS = $db->Execute($sql2);
	}
?>

<!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=600;
		var the_height=300;
		// set window position
		var from_top=83;
		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);
	}
	
	function wipe(x) {
		var do_wipe = confirm("Are you certain that you wish to delete this item?");
		if (do_wipe == true) {
			document.location = "destroySection.php?id=" + x;
		}
	}

	</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 section" class="button" onClick="javascript:window.location = 'addSection.php?pid=<?php echo $nl_id; ?>&t=<?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 sections.</strong><br><br></td>
				</tr>
				<tr>
					<td valign="top">
						<table border="0" cellspacing="2" cellpadding="4">
		<?php
			while (! $rsS->EOF) {
		?>
							<tr>
								<td width="60"></td>
								<td class="blackTypeBold"><?php echo $rsS->fields[1]; ?></td>
								<td> - <input type="button" value="Edit" class="button" onClick="window.location = 'addSection.php?id=<?php echo $rsS->fields[0]; ?>&t=<?php echo $nl_id; ?>';"></td>
								<td><input type="button" value="Delete" class="button" onClick="javascript:wipe('<?php echo $rsS->fields[0]; ?>&t=<?php echo $nl_id; ?>');"></td>
								<td><input type="button" value="Manage articles" class="button" onClick="document.location = 'manageNewsletter.php?id=<?php echo $rsS->fields[0]; ?>&pid=<?php echo $nl_id; ?>'"></td>
							</tr>
		<?php

				$rsS->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='doLogin.php';"></td>
								<td width="20"></td>
								<td><input type="button" value="Refresh list" class="button" onClick="javascript:document.location='manageSections.php?id=<?php echo $nl_id; ?>';"></td>
								<td width="20"></td>
								<td><input type="button" value="Order sections" class="button" onClick="javascript:document.location='orderSections.php?id=<?php echo $nl_id; ?>';"></td>
							</tr>					
						</table>
					</td>
				</tr>
				<tr>
					<td class="blackType">
						<strong>Section listing</strong><br>
						<br>
						The list above indicates the sections assigned to the newsletter <strong><%= newsletter.getTitle() %></strong>.
						<ul>
							<li><strong>Edit</strong> - Change the section name.</li>
							<li><strong>Delete</strong> - Remove the section from the newsletter.</li>
							<li><strong>Manage articles</strong> - View a listing of the articles under the section in question.</li>
						</ul>
					</td>
				</tr>
				<tr>
					<td height="100%"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>