<?

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



	// ========================================================================================
	
	// ========================================================================================
	
	$PageTitle = $MsgText[0][581];
	$BrowserTitle = $MsgText[0][581];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[0][581];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[21] == 'y') {
		
			ReadFormArguments();
			Global $FormArguments;
		
			if (count($FormArguments) > 0) {
		
			
				$query = "select * from `".$Settings['DBPrefix']."core-Countries`";
				$result = mysql_query($query) or die (mysql_error());
				while ($row = mysql_fetch_array($result)) {
				
					if (intval($FormArguments['AllowSales-'.$row['RecordNumber']]) == 1) {
						$FormArguments['AllowUsers-'.$row['RecordNumber']] = 1;
					}
				
					$query2 = "update `".$Settings['DBPrefix']."core-Countries` set AllowUsers=".intval($FormArguments['AllowUsers-'.$row['RecordNumber']]).", AllowSales=".intval($FormArguments['AllowSales-'.$row['RecordNumber']])." where RecordNumber=".$row['RecordNumber']." limit 1";
					$result2 = mysql_query($query2) or die (mysql_error());
					
				}
				
				$PageContents = '<br><br>'.$MsgText[0][617].'<br><br><a href="'.$MainURL.'/options.html">'.$MsgText[0][594].'</a>';
				
	
			}
			else {
				$PageContents = $MsgText[0][98];
			}
			
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}

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




?>
