<?

/*
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 guestbook entries page
	// ========================================================================================
	
	
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_guestbook.gif" width="22" height="21"> '.$MsgText[6][2];
	$BrowserTitle = $MsgText[6][2];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[6][2];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[601] == 'y') {
			
			
			$PageContents .= '<br><b>'.$MsgText[6][16].':</b><br>';
			
		
			$query = "select * from `".$Settings['DBPrefix']."gb-Messages` order by DateCode desc";
			$result = mysql_query($query) or die (mysql_error());
			while ($row = mysql_fetch_array($result)) {
			
				$ApprovalPart = '';
				if ($row['Approved'] != 1) {
					$ApprovalPart = '<a href="'.$MainURL.'/admin/guestbook_approve/'.$row['RecordNumber'].'"><font color="#ff0000">'.$MsgText[6][32].'</font></a> - ';
				}
		
				$PageContents .= '<br><br><i>'.nl2br($row['Message']).'</i><br><b>'.$MsgText[6][6].' '.$row['Name'].' '.$MsgText[6][7].' '.date('F j, Y @ g:ia',$row['DateCode']).'</b><br><b>[ '.$ApprovalPart.'<a href="'.$MainURL.'/admin/guestbook_edit/'.$row['RecordNumber'].'">'.$MsgText[0][155].'</a> - <a href="'.$MainURL.'/admin/guestbook_delete/'.$row['RecordNumber'].'">'.$MsgText[0][156].'</a> ]</b><br>';		
		
			}
			
			
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
		


?>
