0 Members and 1 Guest are viewing this topic.

*

Pharg

  • *****
  • 3,137
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Help for managezip.php and tpl
« Reply #15 on: January 14, 2018, 04:47:29 AM »
Hi Benoitc64,

Awesome works and thanks for sharing works great now.  ;)
« Last Edit: January 14, 2018, 07:37:47 AM by Pharg »
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

Pharg

  • *****
  • 3,137
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Help for managezip.php and tpl
« Reply #16 on: January 17, 2018, 10:55:37 PM »
Hi Benoitc64,

CBG found why I couldn't load the County / District  and the  Cities / Towns and they were not showing, it was because of the States CSV files were wrong.

Example in United States:
Quote
US.AL,Alabama
US.AZ,Arizona
US.AK,Alaska
US.AR,Arkansas
US.CA,California
US.CT,Connecticut
US.CO,Colorado
US.DE,Delaware
US.DC,District of Columbia
US.FL,Florida
US.GA,Georgia

It should be:
Quote
AL,Alabama
AZ,Arizona
AK,Alaska
AR,Arkansas
CA,California
CT,Connecticut
CO,Colorado
DE,Delaware
DC,District of Columbia
FL,Florida
GA,Georgia

The managestates.php when trying to load the files us only looking for the first letter, like AZ, not 2 first letters US.AZ and  this is why the County / District  and the  Cities / Towns weren't loading.


Hi Benoitc64,

The reason I couldn't find it is because for some reason the County / District  and the  Cities / Towns are not loading.

I had to manually add a few to get to where you were talking about, so there must be other problems also with loading
the Counties an Cities.


The fixed states have been attached below.

Now I have added a few manually, I don't seem to get any errors but I do see it's not saving
the Longitude and Latitude you have added as a mod.
« Last Edit: January 17, 2018, 11:53:30 PM by Pharg »
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

Benoitc64

  • **
  • 74
  • osDate Version: osDate Evo v1.2
Re: Help for managezip.php and tpl
« Reply #17 on: January 18, 2018, 05:36:45 AM »
Yes pharg , i've change all STATES for all countries. for some reason

1) In the old version, the program seem confuse with AL for Alabama in United states or Alberta in Canada. or same  state code in many countries
    or AR in france is Auvergne-Rhone-Alpes,
        AR in US is Arkansas.



2) i use the code in Geopostcode.com for uniformizing the data. And i don't have modify the counties, cities and zipcode data.

3) The modification is on progress. That's why i change the Managezip.php and managezip.tpl. It will be use to update the counties. cities and zipcode.
     
osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

Benoitc64

  • **
  • 74
  • osDate Version: osDate Evo v1.2
Re: Help for managezip.php and tpl
« Reply #18 on: January 18, 2018, 05:42:55 AM »
osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

Pharg

  • *****
  • 3,137
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Help for managezip.php and tpl
« Reply #19 on: January 18, 2018, 05:51:01 AM »
Hi Benoitc64,

It had to be changed without the US in the front of each state or we would have had to change
the php code looking for the States.

All good, was just letting you know why it wasn't working on our testing sites and only noticed it when you asked
for help with the managezips.php

All the rest works fine now the States has been changed without the US.

We appreciate all the help with CSV files you did, we are not complaining just letting you know the problem.

Regards, Phill

Yes pharg , i've change all STATES for all countries. for some reason

1) In the old version, the program seem confuse with AL for Alabama in United states or Alberta in Canada. or same  state code in many countries
    or AR in france is Auvergne-Rhone-Alpes,
        AR in US is Arkansas.



2) i use the code in Geopostcode.com for uniformizing the data. And i don't have modify the counties, cities and zipcode data.

3) The modification is on progress. That's why i change the Managezip.php and managezip.tpl. It will be use to update the counties. cities and zipcode.
   
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35

*

Benoitc64

  • **
  • 74
  • osDate Version: osDate Evo v1.2
Re: Help for managezip.php and tpl
« Reply #20 on: January 18, 2018, 06:25:49 AM »
Hi Benoitc64,

It had to be changed without the US in the front of each state or we would have had to change
the php code looking for the States.

All good, was just letting you know why it wasn't working on our testing sites and only noticed it when you asked
for help with the managezips.php

All the rest works fine now the States has been changed without the US.

We appreciate all the help with CSV files you did, we are not complaining just letting you know the problem.

Regards, Phill

Yes pharg , i've change all STATES for all countries. for some reason

1) In the old version, the program seem confuse with AL for Alabama in United states or Alberta in Canada. or same  state code in many countries
    or AR in france is Auvergne-Rhone-Alpes,
        AR in US is Arkansas.



2) i use the code in Geopostcode.com for uniformizing the data. And i don't have modify the counties, cities and zipcode data.

3) The modification is on progress. That's why i change the Managezip.php and managezip.tpl. It will be use to update the counties. cities and zipcode.
   

That's good, Pharg The modification works perfectly with the new or the old version of state, counties. cities and zipcode.

I've made this modification for the future website for saving spaces in database.

If the website have only a 1000 peoples , you cant save more spaces, but if the website have more than 100 000 records. The uniformization save many spaces in hosting.

I've a formation in programming, and database relations and optimization. That's why i suggest those modifications

i've forgot to say to use the old dataset instead of the new one. That's my mistake.


The united states counties, cities and zipcode files have many errors in the files. Some counties doesnt exist, some  zips  have many record for the same

for example in  US_AK_001.csv we have

99501,61.218665,-149.867089,AK,Anchorage,Anchorage
99502,61.149085,-149.94278,AK,Anchorage,Anchorage
99503,61.193435,-149.888062,AK,Anchorage,Anchorage
99504,61.204464,-149.748496,AK,Anchorage,Anchorage
99505,61.255993,-149.689138,AK,Anchorage,Anch                          -1
99505,61.255993,-149.689138,AK,Anchorage,Anchorage                  -1   
99505,61.255993,-149.689138,AK,Anchorage,Fort Richardson          -2
99505,61.255993,-149.689138,AK,Anchorage,Ft Richardson             -2

-1 and -2  are the same record, so  we must clean those data
that's why i use the geopostcode website and the new managezip.php for having clean data. ;)

i know i have many to do.

Benoit




osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

Benoitc64

  • **
  • 74
  • osDate Version: osDate Evo v1.2
Re: Help for managezip.php and tpl
« Reply #21 on: January 22, 2018, 06:01:16 AM »
I'm testing for adding some zipcode and i found a little error i made in the modification.

I use the site geopostcodes.com for reference with the zipcodes
So i found 2 zipcodes who is the same zipcode but not the same city.

So i modify the  managezip.php

in line 99 we have

Code: [Select]
$foundid = $osDB->getOne( 'select id from ! where countrycode = ? and statecode = ?  and citycode = ? ' , array( ZIPCODES_TABLE, $_REQUEST['countrycode'], $_REQUEST['statecode'],  $_REQUEST['citycode'] ) ) ;


change it for

Code: [Select]
$foundid = $osDB->getOne( 'select id from ! where countrycode = ? and statecode = ? and code = ? and citycode = ? ' , array( ZIPCODES_TABLE, $_REQUEST['countrycode'], $_REQUEST['statecode'],  $_REQUEST['code'], $_REQUEST['citycode'] ) ) ;

osDateEvo v1.2 | PHP 5.6.30-0+deb8u1 | MySQL: 5.5.51 |

*

Pharg

  • *****
  • 3,137
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: Help for managezip.php and tpl
« Reply #22 on: January 22, 2018, 07:32:41 AM »
Hi Benoitc64,

Thanks for letting us know about the error.
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35