170 lines
6.8 KiB
PHP
Executable File
170 lines
6.8 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleurrequete.php'; // OK
|
|
require_once 'Modele/Statistique.php';
|
|
//require 'Fpdf/diag.php';
|
|
|
|
class ControleurAjaxstatsmaladiefichetechniquedixseptpdf extends Controleur
|
|
{
|
|
private $detailsp;
|
|
|
|
public function __construct() {
|
|
$this->detailsp = new Statistique();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$idPolice = $this->requete->getParametreFormulaire("idPolice");
|
|
$debutStat = $this->requete->getParametreDate("debutStat");
|
|
$finStat = $this->requete->getParametreDate("finStat");
|
|
|
|
|
|
$_SESSION['debutStat'] = $debutStat;
|
|
$_SESSION['finStat'] = $finStat;
|
|
$_SESSION['depenses'] = $depenses;
|
|
$entete = $this->detailsp->detailrapportspperiodepdfentete($idPolice);
|
|
$p_datedebut = $_SESSION['debutStat'];
|
|
$p_datefin =$_SESSION['finStat'];
|
|
$p_garant = $entete ['codeGcAssureur'];
|
|
$p_id = $entete ['idPolice'] ;
|
|
$p_id_college = null;
|
|
$p_id_clients = null;
|
|
$p_factures = $this->detailsp->etatdepenseparpharmacie($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin);
|
|
|
|
$pdf = new FPDF_Protection();
|
|
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
|
|
$userPassword = '';
|
|
$ownerPassword = null;
|
|
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
|
|
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$pdf->SetMargins(10, 10, 10) ;
|
|
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/logo_vitalis.png',94,3,15);
|
|
$pdf->SetFont('Arial','B',7);
|
|
|
|
$pdf->Cell(0,5,'FICHE TECHNIQUE No 17',0,1,'L',false);
|
|
$pdf->SetY(10);
|
|
$pdf->SetFont('Arial','',7);
|
|
$pdf->Cell(0,5,'Edition du : '.heureCouranteLang($_SESSION['lang']),0,1,'R',false);
|
|
|
|
$pdf->Ln(2);
|
|
|
|
$pdf->SetFont('Arial','B',13);
|
|
|
|
// $pdf->AliasNbPages();
|
|
|
|
//$pdf->SetTextColor(81,163,226);
|
|
$pdf->SetFillColor(143,206,143); // bleu
|
|
$pdf->Cell(0,8,convertirc(_("ETAT DES HOSPITALISATIONS PAR AFFECTIONS")),1,0,'C',true);
|
|
|
|
$pdf->Ln(10);
|
|
$pdf->SetFont('Arial', 'B', 11);
|
|
$pdf->SetTextColor(0);
|
|
$pdf->Ln(8);
|
|
$pdf->Cell(0, 6, convertirc(_('PERIODE COMPTABLE CONSIDEREE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'C', false);
|
|
|
|
$pdf->Ln(10);
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('GARANT')), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc(_(' : '.$entete['garant'])), 0, 1, 'L', false);
|
|
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('SOUSCRIPTEUR')), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc(_(' : '.$entete['souscripteur'])), 0, 1, 'L', false);
|
|
|
|
//$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false);
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('POLICE No')), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc(_(' : '.$entete['numeroPolice'].' / '.$entete['libellePolice'])), 0, 1, 'L', false);
|
|
|
|
//$pdf->Cell(0, 6, convertirc(_('POLICE').' No : '.$entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 1, 'L', false);
|
|
|
|
// $pdf->Cell(0, 6, convertirc(_("DATE D'EFFET").' : '.dateLang($entete['dateEffetPolice'], $_SESSION['lang'])), 0, 1, 'L', false);
|
|
$pdf->SetFont('Arial', 'BUI', 11);
|
|
$pdf->Cell(35, 8, convertirc(_('COURTIER')), 0, 0, 'L', false);
|
|
$pdf->SetFont('Arial', 'BI', 11);
|
|
$pdf->Cell(0, 8, convertirc(_(' : '.$entete['courtier'])), 0, 1, 'L', false);
|
|
// $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false);
|
|
/* $pdf->Ln(10);
|
|
$pdf->SetFont('Arial','B',11);
|
|
$pdf->SetTextColor(0);
|
|
$pdf->Cell(0,8,convertirc($entete['garant']),0,1,'C',false);
|
|
$pdf->Ln(5);
|
|
$pdf->Cell(0,5,$entete['souscripteur'],0,1,'C',false);
|
|
|
|
$pdf->Ln(5);
|
|
$pdf->SetFont('Arial','BI',11);
|
|
$pdf->Cell(45);
|
|
$pdf->Cell(150,8,convertirc(_('POLICE: ').$entete['libellePolice']),0,1,'L',false);
|
|
$pdf->Ln(5);
|
|
$pdf->Cell(30);
|
|
$pdf->Cell(150,5,convertirc(_('PERIODE COMPTABLE CONSIDEREE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])),0,1,'C',false);
|
|
$pdf->Ln(5);
|
|
|
|
*/
|
|
|
|
$pdf->Ln(8);
|
|
$hl=7;
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->SetFillColor(143,206,143);
|
|
$pdf->Cell(15,$hl,convertirc(_("Code")),1,0,'C',true);
|
|
$pdf->SetFillColor(143,206,143);
|
|
$pdf->Cell(85,$hl,convertirc(_('Affection')),1,0,'C',true);
|
|
$pdf->SetFillColor(143,206,143);
|
|
$pdf->Cell(26,$hl,convertirc(_("Montant Facture")),1,0,'C',true);
|
|
$pdf->SetFillColor(143,206,143);
|
|
$pdf->Cell(26,$hl,convertirc(_("Apres Décompte")),1,0,'C',true);
|
|
$pdf->SetFillColor(143,206,143);
|
|
$pdf->Cell(23,$hl,convertirc(_("Coût Moyen")),1,0,'C',true);
|
|
$pdf->SetFillColor(143,206,143);
|
|
$pdf->Cell(17,$hl,convertirc(_("Taux (%)")),1,1,'C',true);
|
|
|
|
$pdf->SetFont('Arial','',8);
|
|
|
|
$total_montantFacture =
|
|
$total_apresDecompte =
|
|
$total_Coutmoyen =
|
|
$total_Taux = 0;
|
|
|
|
foreach ($p_factures as $dep)
|
|
{
|
|
$pdf->Cell(15,$hl,convertirc($dep['codeP']),1,0,'C',false);
|
|
$pdf->Cell(85,$hl,convertirc($dep['Prestataire']),1,0,'L',false);
|
|
$pdf->Cell(26,$hl,convertirc(format_N($dep['montantFacture'])),1,0,'R',false);
|
|
$pdf->Cell(26,$hl,convertirc(format_N($dep['apresDecompte'])),1,0,'R',false);
|
|
$pdf->Cell(23,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'R',false);
|
|
$pdf->Cell(17,$hl,convertirc($dep['Taux']),1,1,'C',false);
|
|
|
|
$total_montantFacture = $total_montantFacture +$dep['montantFacture'];
|
|
$total_apresDecompte = $total_apresDecompte +$dep['apresDecompte'];
|
|
$total_Coutmoyen = $total_Coutmoyen +$dep['Coutmoyen'];
|
|
$total_Taux = $total_Taux +$dep['Taux'];
|
|
}
|
|
// $total_Quantite=count($p_factures)
|
|
// $total_Coutmoyen = $total_Coutmoyen/$total_Quantite ;
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->SetFillColor(143,206,143);
|
|
$pdf->Cell(100,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true);
|
|
$pdf->Cell(26,$hl,format_N($total_montantFacture),1,0,'C',true);
|
|
$pdf->Cell(26,$hl,format_N($total_apresDecompte),1,0,'C',true);
|
|
$pdf->Cell(23,$hl,format_N($total_Coutmoyen),1,0,'C',true);
|
|
$pdf->Cell(17,$hl,format_N($total_Taux),1,1,'C',true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$fichier="Temp/TMP_CUMUL_SP_FICHE17"."_".uniqid().".pdf";
|
|
$pdf->Output($fichier,"F");
|
|
|
|
$t_html =' <div id ="div_export_b" class="alert alert-info"> ';
|
|
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
|
|
$t_html .=' </div ';
|
|
echo $t_html;
|
|
}
|
|
} |