<?

/*
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][113];
	$BrowserTitle = $MsgText[9][113];
	$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][113];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[903] == 'y') {
		
		
			$query = "select * from `".$Settings['DBPrefix']."ec-Settings`";
			$result = mysql_query($query) or die (mysql_error());
			while ($row = mysql_fetch_array($result)) {
				$ecSettings[$row['Name']] = $row['Value'];
			}
		
		
			if ($Arguments3 != '') {
				
				$query = "select * from `".$Settings['DBPrefix']."ec-Shipping` where RecordNumber='".intval($Arguments3)."' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				$row = mysql_fetch_array($result);
				
				$ActiveSelected[$row['Active']] = ' selected';
				
				
				$CountriesArray = explode(',',$row['Countries']);
				for ($x = 0; $x < count($CountriesArray); $x++) {
					if ($CountriesArray[$x] != '') {
						$CountrySelected[$CountriesArray[$x]] = 'y';
					}
				}
				
				
				$query2 = "select * from `".$Settings['DBPrefix']."core-Countries` where AllowSales=1 order by Name asc";
				$result2 = mysql_query($query2) or die (mysql_error());
				while ($row2 = mysql_fetch_array($result2)) {
					if ($CountrySelected[$row2['Code']] == 'y') {
						$CountriesList .= '<br><input type="checkbox" name="Countries-'.$row2['Code'].'" value="y" checked> '.$row2['Name'];
					}
					else {
						$CountriesList .= '<br><input type="checkbox" name="Countries-'.$row2['Code'].'" value="y"> '.$row2['Name'];
					}
				}
				
				if ($CountriesList == '') {
					$CountriesList = '<br>['.$MsgText[9][80].': <a href="'.$MainURL.'/admin/countries.html">'.$MsgText[0][581].'</a>.]';
				}
				
				
				$CalculationsSelected[$row['Calculations']] = ' checked';
				
				
				
				if ($ecSettings['PriceDecimals'] == '') {
					$ecSettings['PriceDecimals'] = 2;
				}
	
				
				if ($ecSettings['DecimalSymbol'] == '') {
					$ecSettings['DecimalSymbol'] = '.';
				}
	
				
				if ($ecSettings['ThousandsSep'] == '') {
					$ecSettings['ThousandsSep'] = ',';
				}
				
				
				
				
				$UnitsDecimalPlaces['w1'] = 4;
				$LimitsDecimalPlaces['w1'] = 4;
				$UnitsDecimalPlaces['w2'] = 4;
				$LimitsDecimalPlaces['w2'] = 4;
				$UnitsDecimalPlaces['v1'] = $ecSettings['PriceDecimals'];
				$LimitsDecimalPlaces['v1'] = $ecSettings['PriceDecimals'];
				$UnitsDecimalPlaces['v2'] = $ecSettings['PriceDecimals'];
				$LimitsDecimalPlaces['v2'] = $ecSettings['PriceDecimals'];
				$UnitsDecimalPlaces['i1'] = 0;
				$LimitsDecimalPlaces['i1'] = 0;
				$UnitsDecimalPlaces['i2'] = 0;
				$LimitsDecimalPlaces['i2'] = 0;
				
				
				$StartingValue[$row['Calculations']]['BasePrice'] = $row['BasePrice'];
				
				if ($row['BaseLimit'] == 0) {
					$StartingValue[$row['Calculations']]['BaseLimit'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['BaseLimit'] = number_format($row['BaseLimit'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				
				if ($row['Price1'] == 0) {
					$StartingValue[$row['Calculations']]['Price1'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price1'] = $row['Price1'];
				}
				if ($row['Price2'] == 0) {
					$StartingValue[$row['Calculations']]['Price2'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price2'] = $row['Price2'];
				}
				if ($row['Price3'] == 0) {
					$StartingValue[$row['Calculations']]['Price3'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price3'] = $row['Price3'];
				}
				if ($row['Price4'] == 0) {
					$StartingValue[$row['Calculations']]['Price4'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price4'] = $row['Price4'];
				}
				if ($row['Price5'] == 0) {
					$StartingValue[$row['Calculations']]['Price5'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price5'] = $row['Price5'];
				}
				if ($row['Price6'] == 0) {
					$StartingValue[$row['Calculations']]['Price6'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price6'] = $row['Price6'];
				}
				if ($row['Price7'] == 0) {
					$StartingValue[$row['Calculations']]['Price7'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price7'] = $row['Price7'];
				}
				if ($row['Price8'] == 0) {
					$StartingValue[$row['Calculations']]['Price8'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Price8'] = $row['Price8'];
				}
				
				if ($row['Unit1'] == 0) {
					$StartingValue[$row['Calculations']]['Unit1'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit1'] = number_format($row['Unit1'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Unit2'] == 0) {
					$StartingValue[$row['Calculations']]['Unit2'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit2'] = number_format($row['Unit2'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Unit3'] == 0) {
					$StartingValue[$row['Calculations']]['Unit3'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit3'] = number_format($row['Unit3'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Unit4'] == 0) {
					$StartingValue[$row['Calculations']]['Unit4'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit4'] = number_format($row['Unit4'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Unit5'] == 0) {
					$StartingValue[$row['Calculations']]['Unit5'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit5'] = number_format($row['Unit5'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Unit6'] == 0) {
					$StartingValue[$row['Calculations']]['Unit6'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit6'] = number_format($row['Unit6'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Unit7'] == 0) {
					$StartingValue[$row['Calculations']]['Unit7'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit7'] = number_format($row['Unit7'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Unit8'] == 0) {
					$StartingValue[$row['Calculations']]['Unit8'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Unit8'] = number_format($row['Unit8'],$UnitsDecimalPlaces[$row['Calculations']]);
				}
				
				if ($row['Limit1'] == 0) {
					$StartingValue[$row['Calculations']]['Limit1'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit1'] = number_format($row['Limit1'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Limit2'] == 0) {
					$StartingValue[$row['Calculations']]['Limit2'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit2'] = number_format($row['Limit2'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Limit3'] == 0) {
					$StartingValue[$row['Calculations']]['Limit3'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit3'] = number_format($row['Limit3'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Limit4'] == 0) {
					$StartingValue[$row['Calculations']]['Limit4'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit4'] = number_format($row['Limit4'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Limit5'] == 0) {
					$StartingValue[$row['Calculations']]['Limit5'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit5'] = number_format($row['Limit5'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Limit6'] == 0) {
					$StartingValue[$row['Calculations']]['Limit6'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit6'] = number_format($row['Limit6'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Limit7'] == 0) {
					$StartingValue[$row['Calculations']]['Limit7'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit7'] = number_format($row['Limit7'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				if ($row['Limit8'] == 0) {
					$StartingValue[$row['Calculations']]['Limit8'] = '';
				}
				else {
					$StartingValue[$row['Calculations']]['Limit8'] = number_format($row['Limit8'],$LimitsDecimalPlaces[$row['Calculations']]);
				}
				
				
				
				$PageContents = '<br><form action="'.$MainURL.'/admin/store-shipping-edit-save" method="post"><input type="hidden" name="ID" value="'.$Arguments3.'"><b>'.$MsgText[9][10].':</b><br><input type="text" name="Description" size="50" maxlength="100" style="'.$FormStyle.'" value="'.str_replace('"','&#34;',$row['Description']).'"><br><br><br><b>'.$MsgText[9][79].':</b>'.$CountriesList.'<br><br><br><b>'.$MsgText[9][81].':</b><br>

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td>&nbsp;&nbsp;&nbsp;</td>
      <td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'">
	  
	<input type="radio" name="Calculations" value="w1" onClick="UpdateCalcSelection(\'w1\')"'.$CalculationsSelected['w1'].'> <b>'.$MsgText[9][82].':</b><br><div id="div_w1"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><b>'.$MsgText[9][83].'</b><br><br>$<input type="text" name="BasePrice_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['BasePrice'].'"> '.$MsgText[9][84].' <input type="text" name="BaseLimit_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['BaseLimit'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price1_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price1'].'"> '.$MsgText[9][86].' <input type="text" name="Unit1_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit1'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit1_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit1'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price2_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price2'].'"> '.$MsgText[9][86].' <input type="text" name="Unit2_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit2'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit2_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit2'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price3_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price3'].'"> '.$MsgText[9][86].' <input type="text" name="Unit3_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit3'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit3_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit3'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price4_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price4'].'"> '.$MsgText[9][86].' <input type="text" name="Unit4_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit4'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit4_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit4'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price5_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price5'].'"> '.$MsgText[9][86].' <input type="text" name="Unit5_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit5'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit5_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit5'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price6_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price6'].'"> '.$MsgText[9][86].' <input type="text" name="Unit6_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit6'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit6_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit6'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price7_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price7'].'"> '.$MsgText[9][86].' <input type="text" name="Unit7_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit7'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit7_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit7'].'"> lbs.<br><br>'.$MsgText[9][85].' $<input type="text" name="Price8_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Price8'].'"> '.$MsgText[9][86].' <input type="text" name="Unit8_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Unit8'].'"> lbs. '.$MsgText[9][87].' <input type="text" name="Limit8_w1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w1']['Limit8'].'"> lbs.<br>&nbsp;</font></td></tr></table></div><br>

	<input type="radio" name="Calculations" value="w2" onClick="UpdateCalcSelection(\'w2\')"'.$CalculationsSelected['w2'].'> <b>'.$MsgText[9][94].':</b><br><div id="div_w2"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><b>'.$MsgText[9][95].'</b><br><br>$<input type="text" name="BasePrice_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['BasePrice'].'"> '.$MsgText[9][84].' <input type="text" name="BaseLimit_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['BaseLimit'].'"> lbs.<br><br>$<input type="text" name="Price1_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price1'].'"> '.$MsgText[9][84].' <input type="text" name="Limit1_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit1'].'"> lbs.<br><br>$<input type="text" name="Price2_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price2'].'"> '.$MsgText[9][84].' <input type="text" name="Limit2_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit2'].'"> lbs.<br><br>$<input type="text" name="Price3_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price3'].'"> '.$MsgText[9][84].' <input type="text" name="Limit3_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit3'].'"> lbs.<br><br>$<input type="text" name="Price4_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price4'].'"> '.$MsgText[9][84].' <input type="text" name="Limit4_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit4'].'"> lbs.<br><br>$<input type="text" name="Price5_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price5'].'"> '.$MsgText[9][84].' <input type="text" name="Limit5_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit5'].'"> lbs.<br><br>$<input type="text" name="Price6_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price6'].'"> '.$MsgText[9][84].' <input type="text" name="Limit6_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit6'].'"> lbs.<br><br>$<input type="text" name="Price7_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price7'].'"> '.$MsgText[9][84].' <input type="text" name="Limit7_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit7'].'"> lbs.<br><br>$<input type="text" name="Price8_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Price8'].'"> '.$MsgText[9][84].' <input type="text" name="Limit8_w2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['w2']['Limit8'].'"> lbs.<br>&nbsp;</font></td></tr></table></div><br>

	<input type="radio" name="Calculations" value="v1" onClick="UpdateCalcSelection(\'v1\')"'.$CalculationsSelected['v1'].'> <b>'.$MsgText[9][96].':</b><br><div id="div_v1"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><b>'.$MsgText[9][97].'</b><br><br>$<input type="text" name="BasePrice_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['BasePrice'].'"> '.$MsgText[9][84].' $<input type="text" name="BaseLimit_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['BaseLimit'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price1_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price1'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit1_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit1'].'"> '.$MsgText[9][87].' $<input type="text" name="Limit1_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Limit1'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price2_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price2'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit2_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit2'].'"> '.$MsgText[9][87].' $<input type="text" name="Limit2_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Limit2'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price3_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price3'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit3_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit3'].'"> '.$MsgText[9][87].' $<input type="text" name="Limit3_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Limit3'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price4_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price4'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit4_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit4'].'"> '.$MsgText[9][87].' $<input type="text" name="Limit4_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Limit4'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price5_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price5'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit5_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit5'].'"> '.$MsgText[9][87].' $<input type="text" name="Limit5_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Limit5'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price6_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price6'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit6_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit6'].'"> '.$MsgText[9][87].' $<input type="text" name="Limit6_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Limit6'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price7_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price7'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit7_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit7'].'"> '.$MsgText[9][87].' $<input type="text" name="Limit7_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Limit7'].'"><br><br>'.$MsgText[9][85].' $<input type="text" name="Price8_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Price8'].'"> '.$MsgText[9][86].' $<input type="text" name="Unit8_v1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v1']['Unit8'].'"> '.$MsgText[9][88].'<br>&nbsp;</font></td></tr></table></div><br>

	<input type="radio" name="Calculations" value="v2" onClick="UpdateCalcSelection(\'v2\')"'.$CalculationsSelected['v2'].'> <b>'.$MsgText[9][98].':</b><br><div id="div_v2"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><b>'.$MsgText[9][99].'</b><br><br>$<input type="text" name="BasePrice_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['BasePrice'].'"> '.$MsgText[9][84].' $<input type="text" name="BaseLimit_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['BaseLimit'].'"><br><br>$<input type="text" name="Price1_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price1'].'"> '.$MsgText[9][84].' $<input type="text" name="Limit1_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Limit1'].'"><br><br>$<input type="text" name="Price2_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price2'].'"> '.$MsgText[9][84].' $<input type="text" name="Limit2_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Limit2'].'"><br><br>$<input type="text" name="Price3_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price3'].'"> '.$MsgText[9][84].' $<input type="text" name="Limit3_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Limit3'].'"><br><br>$<input type="text" name="Price4_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price4'].'"> '.$MsgText[9][84].' $<input type="text" name="Limit4_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Limit4'].'"><br><br>$<input type="text" name="Price5_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price5'].'"> '.$MsgText[9][84].' $<input type="text" name="Limit5_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Limit5'].'"><br><br>$<input type="text" name="Price6_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price6'].'"> '.$MsgText[9][84].' $<input type="text" name="Limit6_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Limit6'].'"><br><br>$<input type="text" name="Price7_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price7'].'"> '.$MsgText[9][84].' $<input type="text" name="Limit7_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Limit7'].'"><br><br>$<input type="text" name="Price8_v2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['v2']['Price8'].'"> '.$MsgText[9][89].'<br>&nbsp;</font></td></tr></table></div><br>

	<input type="radio" name="Calculations" value="i1" onClick="UpdateCalcSelection(\'i1\')"'.$CalculationsSelected['i1'].'> <b>'.$MsgText[9][100].':</b><br><div id="div_i1"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><b>'.$MsgText[9][101].'</b><br><br>$<input type="text" name="BasePrice_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['BasePrice'].'"> '.$MsgText[9][84].' <input type="text" name="BaseLimit_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['BaseLimit'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price1_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price1'].'"> '.$MsgText[9][86].' <input type="text" name="Unit1_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit1'].'"> '.$MsgText[9][91].' <input type="text" name="Limit1_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Limit1'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price2_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price2'].'"> '.$MsgText[9][86].' <input type="text" name="Unit2_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit2'].'"> '.$MsgText[9][91].' <input type="text" name="Limit2_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Limit2'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price3_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price3'].'"> '.$MsgText[9][86].' <input type="text" name="Unit3_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit3'].'"> '.$MsgText[9][91].' <input type="text" name="Limit3_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Limit3'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price4_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price4'].'"> '.$MsgText[9][86].' <input type="text" name="Unit4_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit4'].'"> '.$MsgText[9][91].' <input type="text" name="Limit4_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Limit4'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price5_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price5'].'"> '.$MsgText[9][86].' <input type="text" name="Unit5_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit5'].'"> '.$MsgText[9][91].' <input type="text" name="Limit5_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Limit5'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price6_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price6'].'"> '.$MsgText[9][86].' <input type="text" name="Unit6_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit6'].'"> '.$MsgText[9][91].' <input type="text" name="Limit6_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Limit6'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price7_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price7'].'"> '.$MsgText[9][86].' <input type="text" name="Unit7_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit7'].'"> '.$MsgText[9][91].' <input type="text" name="Limit7_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Limit7'].'"> '.$MsgText[9][90].'<br><br>'.$MsgText[9][85].' $<input type="text" name="Price8_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Price8'].'"> '.$MsgText[9][86].' <input type="text" name="Unit8_i1" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i1']['Unit8'].'"> '.$MsgText[9][92].'<br>&nbsp;</font></td></tr></table></div><br>

	<input type="radio" name="Calculations" value="i2" onClick="UpdateCalcSelection(\'i2\')"'.$CalculationsSelected['i2'].'> <b>'.$MsgText[9][102].':</b><br><div id="div_i2"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><b>'.$MsgText[9][103].'</b><br><br>$<input type="text" name="BasePrice_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['BasePrice'].'"> '.$MsgText[9][84].' <input type="text" name="BaseLimit_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['BaseLimit'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price1_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price1'].'"> '.$MsgText[9][84].' <input type="text" name="Limit1_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Limit1'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price2_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price2'].'"> '.$MsgText[9][84].' <input type="text" name="Limit2_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Limit2'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price3_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price3'].'"> '.$MsgText[9][84].' <input type="text" name="Limit3_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Limit3'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price4_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price4'].'"> '.$MsgText[9][84].' <input type="text" name="Limit4_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Limit4'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price5_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price5'].'"> '.$MsgText[9][84].' <input type="text" name="Limit5_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Limit5'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price6_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price6'].'"> '.$MsgText[9][84].' <input type="text" name="Limit6_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Limit6'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price7_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price7'].'"> '.$MsgText[9][84].' <input type="text" name="Limit7_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Limit7'].'"> '.$MsgText[9][90].'<br><br>$<input type="text" name="Price8_i2" size="5" style="'.$FormStyle.'" value="'.$StartingValue['i2']['Price8'].'"> '.$MsgText[9][93].'<br>&nbsp;</font></td></tr></table></div><br>

	<input type="radio" name="Calculations" value="fp" onClick="UpdateCalcSelection(\'fp\')"'.$CalculationsSelected['fp'].'> <b>'.$MsgText[9][104].'</b><br><div id="div_fp"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br>$<input type="text" name="BasePrice_fp" size="5" style="'.$FormStyle.'" value="'.$StartingValue['fp']['BasePrice'].'"> '.$MsgText[9][105].'<br><br>'.$MsgText[9][106].'</font></td></tr></table></div><br>

	<input type="radio" name="Calculations" value="usps_pm" onClick="UpdateCalcSelection(\'usps_pm\')"'.$CalculationsSelected['usps_pm'].'> <b>'.$MsgText[9][107].'</b><br><div id="div_usps_pm"><table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td width="100%"><font face="'.$FontFace.'" size="'.$FontSize.'"><br><b>'.$MsgText[9][108].'</b></font></td></tr></table></div>

</font></td>
    </tr>
</table>

	<script>
		var LastCalcSelection = "'.$row['Calculations'].'";
		var ElementID = "";
			
		ElementID = document.getElementById("div_w1");
		ElementID.style.display = "none"
		ElementID = document.getElementById("div_w2");
		ElementID.style.display = "none"
		ElementID = document.getElementById("div_v1");
		ElementID.style.display = "none"
		ElementID = document.getElementById("div_v2");
		ElementID.style.display = "none"
		ElementID = document.getElementById("div_i1");
		ElementID.style.display = "none"
		ElementID = document.getElementById("div_i2");
		ElementID.style.display = "none"
		ElementID = document.getElementById("div_fp");
		ElementID.style.display = "none"
		ElementID = document.getElementById("div_usps_pm");
		ElementID.style.display = "none"
		
		ElementID = document.getElementById("div_"+LastCalcSelection);
		ElementID.style.display = ""
			
		function UpdateCalcSelection(NewSelection) {
	  
		 	ElementID = document.getElementById("div_"+LastCalcSelection);
			ElementID.style.display = "none"
		
		  	ElementID = document.getElementById("div_"+NewSelection);
			ElementID.style.display = ""
	  
	  		LastCalcSelection = NewSelection;
		}
	</script>

<br><br><br><b>'.$MsgText[9][109].':</b><br>'.$MsgText[9][110].' $<input type="text" name="Handling" size="5" style="'.$FormStyle.'" value="'.$row['Handling'].'"> '.$MsgText[9][111].'<br><br><br><b>'.$MsgText[0][416].':</b><br><select name="Active" style="'.$FormStyle.'">
	<option value="1"'.$ActiveSelected[1].'> '.$MsgText[9][76].'</option>
	<option value="0"'.$ActiveSelected[0].'> '.$MsgText[9][77].'</option>
</select><br><br><br><input type="checkbox" name="Remove" value="y"> '.$MsgText[0][156].'
<br><br><br><br><input type="submit" value="'.$MsgText[0][123].'" style="'.$FormStyle.'"></form>';
				
			}
			
			else {
				$PageContents = $MsgText[0][98];
			}
					
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}

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




?>
