A voir également:
- Page php to pdf
- Lire le coran en français pdf - Télécharger - Histoire & Religion
- Supprimer page word - Guide
- Save as pdf office 2007 - Télécharger - Bureautique
- Qwerty to azerty - Guide
- Télécharger dictionnaire larousse pdf gratuit - Télécharger - Dictionnaires & Langues
<?php
$db = mysql_connect('localhost', 'root', '');
mysql_select_db('pers',$db);
require('fpdf.php');
session_start();
$mat=$_SESSION['Mat'];
//,situations_administratives,par_grades,affectations,par_lieux_affectation where fonctionnaires.Mat=affectations.Mat AND fonctionnaires.Mat=situations_administratives.Mat AND situations_administratives.Code_grade=par_grades.Code_grade AND affectations.Code_Affectaion=par_lieux_affectation.Code_Affectaion And
$sql="select * from fonctionnaires where Mat=".$mat;
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$resultat=mysql_query($sql);
$data = mysql_fetch_assoc($req);
//$pdf=new FPDF();
$pdf=new FPDF('P','cm','A4');
$pdf->open();
$pdf->AddPage();
//$pdf->SetFont("Arial","B",8);
//$pdf->Cell(10);
$pdf->SetFont('Times','BI',12);
$pdf->MultiCell(0, 0.5, " Fonctionnaires ", 0, "L", 0);
$pdf->Ln(1);
//$pdf->Cell(10);
$pdf->SetFont('Times','B',16);
$pdf->MultiCell(0, 0.5, "Fiche de Renseignements \n ", 0, "C", 0);
//$pdf->Cell(10);
$pdf->SetFont('Times','B',10);
$pdf->MultiCell(0, 0.5, " Identité \n \n", 0, "L", 0);
//Titres des colonnes
//$pdf=new FPDF('P','cm','A4');
$header=array('Nom','Prenom','CIN','PPR');
$pdf->SetFont('Times','B',12);
$pdf->SetFillColor(255,255,255);
//$pdf->SetTextColor(255,255);
$pdf->SetXY(3,6)
//for($i=0;$i<sizeof($header);$i++)
// $pdf->cell(2.5,1,$header[$i],1,0,'C',1);
$pdf->cell(4,1,$header[0],1,0,'C',1);
$pdf->cell(4,1,$header[1],1,0,'C',1);
$pdf->cell(3,1,$header[2],1,0,'C',1);
$pdf->cell(3,1,$header[3],1,0,'C',1);
$pdf->SetFillColor(0xdd,0xdd);
$pdf->SetTextColor(0,0);
$pdf->SetFont('Times','',11);
$pdf->SetXY(3,$pdf->GetY()+1);//
$fond=0;
$i=0;
while($row=mysql_fetch_array($resultat))
{
$pdf->cell(4,0.7,$row['Nom'],1,0,'C');
$pdf->cell(4,0.7,$row['Prenom'],1,0,'C');
$pdf->cell(3,0.7,$row['CIN'],1,0,'C');
$pdf->cell(3,0.7,$row['NPPR_DRPP'],1,0,'C');
$pdf->SetXY(3,$pdf->GetY()+0.7);
$fond=!$fond;
}
$header=array('Date de naissance','Lieu de naissance','Sexe');
$pdf->SetFont('Times','B',12);
$pdf->SetFillColor(255,255,255);
//$pdf->SetTextColor(255,255);
$pdf->SetXY(3,8);
//for($i=0;$i<sizeof($header);$i++)
// $pdf->cell(2.5,1,$header[$i],1,0,'C',1);
$pdf->cell(4,1,$header[0],1,0,'C',1);
$pdf->cell(4,1,$header[1],1,0,'C',1);
$pdf->cell(3,1,$header[2],1,0,'C',1);
$pdf->SetFillColor(0xdd,0xdd);
$pdf->SetTextColor(0,0);
$pdf->SetFont('Times','',11);
$pdf->SetXY(3,$pdf->GetY()+1);
$fond=0;
$i=0;
while($row=mysql_fetch_array($resultat))
{
$pdf->cell(4,0.7,$row['Nom'],1,0,'C');
$pdf->cell(4,0.7,$row['Prenom'],1,0,'C');
$pdf->cell(3,0.7,$row['CIN'],1,0,'C');
$pdf->SetXY(3,$pdf->GetY()+0.7);
$fond=!$fond;
}
$pdf->Output();
?>