IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

convertir le rapport en format html en format pdf


Sujet :

PHP & Base de données

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2011
    Messages
    18
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Rwanda

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Décembre 2011
    Messages : 18
    Points : 25
    Points
    25
    Par défaut convertir le rapport en format html en format pdf
    bonsoir,j'ai un petit problem et je voulais demander l'aide.

    au fait, j'avais un petit projet et dans lequel je dois generer un raport dans un tableau avec de donnees en provenance dans la base de donnees en fin doit mettre en dessus en bouton qui telecharge ce raport en format pdf et voila ce que j'arrive pas a faire. si quelqu'un peut m'aider et me montre comment je peut converting ce format html en format pdf en php. voice la page de donnee que je suis sense convertir.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" type="text/css" href="robe.css"/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>login</title>
     
     
    </head>
    <body style="margin:0px; background:#4CB849; font-family: Arial,Helvetica,sans-serif;">
        <div  align="center" style="background-color:#2A6428;  margin-left:0px; margin-right:0px; height:30px;"></div>
    	<div  align="center" style="background-color:#aae4a8;  margin-left:0px; margin-right:0px; height:5px; color:#556A7E;"></div>
        <div  align="center" style="background-color:#fafafa; width:80%;  margin:auto; padding-top:20px; margin-top:20px; min-height:400px; box-shadow:0px 0px 8px #000;">
    			<div class="login-block" style="margin-top:0px; width:100%;" >
     
    <?php
     
    				include('db.connect.php');
    				 ?>
     
     
     
     
    			<h4 style="margin-top:10px;">MANUAL EXCHANGE OPERATIONS: PURCHASES<BR>
    FOREX BUREAU NAME:  UBWIYUNGE FOREX BUREAU LTD <BR>
    DAY STARTED FROM:<?php print(Date("F d,Y")); ?>
    </h4>        
     
     
    <form method="POST" action="day.php">
    <input type="text" name="day"  placeholder="yyyy-mm-dd" size="30">
    <input type="submit"  name="submit" value="search">
    </form><br>
    <form method="POST" action="delete.php">
    <input type="text" name="del"  placeholder="delete by yyyy-mm-dd or id " size="30">
    <input type="submit"  name="delete" value="delete">
    </form><br>
     
     
    				<table align="center" style="border-collapse:collapse;  width:95%; border:1px solid #111111; font-size:12px; color:#333333;">
    					<tr>
    						<th align="left" color="#111111">Date</th>
    						<th  align="left" color="#111111">Receipt</th>                                                  
    						<th  align="left" color="#111111">Currency</th>                                                  
    						<th  align="left" color="#111111">Amount</th>                                                  
    						<th  align="left" color="#111111">Travel</th>                                                  
    						<th  align="left" color="#111111">Rate</th>                                                  
    						<th  align="left" color="#111111">Equivalent</th>                                                  
    						<th  align="left" color="#111111">Client Name</th>                                                  
    						<th  align="left" color="#111111">Nationality</th>                                                  
    						<!--<th  align="left" color="#3b5c1e"></th>  -->                                                
    					</tr>
    				<?php
    				//$totdollar = mysql_query('SELECT SUM(Amount) AS dol_sum FROM purchases where Currency="USD $" '); 
    				//$toteuro= mysql_query('SELECT SUM(Amount) AS euro_sum FROM purchases where Currency= "Euro €" '); 
    				$totUsDollar = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="USD $"');
    				$totCanadaDollar = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="Canadian $"');
    				$totEuro = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency=" Euro € "');
    				$totSwissFr = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="Swiss FR"');
    				$totgbp = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency=" GBP £ "');
    				$totuea = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="UAE Dirham"');
    				$totsa = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="South African RND"'); 
    				$totug = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency=" Ugandan UGX"');
    				$totbur = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="Burundian BFR"');
    				$totkenya = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="Kenyan KSH"');
    				$totTanz = mysql_query('SELECT SUM(Amount) AS Amount_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY ) AND Currency="Tanzanian TSH"');
    $row1 = mysql_fetch_assoc($totUsDollar); 
    $row2 = mysql_fetch_assoc($totCanadaDollar);
    $row3 = mysql_fetch_assoc($totEuro);
    $row4 = mysql_fetch_assoc($totSwissFr);
    $row5 = mysql_fetch_assoc($totgbp);
    $row6 = mysql_fetch_assoc($totuea);
    $row7 = mysql_fetch_assoc($totsa);
    $row8 = mysql_fetch_assoc($totug);
    $row9 = mysql_fetch_assoc($totbur );
    $row10 = mysql_fetch_assoc($totkenya );
    $row11 = mysql_fetch_assoc($totTanz);
     
     
    $sum1 = $row1['Amount_sum'];
    $sum2 = $row2['Amount_sum'];
    $sum3 = $row3['Amount_sum'];
    $sum4 = $row4['Amount_sum'];
    $sum5 = $row5['Amount_sum'];
    $sum6 = $row6['Amount_sum'];
    $sum7 = $row7['Amount_sum'];
    $sum8 = $row8['Amount_sum'];
    $sum9 = $row9['Amount_sum'];
    $sum10 = $row10['Amount_sum'];
    $sum11 = $row11['Amount_sum'];
     
     
     
    //$tot_equiv = mysql_query('SELECT SUM(Equivalent) AS Equiv_sum FROM purchases'); 
    $tot_equiv = mysql_query('SELECT SUM(Equivalent) AS Equiv_sum FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY)'); 
    $row = mysql_fetch_assoc($tot_equiv); 
    $sum_equiv = $row['Equiv_sum'];
     
     
    				//$result = mysql_query('SELECT * FROM purchases ORDER BY id DESC LIMIT 0, 20');
    				$result = mysql_query('SELECT * FROM purchases WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY) ORDER BY Date DESC');
    				while ($data = mysql_fetch_array($result))
    				{
    				?>
    					<tr>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Date']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Receipt']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Currency']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Amount']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Travel']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Rate']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Equivalent']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['ClientName']); ?></td>
    						<td style="border:1px solid #444444" valign="" width="11.1%"><?php echo stripslashes($data['Nationality']); ?></td>
    						<!--<td style="border:1px solid #444444" valign="" width="20%"><?php //echo '<a href="update_stud.php?modify_stud=' . $data['id'] . '">'; ?>Hindura</a>
    						</td>-->
    					</tr>
     
    				<?php
    				}?>
                    <tr>
    						<td  valign="" width="11.1%"></td>
    						<td  valign="" width="11.1%"></td>
    						<td  valign="" width="11.1%"></td>
    						<td  style="border:1px solid #444444;font-weight:bold; color:#000000;" valign="" width="11.1%"></td>
    						<td  valign="" width="11.1%"></td>
    						<td  valign="" width="11.1%"></td>
    						<td style="border:1px solid #444444; font-weight:bold; color:#000000;" valign="" width="11.1%"><?php echo $sum_equiv; ?></td>
    						<td  valign="" width="11.1%"></td>
    						<td style="" valign="" width="11.1%"></td>
    						<!--<td style="border:1px solid #444444" valign="" width="20%"><?php //echo '<a href="update_stud.php?modify_stud=' . $data['id'] . '">'; ?>Hindura</a>
    						</td>-->
    					</tr>
    					<?
    				?>
    	          </table>
     
     
    		    </div>
    		    <div align="left" style="margin-left:25px ">
    		      <h5>The total is in US$ is:<?php echo"\t".$sum1;?></h5>
    	            <h5>The total is in canadian $ is :<?php echo"\t".$sum2;?></h5>
    	             <h5>The total is in Euro is:<?php echo"\t".$sum3;?></h5>
    	              <h5>The total is in swiss fr is:<?php echo"\t".$sum4;?></h5>
    	               <h5>The total is in pound is :<?php echo"\t".$sum5;?></h5>
    	                <h5>The total is in uea land is :<?php echo"\t".$sum6;?></h5>
    	                 <h5>The total is in south africa land is:<?php echo"\t".$sum7;?></h5>
    	                  <h5>The total is in ugandan shiling is:<?php echo"\t".$sum8;?></h5>
    	                   <h5>The total is in burundian fr is:<?php echo"\t".$sum9;?></h5>
    	                    <h5>The total is in kenyan shiling is:<?php echo"\t".$sum10;?></h5>
    	                     <h5>The total is in tanzanian shiling is:<?php echo"\t".$sum11;?></h5>
    	                      <h5>The total is in Rwandan Francs:<?php echo"\t".$sum_equiv;?></h5>
    	                    </div>
    		<p style=" width:100%; position:absolute; margin-top:30px;">
    		<a href="buy.php" style="color:#279522;">Back</a>&nbsp;&nbsp;<a href="transaction_option.php" style="color:#279522;">Home</a></p>
    	</div>
     
     
     
    </body>
    </html>

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Il s'agirait de chercher un peu :
    http://html2pdf.fr/
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Membre à l'essai
    Homme Profil pro
    Project manager
    Inscrit en
    Juin 2013
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Project manager
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2013
    Messages : 11
    Points : 13
    Points
    13
    Par défaut
    Bonjour,

    ezpdf peut vous aider. C'est une classe php qui permet de gérer les fichiers pdf.

Discussions similaires

  1. Réponses: 3
    Dernier message: 11/04/2011, 15h17
  2. Problème d'affichage d'un rapport Oracle en format HTML.
    Par <M et M> dans le forum Entreprise Manager
    Réponses: 0
    Dernier message: 10/07/2008, 22h27
  3. Écrire un e-mail au format HTML
    Par Benoit30 dans le forum Composants VCL
    Réponses: 4
    Dernier message: 02/08/2005, 12h40
  4. [HTML]Email au format html
    Par willowII dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 12/03/2005, 21h17
  5. Envoi de mail au format html
    Par Mephyston dans le forum C++Builder
    Réponses: 2
    Dernier message: 22/01/2004, 12h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo