Exemplo n.º 1
0
function afficheRecap($bdd, $idco)
{
    /* Récupération des données personnelles du membre */
    list($memberID, $nom, $prenom, $titre, $status, $district, $club, $num, $adressesup, $rue, $ville, $cp, $tel, $mobile, $mail, $positionclub, $positiondistrict, $train, $traindate) = getInfos($bdd, $idco);
    /* Récupération du follower */
    list($fnom, $fprenom) = getFollower($bdd, $memberID);
    /* Récupération du nombre de personnes réservant l'activité */
    $n = 1;
    if (!(empty($fom) && empty($fprenom))) {
        $n = $n + 1;
    }
    /* Affichage des informations personnelles */
    echo '
        <div class="row section-head">
            
            <h2 style="color : #11ABB0;" > <FONT size="5"> Vos informations personnelles <FONT></h2>
            
        </div>
        
        <div>
             <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Civilité</u> : ' . $titre . '</h2> 
        </div>
        <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Nom</u> : ' . $nom . '</h2> 
        </div>
        <div>
             <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Prenom</u> : ' . $prenom . '</h2> 
        </div>
        
        <div class="row section-head">
            <h2 style="color : #8BB24C;" > <FONT size="5">Coordonnées <FONT></h2>
         </div>
         
        <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" >  <u>Adresse</u> : ' . $num . ' ' . $rue . ' (' . $adressesup . ') ' . $cp . ' ' . $ville . '</h2> 
        </div>
        <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" >  <u>Téléphone</u> : ' . $tel . '</h2> 
        </div>
        <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Mobile</u> : ' . $mobile . '</h2> 
        </div>
        <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Mail</u> : ' . $mail . '</h2> 
        </div>
        
        <div class="row section-head">
            <h2 style="color : #8BB24C;"> <FONT size="5">Position dans le Lions Clubs <FONT></h2>
         </div>';
    if ($status == 1) {
        echo '<div>
             <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Satut</u> : Lion </h2> 
        </div>';
    } else {
        echo '<div>
           <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" >  <u>Satut</u> : Leo </h2> 
        </div>';
    }
    echo '   <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>District</u> : ' . $district . '</h2> 
        </div>
        <div>
           <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Position au sein du district</u> : ' . $positiondistrict . '</h2> 
        </div>
        <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" >  <u>Club</u> : ' . $club . '</h2> 
        </div>
        <div>
            <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > <u>Position au sein du club</u> : ' . $positionclub . '</h2> 
        </div>
        
';
    if ($train == 1) {
        echo ' <div class="row section-head">
            <h2 style="color : #8BB24C;"><FONT size="5"> Arrivée <FONT></h2>
         </div>
   <div>
           <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > Par train le : ' . $traindate . '</h2> 
        </div>';
    } else {
        echo ' <div class="row section-head">
            <h2 style="color : #8BB24C;"><FONT size="5"> Arrivée<FONT> </h2>
         </div>
   <div>
             <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" >  Libre</h2> 
        </div>';
    }
    echo ' <div class="row section-head">
            <h2 style="color : #8BB24C;"> <FONT size="5">Accompagnant<FONT></h2>
         </div>
      <div>
          <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > ' . $fprenom . ' ' . $fnom . '</h2> 
        </div>';
    echo '
        <div class="row section-head">
            <br></br>
            <h2 style="color : #11ABB0;" > <FONT size="5"> Activités réservées <FONT></h2> 
        </div>
        
        <div class="row section-head">
            <h2 style="color : #8BB24C;"> <FONT size="5">Repas<FONT></h2>
         </div>';
    /*     * ****************************************** */
    /* Récupération des activités du panier */
    /*     * ********************************************** */
    /* Récupération du basketID et des totaux */
    $basketID = getBasketID($bdd, $memberID);
    list($totalmeal, $totaltrip, $total) = getTotal($bdd, $basketID);
    $total = $n * $total;
    $totaltrip = $n * $totaltrip;
    $totalmeal = $n * $totalmeal;
    /*     * ************************************************** */
    /* Récupération des repas du panier et affichage */
    /*     * **************************************************** */
    /* Récupération du nombre de repas réservés */
    $cpt = getNbRepasPanier($bdd, $basketID);
    if ($cpt != 0) {
        $sql = 'SELECT  Activity_Name, 	YEAR(Activity_Date), MONTH(Activity_Date), DAY(Activity_Date),  Activity_Hour, Belong_Price FROM Activity ' . ' INNER JOIN Activity_Type ON (Activity_Type.Activity_Type_ID = Activity.Activity_Type_ID) ' . ' INNER JOIN Belong ON (Belong.Activity_ID = Activity.Activity_ID) ' . ' WHERE (Basket_ID = :id AND Belong_Paid = 0 AND Belong_Payement_Way IS NULL AND Activity_Type_Name = "Repas" AND Congress_ID = ' . congressID . ') ORDER BY (Activity_Date)';
        $stmt = $bdd->prepare($sql, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
        $stmt->execute(array(':id' => "{$basketID}"));
        echo '
<div>
    <TABLE id="tableau" border  cols="4" style="border:1px solid black;width : 90%; margin-left : 0">             
         <TR class="row" >
                        <Td class ="col"  width=22% style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B"> Date </FONT></TH>
                        <td class ="col" width= 40% style="border:1px solid black; text-align : center;"> <FONT size="4" style="color : #52574B"> Intitulé </FONT></th>
                        <td class ="col" width= 10% style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Tarif </FONT></th>
                        <td class ="col" width=253.41 style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Nombre de personnes </FONT></th>
        </TR>';
        while ($row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
            $activite = $row["Activity_Name"];
            $annee = $row["YEAR(Activity_Date)"];
            $mois = $row["MONTH(Activity_Date)"];
            $jour = $row["DAY(Activity_Date)"];
            $heure = $row["Activity_Hour"];
            $prix = $row["Belong_Price"];
            if ($mois < 10) {
                $mois = "0" . $mois;
            }
            if ($jour < 10) {
                $jour = "0" . $jour;
            }
            $date = $jour . "-" . $mois . "-" . $annee . " à " . $heure;
            echo ' <TR class="row" >
           <Td class ="col"  width=22% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $date . '</FONT> </TH>
           <td class ="col" width=40% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $activite . '</FONT> </th>
           <td class ="col" width=10% style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $prix . ' € </FONT> </th>
          <td class ="col" width=253.41 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $n . '  </FONT> </th>
         </TR>';
        }
        echo '</TABLE>
             </div>';
    } else {
        echo '  <div>
           <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > Aucun repas réservé</h2> 
        </div>';
    }
    /*     * ****************************************************** */
    /* Récupération des excursions du panier et affichage */
    /*     * ******************************************************** */
    echo '

        <div class="row section-head">
        <br>
            <h2 style="color : #8BB24C;"> <FONT size="5"> Excursions<FONT></h2>
         </div>';
    /* Récupération du nombre d'excursions réservées */
    $cpt2 = getNbExcursionsPanier($bdd, $basketID);
    if ($cpt2 != 0) {
        $sql = 'SELECT  Activity_Name, YEAR(Activity_Date), MONTH(Activity_Date), DAY(Activity_Date), Activity_Hour, Belong_Price FROM Activity ' . ' INNER JOIN Activity_Type ON (Activity_Type.Activity_Type_ID = Activity.Activity_Type_ID) ' . ' INNER JOIN Belong ON (Belong.Activity_ID = Activity.Activity_ID) ' . ' WHERE (Basket_ID = :id AND Belong_Paid = 0 AND Belong_Payement_Way IS NULL AND Activity_Type_Name = "Excursion" AND Congress_ID = ' . congressID . ') ORDER BY (Activity_Date)';
        $stmt = $bdd->prepare($sql, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
        $stmt->execute(array(':id' => "{$basketID}"));
        echo '
<div>
    <TABLE id="tableau" border  cols="3" style="border:1px solid black;width : 90%; margin-left : 0">             
         <TR class="row" >
                          <Td class ="col"  width=22% style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B"> Date </FONT></TH>
                        <td class ="col" width= 40% style="border:1px solid black; text-align : center;"> <FONT size="4" style="color : #52574B"> Intitulé </FONT></th>
                        <td class ="col" width= 10% style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Tarif </FONT></th>
                        <td class ="col" width=253.41 style="border:1px solid black ; text-align : center;"><FONT size="4" style="color : #52574B"> Nombre de personnes </FONT></th>
        </TR>';
        while ($row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
            $activite = $row["Activity_Name"];
            $annee = $row["YEAR(Activity_Date)"];
            $mois = $row["MONTH(Activity_Date)"];
            $jour = $row["DAY(Activity_Date)"];
            $heure = $row["Activity_Hour"];
            $prix = $row["Belong_Price"];
            if ($mois < 10) {
                $mois = "0" . $mois;
            }
            if ($jour < 10) {
                $jour = "0" . $jour;
            }
            $date = $jour . "-" . $mois . "-" . $annee . " à " . $heure;
            echo ' <TR class="row" >
          <Td class ="col"  width=22% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $date . '</FONT> </TH>
           <td class ="col" width=40% style="border:1px solid black; text-align : center;"> <FONT size="3.5">' . $activite . '</FONT> </th>
           <td class ="col" width=10% style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $prix . ' € </FONT> </th>
          <td class ="col" width=253.41 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $n . '  </FONT> </th>
         </TR>';
        }
        echo '</TABLE>
             </div>';
    } else {
        echo '  <div>
           <tr style="" > <FONT size="3.5" style="font-weight:normal;color : #C6CCBB;" > Aucune excursion réservée</h2> 
        </div>';
    }
    /*     * ************************** */
    /* Affichage des totaux */
    /*     * ********************** */
    echo '

        <div class="row section-head">
            <br></br>
            <h2 style="color : #11ABB0;" > <FONT size="5"> Totaux <FONT></h2> 
        </div>

<div>
               <TABLE id="tableau" border width=50% cols="2" style="border:1px solid black;width : 40%; margin-left : 0" >

                    <TR class="row" >
                        <Td class ="col"  width=300 height = 35 style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B">  Total des repas </Td>
                        <td class ="col" width=101 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $totalmeal . ' € </FONT></Td>
                    </TR>
                    <TR class="row" >
                        <Td class ="col"  width=300 height = 35  style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B">  Total des excursions </Td>
                        <td class ="col" width=101 style="border:1px solid black; text-align : center;"><FONT size="3.5">' . $totaltrip . ' € </FONT></Td>
                    </TR>
                    <TR class="row" >
                        <Td class ="col"  width=300 height = 35  style="border:1px solid black;text-align : center;"><FONT size="4" style="color : #52574B">  Total </b> </Td>
                        <td class ="col" width=101 style="border:1px solid black; text-align : center;"><FONT size="3.5" style="color:#BA052C">' . $total . ' € </FONT></Td>
                    </TR>
                    </TABLE>
                        </div>
                        <br>';
    /*     * ******************************************* */
    /* BOUTONS */
    /*     * ******************************************** */
    if (!($cpt = 0 && ($cpt2 = 0))) {
        echo '
            
<div>
 <TABLE id="tableau" border width=50% cols="2" style="width : 100%; margin-left : 0" >

     <TR class="row" >
            <Td class ="col"  width=200 height = 35 style=" text-align : left;"><FONT size="4" style="color : #52574B">  
            <form name="validPanier" id="contactForm" method="post"  action="paiement.php">
                 <input type="submit" name="v" value="Valider et payer">
                 <input type="hidden"  name="idco" value="' . $idco . '">
           </form> 
            </Td>      
 
           <Td class ="col"  width=200 height = 35 style=" text-align : left;"><FONT size="4" style="color : #52574B">  
            <form name="imprim" id="contactForm" method="post"  action="recapPDF.php">
                 <input type="submit" name="i" value="Imprimer">
                 <input type="hidden"  name="idco" value="' . $idco . '">
           </form> 
            </Td> 
    </TR>
                    
    </TABLE>
    <br>
 </div>';
    }
}
Exemplo n.º 2
0
function bonDeCommande($bdd, $idco)
{
    /* Récupération des données personnelles du membre */
    list($memberID, $nom, $prenom, $titre, $status, $district, $club, $num, $adressesup, $rue, $ville, $cp, $tel, $mobile, $mail, $positionclub, $positiondistrict, $train, $traindate) = getInfos($bdd, $idco);
    /* Récupération du follower */
    list($fnom, $fprenom) = getFollower($bdd, $memberID);
    $accompagnant = "";
    $n = 1;
    /* nombre de personnes */
    if (!(empty($fnom) && empty($fprenom))) {
        $accompagnant = $fprenom . " " . $fnom;
        $n = $n + 1;
    } else {
        $accompagnant = "Aucun";
    }
    /* On récupère les activités commandées */
    /* Récupération du basketID  */
    $basketID = getBasketID($bdd, $memberID);
    /* Récupération des activités */
    /* On récupère la date du dernier panier */
    $belongdate = getDatePanier($bdd, $basketID);
    /* On récupère toutes les activités */
    $sql = 'SELECT  Activity.Activity_ID, Activity_Name, YEAR(Activity_Date), MONTH(Activity_Date), DAY(Activity_Date), Activity_Hour, Belong_Price FROM Activity ' . ' INNER JOIN Activity_Type ON (Activity_Type.Activity_Type_ID = Activity.Activity_Type_ID) ' . ' INNER JOIN Belong ON (Belong.Activity_ID = Activity.Activity_ID) ' . ' WHERE (Basket_ID = :id  AND Belong_Payement_Way ="CH" AND Congress_ID = ' . congressID . ' AND Belong_Date = :date ) ORDER BY ( Activity_Date)';
    $stmt = $bdd->prepare($sql, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
    $stmt->execute(array(':id' => "{$basketID}", ':date' => "{$belongdate}"));
    $numCommande = "";
    $activite = ' 
<div>
    <TABLE id="tableau" border  cols="3" style="border:1px solid black;width : 100%; margin-left : 0;border-collapse: collapse;">             
         <TR class="row" >
                        <Td class ="col" width=120 style="border:1px solid black; background-color : #C9D2D7;text-align : center;"><FONT size="5" > <b> Date </b></FONT></Td>
                        <td class ="col" width=260 style="border:1px solid black; background-color : #C9D2D7; text-align : center;"> <FONT size="5" > <b> Intitulé </b></FONT></td>
                        <td class ="col" width=100 style="border:1px solid black ; background-color : #C9D2D7; text-align : center;"><FONT size="5" > <b> Tarif </b> </FONT></td>
                        <td class ="col" width=160 style="border:1px solid black ; background-color : #C9D2D7; text-align : center;"><FONT size="5" > <b> Nombre de personnes </b> </FONT></td>
        </TR> ';
    $total = 0;
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
        $numCommande = $numCommande . "." . $row["Activity_ID"];
        $act = $row["Activity_Name"];
        $annee = $row["YEAR(Activity_Date)"];
        $mois = $row["MONTH(Activity_Date)"];
        $jour = $row["DAY(Activity_Date)"];
        $heure = $row["Activity_Hour"];
        $prix = $row["Belong_Price"];
        $total = $total + $prix;
        if ($mois < 10) {
            $mois = "0" . $mois;
        }
        if ($jour < 10) {
            $jour = "0" . $jour;
        }
        $date = $jour . "-" . $mois . "-" . $annee . " à " . $heure;
        $activite = $activite . '<TR class="row" >
           <Td class ="col"  width=120 style="border:1px solid black; text-align : center;"> <FONT size="3.5" style="color : #252E43">' . $date . '</FONT> </Td>
           <td class ="col" width=260 style="border:1px solid black; text-align : center;"> <FONT size="3.5" style="color : #252E43">' . $act . '</FONT> </td>
           <td class ="col" width=100 style="border:1px solid black; text-align : center;"><FONT size="3.5" style="color : #252E43">' . $prix . ' €</FONT> </td>
         <td class ="col" width=160 style="border:1px solid black; text-align : center;"><FONT size="3.5" style="color : #252E43">' . $n . ' </FONT> </td>
         </TR> ';
    }
    $total = $total * $n;
    $activite = $activite . ' </TABLE>
             </div>';
    list($a, $mo, $j, $h, $m, $s) = dateAuj($bdd);
    $dateauj = "{$j}" . "-" . "{$mo}" . "-" . "{$a}";
    $numCommande = $memberID . "-" . $numCommande;
    ob_start();
    ?>

    <page backtop="15mm" backbottom="15mm" backleft="10mm" backright="10mm">
        <div class="logo">
            <a href="" style="top : 4px"><img alt="" src="images/logo.png" style="height:  50px; width: 55px; top: 4px"></a>
        </div>
        <div class="col full">
            <h2 style="margin : 65px ; color : #252E43; text-align : center"> <FONT size="6"> Bon de commande n° <?php 
    echo "{$numCommande}";
    ?>
 - <?php 
    echo "{$dateauj}";
    ?>
 </FONT></h2>

        </div>

        <div class="row section-head">      
            <h2 style="color : #11ABB0;" > <FONT size="5">INFORMATIONS PERSONNELLES </FONT></h2>
        </div>

        <div>
            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" > <u>Civilité</u> : <?php 
    echo "{$titre}";
    ?>
</FONT> </div> 

            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" > <u>Nom</u> :  <?php 
    echo "{$nom}";
    ?>
 </FONT></div> 

            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" > <u>Prenom</u> : <?php 
    echo "{$prenom}";
    ?>
</FONT></div> 

        </div>


        <div>
            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" >  <u>Adresse</u> : <?php 
    echo "{$num} {$rue} ({$adressesup}) {$cp} {$ville}";
    ?>
</FONT> </div> 

            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" >  <u>Téléphone</u> : <?php 
    echo "{$tel}";
    ?>
</FONT> </div> 

            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" > <u>Mobile</u> : <?php 
    echo "{$mobile}";
    ?>
 </FONT></div> 

            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" > <u>Mail</u> : <?php 
    echo "{$mail}";
    ?>
</FONT></div> 
            <div style="" > <FONT size="3.5" style="font-weight:normal;color : #252E43;" > <u>Accompagnant</u> : <?php 
    echo "{$accompagnant}";
    ?>
</FONT></div> 
        </div>

        <div class="row section-head">
            <h2 style="color : #11ABB0;" > <FONT size="5">ACTIVITES RESERVEES</FONT></h2> 
        </div>

        <?php 
    echo "{$activite}";
    ?>

        <div class="row section-head">
            <h2 style="color : #11ABB0;" > <FONT size="5">TOTAL</FONT></h2> 
        </div>

        <div>
            <TABLE id="tableau" border width=50% cols="2" style="border:1px solid black;width : 40%; margin-left : 0; border-collapse: collapse;" >
                <TR class="row" >
                    <Td class ="col"  width=300 height = 35  style="border:1px solid black;text-align : center;background-color : #C9D2D7;"><FONT size="4" > <b> Total </b> </FONT></Td>
                    <Td class ="col" width=101 style="border:1px solid black; text-align : center;"><FONT size="3.5" style="color:#BA052C"><?php 
    echo "{$total}";
    ?>
 € </FONT></Td>
                </TR>
            </TABLE>
        </div>

        <page_footer backtop="5mm" backbottom="10mm" backleft="10mm" backright="10mm">
            <div  style="text-align:center"> <FONT size="3.5" style="font-weight:normal;color : #252E43; text-align:center" ><i>Page 1/1</i> </FONT></div>
        </page_footer>
    </page>


    <?php 
    $content = ob_get_clean();
    require 'html2pdf/html2pdf.class.php';
    try {
        $pdf = new HTML2PDF('P', 'A4', 'fr');
        $pdf->writeHTML($content);
        $pdf->Output('recapitulatif.pdf');
    } catch (HTML2PDF_exception $ex) {
        die($ex);
    }
}
Exemplo n.º 3
0
function nbPersonne($bdd, $memberID)
{
    list($fnom, $fprenom) = getFollower($bdd, $memberID);
    $n = 1;
    /* nombre de personnes */
    if (!(empty($fnom) && empty($fprenom))) {
        $n = $n + 1;
    }
    return $n;
}