Esempio n. 1
0
<?php

// Impossible to access the file itself
if (!defined('PAGE_LOADED_USING_INDEX')) {
    trigger_error("Direct access forbidden.", E_USER_ERROR);
    exit;
}
$action = verifierAction(array('lister', 'relancer'));
$smarty->assign('action', $action);
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Cotisations.php';
$cotisations = new AFUP_Cotisations($bdd);
if ($action == 'lister') {
    $relances_personne_morales = $cotisations->obtenirListeRelancesPersonnesMorales();
    if (empty($relances_personne_morales)) {
        $relances_personne_morales = null;
    }
    $smarty->assign('relances_personnes_morales', $relances_personne_morales);
    $relances_personne_physiques = $cotisations->obtenirListeRelancesPersonnesPhysiques();
    if (empty($relances_personne_physiques)) {
        $relances_personne_physiques = null;
    }
    $smarty->assign('relances_personnes_physiques', $relances_personne_physiques);
} elseif ($action == 'relancer') {
    $donnees = array_keys($_POST);
    $ok = true;
    $liste = "";
    for ($i = 0, $taille = count($donnees); $i < $taille; $i++) {
        if (FALSE !== strpos($donnees[$i], "_")) {
            $type_personne = substr($donnees[$i], 0, 1);
            $id_personne = substr($donnees[$i], 2);
            $ok = $cotisations->relancer($type_personne, $id_personne);
Esempio n. 2
0
<?php

require_once dirname(__FILE__) . '/../../../sources/Afup/Bootstrap/Http.php';
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Base_De_Donnees.php';
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Cotisations.php';
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Logs.php';
AFUP_Logs::initialiser($bdd, 0);
$cotisations = new AFUP_Cotisations($bdd);
$cotisations->validerReglementEnLigne($_GET['cmd'], round($_GET['total'] / 100, 2), $_GET['autorisation'], $_GET['transaction']);
$cotisations->notifierRegelementEnLigneAuTresorier($_GET['cmd'], round($_GET['total'] / 100, 2), $_GET['autorisation'], $_GET['transaction']);
AFUP_Logs::log("Ajout de la cotisation " . $_GET['cmd'] . " via Paybox.");
$message = "<p>Votre paiement a été enregistré. Merci et à bientôt.</p>";
$message .= "<p>Une questions ? N'hésitez pas à contacter <a href=\"mailto:tresorier@afup.org\">le trésorier</a>.</p>";
$message .= "<p><strong></srong><a href=\"index.php\">retour à votre compte</a></strong></p>";
$smarty->assign('paybox', $message);
$smarty->display('paybox.html');
Esempio n. 3
0
 /**
  * Renvoie la dernière cotisation
  *
  * @param int $id Identifiant de la personne physique
  * @access public
  * @return array
  */
 function obtenirDerniereCotisation($id_personne_physique)
 {
     require_once 'Afup/AFUP_Cotisations.php';
     $requete = 'SELECT';
     $requete .= '  id_personne_morale ';
     $requete .= 'FROM';
     $requete .= '  afup_personnes_physiques ';
     $requete .= 'WHERE';
     $requete .= '  id = ' . $id_personne_physique;
     $id_personne_morale = $this->_bdd->obtenirUn($requete);
     $cotisation = new AFUP_Cotisations($this->_bdd);
     if ($id_personne_morale > 0) {
         $id = $id_personne_morale;
         $type_personne = AFUP_PERSONNES_MORALES;
     } else {
         $id = $id_personne_physique;
         $type_personne = AFUP_PERSONNES_PHYSIQUES;
     }
     return $cotisation->obtenirDerniere($type_personne, $id);
 }
Esempio n. 4
0
 /**
  * Supprime une personne morale
  *
  * @param  int      $id     Identifiant de la personne morale à supprimer
  * @access public
  * @return bool     Succès de la suppression
  */
 function supprimer($id)
 {
     require_once 'Afup/AFUP_Cotisations.php';
     $cotisation = new AFUP_Cotisations($this->_bdd);
     $cotisation_personne_morale = $cotisation->obtenirListe(AFUP_PERSONNES_MORALES, $id, 'id');
     require_once 'Afup/AFUP_Personnes_Physiques.php';
     $personne_physique = new AFUP_Personnes_Physiques($this->_bdd);
     $personne_physique_de_personne_morale = $personne_physique->obtenirListe('id', 'nom', '', $id);
     if (sizeof($cotisation_personne_morale) == 0 and sizeof($personne_physique_de_personne_morale) == 0) {
         $requete = 'DELETE FROM afup_personnes_morales WHERE id=' . $id;
         return $this->_bdd->executer($requete);
     }
     return false;
 }
Esempio n. 5
0
    trigger_error("Direct access forbidden.", E_USER_ERROR);
    exit;
}
$action = verifierAction(array('payer', 'telecharger_facture', 'envoyer_facture'));
$smarty->assign('action', $action);
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Personnes_Morales.php';
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Personnes_Physiques.php';
$personnes_physiques = new AFUP_Personnes_Physiques($bdd);
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Pays.php';
$pays = new AFUP_Pays($bdd);
$formulaire =& instancierFormulaire();
$identifiant = $droits->obtenirIdentifiant();
$champs = $personnes_physiques->obtenir($identifiant);
$cotisation = $personnes_physiques->obtenirDerniereCotisation($identifiant);
unset($champs['mot_de_passe']);
$cotisations = new AFUP_Cotisations($bdd);
if (!$cotisation) {
    $message = empty($_GET['hash']) ? 'Est-ce vraiment votre première cotisation ?' : '';
} else {
    $endSubscription = $cotisations->finProchaineCotisation($cotisation);
    $message = sprintf('Votre dernière cotisation -- %s %s -- est valable jusqu\'au %s. <br />
        Si vous renouvellez votre cotisation maintenant, celle-ci sera valable jusqu\'au %s', $cotisation['montant'], EURO, date("d/m/Y", $cotisation['date_fin']), $endSubscription->format('d/m/Y'));
}
if (isset($_GET['action']) && $_GET['action'] == 'envoyer_facture') {
    if ($cotisations->envoyerFacture($_GET['id'])) {
        AFUP_Logs::log('Envoi par email de la facture pour la cotisation n°' . $_GET['id']);
        afficherMessage('La facture a été envoyée par mail', 'index.php?page=membre_cotisation');
    } else {
        afficherMessage("La facture n'a pas pu être envoyée par mail", 'index.php?page=membre_cotisation', true);
    }
} elseif (isset($_GET['action']) && $_GET['action'] == 'telecharger_facture') {
Esempio n. 6
0
$paybox->set_erreur('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/paybox_erreur.php');
$paybox->set_wait(50000);
// Délai d'attente avant la redirection
$paybox->set_boutpi('R&eacute;gler par carte');
// Texte du bouton
$paybox->set_bkgd('#FAEBD7');
// Fond de page
$paybox->set_output('B');
// On veut gerer l'affichage dans la page intermediaire
if (preg_match('#<CENTER>.*</b>(.*)</CENTER>#is', $paybox->paiement(), $r)) {
    $smarty->assign('paybox', $r[1]);
} else {
    $smarty->assign('paybox', '');
}
$smarty->assign('message', $message);
$smarty->assign('formulaire', genererFormulaire($formulaire));
$cotisations = new AFUP_Cotisations($bdd);
$cotisation_physique = $cotisations->obtenirListe(0, $donnees['id']);
$cotisations = new AFUP_Cotisations($bdd);
$cotisation_morale = $cotisations->obtenirListe(1, $donnees['id_personne_morale']);
if (is_array($cotisation_morale) && is_array($cotisation_physique)) {
    $cotisations = array_merge($cotisation_physique, $cotisation_morale);
} elseif (is_array($cotisation_morale)) {
    $cotisations = $cotisation_morale;
} elseif (is_array($cotisation_physique)) {
    $cotisations = $cotisation_physique;
} else {
    $cotisations = array();
}
$smarty->assign('liste_cotisations', $cotisations);
$smarty->assign('time', time());
Esempio n. 7
0
$smarty->assign('action', $action);
// Personne
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Personnes_Physiques.php';
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Personnes_Morales.php';
if ($_GET['type_personne'] == AFUP_PERSONNES_PHYSIQUES) {
    $personnes = new AFUP_Personnes_Physiques($bdd);
} else {
    $personnes = new AFUP_Personnes_Morales($bdd);
}
$smarty->assign('type_personne', $_GET['type_personne']);
$smarty->assign('id_personne', $_GET['id_personne']);
$personne = $personnes->obtenir($_GET['id_personne']);
$smarty->assign('personne', $personne);
// Cotisations
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Cotisations.php';
$cotisations = new AFUP_Cotisations($bdd);
if ($action == 'lister') {
    $smarty->assign('cotisations', $cotisations->obtenirListe($_GET['type_personne'], $_GET['id_personne']));
} elseif ($action == 'telecharger_facture') {
    $cotisations->genererFacture($_GET['id']);
} elseif ($action == 'envoyer_facture') {
    if ($cotisations->envoyerFacture($_GET['id'])) {
        AFUP_Logs::log('Envoi par email de la facture pour la cotisation n°' . $_GET['id']);
        afficherMessage('La facture a été envoyée', 'index.php?page=cotisations&action=lister&type_personne=' . $_GET['type_personne'] . '&id_personne=' . $_GET['id_personne']);
    } else {
        afficherMessage("La facture n'a pas pu être envoyée", 'index.php?page=cotisations&action=lister&type_personne=' . $_GET['type_personne'] . '&id_personne=' . $_GET['id_personne'], true);
    }
} elseif ($action == 'supprimer') {
    if ($cotisations->supprimer($_GET['id'])) {
        AFUP_Logs::log('Suppression de la cotisation ' . $_GET['id']);
        afficherMessage('La cotisation a été supprimée', 'index.php?page=cotisations&action=lister&type_personne=' . $_GET['type_personne'] . '&id_personne=' . $_GET['id_personne']);