<?

/*
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][112];
	$BrowserTitle = $MsgText[9][112];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > <a href="'.$MainURL.'/admin/store-shipping.html">'.$MsgText[9][72].'</a> > '.$MsgText[9][112];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[903] == 'y') {
		
			ReadFormArguments();
			Global $FormArguments;
		
			if (count($FormArguments) > 0) {
						
									
					$query2 = "select * from `".$Settings['DBPrefix']."core-Countries` where AllowSales=1 order by Code asc";
					$result2 = mysql_query($query2) or die (mysql_error());
					while ($row2 = mysql_fetch_array($result2)) {
						if ($FormArguments['Countries-'.$row2['Code']] == 'y') {
							$CountriesList .= $row2['Code'].',';
						}
					}
				
						
					$query = "insert into `".$Settings['DBPrefix']."ec-Shipping` (Description, Active, Handling, Countries, Calculations, BasePrice, BaseLimit, Price1, Unit1, Limit1, Price2, Unit2, Limit2, Price3, Unit3, Limit3, Price4, Unit4, Limit4, Price5, Unit5, Limit5, Price6, Unit6, Limit6, Price7, Unit7, Limit7, Price8, Unit8, Limit8) values ('".$FormArguments['Description']."', '".$FormArguments['Active']."', '".$FormArguments['Handling']."', '".$CountriesList."', '".$FormArguments['Calculations']."', '".$FormArguments['BasePrice_'.$FormArguments['Calculations']]."', '".$FormArguments['BaseLimit_'.$FormArguments['Calculations']]."', '".$FormArguments['Price1_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit1_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit1_'.$FormArguments['Calculations']]."', '".$FormArguments['Price2_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit2_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit2_'.$FormArguments['Calculations']]."', '".$FormArguments['Price3_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit3_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit3_'.$FormArguments['Calculations']]."', '".$FormArguments['Price4_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit4_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit4_'.$FormArguments['Calculations']]."', '".$FormArguments['Price5_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit5_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit5_'.$FormArguments['Calculations']]."', '".$FormArguments['Price6_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit6_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit6_'.$FormArguments['Calculations']]."', '".$FormArguments['Price7_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit7_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit7_'.$FormArguments['Calculations']]."', '".$FormArguments['Price8_'.$FormArguments['Calculations']]."', '".$FormArguments['Unit8_'.$FormArguments['Calculations']]."', '".$FormArguments['Limit8_'.$FormArguments['Calculations']]."')";
					$result = mysql_query($query) or die (mysql_error());
				
				
					$PageContents = '<br><br>'.$MsgText[9][115].'<br><br><a href="'.$MainURL.'/admin/store-shipping.html">'.$MsgText[0][564].'</a>';
					
				

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

	}
	else {
	
		RedirectToLogin();
	
	}

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




?>
