<!--#include file="../../owFunctions/I_GeneralFunctions.asp"-->
<!--#include file="../header.asp"-->
<%
	'************************************************************************************
	'*																					*
	'*	MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH 							*
	'*		ONEWORLDSTORE IS DONE AT YOUR OWN RISK!										*
	'*	Product  : OneWorldStore														*
	'*	Version  : 9.0000																*
	'*	Modified : June 2004															*
	'*	Copyright:	Copyright (C) 2004 OneWorldStore.Com								*
	'*				Registration Number: 1024507										*
	'*				http://strategis.ic.gc.ca/											*
	'*																					*
	'************************************************************************************

	dim sSort, bRefresh, sSearch, sSearchText
	
	bRefresh			= Trim(Request("bRefresh"))
	sSort				= Trim(Request("sSort"))
	sSearch				= Trim(Request("sSearch"))
	sSearchText			= Trim(Request("sSearchText"))
	pIdShipment			= CONVERSION_SQLEncode2(Request("idshipment"),10)
	
	sSQLText = "SELECT * FROM shipments WHERE idShipment=" &pIdShipment
	Call DB_getFromDatabase(sSQLText, rsStoreData, "owModifyCustomerForm.asp") 
	If ( NOT rsStoreData.EOF ) Then
		pShipmentDesc		= rsStoreData("shipmentDesc")
		pPriceToAdd			= rsStoreData("priceToAdd")
		pPercentageToAdd	= rsStoreData("percentageToAdd")
		pHandlingPercentage	= rsStoreData("handlingPercentage")
		pHandlingFix		= rsStoreData("handlingFix")
		pShipmentTime		= rsStoreData("shipmentTime")
		pQuantityFrom		= rsStoreData("quantityFrom")
		pQuantityUntil		= rsStoreData("quantityUntil")
		pPriceFrom			= rsStoreData("priceFrom")
		pPriceUntil			= rsStoreData("priceUntil")
		pWeightFrom			= rsStoreData("WeightFrom")
		pWeightUntil		= rsStoreData("WeightUntil")
		pZip				= rsStoreData("zip")
		pZipEq	 			= rsStoreData("zipEq")
		pStateCode			= rsStoreData("stateCode")
		pStateCodeEq 		= rsStoreData("stateCodeEq")
		pCountryCode		= rsStoreData("countryCode")
		pCountryCodeEq		= rsStoreData("countryCodeEq")
		sIDCustomerType		= rsStoreData("IDCustomerType")   
		%>

		<script language = "javascript">
	
			<%If ( bRefresh = "TRUE" ) Then%>
			parent.owBodyTopNav.location="owBodyTopNav.asp?sPage=ModifyShipping&sMessage=<%=Server.URLEncode(LANG_DT( "CHANGES_SAVED", "** Changes saved **" ))%>"
			<%Else%>
			parent.owBodyTopNav.location="owBodyTopNav.asp?sPage=ModifyShipping"
			<%End If%>
			parent.owBodyFooter.location="owBodyFooter.asp?sAction=Null"
			
		</script>
		<body onLoad = 'toForm()' style="font-family: Arial; font-size: 11px;" topmargin="0" leftmargin="0" bgcolor=C3DAF9>
		<form method="post" name="ModifyShipping" action='owShipmentModifyExec.asp'>
			<input type='hidden' name='sAction' value='ModifyShipping'>
			<input type='hidden' name='sSort' value='<%=sSort%>'>
			<input type='hidden' name='sSearchText' value='<%=sSearchText%>'>
			<input type='hidden' name='sSearch' value='<%=sSearch%>'>
			<input type="hidden" name="IdShipment" value="<%=pIdShipment%>">
			
			<input type='hidden' name='handlingFix' value='0.00'>
			<input type='hidden' name='handlingPercentage' value='0'>
			
			<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding:5px; FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #808080" bgcolor="#ffffff"><tr><td>
			<table border="0" cellpadding="0" cellspacing="0" width="100%" style="FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #808080" bgcolor="#ffffff">
				<tr>
					<td colspan=2 style='padding-top: 5px;'>
						<%=LANG_DT( "MANUALSHIP_DESC", "Description" )%>
					</td>
					<td style='padding-top: 5px;'>
						<%=LANG_DT( "MANUALSHIP_SHIPTIME", "Shipment time" )%>
					</td>
					<td style='padding-top: 5px;'>
						<%=LANG_DT( "MANUALSHIP_CUSTTYPE", "Customer type" )%>
					</td>
				</tr>
				<tr>
					<td colspan=2>
						<%VALIDATE_textbox "shipmentDesc", pshipmentDesc, 66, "textbox", "blank"%>
					</td>
					<td>
						<%VALIDATE_textbox "shipmentTime", pshipmentTime, 25, "textbox", "blank|bok"%>
					</td>
					<td>
						<select name="customerType">
							<option selected value="0"> <%=LANG_DT( "MANUALSHIP_ALL", "ALL" )%> </option>
							<option value='<%=C_GROUP_RETAIL%>' <%If ( sIDCustomerType = C_GROUP_RETAIL ) Then Response.Write "selected" End If%>><%=LANG_DT( "MANUALSHIP_RETAIL", "Retail" )%></option>
							<option value='<%=C_GROUP_WHOLESALE%>' <%If ( sIDCustomerType = C_GROUP_WHOLESALE ) Then Response.Write "selected" End If%>><%=LANG_DT( "MANUALSHIP_WHOLESALE", "Wholesale" )%></option>
						</select>
					</td>
				</tr>
				<tr>
					<td style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_QTYFROM", "Quantity From" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_UNTIL", "Until" )%>
					</td>
					<td style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_WEIGHTFROM", "Weight From" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_UNTIL", "Until" )%>
					</td>
				</tr>
				<tr>
					<td>
						<%VALIDATE_textbox "quantityFrom", pQuantityFrom, 25, "textbox", "number|bok"%>
					</td>
					<td>
						<%VALIDATE_textbox "quantityUntil", pQuantityUntil, 25, "textbox", "number|bok"%>
					</td>
					<td>
						<%VALIDATE_textbox "WeightFrom", pWeightFrom, 25, "textbox", "number|bok"%>
					</td>
					<td>
						<%VALIDATE_textbox "WeightUntil", pWeightUntil, 25, "textbox", "number|bok"%>
					</td>
				</tr>
				
				<tr>
					<td style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_PRICEFROM", "Total price From" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_UNTIL", "Until" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_PERCENT", "Percentage to add" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_FIXEDPRICE", "Fixed price to add" )%>
					</td>
				</tr>
				<tr>
					<td>
						<%VALIDATE_textbox "priceFrom", pPriceFrom, 25, "textbox", "decimalr|bok"%>
					</td>
					<td>
						<%VALIDATE_textbox "priceUntil", pPriceUntil, 25, "textbox", "decimalr|bok"%>
					</td>
					<td>
						<%VALIDATE_textbox "percentageToAdd", ppercentageToAdd, 25, "textbox", ""%>
					</td>
					<td>
						<%VALIDATE_textbox "priceToAdd", pPriceToAdd, 25, "textbox", "decimalr|bok"%>
					</td>
				</tr>
				
				<tr>
					<td style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_STATE", "State Code" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_STATEEQ", "State Code Equal" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_ZIP", "Zip Code" )%>
					</td>
					<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
						<%=LANG_DT( "MANUALSHIP_ZIPEQ", "Zip Equal" )%>
					</td>
				</tr>
				<tr>
					<td>
						<%
						sSQLText = "SELECT * FROM stateCodes WHERE Active = 'Y'"
						call DB_getFromDatabase(sSQLText, rsStoreData2, "") 
						%>
						<SELECT name=stateCode size=1>
							<OPTION value=""><%=LANG_DT( "MANUALSHIP_SELSTATE", "Select a State" )%></OPTION>
							<%
							do while not rsStoreData2.eof      
								pStateCode2 = rsStoreData2("stateCode")
								%><option value="<%response.write pStateCode2%>" <%if pStateCode2=pStateCode then response.write "selected" end if%>><%=rsStoreData2("stateName")%></OPTION>
								<%
								rsStoreData2.movenext
							loop
							Call DB_closeRecordset(rsStoreData2)
							%>
						</SELECT>
					</td>
					<td>
						<%=LANG_DT( "YES", "Yes" )%>  
						<input type="checkbox" name="stateCodeEq" value="-1" <%if (pStateCodeEq=-1) then%> checked <%end if%>>
					</td>
					<td>
						<%VALIDATE_textbox "zip", pZip, 12, "textbox", ""%>
					</td>
					<td>
						<%=LANG_DT( "YES", "Yes" )%>  
						<input type="checkbox" name="zipEq" value="-1" <%if (pZipEq=-1) then%> checked <%end if%>>
					</td>
				</tr>
				
				<tr>
					<td colspan=4>
						<table border="0" cellpadding="0" cellspacing="0" style="FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #808080" bgcolor="#ffffff">
							<tr>
								<td style='padding-bottom: 2px; padding-top: 6px;'>
									<%=LANG_DT( "MANUALSHIP_COUNTRY", "Country" )%>
								</td>
								<td style='padding-bottom: 2px; padding-top: 6px;'>&nbsp;&nbsp;&nbsp;</td>
								<td valign=bottom style='padding-bottom: 2px; padding-top: 6px;'>
									<%=LANG_DT( "MANUALSHIP_COUNTRYEQ", "Country Code Equal" )%>
								</td>
							</tr>
							<tr>
								<td>
									<%
									sSQLText = "SELECT * FROM countryCodes WHERE Active = 'Y'"
									call DB_getFromDatabase(sSQLText, rsStoreData2, "") 
									%>
									<SELECT name=CountryCode>
										<OPTION value=""><%=LANG_DT( "MANUALSHIP_COUNTRY", "Country" )%></OPTION>
										<%
										do while not rsStoreData2.eof
											pCountryCode2=rsStoreData2("countryCode")
											%>
											<option value="<%response.write pCountryCode2%>" <%if pCountryCode=pCountryCode2 then response.write "selected" end if%>><%=rsStoreData2("countryName")%></OPTION>
											<%
											rsStoreData2.movenext
										loop
										%>
									</SELECT>   
								</td>
								<td>&nbsp;&nbsp;&nbsp;</td>
								<td>
									<%=LANG_DT( "YES", "Yes" )%>  
									<input type="checkbox" name="countryCodeEq" value="-1" <%if (pCountryCodeEq=-1) then%> checked <%end if%>>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</td></tr></table>
		</form>
		<form method='post' name='ShippingTypes' action='owListShipments.asp'>
			<input type='hidden' name='sDelete<%=pIdShipment%>' value=''>
			<input type='hidden' name='sAction' value='Delete'>
			<input type='hidden' name='sSort' value='<%=sSort%>'>
		</form>
	<%Else%>
		<script language = "javascript">
	
			parent.owBodyTopNav.location="owBodyTopNav.asp?sPage=ModifyShipping&sMessage=<%=Server.URLEncode(LANG_DT( "SHIPPING_MISSINGTYPE", "** Missing Shipment Type! **" ))%>"
			location="owShipmentModifyForm.asp?sSort=<%=sSort%>&sSearch=<%=sSearch%>&sSearchText=<%=sSearchText%>&IdShipment=<%=pIdShipment%>";
			
		</script>
		<%
	End If
	Call DB_closeRecordset(rsStoreData)
	%>      
<!--#include file="../footer.asp"-->