211 lines
5.7 KiB
PHP
211 lines
5.7 KiB
PHP
<?php
|
|
require_once 'Controleurrequete.php';
|
|
require_once 'Functions.php.php';
|
|
require_once 'Statistique.php';
|
|
|
|
class Emailrapprtsp
|
|
{
|
|
private $tachedetail;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->tachedetail = new Tachedetail();
|
|
}
|
|
|
|
public function excutercron()
|
|
{
|
|
$taches = $this->tachedetail->tachesemail();
|
|
/*
|
|
$headerXLS = array(
|
|
'Executant',
|
|
'Date_Echeance',
|
|
'No_Client',
|
|
'Nom_Client',
|
|
'Police',
|
|
'No_Sin',
|
|
'Tache',
|
|
'Date_Creation',
|
|
'Echeance_Mail_Sup',
|
|
'Id_Tache',
|
|
'Id_Victime',
|
|
'Nom_Victime',
|
|
'Etat_Victime');
|
|
*/
|
|
$headerXLS = array(
|
|
'Executant',
|
|
'Date_Echeance',
|
|
'Nom_Client',
|
|
'No_Sin',
|
|
'Tache');
|
|
|
|
$dataXLS = array();
|
|
|
|
foreach ($taches as $tache)
|
|
{
|
|
$dataXLS[]=$tache;
|
|
}
|
|
|
|
|
|
$classeur = new PHPExcel();
|
|
$classeur->getProperties()->setCreator("SYSTEME TACHES PLANIFIEES RADIANT");
|
|
$classeur->setActiveSheetIndex(0);
|
|
$feuille=$classeur->getActiveSheet();
|
|
$feuille->setTitle('TACHES NON TRAITEES A TEMPS');
|
|
$feuille->fromArray($headerXLS, NULL, 'A1', true);
|
|
$feuille->fromArray($dataXLS, NULL, 'A2', true);
|
|
|
|
$dj = date("Y-m-d");
|
|
|
|
// $fichier = 'Temp/'.$dj.'_taches_non_traites'."_".uniqid().".xlsx";
|
|
|
|
$fichier = '/var/www/taches/Cron/Temp/'.$dj.'_taches_non_traites'."_".uniqid().".xlsx";
|
|
|
|
$writer = new PHPExcel_Writer_Excel2007($classeur);
|
|
$writer->save($fichier);
|
|
|
|
// echo 'Télécharger le résultat : <a href="'.$fichier.'">BORDEREAU DE TACHES</a>';
|
|
|
|
// DEBUT ENVOI DU MAIL AVEC PIECE JOINTE
|
|
require_once 'Ebenegmail.php';
|
|
|
|
$dest1 = "pcnkulikiyinka@radiant.rw";
|
|
|
|
$dest2 = "jcmunyankumburwa@radiant.rw";
|
|
$dest3 = "jjndizeye@radiant.rw";
|
|
$dest4 = "mrugenera@radiant.rw";
|
|
$dest5 = "lkane@ebene.info";
|
|
|
|
|
|
$destCC1 = "lkane@ebene.info";
|
|
$destCC2 = "kanelazeni@gmail.com";
|
|
|
|
$obejt = "RAPPORT DE TACHES NON TRAITEES A TEMPS AUX SUPERIEURS";
|
|
$body = "EBENE SOULTIOINS INFORMATIQUES";
|
|
$altbody = "VOIR PIECE JOINTE";
|
|
|
|
$pj = $fichier;
|
|
|
|
$mail->addAddress($dest1); // destinataire principal
|
|
|
|
$mail->AddCC($dest2); // Copie
|
|
$mail->AddCC($dest3);
|
|
$mail->AddCC($dest4);
|
|
$mail->AddCC($dest5);
|
|
|
|
$mail->AddBCC($destCC1, "Pour EBENE"); // Copie cachée BCC
|
|
$mail->AddBCC($destCC2, "Pour gmail");
|
|
|
|
// $mail->addAddress($destCC1); // destinataire principal
|
|
|
|
$mail->Subject = $obejt;
|
|
|
|
$mail->AltBody = $altbody;
|
|
$mail->Body=$body;
|
|
|
|
$mail->addAttachment($pj);
|
|
|
|
//send the message, check for errors
|
|
if (!$mail->send())
|
|
{
|
|
echo "Erreur mail : " . $mail->ErrorInfo;
|
|
}
|
|
else
|
|
{
|
|
echo "Message envoyé!";
|
|
}
|
|
// FIN ENVOI DU MAIL AVEC PIECE JOINTE
|
|
|
|
exit();
|
|
}
|
|
}
|
|
|
|
echo '</BR>'; echo '</BR>';
|
|
|
|
$emailtaches = new Emailtaches();
|
|
// date_default_timezone_set("Africa/Kigali");
|
|
$emailtaches->excutercron();
|
|
echo "Fin Tâche Cron";
|
|
|
|
/*
|
|
<?php
|
|
require_once 'Framework/Controleurrequete.php';
|
|
require_once 'Modele/Statistique.php';
|
|
|
|
class ControleurAjaxdetailrapportsppdf extends Controleur
|
|
{
|
|
private $detailsp;
|
|
|
|
public function __construct() {
|
|
$this->detailsp = new Statistique();
|
|
}
|
|
|
|
public function detailrapportsppdf()
|
|
{
|
|
$idPolice = $this->requete->getParametreFormulaire("idPolice");
|
|
|
|
$entete = $this->detailsp->detailrapportsppdfentete($idPolice);
|
|
|
|
$detailsps = $this->detailsp->detailrapportsppdf($idPolice);
|
|
|
|
$pdf = new FPDF();
|
|
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$pdf->SetMargins(20, 20, 20) ;
|
|
$pdf->SetFont('Arial','BU',10);
|
|
|
|
// $pdf->AliasNbPages();
|
|
$pdf->Cell(0,6,convertirc($entete['nomAssureur']." : RAPPORT SINISTRE A PRIME PAR FAMILLE"),0,1,'C',false);
|
|
|
|
$pdf->Ln(2);
|
|
|
|
$pdf->SetFont('Arial','B',7);
|
|
|
|
$pdf->Cell(0,5,convertirc('Police Name : '.$entete['souscripteur']),0,1,'L',false);
|
|
$pdf->Cell(0,5,convertirc('Police Number : '.$entete['numeroPolice']),0,1,'L',false);
|
|
$pdf->Cell(0,5,convertirc('Covered Period : '.$entete['dateEffetPolice']." To ".$entete['dateFinPolice']),0,1,'L',false);
|
|
$pdf->Cell(0,5,convertirc('Analyse date : '.$entete['dateAnalyse']),0,0,'L',false);
|
|
$pdf->Cell(0,5,'Edition : '.heureCourante(),0,1,'R',false);
|
|
|
|
$pdf->Ln(2);
|
|
|
|
$hl=5;
|
|
|
|
$pdf->Cell(60,$hl,convertirc("Principal Insured"),"1",0,'C');
|
|
$pdf->Cell(15,$hl,convertirc("Start Date"),"1",0,'C');
|
|
$pdf->Cell(10,$hl,convertirc("Days"),"1",0,'C');
|
|
$pdf->Cell(25,$hl,convertirc("An Prem."),"1",0,'C');
|
|
$pdf->Cell(25,$hl,convertirc("Acq Prem."),"1",0,'C');
|
|
$pdf->Cell(25,$hl,convertirc("Claims"),"1",0,'C');
|
|
$pdf->Cell(10,$hl,convertirc("Ratio"),"1",1,'C');
|
|
|
|
$pdf->SetFont('Arial','I',7);
|
|
foreach ($detailsps as $detailsp)
|
|
{
|
|
$pdf->Cell(60,$hl,convertirc($detailsp['adherent']),"1",0,'L');
|
|
$pdf->Cell(15,$hl,convertirc($detailsp['dateEffetAdherent']),"1",0,'C');
|
|
$pdf->Cell(10,$hl,convertirc($detailsp['duree_acq']),"1",0,'C');
|
|
$pdf->Cell(25,$hl,format_N($detailsp['primeAnnuelle']),"1",0,'C');
|
|
$pdf->Cell(25,$hl,format_N($detailsp['primeAcquise']),"1",0,'C');
|
|
$pdf->Cell(25,$hl,format_N($detailsp['sinistres']),"1",0,'C');
|
|
$pdf->Cell(10,$hl,convertirc($detailsp['rapportSp']),"1",1,'C');
|
|
}
|
|
$pdf->SetFont('Arial','BI',7);
|
|
|
|
$pdf->Cell(85,$hl,convertirc("TOTAL"),"1",0,'C');
|
|
$pdf->Cell(25,$hl,format_N($detailsp['primeAnnuelleTotal']),"1",0,'C');
|
|
$pdf->Cell(25,$hl,format_N($detailsp['primeAcquiseTotal']),"1",0,'C');
|
|
$pdf->Cell(25,$hl,format_N($detailsp['sinistresTotal']),"1",0,'C');
|
|
$pdf->Cell(10,$hl,convertirc($detailsp['rapportSpTotal']),"1",1,'C');
|
|
|
|
$fichier="Temp/TMP_CUMUL_SP_FAMILLE"."_".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 LE RESULTAT PDF </a> ';
|
|
$t_html .=' </div ';
|
|
echo $t_html;
|
|
}
|
|
}
|
|
*/ |