<?

/*
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][629];
	$BrowserTitle = $MsgText[0][629];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > <a href="'.$MainURL.'/admin/countries.html">'.$MsgText[0][581].'</a> > <a href="'.$MainURL.'/admin/countries-edit/'.$Arguments3.'.html">'.$MsgText[0][618].'</a> > '.$MsgText[0][629];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[21] == 'y') {
		
			ReadFormArguments();
			Global $FormArguments;
		
			if (count($FormArguments) > 0) {
						
				if ($FormArguments['Remove'] == 'y') {
				
					$query = "delete from `".$Settings['DBPrefix']."core-StatesProvinces` where RecordNumber=".$FormArguments['ID']." limit 1";
					$result = mysql_query($query) or die (mysql_error());
				
				
					$PageContents = '<br><br>'.$MsgText[0][630].'<br><br><a href="'.$MainURL.'/admin/countries-edit/'.$Arguments3.'.html">'.$MsgText[0][564].'</a>';
				
				}
				else {
						
					$query = "update `".$Settings['DBPrefix']."core-StatesProvinces` set Name='".$FormArguments['Name']."', Code='".$FormArguments['Code']."' where RecordNumber=".$FormArguments['ID']." limit 1";
					$result = mysql_query($query) or die (mysql_error());
				
				
					$PageContents = '<br><br>'.$MsgText[0][628].'<br><br><a href="'.$MainURL.'/admin/countries-edit/'.$Arguments3.'.html">'.$MsgText[0][564].'</a>';
					
				}

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

	}
	else {
	
		RedirectToLogin();
	
	}

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




?>
