Thanks! That's just how I would have coded it. I'll drop it into the
project.
Leon
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Mari Bester
> Sent: Wednesday, December 15, 1999 1:25 AM
> To: 'FreeTrade'
> Subject: [FreeTrade] AddressFunctions
>
>
> Freetrade-19991213
> In order for the outputAddress (on the modules/screens/order_view_ibid
> and modules/screens/order_express) to display the Country Name and
> StateName in stead of only the CountryCode or StateProv code, I
> made the
> following changes:
> A)
> Added the following function to modules/include/makeCountrySelector:
> function getCountryName($CountryCode)
> {
> global $Countries;
> return($Countries[$CountryCode]);
> }
>
> Added the following function to modules/include/makeStateSelector:
> function getStateName($StateCode)
> {
> global $States;
> return($States[$StateCode]);
> }
>
> B)
> Changed the following function in modules/include/addressFunctions:
> function outputAddress($Value, $Field="ALL", $CreateTable=TRUE)
> Changed on Line 355 the following section of code -
> FROM:
> //loop through fields
> reset($Field);
> while(list($key, $FieldName) = each($Field))
> {
> printTableRow($AddressInfo[$FieldName][ADDR_LABEL],
> $Value[$FieldName]);
> }
>
> TO:
> //loop through fields
> reset($Field);
> while(list($key, $FieldName) = each($Field))
> {
> if($FieldName == "StateProv")
> {
> printTableRow($AddressInfo[$FieldName][ADDR_LABEL],
> getStateName($Value[$FieldName]));
> }
> elseif($FieldName == "CountryCode")
> {
> printTableRow($AddressInfo[$FieldName][ADDR_LABEL],
> getCountryName($Value[$FieldName]));
> }
> else
> {
> printTableRow($AddressInfo[$FieldName][ADDR_LABEL],
> $Value[$FieldName]);
> }
> }
>
> Kind regards,
>
> Mari Bester
> Tel: +27(0)12 804 0080
> Fax: +27(0)12 804 1250
> Cell: +27(0)82 458 9137
> E-Mail: [EMAIL PROTECTED]
> URL: http://dchip.com
> Diamond Network Technologies (PTY) Ltd.
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Site: http://www.working-dogs.com/freetrade/
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Site: http://www.working-dogs.com/freetrade/
Problems?: [EMAIL PROTECTED]