Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- فورم البحث
- <html dir="rtl">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <head><title></title></head>
- <body>
- <form name="form1" method="post" action="new 1.php"><p align="center">
- <table border="3">
- <tr><td>
- <tr><td>رقم البكالوريا </td></tr>
- <tr><td>
- <strong>
- <input type="text"name="Mat_Bac" style="width: 173px" autocomplete="off"></strong></td></tr>
- </td></tr></table>
- <input type="submit"name="عرض" value="عرض"style="width:110px">
- <input type="reset"name="مسح" value="مسح"style="width:110px"><br>
- </form></p>
- </body>
- </html>
- 2)
- <?
- // la classe de fonctions
- require('fpdf17/fpdf.php');
- // connexion base de données
- $db_server = "localhost";
- $db_user = "root";
- $db_pass = "root";
- $db_name = "dou";
- function connect($db_server, $db_user, $db_pass, $db) {
- if (!($link=mysql_connect($db_server,$db_user,$db_pass))) {
- exit();
- }
- if (!(mysql_select_db($db,$link))) {
- exit();
- }
- return $link;
- }
- $connexion=connect($db_server,$db_user,$db_pass,$db_name);
- mysql_query("SET NAMES 'utf8'");
- // classe étendue pour créer en-tête et pied de page
- class PDF extends FPDF
- {
- // en-tête
- function Header()
- {
- //Police Arial gras 15
- $this->SetFont('Arial','B',14);
- //Décalage à droite
- $this->Cell(80);
- //Titre
- $this->Cell(30,10,'Mon joli fichier PDF',0,0,'C'); //æÖÚ ãÑÈÚ Úáì ÇáÚäæÇä
- $this->Ln();
- $this->Cell(80);
- $this->Cell(30,10,'aissa brahimi',0,0,'C'); //æÖÚ ãÑÈÚ Úáì ÇáÚäæÇä
- //Saut de ligne
- $this->Ln(20);
- }
- // pied de page
- function Footer()
- {
- //Positionnement à 1,5 cm du bas
- $this->SetY(-15);
- //Police Arial italique 8
- $this->SetFont('Arial','I',8);
- $this->Cell(80);
- $this->Cell(30,0,'DOUOUARGLA.DZ',0,0,'C'); //æÖÚ ãÑÈÚ Úáì ÇáÚäæÇä
- $this->Ln();
- //Numéro de page
- $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
- }
- }
- // création du pdf
- $pdf=new PDF('P','mm','A4', 'UTF-8', true);
- $pdf->SetAuthor('Un grand écrivain');
- $pdf->SetTitle('Raport');
- $pdf->SetSubject('Un exemple de création de fichier PDF');
- $pdf->SetCreator('fpdf_cybermonde_org');
- $pdf->AliasNBPages();
- $pdf->AddPage();
- $pdf->Image('dev.png',10,10,25);
- $pdf->Ln();
- $pdf->Ln();
- // requête
- $id=$_POST['Mat_Bac'];
- $sql = mysql_query("SELECT * FROM feuille_de_couchage where Mat_Bac='$id'");
- // on boucle
- while ($row = mysql_fetch_array($sql)) {
- $id = $row["Mat_Bac"];
- $titre = $row["prenom"];
- $description = $row["Name"];
- // titre en gras
- $pdf->SetFont('Arial','B',10);
- $pdf->Write(5,'prenom:');
- $pdf->Write(5,$titre);
- $pdf->Ln();
- $pdf->Ln();
- // description
- $pdf->SetFont('Arial','',10);
- $pdf->Write(5,'Name:');
- $pdf->Write(5,$description);
- $pdf->Ln();
- }
- $pdf->AddPage();
- $pdf->Image('dev.png',10,10,25);
- $pdf->Ln();
- $pdf->Ln();
- // requête
- $id=$_POST['Mat_Bac'];
- $sql = mysql_query("SELECT * FROM feuille_de_couchage where Mat_Bac='$id'");
- // on boucle
- while ($row = mysql_fetch_array($sql)) {
- $id = $row["Mat_Bac"];
- $titre = $row["prenom"];
- $description = $row["Name"];
- // titre en gras
- // description
- $pdf->SetFont('Arial','',10);
- $pdf->Write(5,'Name:');
- $pdf->Write(5,$description);
- $pdf->Ln();
- }
- // sortie du fichier
- $pdf->Output('monfichier.pdf', 'I');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement