Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1.  
  2. <html dir="rtl">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <head><title></title></head>
  5. <body>
  6. <form name="form1" method="post" action="new 1.php"><p align="center">
  7. <table border="3">
  8. <tr><td>
  9. <tr><td>رقم البكالوريا </td></tr>
  10. <tr><td>
  11. <strong>
  12. <input type="text"name="Mat_Bac" style="width: 173px" autocomplete="off"></strong></td></tr>
  13. </td></tr></table>
  14. <input type="submit"name="عرض" value="عرض"style="width:110px">
  15. <input type="reset"name="مسح" value="مسح"style="width:110px"><br>
  16. </form></p>
  17. </body>
  18. </html>
  19. 2)
  20. <?
  21. // la classe de fonctions
  22. require('fpdf17/fpdf.php');
  23. // connexion base de données
  24. $db_server = "localhost";
  25. $db_user = "root";
  26. $db_pass = "root";
  27. $db_name = "dou";
  28. function connect($db_server, $db_user, $db_pass, $db) {
  29. if (!($link=mysql_connect($db_server,$db_user,$db_pass))) {
  30. exit();
  31. }
  32. if (!(mysql_select_db($db,$link))) {
  33. exit();
  34. }
  35. return $link;
  36. }
  37. $connexion=connect($db_server,$db_user,$db_pass,$db_name);
  38. mysql_query("SET NAMES 'utf8'");
  39. // classe étendue pour créer en-tête et pied de page
  40. class PDF extends FPDF
  41. {
  42. // en-tête
  43. function Header()
  44. {
  45.  
  46. //Police Arial gras 15
  47. $this->SetFont('Arial','B',14);
  48. //Décalage à droite
  49. $this->Cell(80);
  50. //Titre
  51. $this->Cell(30,10,'Mon joli fichier PDF',0,0,'C'); //æÖÚ ãÑÈÚ Úáì ÇáÚäæÇä
  52. $this->Ln();
  53. $this->Cell(80);
  54. $this->Cell(30,10,'aissa brahimi',0,0,'C'); //æÖÚ ãÑÈÚ Úáì ÇáÚäæÇä
  55. //Saut de ligne
  56. $this->Ln(20);
  57. }
  58.  
  59. // pied de page
  60. function Footer()
  61. {
  62. //Positionnement à 1,5 cm du bas
  63. $this->SetY(-15);
  64. //Police Arial italique 8
  65. $this->SetFont('Arial','I',8);
  66. $this->Cell(80);
  67. $this->Cell(30,0,'DOUOUARGLA.DZ',0,0,'C'); //æÖÚ ãÑÈÚ Úáì ÇáÚäæÇä
  68. $this->Ln();
  69. //Numéro de page
  70. $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
  71. }
  72. }
  73. // création du pdf
  74. $pdf=new PDF('P','mm','A4', 'UTF-8', true);
  75. $pdf->SetAuthor('Un grand écrivain');
  76. $pdf->SetTitle('Raport');
  77. $pdf->SetSubject('Un exemple de création de fichier PDF');
  78. $pdf->SetCreator('fpdf_cybermonde_org');
  79. $pdf->AliasNBPages();
  80. $pdf->AddPage();
  81. $pdf->Image('dev.png',10,10,25);
  82. $pdf->Ln();
  83. $pdf->Ln();
  84. // requête
  85. $id=$_POST['Mat_Bac'];
  86. $sql = mysql_query("SELECT * FROM feuille_de_couchage where Mat_Bac='$id'");
  87.  
  88. // on boucle
  89. while ($row = mysql_fetch_array($sql)) {
  90. $id = $row["Mat_Bac"];
  91. $titre = $row["prenom"];
  92. $description = $row["Name"];
  93. // titre en gras
  94. $pdf->SetFont('Arial','B',10);
  95. $pdf->Write(5,'prenom:');
  96. $pdf->Write(5,$titre);
  97. $pdf->Ln();
  98. $pdf->Ln();
  99. // description
  100. $pdf->SetFont('Arial','',10);
  101. $pdf->Write(5,'Name:');
  102. $pdf->Write(5,$description);
  103. $pdf->Ln();
  104.  
  105. }
  106.  
  107.  
  108. $pdf->AddPage();
  109. $pdf->Image('dev.png',10,10,25);
  110. $pdf->Ln();
  111. $pdf->Ln();
  112. // requête
  113. $id=$_POST['Mat_Bac'];
  114. $sql = mysql_query("SELECT * FROM feuille_de_couchage where Mat_Bac='$id'");
  115.  
  116. // on boucle
  117. while ($row = mysql_fetch_array($sql)) {
  118. $id = $row["Mat_Bac"];
  119. $titre = $row["prenom"];
  120. $description = $row["Name"];
  121. // titre en gras
  122.  
  123. // description
  124. $pdf->SetFont('Arial','',10);
  125. $pdf->Write(5,'Name:');
  126. $pdf->Write(5,$description);
  127. $pdf->Ln();
  128.  
  129. }
  130.  
  131.  
  132. // sortie du fichier
  133.  
  134.  
  135. $pdf->Output('monfichier.pdf', 'I');
  136. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement