<?

/*
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 = '<img src="'.$ImagesURL.'/admin/admincp_ecom.gif" width="20" height="21" align="middle"> '.$MsgText[9][127];
	$BrowserTitle = $MsgText[9][127];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > <a href="'.$MainURL.'/admin/store-taxes.html">'.$MsgText[9][116].'</a> > '.$MsgText[9][127];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[904] == 'y') {
		
			if ($Arguments3 == 'n') {
				
				$query = "select * from `".$Settings['DBPrefix']."core-Countries` where RecordNumber='".intval($Arguments4)."' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				$row = mysql_fetch_array($result);
				
				$PageContents = '<br><b>'.$MsgText[9][119].':</b><br><br><br><form action="'.$MainURL.'/admin/store-taxes-new-save" method="post"><input type="hidden" name="Type" value="n"><input type="hidden" name="Country" value="'.$row['Code'].'"><b>'.$MsgText[0][107].':</b><br>'.$row['Name'].'<br><br><br><b>'.$MsgText[9][124].':</b><br><input type="text" name="Title" size="20" maxlength="100" style="'.$FormStyle.'"><br><br><b>'.$MsgText[9][10].' ('.$MsgText[0][418].'):</b><br><input type="text" name="Description" size="40" maxlength="255" style="'.$FormStyle.'"><br><br><br><b>'.$MsgText[9][126].' ('.$MsgText[0][418].'):</b><br><input type="text" name="Number" size="20" maxlength="100" style="'.$FormStyle.'"><br><br><b>'.$MsgText[9][125].':</b><br><input type="text" name="Rate" size="10" maxlength="8" style="'.$FormStyle.'">%<br><br><input type="checkbox" name="TaxShipping" value="1"> '.$MsgText[9][366].'<br><br><br><br><input type="submit" value="'.$MsgText[9][127].'" style="'.$FormStyle.'"></form>';
				
			}
			else if ($Arguments3 == 's') {
			
				$query2 = "select * from `".$Settings['DBPrefix']."core-StatesProvinces` where RecordNumber='".intval($Arguments4)."' limit 1";
				$result2 = mysql_query($query2) or die (mysql_error());
				$row2 = mysql_fetch_array($result2);
			
				$query = "select * from `".$Settings['DBPrefix']."core-Countries` where Code='".$row2['Country']."' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				$row = mysql_fetch_array($result);
				
				$PageContents = '<br><b>'.$MsgText[9][120].':</b><br><br><br><form action="'.$MainURL.'/admin/store-taxes-new-save" method="post"><input type="hidden" name="Type" value="s"><input type="hidden" name="Country" value="'.$row['Code'].'"><input type="hidden" name="StateProv" value="'.$row2['Code'].'"><b>'.$MsgText[0][107].':</b><br>'.$row['Name'].'<br><br><b>'.$MsgText[0][105].':</b><br>'.$row2['Name'].'<br><br><br><b>'.$MsgText[9][124].':</b><br><input type="text" name="Title" size="20" maxlength="100" style="'.$FormStyle.'"><br><br><b>'.$MsgText[9][10].' ('.$MsgText[0][418].'):</b><br><input type="text" name="Description" size="40" maxlength="255" style="'.$FormStyle.'"><br><br><br><b>'.$MsgText[9][126].' ('.$MsgText[0][418].'):</b><br><input type="text" name="Number" size="20" maxlength="100" style="'.$FormStyle.'"><br><br><b>'.$MsgText[9][125].':</b><br><input type="text" name="Rate" size="10" maxlength="8" style="'.$FormStyle.'">%<br><br><input type="checkbox" name="TaxShipping" value="1"> '.$MsgText[9][366].'<br><br><br><br><input type="submit" value="'.$MsgText[9][127].'" style="'.$FormStyle.'"></form>';
			
			}
			else if ($Arguments3 == 'l') {
			
				$query2 = "select * from `".$Settings['DBPrefix']."core-StatesProvinces` where RecordNumber='".intval($Arguments4)."' limit 1";
				$result2 = mysql_query($query2) or die (mysql_error());
				$row2 = mysql_fetch_array($result2);
			
				$query = "select * from `".$Settings['DBPrefix']."core-Countries` where Code='".$row2['Country']."' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				$row = mysql_fetch_array($result);
				
				$PageContents = '<br><b>'.$MsgText[9][121].':</b><br><br><br><form action="'.$MainURL.'/admin/store-taxes-new-save" method="post"><input type="hidden" name="Type" value="l"><input type="hidden" name="Country" value="'.$row['Code'].'"><input type="hidden" name="StateProv" value="'.$row2['Code'].'"><b>'.$MsgText[0][107].':</b><br>'.$row['Name'].'<br><br><b>'.$MsgText[0][105].':</b><br>'.$row2['Name'].'<br><br><br><b>'.$MsgText[9][124].':</b><br><input type="text" name="Title" size="20" maxlength="100" style="'.$FormStyle.'"><br><br><b>'.$MsgText[9][10].' ('.$MsgText[0][418].'):</b><br><input type="text" name="Description" size="40" maxlength="255" style="'.$FormStyle.'"><br><br><br><b>'.$MsgText[9][126].' ('.$MsgText[0][418].'):</b><br><input type="text" name="Number" size="20" maxlength="100" style="'.$FormStyle.'"><br><br><b>'.$MsgText[9][125].':</b><br><input type="text" name="Rate" size="10" maxlength="8" style="'.$FormStyle.'">%<br><br><input type="checkbox" name="TaxShipping" value="1"> '.$MsgText[9][366].'<br><br><br><br><input type="submit" value="'.$MsgText[9][127].'" style="'.$FormStyle.'"></form>';
			
			}
			
			else {
				$PageContents = $MsgText[0][98];
			}
					
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}

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




?>
