コード例 #1
0
ファイル: transfert.php プロジェクト: leqg/leqg
 }
 if (empty($adresse['ville'])) {
     $adresse['ville'] = null;
 }
 if (empty($adresse['zip'])) {
     $adresse['zip'] = null;
 }
 if (empty($adresse['street'])) {
     $adresse['street'] = null;
 }
 if (empty($adresse['building'])) {
     $adresse['building'] = null;
 }
 $address = array('pays' => '', 'ville' => '', 'zip' => '', 'street' => '', 'building' => '');
 if (!is_null($adresse['pays'])) {
     $countries = Maps::countrySearch($adresse['pays']);
     if (count($countries)) {
         $address['pays'] = $countries[0]['id'];
     } else {
         $country = Maps::countryCreate($adresse['pays']);
         $address['pays'] = $country;
     }
 } else {
     $address['pays'] = null;
 }
 if (!is_null($adresse['ville'])) {
     $city = Maps::citySearch($adresse['ville'], $address['pays']);
     if (count($city)) {
         $address['ville'] = $city[0]['id'];
     } else {
         $city = Maps::cityCreate($adresse['ville'], $address['pays']);