menuvue = new Menuvueutilisateur(); $this->menuvue->getMenuVue('Prescription'); $this->prescription = new Prescription(); $this->detailprescription = new Detailprescription(); $this->ged = new Ged(); $this->bonpec = new Bonpec(); $this->acte = new Detailtarifacte(); $this->garantie = new Garantiesbaremepriseencharge(); $this->ouinonrenouvelable = (new Ouinon())->getListe(); $this->feuille = new Feuillemaladie(); $codePrestataire = $_SESSION['p_codePrestataire_C']; } public function index($msgErreur=null) { $contestation = $this->feuille->getContestationFeuille(); if($contestation == "1"){ $this->rediriger("Feuillemaladie"); } $message = ""; $nouveau_fichier = "Rien"; if(!empty($_POST)) { define('TARGET', $_SESSION['p_cheminGed']); // Repertoire cible define('MAX_SIZE', 10000000); // Taille max en octets du fichier $tabExt = array("avi", "bmp", "doc", "docx", "gif", "jpeg", "jpg", "jpe", "mkv", "mp3", "mp4", "pdf", "png", "pps", "xls", "xlsx", "wav"); // Extensions autorisees // Variables $extension = ''; if( !is_dir(TARGET) ) { if( !mkdir(TARGET, 0755) ) { $message = 'Erreur : le répertoire cible ne peut-être créé ! Vérifiez que vous diposiez des droits suffisants pour le faire ou créez le manuellement !'; } } // On verifie si le champ est rempli if( !empty($_FILES['fichier_upload']['name']) ) { // Recuperation de l'extension du fichier $extension = pathinfo($_FILES['fichier_upload']['name'], PATHINFO_EXTENSION); // On verifie l'extension du fichier if(in_array(strtolower($extension), $tabExt)) { $message = $_FILES['fichier_upload']['size']; // On verifie les dimensions et taille du fichier if($_FILES['fichier_upload']['size'] <= MAX_SIZE) { $taille = $_FILES['fichier_upload']['size']; // Parcours du tableau d'erreurs if(isset($_FILES['fichier_upload']['error']) && UPLOAD_ERR_OK === $_FILES['fichier_upload']['error']) { // On renomme le fichier $nomOrigine = $_FILES['fichier_upload']['name']; $nouveau_fichier = dateJourSql()."_".uniqid().".".$extension; // Si c'est OK, on teste l'upload if(move_uploaded_file($_FILES['fichier_upload']['tmp_name'], TARGET.$nouveau_fichier)) { $message = 'Chargé avec succès / Uploaded successfully'; // on va envoyer dans la base de données $this->ged->enregistrergedprescription($nomOrigine, $nouveau_fichier, $taille); } else { // Sinon on affiche une erreur systeme $message = 'Problème lors du chargement !'; } } else { $message = 'Une erreur interne a empêché le chargement'; } } else { $message .= $_FILES['fichier_upload']['size']." Erreur dans les dimensions du fichier !"; // $message = 'Erreur dans les dimensions du fichier !'; } } else { // Sinon on affiche une erreur pour l'extension $message = 'Extension du fichier est incorrecte !'; } } else { // Sinon on affiche une erreur pour le champ vide $message = 'Veuillez sélectionner un fichier SVP! / Please select a file!'; } // fin upload } $msgErreurGed = $message; $codePrestataire = $_SESSION['p_codePrestataire_C']; $codeTypeBon = "ORDO"; $nbBonsOrd = $this->bonpec->getNbBonPrestataireDisponible($codePrestataire, $codeTypeBon); $codeGestionBon = $this->bonpec->getCodeGestionBon($codeTypeBon); $typeGestionbon = $this->bonpec->getGestionBon($codeGestionBon); $numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C']; $numeroPrescription = $_SESSION['p_numeroPrescription_C']; $codeActe = "PH"; $codeGarantie = "PHA"; $idBeneficiaire = $_SESSION['p_idBeneficiaire_C']; $datePrestation = $this->prescription->getDateSurvenance($numeroFeuilleMaladie); //date('Y-m-d'); $_SESSION['datePrestation'] = $datePrestation; $this->garantie->getsourcebaremenew($idBeneficiaire, $codeActe, $datePrestation); $prescription = $this->prescription->getprescription($numeroPrescription); //highlight_string(""); $this->detailprescription->recapmedicament($numeroPrescription); $detailprescriptions = $this->detailprescription->getdetailprescription($numeroPrescription); $montantTotalMedicament = $this->prescription->getParamMontantTotalMedicament(); $codeReponseEntentePrealable = $this->prescription->getcodeReponseEntentePrealable_pha(); $medicaments = array(); $tMacte = $_SESSION['p_bareme']['bareme_ticketModerateur'];//$this->prescription->ticketModerateurActeBeneficiaire($codeActe); $tmDerogation = $this->acte->getTmDerogation($codeGarantie); $tmAffection = $this->acte->getTmAffection(); //var_dump($tmAffection); if($tmAffection == "1000"){ if($tmDerogation == "1000"){ $tauxCouverture = (100-$tMacte)."%"; $tm = $tMacte; }else{ $tauxCouverture = (100-$tmDerogation)."%"; $tm = $tmDerogation; } }else{ $tauxCouverture = (100-$tmAffection)."%"; $tm = $tmAffection; } $_SESSION['p_tm_C'] = $tm; $statut = $this->garantie->getstatutacte($idBeneficiaire,$codeActe,$codeGarantie); $motif = $this->garantie->getlibellemotifdepassement($statut); //var_dump($tm); unset($_FILES['fichier_upload']); $geds = $this->ged->getgedpharmacie(); //fn_enteteententeprealable_type(); $codeTypeEntentePrealable = "PHA"; $numeroEnteteEntentePrealable = $this->acte->getNumeroEnteteEntentePrealable($codeTypeEntentePrealable); $this->genererVue(array('prescription' => $prescription, 'detailprescriptions' => $detailprescriptions, 'geds' => $geds, 'msgErreurGed' => $msgErreurGed, 'nbBonsOrd' => $nbBonsOrd, 'tauxCouverture' => $tauxCouverture, 'codeGestionBon' => $codeGestionBon, 'typeGestionbon' => $typeGestionbon, 'medicaments' => $medicaments, 'montantTotalMedicament' => $montantTotalMedicament, 'codeReponseEntentePrealable' => $codeReponseEntentePrealable, 'statut' => $statut, 'motif' => $motif, 'numeroEnteteEntentePrealable' => $numeroEnteteEntentePrealable, 'ouinonrenouvelable' => $this->ouinonrenouvelable)); } }