Script format pdf
chinoutoure
Messages postés
62
Statut
Membre
-
francis -
francis -
Bonjour,
j'ai un script qui me permet d'afficher la page au format pdf mé le hic est que la page est vierge voici le script si quelqu'un pourrait bien m'aider
Merci
<?php
require('fpdf/fpdf.php');
//Create a new PDF file
$pdf=new FPDF();
$pdf->AddPage();
//require('subwrite.php');
//Connect to your database
require_once('link.php');
$num_extrait=$_GET['num_extrait'];
//Select the Products you want to show in your PDF file
$r=mysql_query("select * from 'etat_civil'.'extrait' where 'extrait'.'NUM_ACTE_NAISS'='$num_extrait'");
//Initialize the 3 columns and the total
//For each row, add the field to the corresponding column
while ($row=mysql_fetch_array($r,MYSQL_ASSOC))
{
$num_mention=$row["NUM_MENTION"];
$datenaiss=$row["DATE_NAISS"];
$date=date("j-n-Y");
$num_reg= $row["CODREG"];
$lieu= $row["LIEU_NAISS"];
$heurenais= $row["HEURE_NAISS"];
$minnaiss= $row["MINUTE_NAISS"];
$num_acte_naiss=$row["NUM_ACTE_NAISS"];
$prenom_conc=$row["PRENOM_CONC"];
$nom_conc=$row["NOM_CONC"];
$prenom_pere=$row["PRENOM_PERE_CONC"];
$prenom_mere=$row["PRENOM_MERE_CONC"];
$nom_mere=$row["NOM_MERE_CONC"];
$sexe=$row["SEXE_CONC"];
$l=mysql_query("select ANNEEREG from 'etat_civil'.'registre' where 'registre'.'CODREG'='$num_reg'");
while ($row1=mysql_fetch_array($l,MYSQL_ASSOC))
{
$annee=$row1["ANNEEREG"];
$m=mysql_query("select LIBELLE from 'etat_civil'.'mention' where 'mention'.'NUM_MENTION'='$num_mention'");
while ($row2=mysql_fetch_array($m,MYSQL_ASSOC))
{
$libelle=$row2["LIBELLE"];
//Fields Name position
$Y_Fields_Name_position = 20;
//Table position, under Fields Name
$Y_Table_Position = 26;
//First create each Field Name
//Gray color filling each Field Name box
$pdf->SetFillColor(232,232,232);
//Bold Font for Field Name
//Now show the 3 columns
$pdf->SetFont('Arial','',12);
$pdf->Write(5,"REGION DE DAKAR REPUBLIQUE DU SENEGAL\n");
$pdf->Write(5,"COMMUNE D'ARRONDISSEMENT DE HANN-BEL-AIR UN PEUPLE-UN BUT-UNE FOI\n");
$pdf->Write(5,"CENTRE HANN BEL-AIR\n");
$pdf->Write(5," ETAT - CIVIL\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"EXTRAIT DU REGISTRE DES ACTES DE NAISSANCES AN $annee\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Pour l annee : .....................................\n");
$pdf->Write(5,"N dans le registre : ........................... $num_reg\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Le : ...............................................................................................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"a $heurenais heures $minnaiss Minutes est ne(e)e a $lieu\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Un enfant de sexe $sexe \n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"$prenom_conc $nom_conc\n");
$pdf->Write(5,"$prenom_pere\n");
$pdf->Write(5,"$prenom_mere $nom_mere\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"Delivre par le ...................................................... AN.........\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Le ..................................................................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Sous le numero .......................................................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Inscrit le ........ sous le registre des actes de naissance de l' annee ............\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Mentions marginales $libelle\n");
$pdf->Write(5,"..............................................................Pour Extrait certifie conforme\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"EXTRAIT DELIVRE PAR DAKAR,le $date\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"LE CENTRE DE HANN BEL-AIR l officier de l etat-civil delegue\n");
$pdf->Write(5,"\n");
$pdf->Write(5," Prenom et Nom ........................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
//Create lines (boxes) for each ROW (Product)
//If you don't use the following code, you don't create the lines separating each row
}}
$pdf->Output();}
?>
j'ai un script qui me permet d'afficher la page au format pdf mé le hic est que la page est vierge voici le script si quelqu'un pourrait bien m'aider
Merci
<?php
require('fpdf/fpdf.php');
//Create a new PDF file
$pdf=new FPDF();
$pdf->AddPage();
//require('subwrite.php');
//Connect to your database
require_once('link.php');
$num_extrait=$_GET['num_extrait'];
//Select the Products you want to show in your PDF file
$r=mysql_query("select * from 'etat_civil'.'extrait' where 'extrait'.'NUM_ACTE_NAISS'='$num_extrait'");
//Initialize the 3 columns and the total
//For each row, add the field to the corresponding column
while ($row=mysql_fetch_array($r,MYSQL_ASSOC))
{
$num_mention=$row["NUM_MENTION"];
$datenaiss=$row["DATE_NAISS"];
$date=date("j-n-Y");
$num_reg= $row["CODREG"];
$lieu= $row["LIEU_NAISS"];
$heurenais= $row["HEURE_NAISS"];
$minnaiss= $row["MINUTE_NAISS"];
$num_acte_naiss=$row["NUM_ACTE_NAISS"];
$prenom_conc=$row["PRENOM_CONC"];
$nom_conc=$row["NOM_CONC"];
$prenom_pere=$row["PRENOM_PERE_CONC"];
$prenom_mere=$row["PRENOM_MERE_CONC"];
$nom_mere=$row["NOM_MERE_CONC"];
$sexe=$row["SEXE_CONC"];
$l=mysql_query("select ANNEEREG from 'etat_civil'.'registre' where 'registre'.'CODREG'='$num_reg'");
while ($row1=mysql_fetch_array($l,MYSQL_ASSOC))
{
$annee=$row1["ANNEEREG"];
$m=mysql_query("select LIBELLE from 'etat_civil'.'mention' where 'mention'.'NUM_MENTION'='$num_mention'");
while ($row2=mysql_fetch_array($m,MYSQL_ASSOC))
{
$libelle=$row2["LIBELLE"];
//Fields Name position
$Y_Fields_Name_position = 20;
//Table position, under Fields Name
$Y_Table_Position = 26;
//First create each Field Name
//Gray color filling each Field Name box
$pdf->SetFillColor(232,232,232);
//Bold Font for Field Name
//Now show the 3 columns
$pdf->SetFont('Arial','',12);
$pdf->Write(5,"REGION DE DAKAR REPUBLIQUE DU SENEGAL\n");
$pdf->Write(5,"COMMUNE D'ARRONDISSEMENT DE HANN-BEL-AIR UN PEUPLE-UN BUT-UNE FOI\n");
$pdf->Write(5,"CENTRE HANN BEL-AIR\n");
$pdf->Write(5," ETAT - CIVIL\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"EXTRAIT DU REGISTRE DES ACTES DE NAISSANCES AN $annee\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Pour l annee : .....................................\n");
$pdf->Write(5,"N dans le registre : ........................... $num_reg\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Le : ...............................................................................................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"a $heurenais heures $minnaiss Minutes est ne(e)e a $lieu\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Un enfant de sexe $sexe \n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"$prenom_conc $nom_conc\n");
$pdf->Write(5,"$prenom_pere\n");
$pdf->Write(5,"$prenom_mere $nom_mere\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"Delivre par le ...................................................... AN.........\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Le ..................................................................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Sous le numero .......................................................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Inscrit le ........ sous le registre des actes de naissance de l' annee ............\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"Mentions marginales $libelle\n");
$pdf->Write(5,"..............................................................Pour Extrait certifie conforme\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"EXTRAIT DELIVRE PAR DAKAR,le $date\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"LE CENTRE DE HANN BEL-AIR l officier de l etat-civil delegue\n");
$pdf->Write(5,"\n");
$pdf->Write(5," Prenom et Nom ........................\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"\n");
$pdf->Write(5,"-----------------------------------------------------------------------------------------------------------------------------\n");
//Create lines (boxes) for each ROW (Product)
//If you don't use the following code, you don't create the lines separating each row
}}
$pdf->Output();}
?>
A voir également:
- Script format pdf
- Lire le coran en français pdf - Télécharger - Histoire & Religion
- Format epub - Guide
- Format factory - Télécharger - Conversion & Codecs
- Hp usb disk storage format tool - Télécharger - Stockage
- Format apfs - Guide