Predefined List for States.

A couple of people have asked me for a predefined list of states, so I thought I would post here in case anyone else needs one.

 

INSERT INTO `sys_pre_values` (`Key`, `Value`, `Order`, `LKey`, `LKey2`, `LKey3`, `Extra`, `Extra2`, `Extra3`) VALUES
('State', '  ', 0, '-Any-', '', '', '', '', ''),
('State', 'AA', 55, 'Armed Forces Americas (except Canada)', '', '', '', '', ''),
('State', 'AE', 54, 'Armed Forces Canada', '', '', '', '', ''),
('State', 'WY', 53, 'Wyoming', '', '', '', '', ''),
('State', 'WI', 52, 'Wisconsin', '', '', '', '', ''),
('State', 'WV', 51, 'West Virginia', '', '', '', '', ''),
('State', 'WA', 50, 'Washington', '', '', '', '', ''),
('State', 'VA', 49, 'Virginia', '', '', '', '', ''),
('State', 'VI', 48, 'Virgin Islands', '', '', '', '', ''),
('State', 'VT', 47, 'Vermont', '', '', '', '', ''),
('State', 'UT', 46, 'Utah', '', '', '', '', ''),
('State', 'TX', 45, 'Texas', '', '', '', '', ''),
('State', 'TN', 44, 'Tennessee', '', '', '', '', ''),
('State', 'SD', 43, 'South Dakota', '', '', '', '', ''),
('State', 'SC', 42, 'South Carolina', '', '', '', '', ''),
('State', 'RI', 41, 'Rhode Island', '', '', '', '', ''),
('State', 'PR', 40, 'Puerto Rico', '', '', '', '', ''),
('State', 'PA', 39, 'Pennsylvania', '', '', '', '', ''),
('State', 'PW', 38, 'Palau', '', '', '', '', ''),
('State', 'OK', 37, 'Oklahoma', '', '', '', '', ''),
('State', 'OH', 36, 'Ohio', '', '', '', '', ''),
('State', 'MP', 35, 'Northern Mariana Islands', '', '', '', '', ''),
('State', 'ND', 34, 'North Dakota', '', '', '', '', ''),
('State', 'NC', 33, 'North Carolina', '', '', '', '', ''),
('State', 'NY', 32, 'New York', '', '', '', '', ''),
('State', 'NM', 31, 'New Mexico', '', '', '', '', ''),
('State', 'NJ', 30, 'New Jersey', '', '', '', '', ''),
('State', 'NH', 29, 'New Hampshire', '', '', '', '', ''),
('State', 'NV', 28, 'Nevada', '', '', '', '', ''),
('State', 'NE', 27, 'Nebraska', '', '', '', '', ''),
('State', 'MT', 26, 'Montana', '', '', '', '', ''),
('State', 'MO', 25, 'Missouri', '', '', '', '', ''),
('State', 'MS', 24, 'Mississippi', '', '', '', '', ''),
('State', 'MN', 23, 'Minnesota', '', '', '', '', ''),
('State', 'MI', 22, 'Michigan', '', '', '', '', ''),
('State', 'MA', 21, 'Massachusetts', '', '', '', '', ''),
('State', 'MD', 20, 'Maryland', '', '', '', '', ''),
('State', 'MH', 19, 'Marshall Islands', '', '', '', '', ''),
('State', 'ME', 18, 'Maine', '', '', '', '', ''),
('State', 'LA', 17, 'Louisiana', '', '', '', '', ''),
('State', 'KY', 16, 'Kentucky', '', '', '', '', ''),
('State', 'KS', 15, 'Kansas', '', '', '', '', ''),
('State', 'IA', 14, 'Iowa', '', '', '', '', ''),
('State', 'IN', 13, 'Indiana', '', '', '', '', ''),
('State', 'IL', 12, 'Illinois', '', '', '', '', ''),
('State', 'ID', 11, 'Idaho', '', '', '', '', ''),
('State', 'HI', 10, 'Hawaii', '', '', '', '', ''),
('State', 'GU', 9, 'Guam', '', '', '', '', ''),
('State', 'GA', 8, 'Georgia', '', '', '', '', ''),
('State', 'FL', 7, 'Florida', '', '', '', '', ''),
('State', 'FM', 6, 'Federated States of Micronesia', '', '', '', '', ''),
('State', 'DC', 5, 'District of Columbia', '', '', '', '', ''),
('State', 'DE', 4, 'Delaware', '', '', '', '', ''),
('State', 'CT', 3, 'Connecticut', '', '', '', '', ''),
('State', 'CO', 2, 'Colorado', '', '', '', '', ''),
('State', 'AZ', 1, 'Arizona', '', '', '', '', '');

caredesign.net
Quote · 8 Mar 2014

Thank you Professor, very much appreciated.

Geeks, making the world a better place
Quote · 8 Mar 2014

That's OK... I never did like Alabama, Alaska, Arkansas, California, or even Oregon for that matter.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 8 Mar 2014

 

That's OK... I never did like Alabama, Alaska, Arkansas, California, or even Oregon for that matter.

 
LOL. I did not even notice those were missing.

https://www.deanbassett.com
Quote · 8 Mar 2014

That's OK Deano... that's why I'm here.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 8 Mar 2014

Thanks HL - I missed those. Any more I missed before I repost? (geography and I did not do well together in school)

 

EDIT:

INSERT INTO `sys_pre_values` (`Key`, `Value`, `Order`, `LKey`, `LKey2`, `LKey3`, `Extra`, `Extra2`, `Extra3`) VALUES
('State', '  ', 0, '-Any-', '', '', '', '', ''),
('State', 'OR', 43, 'Oregon', '', '', '', '', ''),
('State', 'PA', 42, 'Pennsylvania', '', '', '', '', ''),
('State', 'PW', 41, 'Palau', '', '', '', '', ''),
('State', 'OK', 40, 'Oklahoma', '', '', '', '', ''),
('State', 'OH', 39, 'Ohio', '', '', '', '', ''),
('State', 'MP', 38, 'Northern Mariana Islands', '', '', '', '', ''),
('State', 'ND', 37, 'North Dakota', '', '', '', '', ''),
('State', 'NC', 36, 'North Carolina', '', '', '', '', ''),
('State', 'NY', 35, 'New York', '', '', '', '', ''),
('State', 'NM', 34, 'New Mexico', '', '', '', '', ''),
('State', 'NJ', 33, 'New Jersey', '', '', '', '', ''),
('State', 'NH', 32, 'New Hampshire', '', '', '', '', ''),
('State', 'NV', 31, 'Nevada', '', '', '', '', ''),
('State', 'NE', 30, 'Nebraska', '', '', '', '', ''),
('State', 'MT', 29, 'Montana', '', '', '', '', ''),
('State', 'MO', 28, 'Missouri', '', '', '', '', ''),
('State', 'MS', 27, 'Mississippi', '', '', '', '', ''),
('State', 'MN', 26, 'Minnesota', '', '', '', '', ''),
('State', 'MI', 25, 'Michigan', '', '', '', '', ''),
('State', 'MA', 24, 'Massachusetts', '', '', '', '', ''),
('State', 'MD', 23, 'Maryland', '', '', '', '', ''),
('State', 'MH', 22, 'Marshall Islands', '', '', '', '', ''),
('State', 'ME', 21, 'Maine', '', '', '', '', ''),
('State', 'LA', 20, 'Louisiana', '', '', '', '', ''),
('State', 'KY', 19, 'Kentucky', '', '', '', '', ''),
('State', 'KS', 18, 'Kansas', '', '', '', '', ''),
('State', 'IA', 17, 'Iowa', '', '', '', '', ''),
('State', 'IN', 16, 'Indiana', '', '', '', '', ''),
('State', 'IL', 15, 'Illinois', '', '', '', '', ''),
('State', 'ID', 14, 'Idaho', '', '', '', '', ''),
('State', 'HI', 13, 'Hawaii', '', '', '', '', ''),
('State', 'GU', 12, 'Guam', '', '', '', '', ''),
('State', 'GA', 11, 'Georgia', '', '', '', '', ''),
('State', 'FL', 10, 'Florida', '', '', '', '', ''),
('State', 'FM', 9, 'Federated States of Micronesia', '', '', '', '', ''),
('State', 'DC', 8, 'District of Columbia', '', '', '', '', ''),
('State', 'DE', 7, 'Delaware', '', '', '', '', ''),
('State', 'CT', 6, 'Connecticut', '', '', '', '', ''),
('State', 'CO', 5, 'Colorado', '', '', '', '', ''),
('State', 'CA', 4, 'California', '', '', '', '', ''),
('State', 'PR', 44, 'Puerto Rico', '', '', '', '', ''),
('State', 'AR', 3, 'Arkansas', '', '', '', '', ''),
('State', 'AZ', 2, 'Arizona', '', '', '', '', ''),
('State', 'AK', 1, 'Alaska', '', '', '', '', ''),
('State', 'AL', 0, 'Alabama', '', '', '', '', ''),
('State', 'RI', 45, 'Rhode Island', '', '', '', '', ''),
('State', 'SC', 46, 'South Carolina', '', '', '', '', ''),
('State', 'SD', 47, 'South Dakota', '', '', '', '', ''),
('State', 'TN', 48, 'Tennessee', '', '', '', '', ''),
('State', 'TX', 49, 'Texas', '', '', '', '', ''),
('State', 'UT', 50, 'Utah', '', '', '', '', ''),
('State', 'VT', 51, 'Vermont', '', '', '', '', ''),
('State', 'VI', 52, 'Virgin Islands', '', '', '', '', ''),
('State', 'VA', 53, 'Virginia', '', '', '', '', ''),
('State', 'WA', 54, 'Washington', '', '', '', '', ''),
('State', 'WV', 55, 'West Virginia', '', '', '', '', ''),
('State', 'WI', 56, 'Wisconsin', '', '', '', '', ''),
('State', 'WY', 57, 'Wyoming', '', '', '', '', ''),
('State', 'AE', 58, 'Armed Forces Canada', '', '', '', '', ''),
('State', 'AA', 59, 'Armed Forces Americas (except Canada)', '', '', '', '', '');

caredesign.net
Quote · 8 Mar 2014

Thanks Professor, I appreciate the effort and the sharing.

Geeks, making the world a better place
Quote · 9 Mar 2014

Hi,

Thanks for your effort. We have also created a new mod to support this feature for most of the countries. You can find the details here - LINK

Thanks,

Mods4Dolphin

Facebook, Twitter & Instagram Combo - http://bit.ly/1h5CarP
Quote · 20 Apr 2014

 RE:

Hi,

Thanks for your effort. We have also created a new mod to support this feature for most of the countries. You can find the details here - LINK

Thanks,

Mods4Dolphin

 Two Questions:

1. Which core files are modified?

2. I assume the States list is automatically populated according to what country was selected?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 20 Apr 2014

Hi,

Five files get touched per module, here's the list for groups -

-BxGroupsDb.php ( 3 new functions)

-BxGroupsFormAdd.php (Added State field and small change for country field)

-BxGroupsModule.php (added some 3-4 lines new code and changed location to support State)

-BxGroupsSearchResult.php (one line change to include state in the list)

-BxGroupsTemplate.php (one line change to check if field set, this is optional)

Yes, changing country automatically loads the related states for the 'State' field.

You can check the demo here - http://mods4dolphin.com/

That said, you can also install the 'States' module by itself. That will load all the State keys in the database and you can use it for whatever purpose you want...

 

Regards,

Mods4Dolphin

Facebook, Twitter & Instagram Combo - http://bit.ly/1h5CarP
Quote · 20 Apr 2014

WOW - $29 bucks - heck, I should have charged for this list.

caredesign.net
Quote · 20 Apr 2014

 RE:

WOW - $29 bucks - heck, I should have charged for this list.

 It's a little more than just a list

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 20 Apr 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.