0x1998 - MANAGER
Edit File: edit.php
<?php session_cache_limiter('private'); include "config/garde.php"; //define('FPDF_FONTPATH','font/'); require('config/fpdf/tfpdf.php'); // on charge les valeurs $type=isset($_GET['type'])? $_GET['type']:""; $from=isset($_GET['from'])? $_GET['from']:""; $to=isset($_GET['to'])? $_GET['to']:""; $name=isset($_GET['name'])? $_GET['name']:""; $fichier=isset($_GET['fichier'])? $_GET['fichier']:""; $jour=isset($_GET['jour'])? $_GET['jour']:0; $quotite=isset($_GET['quotite'])? $_GET['quotite']:0; // on convertit les valeurs if ($from!="") $from=iconvert_date($from); if ($to!="") $to=iconvert_date($to); $jourCalc=$jour*$quotite; // on arrondi $jourCalc à 0.5 $entier = floor($jourCalc); $decimal = $jourCalc - $entier; $decimal=round($decimal,1); if ($decimal>=0.1 && $decimal<0.3) {$newDecimal=0;} elseif ($decimal>=0.3 && $decimal<0.8) {$newDecimal=0.5;} elseif ($decimal>=0.8) {$newDecimal=0; $entier++;} else { $newDecimal=$decimal;} $jourCalc=$entier+$newDecimal; // SI FORMULAIRE VIERGE ON EFFACE jour et jourCalc $jour=($jour>0) ? $jour:""; $jourCalc=($jourCalc>0) ? $jourCalc:""; //require('config/fpdf_protection.php'); $accent=array("à","â","é","è","ê","ô","ç"); $rep_accent=array("a","a","e","e","e","o","c"); //$pdf=new FPDF_Protection('P','mm','A4'); $pdf=new tFPDF('P','mm','A4'); // Add a Unicode font (uses UTF-8) $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); $pdf->AddFont('DejaVu', 'B', 'DejaVuSansCondensed-Bold.ttf', true); //$pdf->Open(); $pdf->Setauthor ('Guillaume DOUGE'); //$pdf->SetProtection(array('print'),'',''); //$pdf->SetAutoPageBreak(false) ; $pdf->AddPage(); //$pdf->Setfont('helvetica','',12); $pdf->Setfont('DejaVu','',12); if ($type=='CA') { $pdf->Image('modele_ca.jpg',5,0,200); $pdf->Ln(105); $pdf->Cell(110); $pdf->Cell(10,6, $name,0,0,''); $pdf->Ln(27); $pdf->Cell(75); $pdf->Cell(10,6, $jour,0,0,''); $pdf->Cell(45); $pdf->Cell(10,6, $jourCalc,0,0,''); $pdf->Ln(8); $pdf->Cell(65); $pdf->Cell(10,6, $from,0,0,''); $pdf->Cell(45); $pdf->Cell(10,6, $to,0,0,''); $pdf->Ln(18); $pdf->Cell(150); $pdf->Cell(10,6, date("d/m/Y"),0,0,''); } elseif($type=='RT') { $pdf->Image('modele_rt.jpg',5,0,200); $pdf->Ln(102); $pdf->Cell(110); $pdf->Cell(10,6, $name,0,0,''); $pdf->Ln(26); $pdf->Cell(75); $pdf->Cell(10,6, $jour,0,0,''); $pdf->Cell(45); $pdf->Cell(10,6, $jour,0,0,''); $pdf->Ln(8); $pdf->Cell(65); $pdf->Cell(10,6, $from,0,0,''); $pdf->Cell(45); $pdf->Cell(10,6, $to,0,0,''); $pdf->Ln(17); $pdf->Cell(150); $pdf->Cell(10,6, date("d/m/Y"),0,0,''); } if ($fichier!="") { $fichier="out/".$fichier; $pdf->Output($fichier,'F'); } else $pdf->Output(); ?>