CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Editable Grid > BeforeBuildUpdate > Hidden Field Not Updating/Inserting

Print topic Send  topic

Author Message
Koren

Posts: 83
Posted: 03/12/2013, 7:55 PM

I am trying to get the longitude and latitude from google maps and insert it into the database using a hidden field that is populated with the info when keyed into an editable grid.

I am able to get the data just fine and display it in a BeforeShowRow hidden field and can update esisting rows, but i need to have rows newly entered get the data and insert it into the database when the keyed address information is inserted.

Any direction would be greatly appreciated!
Thank You! Thank You!
Koren
P.S.
Project created in Code Charge Studio 4.3

  
In BeforeBuildUpdate for the Editable Grid....  
	global $DBConnection1;  
	global $addresses,$latlng,$myaddress;  
  
$myaddress = $Container->address_st->GetValue();  
$myaddress .= " ";  
$myaddress .= $Container->state->GetValue();  
$myaddress .= " ";  
$myaddress .= $Container->zip->GetValue();  
$url = "http://maps.googleapis.com/maps/api/geocode/json?address=".str_replace(" ","+",$myaddress)."&sensor=false";  
$getmap = file_get_contents($url);   
$googlemap = json_decode($getmap);  
foreach($googlemap->results as $res){  
	 $address = $res->geometry;  
	 $latlng = $address->location;  
	 $formattedaddress = $res->formatted_address;  
	 $Container->DataSource->lat_id->SetValue($latlng->lat);  
	 $Container->DataSource->lng_id->SetValue($latlng->lng);  
  
}  
  
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.