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
|
<?php
require('pdf/fpdf.php');
$pdf=new FPDF('P','cm','A4');
//Titres des colonnes
$header=array('NOM','MOBILE','THE_DATE');
$pdf->SetFont('Arial','B',14);
$pdf->AddPage();
$pdf->SetFillColor(96,96,96);
$pdf->SetTextColor(255,255,255);
$connect=ociplogon("RODA","INTERCEL","INT");
$sql="SELECT NOM, MOBILE, THE_DATE FROM AG_GAINS";
$parseReq=oci_parse($connect,$sql);
ociexecute($parseReq);
$pdf->SetXY(3,3);
for($i=0;$i<sizeof($header);$i++)
$pdf->cell(5,1,$header[$i],1,0,'C',1);
$pdf->SetFillColor(0xdd,0xdd,0xdd);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',10);
$pdf->SetXY(3,$pdf->GetY()+1);
$fond=0;
while($row=oci_fetch_array($parseReq))
{
$pdf->cell(5,0.7,$row['NOM'],1,0,'C',$fond);
$pdf->cell(5,0.7,$row['MOBILE'],1,0,'C',$fond);
$pdf->cell(5,0.7,$row['THE_DATE'],1,0,'C',$fond);
$pdf->SetXY(3,$pdf->GetY()+0.7);
$fond=!$fond;
}
$pdf->output();
?> |
Partager