Bonsoir,

J'essaie de générer un tableau avec fpdf mais les cellules vide restent visible, et ce malgré mes essais pour les faire disparaitrent avec des conditins IF et ELSE.

J'ai essayé empty, isset, variable vide, variable pleine mais rien n'y fait... Le code se comporte comme si ils n'y avait pas de conditions.

code php :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
$sql_fact = "SELECT * FROM facture WHERE id_client_facture = '".$_POST['modifier_client']."'";
$sql_fact = mysql_query ($sql_fact) or die (mysql_error()); 
$data_fact = mysql_fetch_array($sql_fact);
 
if($_POST['facture1']=="0"){$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);}
else{$pdf->Cell(120,5,$data_fact['facture_data19'],1,0);$pdf->Cell(20,5,$data_fact['facture_data36'].' '.EURO,1,0,'R');$pdf->Cell(15,5,$data_fact['facture_data54'],1,0,'C');$pdf->Cell(25,5,$data_fact['facture_data1'].' '.EURO,1,1,'R');}
if($_POST['facture2']=="0"){$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);}
else{$pdf->Cell(120,5,$data_fact['facture_data20'],1,0);$pdf->Cell(20,5,$data_fact['facture_data37'].' '.EURO,1,0,'R');$pdf->Cell(15,5,$data_fact['facture_data55'],1,0,'C');$pdf->Cell(25,5,$data_fact['facture_data2'].' '.EURO,1,1,'R');}
if($_POST['facture3']=="0"){$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);}
else{$pdf->Cell(120,5,$data_fact['facture_data21'],1,0);$pdf->Cell(20,5,$data_fact['facture_data38'].' '.EURO,1,0,'R');$pdf->Cell(15,5,$data_fact['facture_data56'],1,0,'C');$pdf->Cell(25,5,$data_fact['facture_data3'].' '.EURO,1,1,'R');}
if($_POST['facture4']=="0"){$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);}
else{$pdf->Cell(120,5,$data_fact['facture_data22'],1,0);$pdf->Cell(20,5,$data_fact['facture_data39'].' '.EURO,1,0,'R');$pdf->Cell(15,5,$data_fact['facture_data57'],1,0,'C');$pdf->Cell(25,5,$data_fact['facture_data4'].' '.EURO,1,1,'R');}
if($_POST['facture5']=="0"){$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);}
else{$pdf->Cell(120,5,$data_fact['facture_data23'],1,0);$pdf->Cell(20,5,$data_fact['facture_data40'].' '.EURO,1,0,'R');$pdf->Cell(15,5,$data_fact['facture_data58'],1,0,'C');$pdf->Cell(25,5,$data_fact['facture_data5'].' '.EURO,1,1,'R');}
if($_POST['facture6']=="0"){$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);$pdf->Cell(0,0,'',0,0);}
else{$pdf->Cell(120,5,$data_fact['facture_data28'],1,0);$pdf->Cell(20,5,$data_fact['facture_data41'].' '.EURO,1,0,'R');$pdf->Cell(15,5,$data_fact['facture_data59'],1,0,'C');$pdf->Cell(25,5,$data_fact['facture_data6'].' '.EURO,1,1,'R');}
Bon je sait que c'est pas la meilleurs façon de générer un tableau mais c'est la seul façon que je connaisse....

merci d'avance pour vos réponse.

Roland