<?

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



	// ========================================================================================
	// delete block confirm
	// ========================================================================================
	
	$PageTitle = $MsgText[0][235];
	$BrowserTitle = $MsgText[0][235];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="'.$MainURL . '/options.html">'.$MsgText[0][4].'</a> > <a href="'.$MainURL . '/admin/blocks.html">'.$MsgText[0][151].'</a> > '.$MsgText[0][235];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[2] == 'y') {
	
						
			ReadFormArguments();
			Global $FormArguments;
			
			if (count($FormArguments) > 0) {
			
				$FormArguments['BlockID'] = intval($FormArguments['BlockID']);
			
			
				$query = "select * from `".$Settings['DBPrefix']."core-Blocks` where RecordNumber='".$FormArguments['BlockID']."' LIMIT 1";
            	$result = mysql_query($query) or die (mysql_error());
			
				$row = mysql_fetch_array($result);
			
			
				if ($row['MinLevel'] <= $UserLevel && $row['MinEditLevel'] <= $UserLevel && $row['RecordNumber'] == $FormArguments['BlockID']) {
			
					$query = "DELETE FROM `".$Settings['DBPrefix']."core-Blocks` WHERE RecordNumber='".$FormArguments['BlockID']."' LIMIT 1";
		
	    	        $result = mysql_query($query) or die (mysql_error());
					
					header('Location: ' . $MainURL . '/admin/blocks.html');
					
				}
				else {
				
					$PageContents = $MsgText[0][239];
				
				}				
			
			}		
			
			
			
			
			else {
				$PageContents = $MsgText[0][98];
			}

		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}

	// ========================================================================================




?>
