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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
| <?php
session_start();
require('fpdf16/fpdf.php');
require('conversion/chifrenlettre.php');
$connect=mysql_connect("localhost","root","");
mysql_select_db('gestion_budget',$connect);
$num=$_GET['num'];
$sqln="select * from engagement where numeng=$num";
$exen=mysql_query($sqln,$connect);
$lignen=mysql_fetch_array($exen);
$lib_poste_bdg=$lignen[1];
$pdf=new FPDF();
$pdf->AliasnbPages();
$pdf->Addpage();
$pdf->Setfont('Arial','',18);
$pdf->SetFillColor(255,0,0);
$pdf->setTextColor(6,5,7);
$pdf->SetLineWidth(.4);
$pos=$pdf->GetStringWidth("L")+10;
$pdf->SetX((50-$pos)/2);
$pdf->Cell(0,6,"ACEP",0,0,'L',false);
$date=getdate();
$mois=$date['month'];
$jour=$date['mday'];
$an=$date['year'];
$j=$jour.'/'.$mois.'/'.$an;
$pdf->Cell(0,6,"Date: ".date('d-M-y'),0,1,'R',false);
$pdf->Cell(0,6,"Avenue Bourguiba * boul dial diop ",0,1,'L',false);
$pdf->Cell(0,6,"Année ".$an,0,1,'R',false);
$pdf->Cell(0,6,"TEL:33 869 75 50",0,1,'L',false);
$pdf->Cell(0,6,"rubrique: ".$lib_poste_bdg,0,1,'R',false);
$link=$pdf->Addlink();
$pdf->SetLink($link);
$pdf->Write(0, "Site Web:www.acepsenegal.com ",$link);
$pdf->Cell(0,6,"n° d'imputation: ".$lignen[2],0,1,'R',false);
$pdf->Cell(0,6,"ref bon de fourniture: ".$lignen[4],0,1,'R',false);
$pdf->Cell(0,6,"Bureau: ".$lignen[6],0,1,'R',false);
+$pdf->Cell(0,7,"",0,1,'L',false);
$pdf->Ln();
$pos=$pdf->GetStringWidth("L")+6;
$pdf->SetX((125-$pos)/2);
$pdf->Cell(0,7,"fiche d'engagement N°: ".$num,0,0,'L',false);
$pos=$pdf->GetStringWidth("L")+6;
$pdf->SetX((245-$pos)/2);
$pdf->Ln();
$pdf->Ln();
$pos=$pdf->GetStringWidth("L")+6;
$pdf->SetX((60-$pos)/2);
$pdf->Ln();
$entete=array("libelle","montant F CFA");
$pos=array(90,90);
for($si=0;$si<count($entete);$si++)
{
$pdf->Cell($pos[$si],15,$entete[$si],1,0,'C',0);
}
$pdf->Ln();
$fond=false;
$pdf->SetFillcolor(224,235);
$sql="select sum(montsol) from engagement where lib_poste_bdg ='$lib_poste_bdg'";
$exe1=mysql_query($sql,$connect);
$lsom=mysql_fetch_array($exe1);
$som=$lsom[0];
$req2="select montprev from poste_budgetaire where lib_poste_bdg='$lib_poste_bdg'";
$exe2=mysql_query($req2,$connect);
$ligne2=mysql_fetch_array($exe2);
$montprev=$ligne2[0];
$req="select max(numeng) from engagement where lib_poste_bdg ='$lib_poste_bdg'";
$exe=mysql_query($req,$connect);
$lnum=mysql_fetch_array($exe);
$num=$lnum[0];
$req3="select montsol from engagement where numeng='$num'";
$exe3=mysql_query($req3,$connect);
$ligne3=mysql_fetch_array($exe3);
$montsol=$ligne3[0];
echo chifre_en_lettre($montsol);
//$lettre=new ChiffreEnLettre();
//$lettre->Conversion($montsol);
$ent=array("montant budgetisé",$montprev);
$pdf->Cell($pos[0],10,$ent[0],1,0,'C','LR',1);
$pdf->Cell($pos[1],10,$ent[1],1,0,'C',1);
$pdf->Ln();
$ent=array("montant déjà engagé",$som);
$pdf->Cell($pos[0],10,$ent[0],1,0,'C','LR',1);
$pdf->Cell($pos[1],10,$ent[1],1,0,'C',1);
$pdf->Ln();
$ent=array("budget disponible ",$montprev-$som);
$pdf->Cell($pos[0],10,$ent[0],1,0,'C','LR',1);
$pdf->Cell($pos[1],10,$ent[1],1,0,'C',1);
$pdf->Ln();
$ent=array("montant sollicité",$montsol);
$pdf->Cell($pos[0],10,$ent[0],1,0,'C','LR',1);
$pdf->Cell($pos[1],10,$ent[1],1,0,'C',1);
$pdf->Ln();
$pdf->Ln();
$pdf->Cell(0,6,"Arreté la presente demande à la somme TTC de ",0,0,'L',false);
$pdf->Ln();
$pdf->Cell(0,6,"..................................................................................................",0,0,'L',false);
$pdf->Ln();
$pdf->Cell(0,6,"..................................................................................................",0,0,'L',false);
$pdf->Ln();
$pdf->Ln();
$pdf->Cell(0,6,"controleur de gestion ",0,0,'L',false);
$pdf->Cell(0,6,"Responsable RH ",0,1,'R',false);
$pdf->Ln();
$pdf->Cell(0,6,"Date",0,0,'L',false);
$pdf->Cell(0,6,"Date ",0,1,'R',false);
$pdf->Ln();
$pdf->Cell(0,6,"signature",0,0,'L',false);
$pdf->Cell(0,6,"signature ",0,1,'R',false);
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Cell(0,6,"Responsable audit-inspection",0,0,'L',false);
$pdf->Cell(0,6,"Directeur Général ",0,1,'R',false);
$pdf->Ln();
$pdf->Cell(0,6,"Date",0,0,'L',false);
$pdf->Cell(0,6,"Date ",0,1,'R',false);
$pdf->Ln();
$pdf->Cell(0,7,"signature",0,0,'L',false);
$pdf->Cell(0,7,"signature ",0,1,'R',false);
$pdf->Ln();
$pdf->OutPut();
?> |
Partager