<?

/*
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][631];
	$BrowserTitle = $MsgText[0][631];
	$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][631];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[21] == 'y') {
		
			ReadFormArguments();
			Global $FormArguments;
		
			if (count($FormArguments) > 0 && $FormArguments['Name'] != '' && $FormArguments['Code'] != '') {
						
				$query = "insert into `".$Settings['DBPrefix']."core-StatesProvinces` (Name, Code, Country) values ('".$FormArguments['Name']."', '".$FormArguments['Code']."', '".$FormArguments['Country']."')";
				$result = mysql_query($query) or die (mysql_error());
				
		
				$PageContents = '<br><br>'.$MsgText[0][632].'<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();
	
	}

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




?>
