20 lines
400 B
PHP
20 lines
400 B
PHP
<?php
|
|
|
|
require_once 'bootstrap.php';
|
|
|
|
$id = dbGetVal("select id from df_locations where address='".dbEscape($_POST['location']['adr'])."'");
|
|
if($id){
|
|
echo $id;
|
|
exit;
|
|
}
|
|
|
|
dbInsert('df_locations', array(
|
|
'address' => formatAddress($_POST['location']['adr']),
|
|
'latitude' => $_POST['location']['lat'],
|
|
'longitude' => $_POST['location']['lng'],
|
|
));
|
|
|
|
echo dbGetInsertId();
|
|
|
|
|
|
|