Exemplo n.º 1
0
    } else {
        $address['street'] = null;
    }
    if (!is_null($adresse['building'])) {
        $building = Maps::buildingSearch($adresse['building'], $address['street']);
        if (count($building)) {
            $address['building'] = $building[0]['id'];
        } else {
            $building = Maps::buildingNew($adresse['building'], $address['street']);
            $address['building'] = $building;
        }
    } else {
        $address['building'] = null;
    }
    // On lance la création de l'adresse
    Maps::addressNew($person->get('id'), $address['ville'], $address['zip'], $address['street'], $address['building'], 'reel');
    $person->contact_details_add($contact['MAIL']);
    $person->tag_add('Sénateur PS');
    $person->tag_add($contact['REGION']);
    $query = $link->prepare('DELETE FROM `TABLE 30` WHERE `id` = :id');
    $query->bindValue(':id', $contact['id'], PDO::PARAM_INT);
    $query->execute();
}
$query = $link->query('SELECT COUNT(*) FROM `TABLE 30`');
$nb = $query->fetch(PDO::FETCH_NUM);
if ($nb[0]) {
    ?>
<script>
    var url = 'transfert.php';
    document.location.href = url;
</script>
Exemplo n.º 2
0
<?php

/**
 * Ajout d'une nouvelle adresse à un contact
 *
 * PHP version 5
 *
 * @category Ajax
 * @package  LeQG
 * @author   Damien Senger <*****@*****.**>
 * @license  https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
 * @link     http://leqg.info
 */
$rue = Maps::streetNew($_POST['rue'], $_POST['ville']);
$immeuble = Maps::buildingNew($_POST['immeuble'], $rue);
$zipcode = Maps::zipcodeNew($_POST['zipcode'], $_POST['ville']);
$adresse = Maps::addressNew($_POST['fiche'], $_POST['ville'], $zipcode, $rue, $immeuble);
$data = new People($_POST['fiche']);
$postal = $data->postal_address();
echo $postal['reel'];
Exemplo n.º 3
0
<?php

/**
 * Modification de l'immeuble d'habitation d'un contact
 *
 * PHP version 5
 *
 * @category Ajax
 * @package  LeQG
 * @author   Damien Senger <*****@*****.**>
 * @license  https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
 * @link     http://leqg.info
 */
$street = Maps::streetData($_POST['rue']);
$building = Maps::buildingNew($_POST['immeuble'], $street['id']);
$zipcode = Maps::zipcodeDetect($street['id']);
$city = Maps::cityData($street['city']);
$address = Maps::addressNew($_POST['fiche'], $city['id'], $zipcode, $street['id'], $building);
$data = new People($_POST['fiche']);
$postal = $data->postal_address();
echo $postal['reel'];
Exemplo n.º 4
0
<?php

/**
 * Mise à jour de l'immeuble associé à un contact
 *
 * PHP version 5
 *
 * @category Ajax
 * @package  LeQG
 * @author   Damien Senger <*****@*****.**>
 * @license  https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
 * @link     http://leqg.info
 */
$building = Maps::buildingData($_POST['immeuble']);
$street = Maps::streetData($building['street']);
$zipcode = Maps::zipcodeDetect($street['id']);
$city = Maps::cityData($street['city']);
$address = Maps::addressNew($_POST['contact'], $city['id'], $zipcode, $street['id'], $building['id']);
$data = new People($_POST['contact']);
$postal = $data->postal_address();
echo $postal['reel'];