/** * Supprime une personne physique * * @param int $id Identifiant de la personne physique * @access public * @return bool Succès de la suppresion */ function supprimer($id) { require_once 'Afup/AFUP_Cotisations.php'; $cotisation = new AFUP_Cotisations($this->_bdd); $cotisation_personne_physisque = $cotisation->obtenirListe(AFUP_PERSONNES_PHYSIQUES, $id, 'id'); if (sizeof($cotisation_personne_physisque) == 0) { $requete = 'DELETE FROM afup_personnes_physiques WHERE id=' . $id; return $this->_bdd->executer($requete); } return false; }
/** * 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; }
$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é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());
$paybox->set_annule('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/paybox_annule.php'); // URL en cas de disfonctionnement de PayBox $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é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)); $cotisation_physique = $cotisations->obtenirListe(0, $donnees['id']); $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());
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']); } else { afficherMessage('Une erreur est survenue lors de la suppression de la personne morale', 'index.php?page=personnes_morales&action=lister', true);