Ejemplo n.º 1
0
 public function calcDistButtonClicked($sender, $param)
 {
     //lets add the coordinates
     $myGTranslator = new GoogleAdressTranslator();
     $mapparams = $myGTranslator->getLatAndLong(implode(",", array($this->partner_street->Text, $this->partner_town->Text)));
     $myLatandLong = explode(",", $mapparams);
     $arraydistance = array(array($myLatandLong['1'], $myLatandLong['0']), array($this->adresse_lat->Text, $this->adresse_long->Text));
     $distance = PFH::getDistance($arraydistance);
     $baseweight = (double) $this->waren_gewicht->Text;
     $baseprice = (double) $this->waren_preis->Text;
     $this->est_waren_preis->Text = $distance * 1.4 / 1000 * 2.5 / 2 * $baseweight / 10000 + $baseprice;
 }