Commit 192232e3 authored by ramiandrison gova's avatar ramiandrison gova
Browse files

adding zones,nb max and min of address,add other input in form address

parent c1f5ba8a
......@@ -71,8 +71,10 @@ if($mode == "r" || $mode == "pdf"){ ?>
},
options :{
//countryCode :["FR","RE","MG","GP","YT"]
countryCode:formAdd.inputs[key].options.countryCode
countryCode:formAdd.inputs[key].options.countryCode,
zones:formAdd.inputs[key].options.zones,
maxMinAddress: formAdd.inputs[key].options.maxMinAddress,
otherAddressInfo : formAdd.inputs[key].options.otherAddressInfo
}
};
......@@ -112,65 +114,10 @@ if($mode == "r" || $mode == "pdf"){ ?>
// toastr.success('saved');
// } );
// };
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/city/getcitiesbyscopeandparsetoadress",
data: {
countryCode: "MG",
scopeValue : "fianarantsoa"
},
dataType: "json",
success: function(data){
mylog.log("mba mety!!",data);
},
error(error){
mylog.log("tsy mety!!",error);
}
})
});
</script>
<?php } ?>
<?php
/*$params['text'] = "paris";
$params['countryCode'] = "FR";
$getAddressByDataGouv = AdresseDataGouv::getAddressByDataGouv($params);
var_dump($getAddressByDataGouv["features"][0]);
var_dump(AdresseDataGouv::parseAddress($getAddressByDataGouv,$params)[0]);*/
// var_dump(SIG::getAdressSchemaLikeByCodeInsee("01053"));
/*function getCitiesAndparseToAddress ($scopeValue,$countryCode){
$res = array();
if($countryCode == null || $scopeValue == null)
return Rest::json( array("res"=>false, "msg" => "error with countryCode or scopeValue" ));
$where = array('$or'=>
array( array("name" => new MongoRegex("/".$scopeValue."/i")),
array("alternateName" => new MongoRegex("/".$scopeValue."/i")),
array("postalCodes.postalCode" => new MongoRegex("/^".$scopeValue."/i")),
array("postalCodes.name" => new MongoRegex("/^".$scopeValue."/i")),
)
);
$where = array('$and'=> array($where, array("country" => strtoupper($countryCode)) )
);
$att = array("alternateName","country","name", "countryCode","postalCodes", "level", "geo", "geoPosition","geoShape");
$cities = PHDB::findAndSort(City::COLLECTION,$where,$att,null,null);
if (!empty($cities)) {
foreach ($cities as $key => $value) {
$res[]= City::createLocality($value, $value["name"], $value['geo']['latitude'], $value['geo']['longitude']);
var_dump($res);
}
}
return Rest::json( array("res"=>true, "cities" => $cities));
}
getCitiesAndparseToAddress("fia", "MG");*/
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment