Пример #1
0
 * @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
 */
$var = $_GET;
$var['criteres'] = trim($var['criteres'], ';');
$contacts = People::listing($var, 0, false);
$fichier = array();
$nomFichier = 'export-' . User::ID() . '-' . uniqid() . '.csv';
$file = fopen('exports/' . $nomFichier, 'w+');
$entete = ['nom', 'nom_usage', 'prenoms', 'sexe', 'date_naissance', 'age', 'adresse declaree', 'adresse electorale', 'bureau', 'ville', 'electeur', 'electeur_europeen', 'electeur_municipales', 'organisme', 'fonction', 'tags'];
fputcsv($file, $entete, ';', '"');
foreach ($contacts as $_contact) {
    $contact = new People($_contact);
    $address = $contact->postal_address();
    $poll = Maps::pollData($contact->get('bureau'));
    $birthdate = new DateTime($contact->get('date_naissance'));
    $_fichier = array($contact->get('nom'), $contact->get('nom_usage'), $contact->get('prenoms'), $contact->get('sexe'), $birthdate->format('d/m/Y'), $contact->age(), $address['reel'], $address['officiel'], $poll['number'], $poll['city'], $contact->get('electeur'), $contact->get('electeur_europeen'), $contact->get('electeur_municipales'), $contact->get('organisme'), $contact->get('fonction'), implode(',', $contact->get('tags')));
    fputcsv($file, $_fichier, ';', '"');
}
// On retraite le nom du fichier
$f = 'exports/' . $nomFichier;
if ($f) {
    $email = file_get_contents('tpl/mail/export-reussi.tpl.html');
    $objet = '[LeQG] Votre export est prêt à être téléchargé';
    $email = strtr($email, array('{URL}' => 'http://' . Configuration::read('url') . $f));
} else {
    $email = file_get_contents('tpl/mail/export-echec.tpl.html');
    $objet = '[LeQG] Votre export a provoqué un erreur';
}
Пример #2
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'];
Пример #3
0
<?php

// On protège le module
User::protection(5);
// Chargement de l'objet contact
$data = new People($_GET['contact']);
$address = $data->postal_address();
// Chargement de l'entête
Core::loadHeader();
?>

<h2 class="titre" id="nomContact" data-fiche="<?php 
echo $data->get('id');
?>
"><?php 
if (!empty($data->display_name())) {
    echo $data->display_name();
} else {
    echo 'Cliquez pour ajouter un nom';
}
?>
</h2>

<div class="colonne demi gauche">
	<section id="fiche-details" class="contenu demi">
		<ul class="icones-etatcivil">
			<li class="sexe <?php 
echo strtolower($data->display_sex());
?>
 ?>"><?php 
echo $data->display_sex(true);