/////////// INITIALISATION DU FICHIER PDF //Importation de la classe FPDF de génération des fichiers PDF require('fpdf.php'); //Fichier absolument nécessaire //Paramètres du fichier PDF $pdffilename = 'fiche_entretien.pdf'; clearstatcache(); if (file_exists($pdffilename)) { //Si le fichier PDF existe, il faut le supprimer d'abord unlink($pdffilename); } //compteur du nombre de lignes par page PDF $i = 5; //Nombre maxi de lignes par page PDF $max = 28; //Création du fichier PDF $pdf=new FPDF(); //Désactive le saut de page automatique $pdf->SetAutoPageBreak(false); //// enregistrement des engins $compt = $_SESSION['max']; $cpt = 0; while ( $cpt < $compt) { $cpt++; $queryI = "insert into reception ( date_entree ,...); if (query_action($queryI, $database_ninedev_connexion, $ninedev_connexion) > 0 ) { } //Création de la page du fichier PDF PAR ENGIN $pdf->AddPage('P','A4'); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',10); $row_height = 6; $x_axis_initial = 15; $y_axis_initial = 15; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis_initial); $pdf->Image('images/logo.jpg',5,5,90,30); $date=dat(); $pdf->Cell(160,$row_height," $date",0,1,'R',0); $i++; $i++; //// PASSAGE A LA LIGNE $y_axis = $x_axis_initial + 15; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); ///Mise en forme $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',14); $pdf->Cell(170,$row_height,"FICHE D'ENTRETIEN",1,1,'C',0); ///Réception $i++; $i++; $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',10); $pdf->Cell(25,$row_height,"Date Entree: ",1,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(25,$row_height,$date_entree,1,0,'C',0); $pdf->SetFont('Arial','B',10); $pdf->Cell(35,$row_height,"Date Sortie Prevue: ",1,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(25,$row_height,$date_sortieprev,1,0,'C',0); $pdf->SetFont('Arial','B',10); $pdf->Cell(25,$row_height,"Controleur: ",1,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(35,$row_height,$nom_control,1,0,'L',0); ///Identification du client $i++; //$i++; //$y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',10); $pdf->Cell(25,$row_height,"Nom/Raison : ",1,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(25,$row_height,$nom_client,1,0,'C',0); $pdf->SetFont('Arial','B',10); $pdf->Cell(20,$row_height,"Mobile: ",1,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(35,$row_height,$mob_client,1,0,'C',0); $pdf->SetFont('Arial','B',10); $pdf->Cell(30,$row_height,"Compte client: ",1,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(35,$row_height,$cpte_client ,1,0,'L',0); $i++; //$i++; //$y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',10); $pdf->Cell(25,$row_height,"Observation: ",1,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(145,$row_height,$observation ,1,0,'L',0); /////TABLEAU RECAPITULATIF DES SITUATION //Impression des entetes de colonnes $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',12); $pdf->Cell(150,$row_height,"ETAT DE L'ENGIN $num_engin A LA RECEPTION ",0,0,'C',0); ///Identification de l'engin $i++; $i++; $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',10); $pdf->Cell(60,$row_height,$typ_engin,1,0,'C',0); $pdf->SetFont('Arial','B',10); $pdf->Cell(30,$row_height,"Immatriculation: ",0,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(25,$row_height,$immatric,0,0,'L',0); $pdf->SetFont('Arial','B',10); $pdf->Cell(25,$row_height,"Marque: ",0,0,'L',0); $pdf->SetFont('Arial','',10); $pdf->Cell(30,$row_height,$marque,0,0,'L',0); $i++; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',14); $pdf->Cell(170,$row_height,"--------------------------------------------------------------------------------------------------------",0,0,'C',0); //les premieres entetes $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','B',8); $pdf->Cell(50,$row_height,"VIDANGE-MOTEUR",1,0,'L',0); $pdf->SetFont('Arial','',8); /// details de la premiere colonne $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lmoto_filtre_huile!=""){ $pdf->Cell(50,$row_height,$lmoto_filtre_huile,0,0,'L',0);}else{ $saut = 0;} if($lmoto_filtre_air!=""){ $pdf->Cell(50,$row_height,$lmoto_filtre_air,0,0,'L',0);} if($lmoto_huile_moteur!=""){ $pdf->Cell(50,$row_height,$lmoto_huile_moteur,0,0,'L',0);} if ($saut !=0){ $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis);} if($lfiltre_huile!=""){ $pdf->Cell(50,$row_height,$lfiltre_huile,0,0,'L',0);} if($lfiltre_air!=""){ $pdf->Cell(50,$row_height,$lfiltre_air,0,0,'L',0);} if($lhuile_moteur!=""){ $pdf->Cell(50,$row_height,$lhuile_moteur,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lbouchon_carbur!=""){ $pdf->Cell(50,$row_height,$lbouchon_carbur,0,0,'L',0);} if($leff_etrangers!=""){ $pdf->Cell(50,$row_height,$leff_etrangers,0,0,'L',0);} if($lniv_carbur!=""){ $pdf->Cell(50,$row_height,$lniv_carbur,0,0,'L',0);} $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','B',8); $pdf->Cell(50,$row_height,"CARROSSERIE",1,0,'L',0); $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','',8); if($lpeinture!=""){ $pdf->Cell(50,$row_height,$lpeinture,0,0,'L',0);} if($ltolerie!=""){ $pdf->Cell(50,$row_height,$ltolerie,0,0,'L',0);} if($lvitres!=""){ $pdf->Cell(50,$row_height,$lvitres,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lphares!=""){ $pdf->Cell(50,$row_height,$lphares,0,0,'L',0);} if($lretroviseur!=""){ $pdf->Cell(50,$row_height,$lretroviseur,0,0,'L',0);} if($lantenne!=""){ $pdf->Cell(50,$row_height,$lantenne,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lverrouillage!=""){ $pdf->Cell(50,$row_height,$lverrouillage,0,0,'L',0);} $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','B',8); $pdf->Cell(50,$row_height,"ROUES - MECANIQUE",1,0,'L',0); $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','',8); if($lpneus!=""){ $pdf->Cell(50,$row_height,$lpneus,0,0,'L',0);} if($lenjoliveur!=""){ $pdf->Cell(50,$row_height,$lenjoliveur,0,0,'L',0);} if($lmoto_pneu_av!=""){ $pdf->Cell(50,$row_height,$lmoto_pneu_av,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lmoto_pneu_ar!=""){ $pdf->Cell(50,$row_height,$lmoto_pneu_ar,0,0,'L',0);} if($lmoto_frein_av!=""){ $pdf->Cell(50,$row_height,$lmoto_frein_av,0,0,'L',0);} if($lmoto_frein_ar!=""){ $pdf->Cell(50,$row_height,$lmoto_frein_ar,0,0,'L',0);} $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','B',8); $pdf->Cell(50,$row_height,"COFFRE A BAGAGES",1,0,'L',0); $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','',8); if($lroue_secours!=""){ $pdf->Cell(50,$row_height,$lroue_secours,0,0,'L',0);} if($lcric!=""){ $pdf->Cell(50,$row_height,$lcric,0,0,'L',0);} if($ltrousse_outil!=""){ $pdf->Cell(50,$row_height,$ltrousse_outil,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($ltrousse_secours!=""){ $pdf->Cell(50,$row_height,$ltrousse_secours,0,0,'L',0);} if($ltriangle!=""){ $pdf->Cell(50,$row_height,$ltriangle,0,0,'L',0);} if($lextincteur!=""){ $pdf->Cell(50,$row_height,$lextincteur,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lpas_effet_pers!=""){ $pdf->Cell(50,$row_height,$lpas_effet_pers,0,0,'L',0);} //// details de la 3è colonne $y_axis = $y_axis + $row_height; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','B',8); $pdf->Cell(50,$row_height,"INTERIEUR",1,0,'L',0); $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetFont('Arial','',8); if($lleve_glace!=""){ $pdf->Cell(50,$row_height,$lleve_glace,0,0,'L',0);} if($lclimatiseur!=""){ $pdf->Cell(50,$row_height,$lclimatiseur,0,0,'L',0);} if($lradio!=""){ $pdf->Cell(50,$row_height,$lradio,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($ltelephone!=""){ $pdf->Cell(50,$row_height,$ltelephone,0,0,'L',0);} if($lklaxon!=""){ $pdf->Cell(50,$row_height,$lklaxon,0,0,'L',0);} if($lclignotant!=""){ $pdf->Cell(50,$row_height,$lclignotant,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lrevet_volant!=""){ $pdf->Cell(50,$row_height,$lrevet_volant,0,0,'L',0);} if($lrevet_int!=""){ $pdf->Cell(50,$row_height,$lrevet_int,0,0,'L',0);} if($lregl_retrov!=""){ $pdf->Cell(50,$row_height,$lregl_retrov,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lfonct_levvitre!=""){ $pdf->Cell(50,$row_height,$lfonct_levvitre,0,0,'L',0);} if($ltab_bord!=""){ $pdf->Cell(50,$row_height,$ltab_bord,0,0,'L',0);} if($lessuie_glace!=""){ $pdf->Cell(50,$row_height,$lessuie_glace,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lretro_inter!=""){ $pdf->Cell(50,$row_height,$lretro_inter,0,0,'L',0);} if($lproprete_inter!=""){ $pdf->Cell(50,$row_height,$lproprete_inter,0,0,'L',0);} if($lallume_cigare!=""){ $pdf->Cell(50,$row_height,$lallume_cigare,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lmanivelle!=""){ $pdf->Cell(50,$row_height,$lmanivelle,0,0,'L',0);} if($lmoto_bougie!=""){ $pdf->Cell(50,$row_height,$lmoto_bougie,0,0,'L',0);} if($lmoto_levier_frein!=""){ $pdf->Cell(50,$row_height,$lmoto_levier_frein,0,0,'L',0);} $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); if($lmoto_levier_emb!=""){ $pdf->Cell(50,$row_height,$lmoto_levier_emb,0,0,'L',0);} if($lmoto_cable_acc!=""){ $pdf->Cell(50,$row_height,$lmoto_cable_acc,0,0,'L',0);} if($lmoto_ampoule!=""){ $pdf->Cell(50,$row_height,$lmoto_ampoule,0,0,'L',0);} $i++; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',14); $pdf->Cell(170,$row_height,"--------------------------------------------------------------------------------------------------------",0,0,'C',0); $i++; $y_axis = $y_axis + $row_height; $pdf->SetX($x_axis_initial); $pdf->SetY($y_axis); $pdf->SetTextColor(0); $pdf->SetFont('Arial','B',10); $pdf->Cell(15,$row_height," Page $cpt / $compt ",0,0,'L',0); $pdf->Cell(150,$row_height,"VISA",0,0,'R',0); } //Sauvegarde du fichier PDF généré $pdf->Output($pdffilename,'F'); echo ""; // On inclus le formulaire d'identifications