<?

/*
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
*/



	// ========================================================================================
	// compose new message
	// ========================================================================================
	
	$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][26];
	$BrowserTitle = $MsgText[5][2];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > <a href="'.$MainURL.'/admin/newsletter_archived.html">'.$MsgText[5][4].'</a> > '.$MsgText[5][26];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[502] == 'y') {
			
			$Arguments3 = intval($Arguments3);
			
			$query = "select * from `".$Settings['DBPrefix']."nl-Messages` where RecordNumber='".$Arguments3."' limit 1";
			$result = mysql_query($query) or die (mysql_error());
			if (mysql_num_rows($result) > 0) {
				$row = mysql_fetch_array($result);	
		
							
				$PageContents = '<br><br><form name="NewsletterCompose" action="'.$MainURL.'/admin/newsletter_archived_edit_save" method="post">
<input type="hidden" name="MessageIDToEdit" value="'.$Arguments3.'">
<b>'.$MsgText[5][15].':</b><br><input type="text" name="Title" size="65" value="'.str_replace('"','&#34;',$row['Title']).'">
<br><br>
<b>'.$MsgText[5][16].':</b><br>
<textarea name="Message" cols="56" rows="8" wrap="virtual">'.str_replace('<','&lt;',$row['Message']).'</textarea>
<br><br><br>
<input type="submit" name="submit" value="'.$MsgText[0][123].'">
</form>';
			}
			else {
			
				$PageContents = $MsgText[5][13];
			
			}			
						
			
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
		


?>
