echo Event::displayType($e->get('type')); ?> </span></small> <strong><a href="<?php echo Core::goPage('contact', array('contact' => $c->get('id'), 'evenement' => $e->get('id'))); ?> "><?php echo !empty($e->get('objet')) ? $e->get('objet') : 'Événement sans titre'; ?> </a></strong> <ul class="infosAnnexes"> <li class="contact"><a href="<?php echo Core::goPage('contact', array('contact' => $c->get('id'))); ?> "><?php echo $c->display_name(); ?> </a></li> <li class="date"><?php echo date('d/m/Y', strtotime($e->get('date'))); ?> </li> </ul> </li> <?php } ?> </ul> </section> <?php }
/** * Email sending method * * @param integer $campaign Campaign ID * @param string $email Recipient's email * * @return void * @static **/ public static function sending(int $campaign, string $email) { // campaign data $campaign = new Campaign($campaign); // recipient data $query = Core::query('contact-by-email'); $query->bindValue(':coord', $email); $query->execute(); $data = $query->fetch(PDO::FETCH_NUM); $person = new People($data[0]); unset($data); $mail = $campaign->get('mail'); $replace = array('mail-optout.php?test' => 'mail-optout.php?email=' . md5($email)); $mail = strtr($mail, $replace); $to = array(array('email' => $email, 'name' => $person->display_name(), 'type' => 'to')); $message = array('html' => $mail, 'subject' => $campaign->get('objet'), 'from_email' => Configuration::read('mail.sender.mail'), 'from_name' => Configuration::read('mail.sender.name'), 'headers' => array('Reply-To' => Configuration::read('mail.replyto')), 'to' => $to, 'track_opens' => true, 'auto_text' => true, 'subaccount' => Configuration::read('client')); $async = true; $mandrill = Configuration::read('mail'); $result = $mandrill->messages->send($message, $async); // we parse mail sending result $result = $result[0]; // we save result data $query = Core::query('tracking-update'); $query->bindValue(':campaign', $campaign->get('id'), PDO::PARAM_INT); $query->bindValue(':email', $result['email']); $query->bindValue(':id', $result['_id']); $query->bindValue(':status', $result['status']); $query->bindValue(':reject', $result['reject_reason']); $query->execute(); }
<th>Électeur</th> <th style="width: 300px">Email</th> <th style="width: 200px">Téléphone</th> </tr> </thead> <tbody> <?php foreach ($coordonnees as $electeur) { $contact = new People($electeur); ?> <tr class="ligne-electeur-<?php echo $contact->get('id'); ?> "> <td><?php echo $contact->display_name(); ?> </td> <td><input type="text" name="email-<?php echo $electeur; ?> " placeholder="email" style="border: none; width: 100%; text-align: center;"></td> <td><input type="text" name="phone-<?php echo $electeur; ?> " placeholder="numéro" style="border: none; width: 100%; text-align: center;"></td> </tr> <?php } ?> </tbody>
<ul class="listeContacts"> <?php if ($data->newContactsNumber()) { // On fait la liste des contacts concernés $contacts = $data->contactsList(4); foreach ($contacts as $contact) { // On ouvre la fiche du contact concerné $fiche = new People($contact[0]); if ($fiche->get('sexe') == 'H') { $sexe = 'homme'; } elseif ($fiche->get('sexe') == 'F') { $sexe = 'femme'; } else { $sexe = 'isexe'; } if (!empty($fiche->display_name())) { $nomAffichage = $fiche->display_name(); } elseif (!empty($fiche->get('organisme'))) { $nomAffichage = $fiche->get('organisme'); } else { $nomAffichage = 'Fiche sans nom'; } ?> <a href="<?php Core::goPage('contact', array('contact' => $fiche->get('id'))); ?> " class="nostyle contact-<?php echo $fiche->get('id'); ?> "> <li class="contact <?php
<?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);
$rappel = $query->fetch(PDO::FETCH_ASSOC); // On affecte ce rappel à l'utilisateur qui vient de l'ouvrir $query = $link->prepare('UPDATE `rappels` SET `user_id` = :user, `rappel_statut` = 1 WHERE `argumentaire_id` = :argumentaire AND `contact_id` = :contact'); $query->bindParam(':user', $userId, PDO::PARAM_INT); $query->bindParam(':argumentaire', $rappel['argumentaire_id'], PDO::PARAM_INT); $query->bindParam(':contact', $rappel['contact_id'], PDO::PARAM_INT); $query->execute(); // On ouvre l'argumentaire $query = $link->prepare('SELECT * FROM `argumentaires` WHERE `argumentaire_id` = :argumentaire'); $query->bindParam(':argumentaire', $rappel['argumentaire_id'], PDO::PARAM_INT); $query->execute(); $argumentaire = $query->fetch(PDO::FETCH_ASSOC); // On ouvre la fiche du contact $contact = new People($rappel['contact_id']); // On cherche le nom à afficher if (!empty($contact->display_name())) { $nomAffichage = $contact->display_name(); } elseif (!empty($contact->get('organisme'))) { $nomAffichage = $contact->get('organisme'); } else { $nomAffichage = 'Fiche sans nom'; } } // On charge le template Core::loadHeader(); ?> <h2 class="titre" data-argumentaire="<?php echo $argumentaire['argumentaire_id']; ?> " data-contact="<?php echo $contact->get('id');