Example #1
0
<?php

require_once dirname(__FILE__) . '/../../../sources/Afup/Bootstrap/Http.php';
require_once 'Afup/AFUP_Pays.php';
$pays = new AFUP_Pays($bdd);
require_once 'Afup/AFUP_Inscriptions_Forum.php';
$inscriptions = new AFUP_Inscriptions_Forum($bdd);
// S'il ne reste plus de place, on ne permet pas l'inscription
$nombre_places = 200;
// TODO : Mettre cela dans le fichier de configuration
/*$nombre_inscrits = $inscriptions->obtenirNombreInscrits();
if ($nombre_inscrits >= $nombre_places) {
    $smarty->display('inscriptions_completes.html');
    die();
}*/
// On créé le formulaire
$formulaire =& instancierFormulaire();
$formulaire->setDefaults(array('civilite' => 'M.', 'id_pays_facturation' => 'FR', 'type_inscription' => -1, 'type_reglement' => -1));
$formulaire->addElement('header', null, 'Informations');
$groupe = array();
$groupe[] =& HTML_QuickForm::createElement('radio', 'type_inscription', null, 'Journée fonctionnelle, mercredi 09 novembre 2005 : <strong>100,00 ' . EURO . '</strong>', AFUP_FORUM_PREMIERE_JOURNEE);
$groupe[] =& HTML_QuickForm::createElement('radio', 'type_inscription', null, 'Journée technique, jeudi 10 novembre 2005 : <strong>100,00 ' . EURO . '</strong>', AFUP_FORUM_DEUXIEME_JOURNEE);
$groupe[] =& HTML_QuickForm::createElement('radio', 'type_inscription', null, 'Deux jours : <strong>150,00 ' . EURO . '</strong>', AFUP_FORUM_2_JOURNEES);
$groupe[] =& HTML_QuickForm::createElement('radio', 'type_inscription', null, 'Deux jours (membre AFUP) : <strong>100,00 ' . EURO . '</strong>', AFUP_FORUM_2_JOURNEES_AFUP);
$groupe[] =& HTML_QuickForm::createElement('radio', 'type_inscription', null, 'Deux jours (étudiant) : <strong>100,00 ' . EURO . '</strong>', AFUP_FORUM_2_JOURNEES_ETUDIANT);
$formulaire->addGroup($groupe, 'groupe_type_inscription', 'Formule', '<br />', false);
$groupe = array();
$groupe[] =& HTML_QuickForm::createElement('radio', 'type_reglement', null, 'Carte bancaire', AFUP_FORUM_REGLEMENT_CARTE_BANCAIRE);
$groupe[] =& HTML_QuickForm::createElement('radio', 'type_reglement', null, 'Chèque', AFUP_FORUM_REGLEMENT_CHEQUE);
$formulaire->addGroup($groupe, 'groupe_type_reglement', 'Règlement', '&nbsp;', false);
$formulaire->addElement('select', 'civilite', 'Civilité', array('M.' => 'M.', 'Mme' => 'Mme', 'Mlle' => 'Mlle'));
Example #2
0
<?php

// Impossible to access the file itself
if (!defined('PAGE_LOADED_USING_INDEX')) {
    trigger_error("Direct access forbidden.", E_USER_ERROR);
    exit;
}
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);
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Utils.php';
require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Tags.php';
$tags = new AFUP_Tags($bdd);
$membre = $personnes_physiques->obtenir($droits->obtenirIdentifiant());
unset($membre['mot_de_passe']);
// Obtention du gravatar
$membre["gravatar"] = AFUP_Utils::get_gravatar($membre["email"]);
$membre["tags"] = $tags->obtenirTagsSurPersonnePhysique($membre["id"]);
//var_dump($membre);die;
$smarty->assign('membre', $membre);
$smarty->assign('pays', $pays->obtenirPays());
Example #3
0
    if ($annuairepro_membres->supprimer($_GET['id'])) {
        AFUP_Logs::log('Suppression du membre de l\'annuaire pro ' . $_GET['id']);
        afficherMessage('Le membre de l\'annuaire pro a été supprimé', 'index.php?page=annuairepro_membres&action=lister');
    } else {
        afficherMessage('Une erreur est survenue lors de la suppression du membre de l\'annuaire pro', 'index.php?page=annuairepro_membres&action=lister', true);
    }
} elseif ($action == 'nettoyer') {
    if ($annuairepro_membres->nettoyer()) {
        AFUP_Logs::log('Suppression des membres spammeurs de l\'annuaire pro');
        afficherMessage('Les membres spammeurs de l\'annuaire pro ont été supprimé', 'index.php?page=annuairepro_membres&action=lister');
    } else {
        afficherMessage('Une erreur est survenue lors de la suppression des membres spammeurs de l\'annuaire pro', 'index.php?page=annuairepro_membres&action=lister', true);
    }
} else {
    require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Pays.php';
    $pays = new AFUP_Pays($bdd);
    $formulaire =& instancierFormulaire();
    if ($action == 'ajouter') {
        $formulaire->setDefaults(array('id_pays' => 'FR', 'SIREN-Test' => 'KO', 'etat' => AFUP_DROITS_ETAT_ACTIF));
        $champs['SiteWeb'] = '';
        $champs['SIREN-Test'] = 'KO';
    } else {
        $champs = $annuairepro_membres->obtenir($_GET['id']);
        $champs['SIREN-Test'] = $annuairepro_membres->VerifierSIREN($champs['SIREN']);
        $formulaire->setDefaults($champs);
    }
    $formulaire->addElement('header', '', 'Informations');
    $formulaire->addElement('text', 'RaisonSociale', 'Raison sociale', array('size' => 30, 'maxlength' => 40));
    $formulaire->addElement('select', 'FormeJuridique', 'Forme juridique', $annuairepro_membres->obtenirFormesJuridiques());
    $formulaire->addElement('text', 'SIREN', 'SIREN', array('size' => 30, 'maxlength' => 40));
    $formulaire->addElement('text', 'SIREN-Test', '', array('size' => 3, 'disabled' => 'disabled', 'class' => $champs['SIREN-Test']));
Example #4
0
 /**
  * Génère une facture au format PDF
  *
  * @param string    $reference      Reference de la facture
  * @param string    $chemin         Chemin du fichier PDF à générer. Si ce chemin est omi, le PDF est renvoyé au navigateur.
  * @access public
  * @return bool
  */
 function genererFacture($reference, $chemin = null)
 {
     $requete = 'SELECT * FROM afup_facturation_forum WHERE reference=' . $this->_bdd->echapper($reference);
     $facture = $this->_bdd->obtenirEnregistrement($requete);
     $requete = 'SELECT * FROM afup_inscription_forum WHERE reference=' . $this->_bdd->echapper($reference);
     $inscriptions = $this->_bdd->obtenirTous($requete);
     require_once 'AFUP_Configuration.php';
     $configuration = $GLOBALS['AFUP_CONF'];
     require_once 'AFUP_Pays.php';
     $pays = new AFUP_Pays($this->_bdd);
     // Construction du PDF
     require_once 'AFUP_PDF_Facture.php';
     $pdf = new AFUP_PDF_Facture($configuration);
     $pdf->AddPage();
     $pdf->Cell(130, 5);
     $pdf->Cell(60, 5, 'Le ' . date('d/m/Y', isset($facture['date_facture']) && !empty($facture['date_facture']) ? $facture['date_facture'] : time()));
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Ln();
     if (empty($facture['societe'])) {
         $facture['societe'] = $facture['nom'] . " " . $facture['prenom'];
     }
     // A l'attention du client [adresse]
     $pdf->SetFont('Arial', 'BU', 10);
     $pdf->Cell(130, 5, utf8_decode('Objet : Facture n°' . $reference));
     $pdf->SetFont('Arial', '', 10);
     $pdf->Ln(10);
     $pdf->MultiCell(130, 5, utf8_decode($facture['societe']) . "\n" . utf8_decode($facture['adresse']) . "\n" . utf8_decode($facture['code_postal']) . "\n" . utf8_decode($facture['ville']) . "\n" . utf8_decode($pays->obtenirNom($facture['id_pays'])));
     $pdf->Ln(15);
     $pdf->MultiCell(180, 5, utf8_decode("Facture concernant votre participation au forum organisé par l'Association Française des Utilisateurs de PHP (AFUP)."));
     if ($facture['informations_reglement']) {
         $pdf->Ln(10);
         $pdf->Cell(32, 5, utf8_decode('Référence client : '));
         $infos = explode("\n", $facture['informations_reglement']);
         foreach ($infos as $info) {
             $pdf->Cell(100, 5, utf8_decode($info));
             $pdf->Ln();
             $pdf->Cell(32, 5);
         }
     }
     // Cadre
     $pdf->Ln(10);
     $pdf->SetFillColor(200, 200, 200);
     $pdf->Cell(50, 5, 'Type', 1, 0, 'L', 1);
     $pdf->Cell(100, 5, 'Personne inscrite', 1, 0, 'L', 1);
     $pdf->Cell(40, 5, 'Prix', 1, 0, 'L', 1);
     $total = 0;
     foreach ($inscriptions as $inscription) {
         $pdf->Ln();
         $pdf->SetFillColor(255, 255, 255);
         switch ($inscription['type_inscription']) {
             case AFUP_FORUM_PREMIERE_JOURNEE:
                 $code = 'FONC';
                 break;
             case AFUP_FORUM_DEUXIEME_JOURNEE:
                 $code = 'TECH';
                 break;
             case AFUP_FORUM_2_JOURNEES:
                 $code = '2JOU';
                 break;
             case AFUP_FORUM_2_JOURNEES_AFUP:
                 $code = 'AFUP';
                 break;
             case AFUP_FORUM_2_JOURNEES_ETUDIANT:
                 $code = 'ETUD';
                 break;
             case AFUP_FORUM_2_JOURNEES_PREVENTE:
                 $code = 'PREV';
                 break;
             case AFUP_FORUM_2_JOURNEES_AFUP_PREVENTE:
                 $code = 'AFUP-PRE';
                 break;
             case AFUP_FORUM_2_JOURNEES_ETUDIANT_PREVENTE:
                 $code = 'ETUD-PRE';
                 break;
             case AFUP_FORUM_2_JOURNEES_COUPON:
                 $code = 'COUPON';
                 break;
             case AFUP_FORUM_ORGANISATION:
                 $code = 'ORGANISATION';
                 break;
             case AFUP_FORUM_SPONSOR:
                 $code = 'SPONSOR';
                 break;
             case AFUP_FORUM_PRESSE:
                 $code = 'PRESSE';
                 break;
             case AFUP_FORUM_CONFERENCIER:
                 $code = 'CONFERENCIER';
                 break;
             case AFUP_FORUM_INVITATION:
                 $code = 'INVITATION';
                 break;
             case AFUP_FORUM_PROJET:
                 $code = 'PROJET';
                 break;
             case AFUP_FORUM_2_JOURNEES_SPONSOR:
                 $code = '2_JOURNEES_SPONSOR';
                 break;
             case AFUP_FORUM_PROF:
                 $code = 'PROF';
                 break;
             case AFUP_FORUM_PREMIERE_JOURNEE_ETUDIANT_PREVENTE:
                 $code = 'PREMIERE_JOURNEE_ETUDIANT_PREVENTE';
                 break;
             case AFUP_FORUM_DEUXIEME_JOURNEE_ETUDIANT_PREVENTE:
                 $code = 'DEUXIEME_JOURNEE_ETUDIANT_PREVENTE';
                 break;
             case AFUP_FORUM_2_JOURNEES_PREVENTE_ADHESION:
                 $code = '2_JOURNEES_PREVENTE_ADHESION';
                 break;
             case AFUP_FORUM_PREMIERE_JOURNEE_AFUP:
                 $code = 'PREMIERE_JOURNEE_AFUP';
                 break;
             case AFUP_FORUM_DEUXIEME_JOURNEE_AFUP:
                 $code = 'DEUXIEME_JOURNEE_AFUP';
                 break;
             case AFUP_FORUM_PREMIERE_JOURNEE_ETUDIANT:
                 $code = 'PREMIERE_JOURNEE_ETUDIANT';
                 break;
             case AFUP_FORUM_DEUXIEME_JOURNEE_ETUDIANT:
                 $code = 'DEUXIEME_JOURNEE_ETUDIANT';
                 break;
             default:
                 $code = 'XXX';
         }
         $pdf->Cell(50, 5, $code, 1);
         $pdf->Cell(100, 5, utf8_decode($inscription['prenom']) . ' ' . utf8_decode($inscription['nom']), 1);
         $pdf->Cell(40, 5, utf8_decode($inscription['montant']) . utf8_decode(' €'), 1);
         $total += $inscription['montant'];
     }
     if ($facture['type_reglement'] == 1) {
         // Paiement par chèque
         $pdf->Ln();
         $pdf->Cell(50, 5, 'FRAIS', 1);
         $pdf->Cell(100, 5, utf8_decode('Paiement par chèque'), 1);
         $pdf->Cell(40, 5, '25' . utf8_decode(' €'), 1);
         $total += 25;
     }
     $pdf->Ln();
     $pdf->SetFillColor(225, 225, 225);
     $pdf->Cell(150, 5, 'TOTAL', 1, 0, 'L', 1);
     $pdf->Cell(40, 5, $total . utf8_decode(' €'), 1, 0, 'L', 1);
     $pdf->Ln(15);
     if ($facture['etat'] == 4) {
         switch ($facture['type_reglement']) {
             case 0:
                 $type = 'par CB';
                 break;
             case 1:
                 $type = 'par chèque';
                 break;
             case 2:
                 $type = 'par virement';
                 break;
         }
         $pdf->SetTextColor(255, 0, 0);
         $pdf->Cell(130, 5);
         $pdf->Cell(60, 5, utf8_decode('Payé ' . $type . ' le ' . date('d/m/Y', $facture['date_reglement'])));
         $pdf->SetTextColor(0, 0, 0);
     }
     $pdf->Ln();
     $pdf->Cell(10, 5, 'TVA non applicable - art. 293B du CGI');
     if (is_null($chemin)) {
         $pdf->Output('Facture - ' . ($facture['societe'] ? $facture['societe'] : $facture['nom'] . '_' . $facture['prenom']) . ' - ' . date('Y-m-d_H-i', $facture['date_facture']) . '.pdf', 'D');
     } else {
         $pdf->Output($chemin, 'F');
     }
     return $reference;
 }
Example #5
0
<?php

/*if (isset($_GET['nolayout']) === false) {
    header('HTTP/1.0 301 Moved Permanently');
    header('Location:http://event.afup.org/php-tour-2016/tickets-inscriptions/');
}*/
require_once __DIR__ . '/../../include/prepend.inc.php';
require_once __DIR__ . '/_config.inc.php';
require_once __DIR__ . '/../../../sources/Afup/AFUP_Pays.php';
require_once __DIR__ . '/../../../sources/Afup/AFUP_Forum.php';
require_once __DIR__ . '/../../../sources/Afup/AFUP_Inscriptions_Forum.php';
require_once __DIR__ . '/../../../sources/Afup/AFUP_Facturation_Forum.php';
$pays = new AFUP_Pays($bdd);
$forum = new AFUP_Forum($bdd);
$id_forum = $config_forum['id'];
$forum_inscriptions = new AFUP_Inscriptions_Forum($bdd);
$forum_facturation = new AFUP_Facturation_Forum($bdd);
$nombre_places = $forum->obtenirNombrePlaces($id_forum);
$nombre_inscrits = $forum_inscriptions->obtenirNombreInscrits($id_forum);
$is_prevente = time() < $config_forum['date_fin_prevente'];
if (!isset($_GET['passage_en_force'])) {
    if (time() > $config_forum['date_fin_vente']) {
        $smarty->display('inscriptions_fermes.html');
        die;
    }
    if ($nombre_inscrits >= $nombre_places) {
        $smarty->display('inscriptions_fermes.html');
        die;
    }
}
//nombre possible d'inscrptions sur une même commande
Example #6
0
 function genererFacture($reference, $chemin = null)
 {
     $requete = 'SELECT * FROM afup_compta_facture WHERE numero_facture=' . $this->_bdd->echapper($reference);
     $coordonnees = $this->_bdd->obtenirEnregistrement($requete);
     $requete = 'SELECT * FROM afup_compta_facture_details WHERE idafup_compta_facture=' . $this->_bdd->echapper($coordonnees['id']);
     $details = $this->_bdd->obtenirTous($requete);
     require_once 'Afup/AFUP_Configuration.php';
     $configuration = $GLOBALS['AFUP_CONF'];
     require_once 'Afup/AFUP_Pays.php';
     $pays = new AFUP_Pays($this->_bdd);
     // Construction du PDF
     require_once 'Afup/AFUP_PDF_Facture.php';
     $pdf = new AFUP_PDF_Facture($configuration);
     $pdf->AddPage();
     $pdf->Cell(130, 5);
     $pdf->Cell(60, 5, 'Le ' . date('d/m/Y', isset($coordonnees['date_facture']) && !empty($coordonnees['date_facture']) ? strtotime($coordonnees['date_facture']) : time()));
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Ln();
     // A l'attention du client [adresse]
     $pdf->SetFont('Arial', '', 10);
     $pdf->Ln(10);
     $pdf->setx(120);
     $pdf->MultiCell(130, 5, utf8_decode($coordonnees['societe']) . "\n" . utf8_decode($coordonnees['service']) . "\n" . utf8_decode($coordonnees['adresse']) . "\n" . utf8_decode($coordonnees['code_postal']) . "\n" . utf8_decode($coordonnees['ville']) . "\n" . utf8_decode($pays->obtenirNom($coordonnees['id_pays'])));
     $pdf->Ln(10);
     $pdf->SetFont('Arial', 'BU', 10);
     $pdf->Cell(0, 5, utf8_decode('Facture n° ' . $reference), 0, 0, "C");
     $pdf->SetFont('Arial', '', 10);
     if ($coordonnees['ref_clt1'] || $coordonnees['ref_clt2'] || $coordonnees['ref_clt3']) {
         $pdf->Ln(15);
         $pdf->Cell(40, 5, utf8_decode('Repère(s) : '));
     }
     if ($coordonnees['ref_clt1']) {
         $pdf->setx(30);
         $pdf->Cell(100, 5, utf8_decode($coordonnees['ref_clt1']));
         $pdf->Ln(5);
     }
     if ($coordonnees['ref_clt2']) {
         $pdf->setx(30);
         $pdf->Cell(100, 5, utf8_decode($coordonnees['ref_clt2']));
         $pdf->Ln(5);
     }
     if ($coordonnees['ref_clt3']) {
         $pdf->setx(30);
         $pdf->Cell(100, 5, utf8_decode($coordonnees['ref_clt3']));
         $pdf->Ln(5);
     }
     $pdf->Ln(10);
     $pdf->MultiCell(180, 5, utf8_decode("Comme convenu, nous vous prions de trouver votre facture"));
     // Cadre
     $pdf->Ln(5);
     $pdf->SetFillColor(200, 200, 200);
     $pdf->Cell(30, 5, 'Type', 1, 0, 'L', 1);
     $pdf->Cell(80, 5, 'Description', 1, 0, 'L', 1);
     $pdf->Cell(20, 5, 'Quantite', 1, 0, 'L', 1);
     $pdf->Cell(30, 5, 'Prix', 1, 0, 'L', 1);
     $pdf->Cell(30, 5, 'Total', 1, 0, 'L', 1);
     $total = 0;
     switch ($coordonnees['devise_facture']) {
         case 'DOL':
             $devise = ' $';
             break;
         case 'EUR':
         default:
             $devise = utf8_decode(' €');
             break;
     }
     $yInitial = $pdf->getY();
     $columns = [0, 30, 110, 130, 160, 190];
     foreach ($details as $detail) {
         if ($detail['quantite'] != 0) {
             $montant = $detail['quantite'] * $detail['pu'];
             $pdf->Ln();
             $pdf->SetFillColor(255, 255, 255);
             $y = $pdf->GetY();
             $x = $pdf->GetX();
             $pdf->MultiCell(30, 5, $detail['ref'], 'T');
             $x += 30;
             $pdf->SetXY($x, $y);
             $pdf->MultiCell(80, 5, utf8_decode($detail['designation']), 'T');
             $x += 80;
             $pdf->SetXY($x, $y);
             $pdf->MultiCell(20, 5, utf8_decode($detail['quantite']), 'T', 0, "C");
             $x += 20;
             $pdf->SetXY($x, $y);
             $pdf->MultiCell(30, 5, utf8_decode($detail['pu']) . $devise, 'T', 0, "R");
             $x += 30;
             $pdf->SetXY($x, $y);
             $pdf->MultiCell(30, 5, utf8_decode($montant) . $devise, 'T', 0, "R");
             $total += $montant;
         }
     }
     $pdf->Ln();
     foreach ($columns as $column) {
         $pdf->Line($pdf->GetX() + $column, $yInitial, $pdf->GetX() + $column, $pdf->GetY());
     }
     $pdf->SetFillColor(225, 225, 225);
     $pdf->Cell(160, 5, 'TOTAL', 1, 0, 'L', 1);
     $pdf->Cell(30, 5, $total . $devise, 1, 0, 'R', 1);
     $pdf->Ln(15);
     $pdf->Cell(10, 5, 'TVA non applicable - art. 293B du CGI');
     $pdf->Ln(10);
     if ($coordonnees['observation']) {
         $pdf->Cell(10, 5, 'Observations : ');
         $pdf->Ln(5);
         $pdf->SetFont('Arial', '', 8);
         $pdf->MultiCell(130, 5, utf8_decode($coordonnees['observation']));
     }
     if (is_null($chemin)) {
         $pdf->Output('Facture - ' . $coordonnees['societe'] . ' - ' . $coordonnees['date_facture'] . '.pdf', 'D');
     } else {
         $pdf->Output($chemin, 'F');
     }
 }