<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



	// ========================================================================================
	// manage archives page
	// ========================================================================================
	
	$query = "select * from `".$Settings['DBPrefix']."nl-Settings`";
	$result = mysql_query($query) or die (mysql_error());
	while ($row = mysql_fetch_array($result)) {
		$nlSettings[$row['Name']] = $row['Value'];
	}
	
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_newsletter.gif" width="22" height="21"> '.$MsgText[5][4];
	$BrowserTitle = $MsgText[5][4];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[5][4];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[502] == 'y') {
			
			
			$PageContents .= '<br><table cellpadding="1" cellspacing="0" border="0">';
			
		
			$query = "select * from `".$Settings['DBPrefix']."nl-Messages` order by DateCode desc";
			$result = mysql_query($query) or die (mysql_error());
			while ($row = mysql_fetch_array($result)) {	
			
				$PageContents .= '<tr><td><font face="'.$FontFace.'" size="'.$FontSize.'"><a href="'.$MainURL.'/newsletter/messages/'.$row['RecordNumber'].'.html" target="_blank"><b>'.$row['Title'].'</b></a><br><font size="1">'.$MsgText[5][10].': '.date("F j, Y",$row['DateCode']).'<br></font></td><td><font face="'.$FontFace.'" size="'.$FontSize.'">&nbsp;&nbsp;&nbsp;<a href="'.$MainURL.'/admin/newsletter_archived_edit/'.$row['RecordNumber'].'.html">'.$MsgText[0][155].'</a></td><td><font face="'.$FontFace.'" size="'.$FontSize.'">&nbsp;&nbsp;<a href="'.$MainURL.'/admin/newsletter_archived_delete/'.$row['RecordNumber'].'.html">'.$MsgText[0][156].'</a></td></tr><tr><td colspan="2" height="10"></td></tr>';	
			
			}
			
			
			$PageContents .= '</table>';
			
			
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
		


?>
