Пример #1
0
 function Valide($valid = '')
 {
     global $errs;
     if ($valid) {
         $param['cw'] = "WHERE idActeur='" . $_POST['idActeur'] . "'";
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "authCodeAcces", $param, "ResultQuery");
     } else {
         $param['cw'] = "WHERE password='******'codeacces'] . "'";
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "authCodeAcces", $param, "ResultQuery");
     }
     //print affTab ( $res['INDIC_SVC'] ) ;
     if ($res['password'][0] == stripslashes($_POST['codeacces']) or $res['idActeur'][0] == $_POST['idActeur'] and $res['idActeur'][0]) {
         global $pi;
         $pi->addPostIt('Information', '<br>Pensez à déverrouiller vos formulaires (avec la petite flèche de retour tout en bas de chaque formulaire) afin de pouvoir les modifier. Merci.');
         $this->informations['type'] = "CodeAcces";
         $this->informations['nom'] = "";
         $this->informations['prenom'] = "";
         $this->informations['pseudo'] = $res['nomActeur'][0];
         $this->informations['mail'] = "";
         $this->informations['iduser'] = $res['idActeur'][0];
         $param['cw'] = "WHERE idacteur='" . $res['idActeur'][0] . "'";
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "getGroupesUtilisateur", $param, "ResultQuery");
         //print affTab ( $res['INDIC_SVC'] ) ;
         $groupes = $res['idgroupe'][0];
         for ($i = 1; isset($res['idutilisateur'][$i]); $i++) {
             $groupes .= "," . $res['idgroupe'][$i];
         }
         $this->informations['idgroupe'] = $groupes;
         return 1;
     }
 }
Пример #2
0
 function afficherNote($ids, $div = 'note', $style = '')
 {
     $req = new clResultQuery();
     $param['cw'] = "WHERE ids='{$ids}'";
     $param['table'] = 'notes';
     $res = $req->Execute("Fichier", "getGenXHAM", $param, "ResultQuery");
     //eko ( $res ) ;
     if ($res['INDIC_SVC'][2] > 0) {
         $message = $res['note'][0];
     }
     $mod = new ModeliXe("note.html");
     $mod->SetModeliXe();
     $mod->MxText("id", $div);
     if (!$this->droit) {
         $mod->MxBloc('droit', 'replace', '<div id="text' . $div . '">');
         $mod->MxBloc('droitJ', 'delete');
     } else {
         $mod->MxText("droit.id", $div);
         $mod->MxText("droitJ.id", $div);
         $mod->MxText("droitJ.navi", $this->xham->genNavi('ajax', 'majNote', $ids));
     }
     $mod->MxText("contenu1", nl2br($message));
     $mod->MxText("contenu2", $message);
     //$mod -> MxText ( "navi", $this->xham->genNavi ( 'ajax', 'majNote', $ids ) ) ;
     //$mod -> MxHidden ( "hidden1", "navi=".$session -> genNavi ( $session->getNavi(0), $session->getNavi(1), $session->getNavi(2) ) ) ;
     return $mod->MxWrite("1");
 }
Пример #3
0
 function genItem($nom, $page, $idmenu)
 {
     global $session;
     global $options;
     if ($session->getNavi(0) == $page) {
         $active = "id=\"active\"";
     } else {
         $active = '';
     }
     $param['cw'] = "WHERE type='item' AND etat=1 AND menuparent='{$idmenu}' AND idapplication=" . IDAPPLICATION . " ORDER BY rang";
     $req = new clResultQuery();
     $res = $req->Execute("Fichier", "getMenus", $param, "ResultQuery");
     //eko ( $res[INDIC_SVC] ) ;
     if ($res['INDIC_SVC'][2]) {
         $this->menu++;
         if ($this->menu == 10) {
             $this->menu++;
         }
         $af = "\t<dl id=\"menus" . $idmenu . "\"><dt {$active} onmouseover=\"javascript:montre('s" . $this->menu . "');\"><a>{$nom}</a></dt>\n";
         $af .= "\t<dd id=\"s" . $this->menu . "\"><ul>\n";
         for ($i = 0; isset($res['idmenu'][$i]); $i++) {
             if (!$res['noption'][$i]) {
                 $af .= $this->genMiniItem($page, $res['libelle'][$i], $res['cle'][$i], $res['droit'][$i]);
             } elseif ($options->getOption($res['noption'][$i]) == $res['valeur'][$i]) {
                 $af .= $this->genMiniItem($page, $res['libelle'][$i], $res['cle'][$i], $res['droit'][$i]);
             }
         }
         $af .= "\t</ul></dd></dl>\n";
         return $af;
     } elseif ($nom == "Accueil") {
         return "\t<dl id=\"menus" . $idmenu . "\"><dt {$active} onmouseover=\"javascript:montre('s10');\" onclick=\"document.location='" . URLNAVI . $session->genNavi($page) . "'\"><a href=\"" . URLNAVI . $session->genNavi($page) . "\">{$nom}</a></dt>" . $this->menuAuth . "</dl>\n";
     } else {
         return "\t<dl id=\"menus" . $idmenu . "\"><dt {$active} onmouseover=\"javascript:montre();\" onclick=\"document.location='" . URLNAVI . $session->genNavi($page) . "'\" ><a href=\"" . URLNAVI . $session->genNavi($page) . "\">{$nom}</a></dt><dd style=\"display:none;\">Vide</dd></dl>\n";
     }
 }
Пример #4
0
function Init_NetForce_Data_Base($formx)
{
    global $session;
    $id_instance = $formx->getIdInstance();
    //eko ($id_instance);
    $idu = $formx->getVar('ids');
    //eko ($idu);
    $idpatient = $session->getNavi(2);
    //eko ($idpatient);
    $req = new clResultQuery();
    $param = array();
    $param['cw'] = "where idpatient='" . $idpatient . "'";
    $param['table'] = PPRESENTS;
    $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery");
    //$idpatient = $res['idpatient'][0] ;
    //eko ( $res ) ;
    $param['idu'] = $idu;
    $res = $req->Execute("Fichier", "netForceDataBase_getAllFormulaire_ids", $param, "ResultQuery");
    eko($res[INDIC_SVC][15]);
    $liste = array();
    for ($i = 0; $i <= $res[INDIC_SVC][2]; $i++) {
        $liste[utf8_encode($res["id_instance"][$i])] = $res["dt_creation"][$i] . " --- " . $res["libelle"][$i];
    }
    //header ( 'Location:index.php?navi=TGlzdGVfUHJlc2VudHM=' ) ;
    eko($liste);
    return $liste;
}
Пример #5
0
 function Valide($valid = '')
 {
     global $errs;
     if ($valid) {
         $param['cw'] = "WHERE idutilisateur=" . $_POST['iduser'];
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "getUtilisateurs", $param, "ResultQuery");
     } else {
         $param['password'] = $_POST['password'];
         $param['uid'] = $_POST['login'];
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "authUtilisateur", $param, "ResultQuery");
     }
     if ($res['uid'][0] == $_POST['login'] or $res['idutilisateur'][0] == $_POST['iduser'] and $_POST['iduser']) {
         $this->informations['password'] = XhamTools::chiffre($_POST['password']);
         $this->informations['type'] = "MySQLInt";
         $this->informations['nom'] = $res['nom'][0];
         $this->informations['prenom'] = $res['prenom'][0];
         $this->informations['pseudo'] = $res['uid'][0];
         $this->informations['mail'] = $res['mail'][0];
         $this->informations['iduser'] = $res['uid'][0];
         $param[cw] = "WHERE idutilisateur='" . $res['idutilisateur'][0] . "'";
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "getGroupesUtilisateur", $param, "ResultQuery");
         $groupes = $res['idgroupe'][0];
         for ($i = 1; isset($res['idutilisateur'][$i]); $i++) {
             $groupes .= "," . $res['idgroupe'][$i];
         }
         $this->informations['idgroupe'] = $groupes;
         return 1;
     }
 }
Пример #6
0
function Formulaire_Radio_MAJ_Table($formx)
{
    $id_instance = $formx->getIdInstance();
    $idu = $formx->getVar('ids');
    //eko ($id_instance);
    //eko ($idu);
    $req = new clResultQuery();
    $param = array();
    $param['cw'] = "*";
    $param['idu'] = $idu;
    $res = $req->Execute("Fichier", "getInfoPatientFromIDU", $param, "ResultQuery");
    $idpatient = $res['idpatient'][0];
    //eko($res);
    $param = array();
    $param['etat'] = "a";
    $param['idpatient'] = $idpatient;
    $param['idapplication'] = IDAPPLICATION;
    $param['id_instance'] = $id_instance;
    //$param['dt_creation'] = date("Y")."-".date("m")."-".date("d")." ".date("H").":".date("i").":00";
    list($jour, $mois, $annee) = explode("-", utf8_decode($formx->getFormVar('Val_F_RADIO_Date')));
    $param['dt_creation'] = $annee . "-" . $mois . "-" . $jour . " " . utf8_decode($formx->getFormVar('Val_F_RADIO_Heure')) . ":" . utf8_decode($formx->getFormVar('Val_F_RADIO_Minute')) . ":00";
    //eko ( utf8_decode($formx->getFormVar('Val_F_RADIO_Heure'))  );
    //eko ( utf8_decode($formx->getFormVar('Val_F_RADIO_Minute')) );
    //eko ( utf8_decode($formx->getFormVar('Val_F_RADIO_Date')) );
    //eko ( $annee."-".$mois."-".$jour." ".utf8_decode($formx->getFormVar('Val_F_RADIO_Heure')).":".utf8_decode($formx->getFormVar('Val_F_RADIO_Minute')).":00");
    //eko ($param);
    $req = new clRequete(BDD, "radios", $param);
    $res = $req->addRecord();
    //$res = $req -> Execute ( "Fichier", "putFormulaireRadioData", $param, "ResultQuery" ) ;
    //eko($res);
    return "";
}
Пример #7
0
 function Valide($valid = '')
 {
     global $errs;
     // Alain : Tu dois remplacer "fonctionSSO" par le nom de ta fonction.
     $param['cw'] = "WHERE uid='" . fonctionSSO() . "'";
     $req = new clResultQuery();
     $res = $req->Execute("Fichier", "getUtilisateurs", $param, "ResultQuery");
     // On récupère les informations de l'utilisateur.
     if ($res['INDIC_SVC'][2]) {
         $this->informations['type'] = "SSOBrignoles";
         $this->informations['nom'] = $res['nom'][0];
         $this->informations['prenom'] = $res['prenom'][0];
         $this->informations['pseudo'] = $res['uid'][0];
         $this->informations['mail'] = $res['mail'][0];
         $this->informations['iduser'] = $res['uid'][0];
         $param[cw] = "WHERE idutilisateur='" . $res['idutilisateur'][0] . "'";
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "getGroupesUtilisateur", $param, "ResultQuery");
         $groupes = $res['idgroupe'][0];
         for ($i = 1; isset($res['idutilisateur'][$i]); $i++) {
             $groupes .= "," . $res['idgroupe'][$i];
         }
         $this->informations['idgroupe'] = $groupes;
         return 1;
     }
 }
Пример #8
0
function getIdDomaine($idApplication)
{
    $req = new clResultQuery();
    $param[cw] = "";
    $res = $req->Execute("Fichier", "CCAM_get1Domaine", $param, "ResultQuery");
    //newfct(gen_affiche_tableau,$res[INDIC_SVC]);
    $idDomaine = $res[domaine][0];
    return $idDomaine;
}
Пример #9
0
function GetUF($formx)
{
    $uf = $formx->getFormVar('Val_IDENT_UF');
    $req = new clResultQuery();
    $param = array();
    $param['liste'] = $uf;
    $res = $req->Execute("Fichier", "struct", $param, "ResultQuery");
    return utf8_encode($res['LIBSER'][0]);
}
Пример #10
0
 function genAffichage()
 {
     global $session;
     global $stopAffichage;
     $stopAffichage = 1;
     $idpass = $session->getNavi(2);
     $req = new clResultQuery();
     // On vérifie que l'entrée n'existe pas déjà dans la table des patients présents.
     $param2['table'] = PPRESENTS;
     $param2['cw'] = "WHERE nsej='" . $idpass . "'";
     $ras = $req->Execute("Fichier", "getPatients", $param2, "ResultQuery");
     // On vérifie que l'entrée n'existe pas déjà dans la table des patients sortis.
     $param3['table'] = PSORTIS;
     $param3['cw'] = "WHERE nsej='" . $idpass . "'";
     $rus = $req->Execute("Fichier", "getPatients", $param3, "ResultQuery");
     if ($ras['INDIC_SVC'][2]) {
         $type = "Presents";
         $table = PPRESENTS;
         $idpatient = $ras['idpatient'][0];
         $ok = 1;
     } elseif ($rus['INDIC_SVC'][2]) {
         $type = "Sortis";
         $table = PSORTIS;
         $idpatient = $rus['idpatient'][0];
         $ok = 1;
     }
     if ($ok) {
         $patient = new clFichePatient($type, $table, $idpatient, 1);
         switch ($session->getNavi(1)) {
             case 'EtatCivil':
                 $this->af .= $patient->EtatCivil();
                 break;
             case 'HistoriquePassage':
                 $this->af .= $patient->Historique();
                 break;
             case 'HistoriqueDocuments':
                 $this->af .= $patient->HistoriqueDocs();
                 break;
             case 'Messages':
                 $this->af .= $patient->viewMessages();
                 break;
             case 'DocumentsEdites':
                 $this->af .= $patient->Documents();
                 break;
             case 'DiagnosticsActes':
                 $this->af .= $patient->getActesDiagnostics();
                 break;
             case 'Informations':
                 $this->af .= $patient->Informations();
                 break;
             default:
                 $stopAffichage = 0;
                 break;
         }
     }
 }
Пример #11
0
 static function getVar($var)
 {
     if (!defined('TABLEGLOB')) {
         define('TABLEGLOB', 'variables');
     }
     $param['table'] = TABLEGLOB;
     $param['cw'] = "WHERE nom='{$var}' AND idapplication = " . IDAPPLICATION;
     $req = new clResultQuery();
     $res = $req->Execute("Fichier", "getGenXHAM", $param, "ResultQuery");
     if ($res['INDIC_SVC'][2] == 0) {
         return false;
     }
     return $res['valeur'][0];
 }
Пример #12
0
 function __construct()
 {
     global $session;
     global $options;
     global $errs;
     global $pi;
     if (isset($_REQUEST['reloadAuto'])) {
         //	header("Cache-Control: no-cache, must-revalidate");
         header("Location:index.php?navi=" . $session->genNaviFull());
     }
     $aucunAffichage = 0;
     $pi->addMove("miniMessagerie");
     $param['cw'] = "WHERE cletotale='" . addslashes(stripslashes($session->getNavi(0) . "|" . $session->getNavi(1))) . "' AND idapplication=" . IDAPPLICATION;
     $req = new clResultQuery();
     $res = $req->Execute("Fichier", "getMenus", $param, "ResultQuery");
     if (!$res['INDIC_SVC'][2]) {
         $param['cw'] = "WHERE cletotale='" . addslashes(stripslashes($session->getNavi(0))) . "' AND idapplication=" . IDAPPLICATION;
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "getMenus", $param, "ResultQuery");
     }
     if ($res['classe'][0]) {
         $code = '$classe = new ' . $res['classe'][0] . ' ( ' . $res['arguments'][0] . ' ) ;';
         $code .= '$this->af .= $classe->getAffichage ( ) ;';
     } elseif ($res['code'][0]) {
         $code = $res['code'][0];
     } else {
         $aucunAffichage = 1;
         $this->af .= "Aucun affichage trouvé pour la page " . $session->getNaviFull();
         $errs->addErreur("clNavigation : Aucun affichage trouvé pour la page " . $session->getNaviFull());
     }
     if (!$res['noption'][0] or $options->getOption($res['noption'][0]) == $res['valeur'][0]) {
         if ($session->getDroit($res['droit'][0], "r")) {
             eval($code);
             if ($session->getUid() == "dborel") {
                 global $stopAffichage;
                 if (!$stopAffichage) {
                     //$this->af .= file_get_contents ( "../pifgadget/fabien.html" ) ;
                     //$this->af .= file_get_contents ( "../pifgadget/cyril/cyril.html" ) ;
                 }
             }
         } else {
             if (!$aucunAffichage) {
                 $this->af .= "Vos droits ne vous permettent pas d'afficher la page demandée (" . $session->getNaviFull() . ")";
             }
         }
     } else {
         $this->af .= "Cette partie a été désactivée, vous ne pouvez pas l'afficher.";
     }
 }
Пример #13
0
 function getPreference($libelle, $idUser = '')
 {
     global $session;
     if ($idUser) {
         $param['cw'] = "WHERE idUser='******' AND libellePreference='{$libelle}'";
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "getPreferences", $param, "ResultQuery");
         if ($res['INDIC_SVC'][2]) {
             return $res['valeurPreference'][0];
         }
     } else {
         if (isset($this->preferences[$libelle])) {
             return $this->preferences[$libelle];
         }
     }
 }
Пример #14
0
function GetTimeHeureExamen($formx)
{
    global $session;
    $id_instance = $formx->getIdInstance();
    $idu = $formx->getVar('ids');
    $idpatient = $session->getNavi(2);
    $req = new clResultQuery();
    $param = array();
    $param['cw'] = "where idpatient='" . $idpatient . "'";
    $param['table'] = PPRESENTS;
    $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery");
    //$idpatient = $res['idpatient'][0] ;
    //eko ( $res ) ;
    $posted = explode(" ", $res['dt_examen'][0]);
    return $posted[1];
}
Пример #15
0
 function mbtv2ToHxml()
 {
     $req = new clResultQuery();
     $param['cw'] = "where etat='P' order by ID";
     // $this->filtre ;
     $res = $req->Execute("Fichier", "CCAM_getActesBAL", $param, "ResultQuery");
     $this->af .= "<h4>Génération des fichiers HprimXML</h4>";
     if ($res['INDIC_SVC'][2] == 0) {
         $this->af .= "Aucun acte dans la BAL MySQL.";
     }
     for ($i = 0; isset($res['ID'][$i]); $i++) {
         $this->hxmlCreate($res, $i);
     }
     //eko ( $res['INDIC_SVC'] ) ;
     $this->launchFTP();
     $this->af .= "<br/><br/>";
 }
Пример #16
0
function getDateE2($formx)
{
    global $tool;
    $idu = $formx->getVar('ids');
    $req = new clResultQuery();
    $param = array();
    $param['cw'] = "dt_naissance";
    $param['idu'] = $idu;
    $res = $req->Execute("Fichier", "getInfoPatientFromIDU", $param, "ResultQuery");
    $DateNPat = $res['dt_naissance'][0];
    //eko($DateNPat);
    // Calcul sur les différentes dates.
    $age = new clDate($DateNPat);
    $dateSimple = $age->getDate("d-m-Y");
    $dateComple = $age->getDateText();
    $duree = new clDuree();
    return "" . utf8_encode($dateComple) . "";
}
Пример #17
0
function Formulaire_Radio_MAJ_Table($formx)
{
    $id_instance = $formx->getIdInstance();
    $idu = $formx->getVar('ids');
    //eko ($id_instance);
    //eko ($idu);
    $req = new clResultQuery();
    $param = array();
    $param['cw'] = "*";
    $param['idu'] = $idu;
    $res = $req->Execute("Fichier", "getInfoPatientFromIDU", $param, "ResultQuery");
    $idpatient = $res['idpatient'][0];
    //eko($res);
    $param = array();
    $param['etat'] = "a";
    $param['idpatient'] = $idpatient;
    $param['idapplication'] = IDAPPLICATION;
    $param['id_instance'] = $id_instance;
    //$param['dt_creation'] = date("Y")."-".date("m")."-".date("d")." ".date("H").":".date("i").":00";
    list($jour, $mois, $annee) = explode("-", utf8_decode($formx->getFormVar('Val_F_RADIO_Date')));
    $param['dt_creation'] = $annee . "-" . $mois . "-" . $jour . " " . utf8_decode($formx->getFormVar('Val_F_RADIO_Heure')) . ":" . utf8_decode($formx->getFormVar('Val_F_RADIO_Minute')) . ":00";
    //eko ( utf8_decode($formx->getFormVar('Val_F_RADIO_Heure'))  );
    //eko ( utf8_decode($formx->getFormVar('Val_F_RADIO_Minute')) );
    //eko ( utf8_decode($formx->getFormVar('Val_F_RADIO_Date')) );
    //eko ( $annee."-".$mois."-".$jour." ".utf8_decode($formx->getFormVar('Val_F_RADIO_Heure')).":".utf8_decode($formx->getFormVar('Val_F_RADIO_Minute')).":00");
    //eko ($param);
    $req = new clRequete(BDD, "radios", $param);
    $res = $req->addRecord();
    unset($param);
    global $options;
    if ($options->getOption('EnquetePoumonsFace') and $formx->getFormVar('Val_F_RADIO_Centre') == "Poumons Face") {
        $idradio = $res['cur_id'];
        $param['idradio'] = $idradio;
        $param['enquete'] = 'PoumonsFace';
        $param['indication'] = $formx->getFormVar('Val_F_RADIO_Indication');
        $param['recherche'] = $formx->getFormVar('Val_F_RADIO_Recherche');
        $req = new clRequete(BDD, "radios_enquetes", $param);
        $res = $req->addRecord();
    }
    //$res = $req -> Execute ( "Fichier", "putFormulaireRadioData", $param, "ResultQuery" ) ;
    //eko($res);
    return "";
}
Пример #18
0
 function genListePatientsSortis()
 {
     if ($_REQUEST['nom'] or $_REQUEST['prenom']) {
         //$filtre = "WHERE nom LIKE '".$_POST['nom']."%' AND prenom LIKE '".$_POST['prenom']."%' AND sexe='".$_POST['sexe']."'" ;
         $filtre = "WHERE nom LIKE '" . $_POST['nom'] . "%' AND prenom LIKE '" . $_POST['prenom'] . "%'";
         $req = new clResultQuery();
         $param['table'] = "patients_sortis";
         $param['cw'] = $filtre;
         $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery");
         $this->genListe($res);
         if ($res['INDIC_SVC'][2] > 1) {
             $this->af .= "<br><i>" . $res['INDIC_SVC'][2] . " résultats en " . sprintf('%.2f', $res['INDIC_SVC']['temps']) . " sec</i><br>";
         } else {
             $this->af .= "<br><i>" . $res['INDIC_SVC'][2] . " résultat en " . sprintf('%.2f', $res['INDIC_SVC']['temps']) . " sec</i><br>";
         }
         //print affTab ( $res['INDIC_SVC'] ) ;
     } else {
         $this->af = "<font color=red>Seulement le nom et le prénom sont utilisés dans la\nrecherche.</font>\n<br/>Vous devez entrer quelques lettres du nom ou du prénom pour voir les résultats.";
     }
 }
Пример #19
0
 function genAffichage()
 {
     global $session;
     $mod = new ModeliXe("Messagerie.mxt");
     $mod->SetModeliXe();
     $req = new clResultQuery();
     $param['cw'] = "WHERE pour='TOUS' AND statut NOT LIKE '%" . $session->getUid() . "%'";
     $res = $req->Execute("Fichier", "getMessagerie", $param, "ResultQuery");
     $param['cw'] = "WHERE pour='" . $session->getUid() . "' AND statut NOT LIKE '%" . $session->getUid() . "%'";
     $resPerso = $req->Execute("Fichier", "getMessagerie", $param, "ResultQuery");
     $mod->MxText("messages", $res['INDIC_SVC'][2]);
     $mod->MxText("messagesPerso", $resPerso['INDIC_SVC'][2]);
     if (!isset($_SESSION['showMessagerie']) or !$_SESSION['showMessagerie']) {
         $mod->MxImage("imgAffichage", URLIMGAFF, "Afficher la messagerie XHAM");
         $mod->MxUrl("lienAffichage", URLNAVI . $session->genNaviFull() . "&showMessagerie=1");
     } else {
         $mod->MxImage("imgAffichage", URLIMGMAS, "Masquer la messagerie XHAM");
         $mod->MxUrl("lienAffichage", URLNAVI . $session->genNaviFull() . "&showMessagerie=0");
         $this->genMessagerie();
     }
     $mod->MxImage("imgFermer", URLIMG . "close2.png", "Masquer");
     $this->af .= $mod->MxWrite("1");
 }
Пример #20
0
function getPatientMineur($formx)
{
    global $tool;
    $idu = $formx->getVar('ids');
    $req = new clResultQuery();
    $param = array();
    $param['cw'] = "dt_naissance";
    $param['idu'] = $idu;
    $res = $req->Execute("Fichier", "getInfoPatientFromIDU", $param, "ResultQuery");
    $DateNPat = $res['dt_naissance'][0];
    //eko($DateNPat);
    // Calcul sur les différentes dates.
    $age = new clDate($DateNPat);
    $dateSimple = $age->getDate("d-m-Y");
    $dateComple = $age->getDateText();
    $duree = new clDuree();
    $duree->getAgePrecis($age->getTimestamp());
    if ($duree->getYears() < 18) {
        return "mineur";
    } else {
        return "majeur";
    }
}
Пример #21
0
 function getCodeRecoursFirst()
 {
     $param[nomliste] = addslashes(stripslashes($this->getCategorieRecours()));
     $param[nomitem] = addslashes(stripslashes($this->getRecours()));
     $req = new clResultQuery();
     $res = $req->Execute("Fichier", "getCodeRecours", $param, "ResultQuery");
     //newfct ( gen_affiche_tableau, $res[INDIC_SVC] ) ;
     return $res[code][0];
 }
Пример #22
0
 function getAllFormxCw($cw = " 1=1 ")
 {
     $req = new clResultQuery();
     $param['table'] = $this->session->tableInstances;
     $param['cw'] = $cw;
     $param['ids'] = $this->ids;
     $res = $req->Execute("Fichier", "FX_getInstancesFromIds", $param, "ResultQuery");
     return $res;
 }
Пример #23
0
 function launchAES()
 {
     global $options;
     $mails = '';
     $codes = '';
     $contenu = '';
     $config[type] = "MySQL";
     $config[host] = MYSQL_HOST;
     $config[login] = MYSQL_USER;
     $config[password] = MYSQL_PASS;
     $config[db] = BDD;
     $date = new clDate();
     $date_naissance = new clDate();
     $date_admission = new clDate();
     //$aujourdhui =getdate();
     //$date ->getHours ( )
     $date1 = $date->getDate("Y-m-d");
     // aujourdhui J
     $date->addDays("-1");
     $date2 = $date->getDate("Y-m-d");
     // date J-1
     $heure = $date->getDate("H:i:00");
     $date->addHours("-8");
     $hour1 = $date->getDate("H:i:00");
     $date->addHours("8");
     $date->addHours("-16");
     $hour2 = $date->getDate("H:i:00");
     $requete = new clResultQuery();
     $listeGen = new clListesGenerales("recup");
     $listeMails = $listeGen->getListeItems("Mails Alertes AES", "1", '', '', "1");
     $listeCodesR = $listeGen->getListeItems("Alertes AES - Code Recours", "1", '', '', "1");
     $listeCodesD = $listeGen->getListeItems("Alertes AES - Code Diagnostics", "1", '', '', "1");
     while (list($key, $val) = each($listeMails)) {
         if ($mails) {
             $virgule = ',';
         } else {
             $virgule = '';
         }
         if ($val != "--") {
             $mails .= $virgule . $val;
         }
     }
     //print "Mails : $mails" ;
     while (list($key, $val) = each($listeCodesR)) {
         if ($codes) {
             $or = ' OR ';
         } else {
             $or = '';
         }
         if ($val != "--") {
             $codes .= $or . "recours_code='" . $val . "'";
         }
     }
     while (list($key, $val) = each($listeCodesD)) {
         if ($codes) {
             $or = ' OR ';
         } else {
             $or = '';
         }
         if ($val != "--") {
             $codes .= $or . "diagnostic_code='" . $val . "'";
         }
     }
     if ($heure >= "15:00:00") {
         $req2 = "SELECT * FROM patients_sortis WHERE ({$codes}) AND dt_sortie BETWEEN '{$date1} {$hour1}' AND '{$date1} {$heure}'";
         $res1 = $requete->Execute("Query", $req2, $config);
     } else {
         $req2 = "SELECT * FROM patients_sortis WHERE ({$codes}) AND dt_sortie BETWEEN '{$date2} {$hour2}' AND '{$date1} {$heure}'";
         $res1 = $requete->Execute("Query", $req2, $config);
     }
     $contenu1 = $contenu1 . "\n";
     if ($res1[idpatient] > 0) {
         if ($options->getOption("typeMail") == "HTML") {
             $contenu1 = "<table align=\"center\" border =1>\n\t\t\t       <tr bgcolor=\"Silver\">\n\t\t\t       <th colspan=\"5\">Informations AES (Patients sortis)</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr bgcolor=\"Silver\">\n\t\t\t\t<th>Nom</th>\n\t\t\t\t<th>Prénom</th>\n\t\t\t\t<th>Né(e) le</th>\n\t\t\t\t<th>Admission le</th>\n\t\t\t\t<th>Médecin Urg.</th>\n\t\t\t\t</tr>";
         } else {
             $contenu1 = "Informations AES (Patients sortis)\tNom\tPrénom\tNé(e) le\tAdmission le\tMédecin Urg.\n";
         }
         for ($i = 0; isset($res1[idpatient][$i]); ++$i) {
             // Affectation de resultats dans le tableau entrants
             $date_naissance->setDate($res1[dt_naissance][$i]);
             $date_admission->setDate($res1[dt_admission][$i]);
             if ($options->getOption("typeMail") == "HTML") {
                 $contenu1 .= "<tr>";
                 $contenu1 .= "<td>" . $res1[nom][$i] . "</td>";
                 $contenu1 .= "<td>" . $res1[prenom][$i] . "</td>";
                 $contenu1 .= "<td>" . $date_naissance->getDate('d-m-Y H:i:s') . "</td>";
                 $contenu1 .= "<td>" . $date_admission->getDate('d-m-Y H:i:s') . "</td>";
                 $contenu1 .= "<td>Dr " . $res1[medecin_urgences][$i] . "</td>";
                 $contenu1 .= "</tr>";
                 //Ecriture du log
             } else {
                 $contenu1 .= $res1[nom][$i] . "\t" . $res1[prenom][$i] . "\t";
                 $contenu1 .= $date_naissance->getDate('d-m-Y H:i:s') . "\t";
                 $contenu1 .= $date_admission->getDate('d-m-Y H:i:s') . "\t";
                 $contenu1 .= "Dr " . $res1[medecin_urgences][$i] . '\\n';
             }
             $text_log1 .= $text_log1 . "\n";
             $text_log1 .= $res1[nom][$i] . ";";
             $text_log1 .= $res1[prenom][$i] . ";";
             $text_log1 .= $res1[dt_naissance][$i] . ";";
             $text_log1 .= $res1[dt_admission][$i] . ";";
             $text_log1 .= $res1[medecin_urgences][$i] . ";";
             $text_log1 .= " patients sortis ";
             $fp = fopen("fichier_log.txt", "a");
             fputs($fp, $text_log1);
         }
         if ($options->getOption("typeMail") == "HTML") {
             $contenu1 .= "</table>";
         }
         eko($contenu1);
     } else {
         $verif2 = 1;
         eko("Aucun enregistrement correspondant à la requête de patients sortis.");
         $contenu1 .= "Aucun enregistrement correspondant à la requête de patients sortis.";
     }
     // Paramètre de mail
     $reply = Erreurs_MailApp;
     if ($options->getOption("typeMail") == "HTML") {
         $comment = "<hr><i>Ce message a été envoyé automatiquement par un serveur !</i> ";
     } else {
         $comment = "\n\nCe message a été envoyé automatiquement par un serveur !";
     }
     $contenu2 = $contenu;
     $contenu2 .= $contenu1;
     $contenu2 .= $comment;
     //$contenu2 .= "<br>req1 : $req<br>" ;
     //$contenu2 .= "req2 : $req2<br>" ;
     $from = Erreurs_MailApp;
     //$dest_mail = "*****@*****.**" ;
     $dest_mail = $mails;
     eko("\nContenu : {$contenu2}\n");
     if ($options->getOption("typeMail") == "HTML") {
         $content = "Content-Type: text/html; charset=\"iso-8859-1\"";
     } else {
         $content = "Content-Type: text/plain; charset=\"iso-8859-1\"";
     }
     $head = "From: {$from}\n{$content}\n";
     $obj = "Alerte AES";
     if ($verif2) {
         $dest_mail = "*****@*****.**";
         $obj = "Alerte AES (RAS)";
     } else {
         mail($dest_mail, $obj, $contenu2, $head);
     }
     eko($comment);
 }
Пример #24
0
 function modItem()
 {
     global $session;
     global $options;
     global $errs;
     $req = new clResultQuery();
     // Récupération des anciennes informations de l'item à modifier.
     $param[cw] = "WHERE idDomaine='" . CCAM_IDDOMAINE . "' AND nomliste='" . $_POST['liste'] . "' AND iditem='" . $_POST['item'] . "'";
     $res1 = $req->Execute("Fichier", "CCAM_getListesItemsComplexes", $param, "ResultQuery");
     // Récupération de tous les autres items.
     $param[cw] = "WHERE idDomaine='" . CCAM_IDDOMAINE . "' AND categorie='" . $this->type . "' AND nomliste='" . $_POST['liste'] . "'";
     $res2 = $req->Execute("Fichier", "CCAM_getListesItemsComplexes", $param, "ResultQuery");
     // Vérification de la présence d'une liste portant le nouveau nom.
     $param[cw] = "WHERE idDomaine='" . CCAM_IDDOMAINE . "' AND nomitem='" . $_POST['nomItemF'] . "' and iditem!='" . $res1[iditem][0] . "' AND nomliste='" . $_POST['liste'] . "'";
     $res3 = $req->Execute("Fichier", "CCAM_getListesItemsComplexes", $param, "ResultQuery");
     // Vérification que l'item existe.
     if ($res1[INDIC_SVC] > 0) {
         // Vérification d'un changement de nom.
         if ($res1[nomitem][0] != stripslashes($_POST['nomItemF'])) {
             // Nouveau nom libre ou pas.
             if ($res3[INDIC_SVC][2] == 0) {
                 // Nouveau nom correct.
                 if (eregi("[0-9a-zA-Z]", $_POST['nomItemF'])) {
                     // Mise à jour du nom de l'item dans la base.
                     $data[nomitem] = $_POST['nomItemF'];
                     $requete = new clRequete(CCAM_BDD, "ccam_liste", $data);
                     $requete->updRecord("iditem='" . $_POST['item'] . "'");
                     // Message d'information.
                     $this->infos .= "L'item \"" . $res1[nomitem][0] . "\" de la liste \"" . stripslashes($_POST['liste']) . "\" a changé de nom : \n                             \"" . stripslashes($_POST['nomItemF']) . "\".<br />";
                 } else {
                     // Message d'erreur.
                     $this->erreurs .= "Le nom choisi ne doit pas être vide.";
                 }
             } else {
                 // Message d'erreur.
                 $this->erreurs .= "Le nom choisi pour l'item \"" . $res1[nomitem][0] . "\" est déjà utilisé. La modification est annulée.<br />";
             }
         }
         // On vérifie si l'item a changé de position ou non.
         if ($_POST['item'] != $_POST['placerF']) {
             // Suppression du rang actuel et décalage du rang des autres items.
             $rang = $res1[rang][0];
             $param[cw] = "WHERE idDomaine='" . CCAM_IDDOMAINE . "' AND rang>'{$rang}' AND categorie='" . $this->type . "' AND nomitem!='LISTE' AND nomliste='" . $_POST['liste'] . "'";
             $res4 = $req->Execute("Fichier", "CCAM_getListesItemsComplexes", $param, "ResultQuery");
             for ($i = 0; isset($res4[iditem][$i]); $i++) {
                 $data3[rang] = $res4[rang][$i] - 1;
                 $requete = new clRequete(CCAM_BDD, "ccam_liste", $data3);
                 $requete->updRecord("iditem='" . $res4[iditem][$i] . "'");
             }
             // Calcul du rang suivant.
             if ($_POST['placerF']) {
                 $param[cw] = "WHERE idDomaine='" . CCAM_IDDOMAINE . "' AND iditem='" . $_POST['placerF'] . "' AND categorie='" . $this->type . "'";
                 $res6 = $req->Execute("Fichier", "CCAM_getListesItemsComplexes", $param, "ResultQuery");
                 $rang = $res6[rang][0] + 1;
             } else {
                 $rang = 1;
             }
             // Décalage de tous les items d'un rang.
             $param[cw] = "WHERE idDomaine='" . CCAM_IDDOMAINE . "' AND rang>='{$rang}' AND categorie='" . $this->type . "' AND nomitem!='LISTE' AND nomliste='" . $_POST['liste'] . "'";
             $res5 = $req->Execute("Fichier", "CCAM_getListesItemsComplexes", $param, "ResultQuery");
             for ($i = 0; isset($res5[iditem][$i]); $i++) {
                 $data4[rang] = $res5[rang][$i] + 1;
                 $requete = new clRequete(CCAM_BDD, "ccam_liste", $data4);
                 $requete->updRecord("iditem='" . $res5[iditem][$i] . "'");
             }
             // Mise à jour du rang de l'item.
             if ($_POST['placerF']) {
                 $data5[rang] = $res6[rang][0] + 1;
             } else {
                 $data5[rang] = 1;
             }
             $requete = new clRequete(CCAM_BDD, "ccam_liste", $data5);
             $requete->updRecord("iditem='" . $res1[iditem][0] . "'");
             // Message d'information.
             $this->infos .= "L'item \"" . $res1[nomitem][0] . "\" a changé de position.<br />";
             /*if ($this->type == "ListeMédecins" ) {
                 $dataUf[code] = $_POST['ufF'] ;
                 $requete = new clRequete ( CCAM_BDD, "ccam_liste", $dataUf ) ;
                 $requete->updRecord ( "nomitem='LISTE' and nomliste='".$_REQUEST["liste"]."'" ) ;
               
               // Mise à jour de l'Uf dans la table ccam_uf_spe
                 $dataSpe[numeroUF] = $_POST['ufF'] ;
                 $requete = new clRequete ( CCAM_BDD, "ccam_uf_spe", $dataSpe ) ;
                 $requete->updRecord ( "libelleSpecialite='".$_REQUEST["liste"]."'" ) ;  
               
               }*/
         }
         // On vérifie si le code a changé.
         if ($res1[code][0] != $_POST['codeF']) {
             $param[cw] = "WHERE idDomaine='" . CCAM_IDDOMAINE . "' AND code='" . $_POST['codeF'] . "' AND categorie='" . $this->type . "' AND nomliste='" . $_POST['liste'] . "'";
             $res6 = $req->Execute("Fichier", "CCAM_getListesItemsComplexes", $param, "ResultQuery");
             if (eregi("[0-9a-zA-Z]", $_POST['codeF']) && $this->type != "Documents") {
                 // code modifié pour permettre de saisir des codes ADELI non unique
                 if ($res6[INDIC_SVC][2] > 0 && $this->type != "Documents") {
                     $this->erreurs .= "L'item \"" . $res6[nomitem][0] . "\" a déjà ce code attribué. Merci d'en choisir un autre.";
                 } else {
                     // Mise à jour du rang de l'item.
                     if ($_POST['codeF']) {
                         $data6[code] = $_POST['codeF'];
                     } else {
                         $data6[code] = '_';
                     }
                     $requete = new clRequete(CCAM_BDD, "ccam_liste", $data6);
                     $requete->updRecord("iditem='" . $res1[iditem][0] . "'");
                     $this->infos .= "Le code \"" . $res1[code][0] . "\" de l'item \"" . $res1[nomitem][0] . "\" a changé : \"" . stripslashes($_POST['codeF']) . "\"<br />";
                 }
             } else {
                 $this->erreurs = "Le code ne doit pas être vide.";
             }
         }
     } else {
         // Signalement d'une erreur si l'item à modifier n'existe pas.
         $this->erreurs .= "L'item ne peut pas être modifié (id=\"{$idItem}\") car il n'existe pas.";
         $errs->addErreur("clListesGenerales : L'item ne peut pas être modifié (id=\"{$idIditem}\") car il n'existe pas.");
     }
 }
function Formulaire_Transfert_Launch($formx)
{
    global $session;
    $id_instance = $formx->getIdInstance();
    $idu = $formx->getVar('ids');
    $idpatient = $session->getNavi(2);
    $req = new clResultQuery();
    $param = array();
    $param['cw'] = "where idpatient='" . $idpatient . "'";
    $param['table'] = PPRESENTS;
    $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery");
    //$idpatient = $res['idpatient'][0] ;
    eko($res);
    $data['idpatient'] = $res['idpatient'][0];
    $data['idu'] = $res['idu'][0];
    $data['ilp'] = $res['ilp'][0];
    $data['nsej'] = $res['nsej'][0];
    $data['uf'] = $res['uf'][0];
    $data['nom'] = $res['nom'][0];
    $data['prenom'] = $res['prenom'][0];
    $data['sexe'] = $res['sexe'][0];
    $data['dt_naissance'] = $res['dt_naissance'][0];
    $data['adresse_libre'] = $res['adresse_libre'][0];
    $data['adresse_cp'] = $res['adresse_cp'][0];
    $data['adresse_ville'] = $res['adresse_ville'][0];
    $data['telephone'] = $res['telephone'][0];
    $data['prevenir'] = $res['prevenir'][0];
    $data['medecin_traitant'] = $res['medecin_traitant'][0];
    $data['dt_admission'] = $res['dt_admission'][0];
    $data['adresseur'] = $res['adresseur'][0];
    $data['mode_admission'] = $res['mode_admission'][0];
    $data['dt_examen'] = $res['dt_examen'][0];
    $data['medecin_urgences'] = $res['medecin_urgences'][0];
    $data['ide'] = $res['ide'][0];
    $data['salle_examen'] = $res['salle_examen'][0];
    $data['motif_recours'] = $res['motif_recours'][0];
    $data['code_gravite'] = $res['code_gravite'][0];
    $data['ccmu'] = $res['ccmu'][0];
    $data['gemsa'] = $res['gemsa'][0];
    $data['traumato'] = $res['traumato'][0];
    $data['dest_souhaitee'] = $res['dest_souhaitee'][0];
    $data['dest_attendue'] = $res['dest_attendue'][0];
    $data['moyen_transport'] = $res['moyen_transport'][0];
    $data['motif_transfert'] = $res['motif_transfert'][0];
    $data['dt_sortie'] = $res['dt_sortie'][0];
    $data['recours_code'] = $res['recours_code'][0];
    $data['recours_categorie'] = $res['recours_categorie'][0];
    $data['type_destination'] = $res['type_destination'][0];
    $data['diagnostic_categorie'] = $res['diagnostic_categorie'][0];
    $data['diagnostic_libelle'] = $res['diagnostic_libelle'][0];
    $data['diagnostic_code'] = $res['diagnostic_code'][0];
    $data['etatUHCD'] = $res['etatUHCD'][0];
    $data['dt_UHCD'] = $res['dt_UHCD'][0];
    $data['provenance'] = $res['provenance'][0];
    $data['dest_pmsi'] = $res['dest_pmsi'][0];
    $data['orientation'] = $res['orientation'][0];
    $data['iduser'] = '******';
    $data['manuel'] = $res['manuel'][0];
    if ($res['uf'][0] == '6004') {
        $data['uf'] = '6006';
        $base = 'terminal2_tuv2';
    } elseif ($res['uf'][0] == '6006') {
        $data['uf'] = '6004';
        $base = 'terminal_tuv2';
    } elseif ($res['uf'][0] == 'UHCD6004') {
        $data['uf'] = 'UHCD6006';
        $base = 'terminal2_tuv2';
    } elseif ($res['uf'][0] == 'UHCD6006') {
        $data['uf'] = 'UHCD6004';
        $base = 'terminal_tuv2';
    }
    $req = new clRequete($base, PPRESENTS, $data);
    $req->addRecord();
    $req = new clRequete(BDD, PPRESENTS);
    $req->delRecord("idpatient={$idpatient}");
    header('Location:index.php?navi=TGlzdGVfUHJlc2VudHM=');
    //eko ( $data ) ;
    /*
    $param = array();
    $param['etat'] = "a";
    $param['idpatient'] = $idpatient;
    $param['id_instance'] = $id_instance;
    $param['dt_creation'] = date("Y")."-".date("m")."-".date("d")." ".date("H").":".date("i").":00";
    //eko ($param);
    $req = new clRequete(BDD,"radios",$param);
    $req->addRecord();
    */
    //$res = $req -> Execute ( "Fichier", "putFormulaireRadioData", $param, "ResultQuery" ) ;
    //eko($res);
    return "";
}
Пример #26
0
 function genGraphs($mod, $dateG = '', $nbDays = '7')
 {
     $param['cs'] = "*";
     $req = new clResultQuery();
     $date = new clDate($dateG);
     $dateT = new clDate($date->getDate("Y-m-d 00:00:00"));
     $dateT->addDays(-1);
     $dateH = new clDate($dateT->getDate("Y-m-d"));
     $dateT->addDays(1);
     $dateT->addDays(-$nbDays);
     $dateS = new clDate($dateT->getDate("Y-m-d"));
     $dateT->addDays($nbDays);
     $j = 0;
     for ($dateDeb = $dateH; $dateDeb->getTimestamp() < $dateT->getTimestamp();) {
         $heureA = $dateDeb->getHours();
         $dateA = $dateDeb->getDatetime();
         $dateDeb->addHours(1);
         $param['cs'] = "*";
         $param['cw'] = "WHERE iduser LIKE '" . $_POST['choix'] . "' AND ( date BETWEEN '" . $dateA . "' AND '" . $dateDeb->getDatetime() . "' ) AND idapplication=" . IDAPPLICATION . " AND type='navi'";
         $res = $req->Execute("Fichier", "getLogs", $param, "ResultQuery");
         $tab[0][0][] = $res['INDIC_SVC'][2];
         //eko ( $res['INDIC_SVC'] ) ;
         $tab[1][0][$j] = 0;
         $tab[1][1][$j] = 0;
         //      $tab[0][1][$j] = 0 ;
         $titres[1][] = $heureA . "h - " . $dateDeb->getHours() . "h";
         for ($i = 0; isset($res['idlog'][$i]); $i++) {
             $tab[1][0][$j] += $res['tempsPage'][$i];
             $tab[1][1][$j] += $res['tempsSQL'][$i];
             //$tab[0][1][$j] += $res['nombreSQL'][$i] ;
         }
         if ($res['INDIC_SVC'][2]) {
             $tab[1][0][$j] = $tab[1][0][$j] / $res['INDIC_SVC'][2];
             $tab[1][1][$j] = $tab[1][1][$j] / $res['INDIC_SVC'][2];
         }
         $j++;
     }
     $dateH->addDays(-1);
     $jpG = new clJpGraph();
     $jpG->arh_graph("Nombre de clics et requetes par heure (" . $_POST['choix'] . ") - " . $dateH->getDateText(), '', '', $tab[0], array('Clics', 'Requetes'), array('#DDCC55', '#CC3355'), 800, 500, "image1.png", $titres[1], "45", '#C8DE3D', "groupbar", '#FFFFFF', "%d");
     $jpG->arh_graph("Temps moyen par heure (" . $_POST['choix'] . ") - " . $dateH->getDateText(), '', '', $tab[1], array('Temps total', 'Temps SQL'), array('#DDCC55', '#CC3355'), 800, 400, "image2.png", $titres[1], "45", '#C8DE3D', "groupbar", '#FFFFFF', "%2.2f");
     $j = 0;
     for ($dateDeb = $dateS; $dateDeb->getTimestamp() < $dateT->getTimestamp();) {
         $jourA = $dateDeb->getDayWeek();
         $dateA = $dateDeb->getDatetime();
         $dateDeb->addDays(1);
         $param['cs'] = "*";
         $param['cw'] = "WHERE iduser LIKE '" . $_POST['choix'] . "' AND ( date BETWEEN '" . $dateA . "' AND '" . $dateDeb->getDatetime() . "' ) AND idapplication=" . IDAPPLICATION . " AND type='navi'";
         $res = $req->Execute("Fichier", "getLogs", $param, "ResultQuery");
         $tab[2][0][] = $res['INDIC_SVC'][2];
         $titres[2][] = $jourA;
         /*
         //eko ( $res['INDIC_SVC'] ) ;
         $tab[3][0][$j] = 0 ;
         $tab[3][1][$j] = 0 ;
         //$tab[2][1][$j] = 0 ;
         $titres[2][] = $jourA ;
         for ( $i = 0 ; isset ( $res['idlog'][$i] ) ; $i++ ) {
         	$tab[3][0][$j] += $res['tempsPage'][$i] ;
         	$tab[3][1][$j] += $res['tempsSQL'][$i] ;
         	//$tab[2][1][$j] += $res['nombreSQL'][$i] ;
         }
         if ( $res['INDIC_SVC'][2] ) {
         	$tab[3][0][$j] = $tab[3][0][$j] / $res['INDIC_SVC'][2] ;
         	$tab[3][1][$j] = $tab[3][1][$j] / $res['INDIC_SVC'][2] ;
         }
         $j++ ;
         */
     }
     // eko ( $tab[3][1] ) ;
     $jpG->arh_graph("Nombre de clics et requetes par jour (" . $_POST['choix'] . ") ", '', '', $tab[2], array('Clics', 'Requetes'), array('#DDCC55', '#CC3355'), 800, 500, "image3.png", $titres[2], "45", '#C8DE3D', "groupbar", '#FFFFFF', "%d");
     //$jpG->arh_graph( "Temps moyen par jour - ".$date->getDateText ( ),'','', $tab[3], array ( 'Temps total', 'Temps SQL' ), array ( '#DDCC55', '#CC3355' ), 800, 400, "image4.png", $titres[2], "45", '#C8DE3D', "groupbar", '#FFFFFF', "%2.2f" ) ;
 }
Пример #27
0
 function addPatientPresent()
 {
     global $session;
     global $listeMois;
     global $options;
     // Si la confirmation d'ajout est présente, alors on ajoute le nouveau patient dans la table.
     if ($_POST['ValiderAjouter'] or $_POST['ValiderAjouter_x']) {
         global $errs;
         // Préparation de la date d'admission.
         $date = new clDate();
         $dateN = new clDate($_POST['naissance']);
         /*if ( $options -> getOption ( "DoubleEtablissement" ) AND ! ( $options -> getOption ( 'DoubleSansCom' ) ) ) {
           $req = new clResultQuery ;			
             	  $ras = $req -> Execute ( "Fichier", "getMaxIdToulon", array(), "ResultQuery" ) ; 
           $max = 1 ;
           for ( $j = 0 ; isset ( $ras['idpatient'][$j] ) ; $j++ )
           	if ( $ras['idpatient'][$j] > $max ) $max = $ras['idpatient'][$j] ;
           $max++ ;
           eko ( "Double Etablissement : Calcul du max ($max)" ) ;
           $data['idpatient'] = $max ;
             }*/
         // Remplissage des champs pour la requête.
         $data['idu'] = "X";
         $data['ilp'] = "X";
         $data['nsej'] = "X";
         $data['uf'] = $options->getOption("AjoutManuelUF");
         $data['sexe'] = $_POST['sexe'];
         $data['prenom'] = $_POST['prenom'];
         $data['nom'] = $_POST['nom'];
         $data['dt_admission'] = $date->getDatetime();
         $data['dt_naissance'] = $dateN->getDatetime();
         $data['adresse_libre'] = $_POST['adresse'];
         $data['adresse_cp'] = $_POST['cp'];
         $data['adresse_ville'] = $_POST['ville'];
         $data['telephone'] = $_POST['telephone'];
         $data['salle_examen'] = $_POST['salle'];
         $data['dest_souhaitee'] = $_POST['destSouhaitee'];
         $data['dest_attendue'] = $_POST['destAttendue'];
         $data['adresseur'] = $_POST['adresseur'];
         $data['medecin_urgences'] = $_POST['medecin'];
         if ($_POST['medecin']) {
             $data[dt_examen] = $date->getDatetime();
         }
         $data['recours_categorie'] = $_POST['categorieRecours'];
         $data['manuel'] = 1;
         // Préparation de la requête.
         $requete = new clRequete(BDD, PPRESENTS, $data);
         // Exécution de la requête.
         $resu = $requete->addRecord();
         // On signale les éventuelles erreurs rencontrées.
         if ($resu['error']) {
             $errs->addErreur("clListesPatients : Erreur lors de la bascule d'un patient attendu en patient présent (" . $resu[error] . ").");
         }
         $param['table'] = PPRESENTS;
         $param['cw'] = "WHERE idu='X'";
         $req = new clResultQuery();
         $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery");
         for ($i = 0; isset($res['idpatient'][$i]); $i++) {
             $data2['idu'] = "MANU" . $res['idpatient'][$i];
             $data2['ilp'] = "MANU" . $res['idpatient'][$i];
             $data2['nsej'] = "MANU" . $res['idpatient'][$i];
             // Préparation de la requête.
             $requete = new clRequete(BDD, PPRESENTS, $data2);
             // Exécution de la requête.
             $requete->updRecord("idpatient='" . $res['idpatient'][$i] . "'");
             header('Location:' . URLNAVI . $session->genNavi($session->getNavi(0)));
         }
     } else {
         // Sinon, nous affichons le formulaire d'ajout d'un nouveau patient présent.
         // Chargement du template ModeliXe.
         $mod = new ModeliXe("addPresent.html");
         $mod->SetModeliXe();
         // Préparation du titre, des images, des urls...
         $mod->MxText("titre", "Ajouter un nouveau patient présent");
         $mod->MxImage("imgClose", URLIMGFER, "Annuler");
         $mod->MxUrl("lienClose", URLNAVI . $session->genNavi($session->getNavi(0)));
         // Champs IDU, IPP, et nsej...
         // $mod -> MxFormField ( "idu", "text", "idu", $_POST['idu'], "size=\"47\" maxlength=\"50\"" ) ;
         // $mod -> MxFormField ( "ilp", "text", "ilp", $_POST['ilp'], "size=\"47\" maxlength=\"50\"" ) ;
         // $mod -> MxFormField ( "nsej", "text", "nsej", $_POST['nsej'], "size=\"47\" maxlength=\"50\"" ) ;
         // Champs de l'état civil du patient.
         $data['M'] = "Homme";
         $data['F'] = "Femme";
         $data['I'] = "Indéterminé";
         $javascript1 = XhamTools::genAjax('onKeyUp', 'getPatients', 'navi=' . $session->genNavi('Ajax', 'getPatientsSortis'));
         $javascript3 = XhamTools::genAjax('onChange', 'getPatients', 'navi=' . $session->genNavi('Ajax', 'getPatientsSortis'));
         $javascript1 = XhamTools::genAjaxWithTempo('getPatients', 'navi=' . $session->genNavi('Ajax', 'getPatientsSortis'));
         $mod->MxSelect("sexe", "sexe", $_POST['sexe'], $data, '', '', 'class="w300"  ' . "{$javascript3}");
         $mod->MxFormField("prenom", "text", "prenom", $_POST['prenom'], "size=\"47\" maxlength=\"50\" {$javascript1} {$javascript3}");
         $mod->MxFormField("nom", "text", "nom", $_POST['nom'], "size=\"47\" maxlength=\"50\"  {$javascript1} {$javascript3}");
         // Gestion des champs de la date de naissance.
         $_POST['naissance'] = date('d/m/Y');
         $mod->MxFormField("naissance", "text", "naissance", $_POST['naissance'], "id=\"naissance\"");
         // Adresse et téléphone du patient.
         $mod->MxFormField("adresse", "text", "adresse", $_POST['adresse'], "size=\"47\" maxlength=\"128\"");
         $mod->MxFormField("telephone", "text", "telephone", $_POST['telephone'], "size=\"47\" maxlength=\"64\"");
         $mod->MxFormField("cp", "text", "cp", $_POST['cp'], "size=\"5\" maxlength=\"5\"");
         $mod->MxFormField("ville", "text", "ville", $_POST['ville'], "size=\"38\" maxlength=\"64\"");
         // Préparation des listes dynamiques.
         $listeCom = new clListes("Recours", "recup");
         $listeGen = new clListesGenerales("recup");
         $listeMedecins = $listeGen->getListeItems("Médecins", "1", '', '', "1");
         $listeSalles = $listeGen->getListeItems("Salles d'examens", "1", '', '', "1");
         $listeCategoriesRecours = $listeCom->getListes("", "1");
         $listeDestSouhaitees = $listeGen->getListeItems("Destinations souhaitées", "1", '', '', "1");
         $listeDestAttendues = $listeGen->getListeItems("Destinations attendues", "1", '', '', "1");
         // Affichage des listes dynamiques.
         $mod->MxSelect("medecin", "medecin", $_POST['medecin'], $listeMedecins, '', '', 'class="w300"');
         $mod->MxSelect("salle", "salle", $_POST['salle'], $listeSalles, '', '', 'class="w300"');
         $mod->MxSelect("categorieRecours", "categorieRecours", $_POST['categorieRecours'], $listeCategoriesRecours, '', '', 'class="w300"');
         $mod->MxSelect("destSouhaitee", "destSouhaitee", $_POST['destSouhaitee'], $listeDestSouhaitees, '', '', 'class="w300"');
         $mod->MxSelect("destAttendue", "destAttendue", $_POST['destAttendue'], $listeDestAttendues, '', '', 'class="w300"');
         // Suppression du bouton de modification inutile ici.
         $mod->MxBloc("modifier", "modify", " ");
         // Variable de navigation.
         $mod->MxHidden("hidden", "navi=" . $session->genNavi($session->getNavi(0), "addPatientPresent"));
         // Récupération du code HTML généré par le template ModeliXe.
         $this->af .= $mod->MxWrite("1");
     }
 }
Пример #28
0
 function __construct($idu, $nsej, $type = 'radio')
 {
     global $tab;
     // Préparation du document PDF.
     $liste = new clListes("Documents", "1");
     $tub = $liste->getListes();
     //newfct ( gen_affiche_tableau, $tab ) ;
     while (list($key, $val) = each($tub)) {
         $tab[$val] = $liste->getListes($val);
         //newfct ( gen_affiche_tableau, $tab[$val] ) ;
     }
     //if ( headers_sent() ) print "<br/><b>Avant Formx : Headers déjà envoyés</b><br/>" ;
     //else print "<br/><b>Avant Formx : Headers non envoyés</b><br/>" ;
     $formx = new clFoRmX($idu, 'NO_POST_THREAT');
     //header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     // setcookie("pouet","pouet");
     //if ( headers_sent() ) print "<br/><b>Après Formx : Headers envoyés</b><br/><br/>" ;
     //else print "<br/><b>Après Formx : Headers non envoyés</b><br/><br/>" ;
     if ($_REQUEST['Formulaire2print'] == 'bio2009') {
         $r = $formx->getAllValuesFromFormx($_REQUEST['FormX_ext_goto_'], '', '', 'idinstance');
         //print affTab ( $r ) ;
         $pdf = new clFPDF();
         $pdf->footerOn = 1;
         $pdf->AliasNbPages();
         $pdf->SetFont('Times', '', 12);
         $pdf->AddFont('code39h48', '', 'IDAutomation_Code_39.php');
         for ($i = 0; isset($r['Val_IDENT_NomPatient'][$i]); $i++) {
             if ($r['Val_IDENT_NsejPatient'][$i] == $nsej) {
                 if ($r['Val_IDENT_SexePat'][0] == "M" or $r['Val_IDENT_SexePat'][0] == "Masculin") {
                     $e = '';
                     $titre = 'Mr ';
                 }
                 if ($r['Val_IDENT_SexePat'][0] == "F" or $r['Val_IDENT_SexePat'][0] == "Feminin" or $r['Val_IDENT_SexePat'][0] == "Féminin" or $r['Val_IDENT_SexePat'][0] == utf8_encode("Féminin")) {
                     $e = 'e';
                     $titre = 'Mme ';
                 }
                 $html = "<b>Nom : </b>" . $titre . $r['Val_IDENT_NomPatient'][$i] . '<br>';
                 $html .= "<b>Prénom : </b>" . $r['Val_IDENT_PrenomPatient'][$i] . '<br>';
                 $html .= "<b>Né{$e} le : </b>" . $r['Val_IDENT_DateNPat2'][$i] . '<br><br>';
                 $html .= "<b>Motif : </b>" . $r['Val_F_BIO_Motif'][$i] . '<br><br>';
                 // Saut de page.
                 $pdf->AddPage();
                 // On remplace les balises par leurs valeurs réelles.
                 $pdf->SetFont('times', '', 10);
                 // Génération du contenu.
                 $pdf->writehtml($html);
                 $pdf->SetFont('times', 'BU', 11);
                 $pdf->setx(65);
                 $pdf->Cell(80, 10, "EXAMENS", 0, 1, L);
                 if ($r['biochimie'][$i] and $r['biochimie'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Biochimie", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     if ($r['biochimie_temp'][$i] and $r['biochimie_temp'][$i] != 'Aucun.') {
                         $pdf->Cell(80, 3, $r['biochimie_temp'][$i], 0, 1, L);
                         $pdf->Cell(80, 3, " ", 0, 1, L);
                     }
                     $exp = explode('|', $r['biochimie'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['hematologie'][$i] and $r['hematologie'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Hématologie", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $exp = explode('|', $r['hematologie'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['grossesse'][$i] and $r['grossesse'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Grossesse", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     if ($r['grossesse_date_regles'][$i] and $r['grossesse_date_regles'][$i] != 'Aucun.') {
                         $pdf->Cell(80, 3, "Dernières règles : " . $r['grossesse_date_regles'][$i], 0, 1, L);
                     }
                     $exp = explode('|', $r['grossesse'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['toxicologie'][$i] and $r['toxicologie'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Toxicologie", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $exp = explode('|', $r['toxicologie'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['hemostase_renseignements'][$i] and $r['hemostase_renseignements'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Hemostase Renseignements", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $exp = explode('|', $r['hemostase_renseignements'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['anti_vit_medic'][$i] and $r['anti_vit_medic'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Détail Médicamentation Anti Vit", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $pdf->Cell(80, 3, "Médicament : " . $r['anti_vit_medic'][$i], 0, 1, L);
                     $pdf->Cell(80, 3, "Dose : " . $r['anti_vit_dose'][$i], 0, 1, L);
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['hph_medic'][$i] and $r['hph_medic'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Détail Médicamentation Héparine", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $pdf->Cell(80, 3, "Médicament : " . $r['hph_medic'][$i], 0, 1, L);
                     $pdf->Cell(80, 3, "Dose : " . $r['hph_dose'][$i], 0, 1, L);
                     $pdf->Cell(80, 3, "Heure injection : " . $r['hph_heure_injec'][$i], 0, 1, L);
                     $pdf->Cell(80, 3, "Heure prélèvement : " . $r['hph_heure_prelev'][$i], 0, 1, L);
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['hemostase_examens_demandes'][$i] and $r['hemostase_examens_demandes'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'B', 11);
                     $pdf->Cell(80, 5, "Hemostase Examens Demandés", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $exp = explode('|', $r['hemostase_examens_demandes'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                     $pdf->Cell(80, 3, " ", 0, 1, L);
                 }
                 if ($r['Val_F_BIO_F2'][$i] and $r['Val_F_BIO_F2'][$i] != 'Aucun.') {
                     //$pdf -> SetFont ( 'times', 'BU', 12 ) ;
                     //$pdf -> setx ( 65 ) ;
                     //$pdf -> Cell ( 80, 10, "", 0, 1, L ) ;
                     $pdf->SetFont('times', '', 11);
                     $exp = explode('|', $r['Val_F_BIO_F2'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                 }
                 if ($r['Val_F_BIO_Autres_E'][$i] and $r['Val_F_BIO_Autres_E'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'BU', 11);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "AUTRES", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $pdf->Cell(80, 3, $r['Val_F_BIO_Autres_E'][$i], 0, 1, L);
                 }
                 if ($r['Val_F_BIO_Comm'][$i] and $r['Val_F_BIO_Comm'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'BU', 11);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "COMMENTAIRES", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $pdf->Cell(80, 3, $r['Val_F_BIO_Comm'][$i], 0, 1, L);
                 }
                 // Préleveur.
                 $pdf->SetY(225);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(0, 25, "Préleveur : " . $r['Val_F_BIO_Nom_Prel'][$i], 0, 1, L);
                 $pdf->SetY(229);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(0, 25, "Heure prélevement : " . $r['Val_F_BIO_Heure_Prel'][$i], 0, 1, L);
                 // IPP
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(82);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_ILPPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(76);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(80, 0, "N° IPP : ", 0, 1, R);
                 // Nsej
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(100);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_NsejPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(96);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(80, 0, "N° Séjour : ", 0, 1, R);
                 // Signature du médecin.
                 $pdf->SetY(225);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(120, 25, "Docteur : " . $r['Val_F_BIO_Nom_P'][$i], 0, 1, R);
                 //$pdf -> Footer ( ) ;
             }
         }
     } elseif ($_REQUEST['Formulaire2print'] == 'radio') {
         //if ( headers_sent() ) print "<br/><b>Headers déjà envoyés</b><br/>" ;
         $r = $formx->getAllValuesFromFormx($_REQUEST['FormX_ext_goto_'], '', '', 'idinstance');
         //$r = $formx -> getAllItems ( ) ;
         //print affTab ( $r ) ;
         $pdf = new clFPDF();
         $pdf->footerOn = 1;
         $pdf->AliasNbPages();
         $pdf->SetFont('Times', '', 12);
         $pdf->AddFont('code39h48', '', 'IDAutomation_Code_39.php');
         for ($i = 0; isset($r['Val_IDENT_NomPatient'][$i]); $i++) {
             if ($r['Val_IDENT_NsejPatient'][$i] == $nsej) {
                 if ($r['Val_IDENT_SexePat'][0] == "M" or $r['Val_IDENT_SexePat'][0] == "Masculin") {
                     $e = '';
                     $titre = 'Mr ';
                 }
                 if ($r['Val_IDENT_SexePat'][0] == "F" or $r['Val_IDENT_SexePat'][0] == "Feminin" or $r['Val_IDENT_SexePat'][0] == "Féminin" or $r['Val_IDENT_SexePat'][0] == utf8_encode("Féminin")) {
                     $e = 'e';
                     $titre = 'Mme ';
                 }
                 $html = "<b>Nom : </b>" . $titre . $r['Val_IDENT_NomPatient'][$i] . '<br>';
                 $html .= "<b>Prénom : </b>" . $r['Val_IDENT_PrenomPatient'][$i] . '<br>';
                 $html .= "<b>Né{$e} le : </b>" . $r['Val_IDENT_DateNPat2'][$i] . '<br><br>';
                 $html .= "<b>Motif : </b>" . $r['Val_F_RADIO_Motif'][$i] . '<br><br>';
                 // Saut de page.
                 $pdf->AddPage();
                 // On remplace les balises par leurs valeurs réelles.
                 $pdf->SetFont('times', '', 10);
                 // Génération du contenu.
                 $pdf->writehtml($html);
                 if ($r['Val_F_RADIO_CoteDroit'][$i] == 'Aucune Radio à effectuer' and $r['Val_F_RADIO_Centre'][$i] == 'Aucune Radio à effectuer' and $r['Val_F_RADIO_CoteGauche'][$i] == 'Aucune Radio à effectuer' or !$r['Val_F_RADIO_CoteDroit'][$i] and !$r['Val_F_RADIO_Centre'][$i] and !$r['Val_F_RADIO_CoteGauche'][$i]) {
                 } else {
                     $pdf->SetFont('times', 'BU', 12);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "RADIOGRAPHIES", 0, 1, L);
                     $pdf->SetFont('times', '', 12);
                     if ($r['Val_F_RADIO_CoteDroit'][$i] != 'Aucune Radio à effectuer') {
                         $exp = explode('|', $r['Val_F_RADIO_CoteDroit'][$i]);
                         while (list($key, $val) = each($exp)) {
                             if ($val) {
                                 $pdf->Cell(80, 3, "1x " . $val . " côté droit", 0, 1, L);
                             }
                         }
                         $exp = explode('|', $r['Val_F_RADIO_Centre'][$i]);
                         while (list($key, $val) = each($exp)) {
                             if ($val) {
                                 $pdf->Cell(80, 3, "1x " . $val . " centre", 0, 1, L);
                             }
                         }
                         if ($r['Val_F_RADIO_Indication'][0] or $r['Val_F_RADIO_Recherche'][0]) {
                             $pdf->Cell(80, 3, '', 0, 1, L);
                             $pdf->Cell(80, 3, "Indication : " . $r['Val_F_RADIO_Indication'][0], 0, 1, L);
                             $pdf->Cell(80, 3, '', 0, 1, L);
                             $pdf->Cell(80, 3, "Je recherche : " . $r['Val_F_RADIO_Recherche'][0], 0, 1, L);
                             $req = new clResultQuery();
                             $param['base'] = BDD;
                             $param['cw'] = ", radios_enquetes e where e.idradio=r.idradio and r.idpatient=p.idpatient and p.idu='{$idu}'";
                             $res = $req->Execute("Fichier", "getRadios", $param, "ResultQuery");
                             $pdf->Cell(80, 3, '', 0, 1, L);
                             $pdf->Cell(80, 3, "Destination confirmée : " . $res['dest_attendue'][0], 0, 1, L);
                             $pdf->Cell(80, 3, '', 0, 1, L);
                         }
                         $exp = explode('|', $r['Val_F_RADIO_CoteGauche'][$i]);
                         while (list($key, $val) = each($exp)) {
                             if ($val) {
                                 $pdf->Cell(80, 3, "1x " . $val . " côté gauche", 0, 1, L);
                             }
                         }
                     }
                 }
                 if ($r['Val_F_RADIO_TDM'][$i] == 'Aucun Scanner à effectuer' or !$r['Val_F_RADIO_TDM'][$i]) {
                 } else {
                     $pdf->SetFont('times', 'BU', 12);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "SCANNER", 0, 1, L);
                     $pdf->SetFont('times', '', 12);
                     $exp = explode('|', $r['Val_F_RADIO_TDM'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                 }
                 if ($r['Val_F_RADIO_Echo'][$i] == 'Aucune Echographie à effectuer' or !$r['Val_F_RADIO_Echo'][$i]) {
                 } else {
                     $pdf->SetFont('times', 'BU', 12);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "ECHOGRAPHIES", 0, 1, L);
                     $pdf->SetFont('times', '', 12);
                     $exp = explode('|', $r['Val_F_RADIO_Echo'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                 }
                 if ($r['Val_F_RADIO_Autres_E'][$i] and $r['Val_F_RADIO_Autres_E'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'BU', 12);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "AUTRES", 0, 1, L);
                     $pdf->SetFont('times', '', 12);
                     $exp = explode('|', $r['Val_F_RADIO_Autres_E'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                 }
                 if ($r['Val_F_RADIO_Comm'][$i] and $r['Val_F_RADIO_Comm'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'BU', 12);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "COMMENTAIRES", 0, 1, L);
                     $pdf->SetFont('times', '', 12);
                     $exp = explode('|', $r['Val_F_RADIO_Comm'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                 }
                 $pdf->Rect(15, 235, 115, 20);
                 $pdf->SetY(232);
                 $pdf->SetFont('times', '', 9);
                 $pdf->Cell(0, 0, "Cotation", 0, 1, L);
                 // IPP
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(82);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_ILPPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(76);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(80, 0, "N° IPP : ", 0, 1, R);
                 // Nsej
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(100);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_NsejPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(96);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(80, 0, "N° Séjour : ", 0, 1, R);
                 // Signature du médecin.
                 $pdf->SetY(225);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(120, 25, "Docteur : " . $r['Val_F_RADIO_Nom_P'][$i], 0, 1, R);
                 //$pdf -> Footer ( ) ;
             }
         }
     } elseif ($_REQUEST['Formulaire2print'] == 'labo') {
         $r = $formx->getAllValuesFromFormx($_REQUEST['FormX_ext_goto_'], '', '', 'idinstance');
         //print affTab ( $r ) ;
         $pdf = new clFPDF();
         $pdf->footerOn = 1;
         $pdf->AliasNbPages();
         $pdf->SetFont('Times', '', 12);
         $pdf->AddFont('code39h48', '', 'IDAutomation_Code_39.php');
         for ($i = 0; isset($r['Val_IDENT_NomPatient'][$i]); $i++) {
             if ($r['Val_IDENT_NsejPatient'][$i] == $nsej) {
                 if ($r['Val_IDENT_SexePat'][0] == "M" or $r['Val_IDENT_SexePat'][0] == "Masculin") {
                     $e = '';
                     $titre = 'Mr ';
                 }
                 if ($r['Val_IDENT_SexePat'][0] == "F" or $r['Val_IDENT_SexePat'][0] == "Feminin" or $r['Val_IDENT_SexePat'][0] == "Féminin" or $r['Val_IDENT_SexePat'][0] == utf8_encode("Féminin")) {
                     $e = 'e';
                     $titre = 'Mme ';
                 }
                 $html = "<b>Nom : </b>" . $titre . $r['Val_IDENT_NomPatient'][$i] . '<br>';
                 $html .= "<b>Prénom : </b>" . $r['Val_IDENT_PrenomPatient'][$i] . '<br>';
                 $html .= "<b>Né{$e} le : </b>" . $r['Val_IDENT_DateNPat2'][$i] . '<br><br>';
                 $html .= "<b>Motif : </b>" . $r['Val_F_BIO_Motif'][$i] . '<br><br>';
                 // Saut de page.
                 $pdf->AddPage();
                 // On remplace les balises par leurs valeurs réelles.
                 $pdf->SetFont('times', '', 10);
                 // Génération du contenu.
                 $pdf->writehtml($html);
                 $pdf->SetFont('times', 'BU', 11);
                 $pdf->setx(65);
                 $pdf->Cell(80, 10, "EXAMENS", 0, 1, L);
                 if ($r['Val_F_BIO_F1'][$i] and $r['Val_F_BIO_F1'][$i] != 'Aucun.') {
                     //$pdf -> SetFont ( 'times', 'BU', 12 ) ;
                     //$pdf -> setx ( 65 ) ;
                     //$pdf -> Cell ( 80, 10, "", 0, 1, L ) ;
                     $pdf->SetFont('times', '', 11);
                     $exp = explode('|', $r['Val_F_BIO_F1'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                 }
                 if ($r['Val_F_BIO_F2'][$i] and $r['Val_F_BIO_F2'][$i] != 'Aucun.') {
                     //$pdf -> SetFont ( 'times', 'BU', 12 ) ;
                     //$pdf -> setx ( 65 ) ;
                     //$pdf -> Cell ( 80, 10, "", 0, 1, L ) ;
                     $pdf->SetFont('times', '', 11);
                     $exp = explode('|', $r['Val_F_BIO_F2'][$i]);
                     while (list($key, $val) = each($exp)) {
                         $pdf->Cell(80, 3, "1x " . $val, 0, 1, L);
                     }
                 }
                 if ($r['Val_F_BIO_Autres_E'][$i] and $r['Val_F_BIO_Autres_E'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'BU', 11);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "AUTRES", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $pdf->Cell(80, 3, $r['Val_F_BIO_Autres_E'][$i], 0, 1, L);
                 }
                 if ($r['Val_F_BIO_Comm'][$i] and $r['Val_F_BIO_Comm'][$i] != 'Aucun.') {
                     $pdf->SetFont('times', 'BU', 11);
                     $pdf->setx(65);
                     $pdf->Cell(80, 10, "COMMENTAIRES", 0, 1, L);
                     $pdf->SetFont('times', '', 11);
                     $pdf->Cell(80, 3, $r['Val_F_BIO_Comm'][$i], 0, 1, L);
                 }
                 // Préleveur.
                 $pdf->SetY(225);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(0, 25, "Préleveur : " . $r['Val_F_BIO_Nom_Prel'][$i], 0, 1, L);
                 $pdf->SetY(229);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(0, 25, "Heure prélevement : " . $r['Val_F_BIO_Heure_Prel'][$i], 0, 1, L);
                 // IPP
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(82);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_ILPPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(76);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(80, 0, "N° IPP : ", 0, 1, R);
                 // Nsej
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(100);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_NsejPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(96);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(80, 0, "N° Séjour : ", 0, 1, R);
                 // Signature du médecin.
                 $pdf->SetY(225);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(120, 25, "Docteur : " . $r['Val_F_BIO_Nom_P'][$i], 0, 1, R);
                 //$pdf -> Footer ( ) ;
             }
         }
     } else {
         $r = $formx->getAllValuesFromFormx($_REQUEST['FormX_ext_goto_'], '', '', 'idinstance');
         //print affTab ( $r ) ;
         $pdf = new clFPDF();
         $pdf->footerOn = 1;
         $pdf->AliasNbPages();
         $pdf->SetFont('Times', '', 12);
         $pdf->AddFont('code39h48', '', 'IDAutomation_Code_39.php');
         for ($i = 0; isset($r['Val_IDENT_NomPatient'][$i]); $i++) {
             if ($r['Val_IDENT_NsejPatient'][$i] == $nsej) {
                 if ($r['Val_IDENT_SexePat'][0] == "M" or $r['Val_IDENT_SexePat'][0] == "Masculin") {
                     $e = '';
                     $titre = 'Mr ';
                 }
                 if ($r['Val_IDENT_SexePat'][0] == "F" or $r['Val_IDENT_SexePat'][0] == "Feminin" or $r['Val_IDENT_SexePat'][0] == "Féminin" or $r['Val_IDENT_SexePat'][0] == utf8_encode("Féminin")) {
                     $e = 'e';
                     $titre = 'Mme ';
                 }
                 $html = "<b>Nom : </b>" . $titre . $r['Val_IDENT_NomPatient'][$i] . '<br>';
                 $html .= "<b>Prénom : </b>" . $r['Val_IDENT_PrenomPatient'][$i] . '<br>';
                 $html .= "<b>Né{$e} le : </b>" . $r['Val_IDENT_DateNPat2'][$i] . '<br>';
                 $html .= "<b>IPP : </b>" . $r['Val_IDENT_ILPPatient'][$i] . '<br><br>';
                 $html .= "<b>Motif : </b>" . $r['Val_F_CS_Motif'][$i] . '<br>';
                 $html .= "<b>Prescripteur : </b>" . $r['Val_F_CS_Nom_P'][$i] . '<br>';
                 $html .= "<b>Consultation : </b>" . $r['Val_F_CS_Con'][$i] . '<br>';
                 // Saut de page.
                 $pdf->AddPage();
                 // On remplace les balises par leurs valeurs réelles.
                 $pdf->SetFont('times', '', 10);
                 // Génération du contenu.
                 $pdf->writehtml($html);
                 $pdf->SetFont('times', 'BU', 11);
                 // Compte rendu spécialiste
                 $pdf->SetY(129);
                 $pdf->SetFont('times', 'b', 13);
                 $pdf->Cell(0, 10, "COMPTE RENDU SPECIALISTE", 0, 1, C);
                 // IPP
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(85);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_ILPPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(81);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(88, 0, "N° IPP : ", 0, 1, R);
                 // Nsej
                 $pdf->SetFont('code39h48', '', 16);
                 $pdf->sety(100);
                 $pdf->Cell(0, 0, "*" . $r['Val_IDENT_NsejPatient'][$i] . "*", 0, 1, R);
                 $pdf->SetY(96);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(88, 0, "N° Séjour : ", 0, 1, R);
                 // Signature
                 $pdf->SetY(216);
                 $pdf->SetFont('times', 'b', 11);
                 $pdf->Cell(0, 10, "Signature : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetY(229);
                 $pdf->SetX(5);
                 $pdf->Cell(0, 0, "Partie à remettre au service demandeur");
                 /*
                  * PARTIE BASSE DU BON
                  */
                 $pdf->SetY(237);
                 $pdf->SetX(5);
                 $pdf->Cell(0, 0, "Partie à remettre au service financier");
                 $pdf->Image(URLIMG . "pointillers_decoupe.png", 0, 233);
                 // Spécialiste
                 $pdf->setx(65);
                 $pdf->SetY(250);
                 $pdf->SetFont('times', 'b', 11);
                 $pdf->Cell(0, 0, "Spécialiste : ", 0, 1, L);
                 $pdf->SetX(86);
                 $pdf->SetFont('times', '', 11);
                 $pdf->Cell(0, 0, $r['Val_F_CS_Spe'][$i], 0, 1, L);
                 // Cotation CCAM
                 $pdf->SetY(250);
                 $pdf->SetFont('times', 'b', 11);
                 $pdf->Cell(55, 10, "Cotation CCAM : ", 0, 1, L);
                 // affichage nom du service sur la partie basse du bon
                 global $options;
                 global $tab;
                 reset($tab);
                 list($key, $service) = each($tab);
                 $pdf->setxy(66, 239);
                 $pdf->SetFont('times', 'B', 12);
                 list($key, $val) = each($service);
                 $pdf->Cell(132, 5, $val, 1, 2, C);
                 reset($service);
                 // affichage des infos patients
                 $x_titre = 10;
                 $y = 243;
                 // nom
                 $pdf->SetY($y);
                 $pdf->SetX($x_titre);
                 $pdf->SetFont('times', 'b', 10);
                 $pdf->Cell(88, 0, "Nom : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetX(21);
                 $pdf->Cell(80, 0, $r['Val_IDENT_NomPatient'][$i], 0, 1, L);
                 // prenom
                 $pdf->SetY($y + 4);
                 $pdf->SetX($x_titre);
                 $pdf->SetFont('times', 'b', 10);
                 $pdf->Cell(88, 0, "Prenom : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetX(25);
                 $pdf->Cell(80, 0, $r['Val_IDENT_PrenomPatient'][$i], 0, 1, L);
                 // date naissance
                 $pdf->SetY($y + 4 * 2);
                 $pdf->SetX($x_titre);
                 $pdf->SetFont('times', 'b', 10);
                 $pdf->Cell(88, 0, "Né{$e} le : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetX(21);
                 $pdf->Cell(80, 0, $r['Val_IDENT_DateNPat2'][$i], 0, 1, L);
                 // ipp
                 $pdf->SetY($y + 4 * 3);
                 $pdf->SetX($x_titre);
                 $pdf->SetFont('times', 'b', 10);
                 $pdf->Cell(88, 0, "IPP : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetX(19);
                 $pdf->Cell(80, 0, $r['Val_IDENT_ILPPatient'][$i], 0, 1, L);
                 // motif
                 $pdf->SetY($y + 4 * 5);
                 $pdf->SetX($x_titre);
                 $pdf->SetFont('times', 'b', 10);
                 $pdf->Cell(88, 0, "Motif : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetX(22);
                 $pdf->Cell(80, 0, $r['Val_F_CS_Motif'][$i], 0, 1, L);
                 // prescripteur
                 $pdf->SetY($y + 4 * 6);
                 $pdf->SetX($x_titre);
                 $pdf->SetFont('times', 'b', 10);
                 $pdf->Cell(88, 0, "Prescripteur : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetX(32);
                 $pdf->Cell(80, 0, $r['Val_F_CS_Nom_P'][$i], 0, 1, L);
                 // consultation
                 $pdf->SetY($y + 4 * 7);
                 $pdf->SetX($x_titre);
                 $pdf->SetFont('times', 'b', 10);
                 $pdf->Cell(88, 0, "Consultation : ", 0, 1, L);
                 $pdf->SetFont('times', '', 10);
                 $pdf->SetX(32);
                 $pdf->Cell(80, 0, $r['Val_F_CS_Con'][$i], 0, 1, L);
                 // divers rectangles dans la page
                 $pdf->Rect(97, 257 - 5, 101, 6);
                 $pdf->Rect(65, 130, 133, 7);
                 $pdf->Rect(65, 138, 133, 80);
                 $pdf->Rect(86, 219, 112, 7);
             }
         }
     }
     $pdf->Output();
 }
Пример #29
0
 static function getIDUfromILP($ilp)
 {
     global $errs;
     global $xham;
     if (defined("VERSIONXHAM") && VERSIONXHAM == "2") {
         $errs = $xham;
     }
     $param = array();
     $param['ilp'] = $ilp;
     $req = new clResultQuery();
     $res = $req->Execute("Fichier", "getIDUfromILP", $param, "ResultQuery");
     if ($res['INDIC_SVC'][2] > 0) {
         return $res['IDU'][0];
     } else {
         $errs->addErreur("aucun idu trouvé pour l'ilp {$ilp}");
         return false;
     }
 }
Пример #30
0
 function valeursListeGauche($requeteTableA, $requeteTableRelation, $paramA = "", $paramRelation = "", $lignePresentation = "")
 {
     /*****************************************************************************/
     //eko ("valeursListeGauche");
     //Récupération des lignes figurant dans la liste de droite
     $req = new clResultQuery();
     $res = $req->Execute("Fichier", $requeteTableRelation, $paramRelation, "ResultQuery");
     //newfct(gen_affiche_tableau,$res[INDIC_SVC]);
     //eko($requeteTableRelation);
     //eko($paramRelation);
     //eko($res);
     $listeIdRelation = "";
     //eko($res);
     for ($i = 0; isset($res[identifiant][$i]); $i++) {
         $tabRelation[$res[identifiant][$i]] = $res[identifiant][$i];
         $listeIdRelation .= "'" . $res[identifiant][$i] . "',";
     }
     $listeIdRelation == "" ? $listeIdRelation = "''" : ($listeIdRelation = substr($listeIdRelation, 0, -1));
     //echo "listeIdRelation:$listeIdRelation<br>";
     // Récupération de la liste de valeurs pour la liste de gauche
     $paramA[listeIdRelation] = $listeIdRelation;
     $tab = $this->tableauValeurs($requeteTableA, $paramA, $lignePresentation);
     return $tab;
 }