detailsp = new Statistique(); $this->college = new Collegepolice(); $this->statAdherent = new ControleurAjaxstatsmaladiefichetechniqueadherentpdf(); $this->police = new Police(); $this->police_societe = new Police_sodciete(); } public function index() { //////////////////////////////////////////// $idPolice = $this->requete->getParametreFormulaire("idPolice"); $idCollege = $this->requete->getParametreFormulaire("idCollege"); if( $idCollege ==""){ $idCollege = null; } $codeGcAssureur = $this->requete->getParametreFormulaire("codeGcAssureur"); $Chargement = $this->requete->getParametreFormulaire("Chargement"); $debutStat = $this->requete->getParametreDate("debutStat"); $finStat = $this->requete->getParametreDate("finStat"); $depenses = $this->requete->getParametreFormulaire("depenses","numerique"); $chargeravantapres = $this->requete->getParametreFormulaire("chargeravantapres"); $entete = $this->detailsp->detailrapportspperiodepdfentete($idPolice); $_SESSION['debutStat'] = $debutStat; $_SESSION['finStat'] = $finStat; $_SESSION['depenses'] = $depenses; $p_datedebut = $_SESSION['debutStat']; $p_datefin =$_SESSION['finStat']; $p_garant = $codeGcAssureur; $p_id = $entete['idPolice'] ; $p_limite = $_SESSION['depenses']; $p_id_college = $idCollege; $p_id_clients = null; $p_apporteur = null; if(empty($entete) && !empty($idPolice)){ $police = $this->police->getPoliceId($idPolice); $t_html ='
'; $t_html .=' '._("La période d'éffet de cette police est du ").dateLang($police['dateEffet'], $_SESSION['lang'])." au ".dateLang($police['dateFin'], $_SESSION['lang']).' '; $t_html .='
'; echo $t_html; exit(); } $tousadherents = $this->detailsp->detaildepensefamilleass($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $p_limite); if(empty($tousadherents)){ $t_html ='
'; $t_html .=' '._("Aucune donnée").' '; $t_html .='
'; echo $t_html; exit(); } // $pdfone = new FPDF_Merge(); $pdfone = new FPDF_Protection(); $pdfone->SetAuthor('EBENE SOLUTIONS INFORMATIQUES'); $userPassword = ''; $ownerPassword = null; $pdfone->SetProtection(['print'], $userPassword, $ownerPassword); foreach($tousadherents as $statsAdherent){ $famille =$statsAdherent['adherent']; $numeroAdherent =$statsAdherent['numeroAdherent']; $fichier = $this->statAdherent->statsadherent($idPolice,$idCollege,$codeGcAssureur,$Chargement,$debutStat,$finStat,$depenses,$chargeravantapres,$famille,$numeroAdherent ); $pdfone->add($fichier); } $fichierall="Temp/TMP_KIT_STATISTIQUES"."_".uniqid().".pdf"; $pdfone->Output($fichierall); $t_html ='
'; $t_html .=' '._("TELECHARGER").' '; $t_html .=' '; $t_html .=' '; $t_html .='
'; echo $t_html; } public function envoiewhatsapp() { $idPolice = $this->requete->getParametreFormulaire("idPolice"); $idCollege = $this->requete->getParametreFormulaire("idCollege"); if( $idCollege ==""){ $idCollege = null; } $codeGcAssureur = $this->requete->getParametreFormulaire("codeGcAssureur"); $Chargement = $this->requete->getParametreFormulaire("Chargement"); $debutStat = $this->requete->getParametreDate("debutStat"); $finStat = $this->requete->getParametreDate("finStat"); $depenses = $this->requete->getParametreFormulaire("depenses","numerique"); $chargeravantapres = $this->requete->getParametreFormulaire("chargeravantapres"); $entete = $this->detailsp->detailrapportspperiodepdfentete($idPolice); $p_datedebut = $_SESSION['debutStat']; $p_datefin =$_SESSION['finStat']; $p_garant = $codeGcAssureur; $p_id = $entete['idPolice'] ; $p_limite = $_SESSION['depenses']; $p_id_college = $idCollege; $p_id_clients = null; $p_apporteur = null; if(empty($entete) && !empty($idPolice)){ $police = $this->police->getPoliceId($idPolice); $t_html ='
'; $t_html .=' '._("La période d'éffet de cette police est du ").dateLang($police['dateEffet'], $_SESSION['lang'])." au ".dateLang($police['dateFin'], $_SESSION['lang']).' '; $t_html .='
'; echo $t_html; exit(); } $tousadherents = $this->detailsp->detaildepensefamilleass($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $p_limite); foreach($tousadherents as $statsAdherent){ $famille =$statsAdherent['adherent']; $numeroAdherent =$statsAdherent['numeroAdherent']; $fichier="Temp/TMP_KIT_STATISTIQUES_FAMILLE"."_".$famille.".pdf"; if(is_file($fichier)){ $fichier="https://gestionnaire.vitalis-ci.com/Temp/TMP_KIT_STATISTIQUES_FAMILLE"."_".$famille.".pdf"; $params=array( 'token' => '5ujfcrqcc9qykwdq', 'to' => '2250152706497,', 'filename' => 'TMP_KIT_STATISTIQUES.pdf', 'document' => $fichier, 'caption' => 'Statistiques famille', 'priority' => '', 'referenceId' => '', 'nocache' => '', 'msgId' => '', 'mentions' => '' ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.ultramsg.com/instance72717/messages/document", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => http_build_query($params), CURLOPT_HTTPHEADER => array( "content-type: application/x-www-form-urlencoded" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } } } $t_html ='
'; $t_html .=' '._("Traitement terminé avec succes").' '; $t_html .='
'; echo $t_html; } }