function eko($message, $force = false) { global $xham; if (is_array($message)) { $message = " Affichage d'un tableau demandé<BR/>" . affTab($message); } if (isset($xham)) { $xham->errs->logThis($message, $force); } }
function eko($message) { global $errs; if (is_array($message)) { $message = "Affichage d'un tableau demandé<BR/>" . affTab($message); } if (isset($errs)) { $errs->logThis($message); } return true; }
function setOptions() { // Requête pour récupérer les informations actuelles de l'option. $param['cw'] = "WHERE idapplication=" . IDAPPLICATION; $res = $this->xham->Execute("Fichier", "getOptions", $param, "ResultQuery"); // Fabrication du tableau contenant la valeur des options de l'application. for ($i = 0; isset($res['idoption'][$i]); $i++) { $this->options[$res['libelle'][$i]] = $res['valeur'][$i]; } if (DEBUGOPTION) { affTab($this->options); } }
function getAffichage() { //Recuperation seulement de la donn�e du nom prescipteur dans tous les formulaires radio $tab = clFoRmXtOoLs::getinstances('Formulaire_Radio', 'Val_F_RADIO_Nom_P', ''); $nbResultats = $tab['INDIC_SVC'][2]; $res = array(); for ($i = 0; $i < $nbResultats; $i++) { $precripteur = $tab['Val_F_RADIO_Nom_P'][$i]; $res[$precripteur]++; } return affTab($res); //AUTRES EXEMPLES //Recuperation de toutes les donn�es radio de la date $date1 � la date $date2 //clFoRmXtOoLs::getinstances('Formulaire_Radio','','',$date1="",$date2="") //Recuperation de toutes les donn�es de tous les formulares demandes radio //$tabAllDonnesRadio = clFoRmXtOoLs::getinstances('Formulaire_Radio'); }
function setTraitement() { global $session; global $stopAffichage; //$stopAffichage = 1 ; $n = $_REQUEST['type']; $req = new clRequete(BDD, '', ''); $sql = "select * from export where idpatient='" . $_REQUEST['idpatient'] . "'"; $exp = $req->exec_requete($sql, 'resultquery'); if (isset($exp['etat' . $n][0]) and $exp['etat' . $n][0]) { $data['etat' . $n] = 0; } else { $data['etat' . $n] = 1; } $data['iduser' . $n] = $session->getUid(); $data['date' . $n] = date('Y-m-d H:i:s'); $data['idpatient'] = $_REQUEST['idpatient']; $requete = new clRequete(BDD, "export", $data); $res = $requete->uoiRecord('idpatient=' . $_REQUEST['idpatient']); print affTab($res); }
function getPatient() { global $errs; $param[cw] = "WHERE idpatient='" . $this->idpatient . "'"; $param[table] = $this->base . '.' . $this->table; $req = new clResultQuery(); $res = $req->Execute("Fichier", "getPatients", $param, "ResultQuery"); //print affTab ( $res[INDIC_SVC] ) ; //newfct ( gen_affiche_tableau, $res[INDIC_SVC] ) ; if ($res[INDIC_SVC][2]) { while (list($key, $val) = each($res)) { if ($key != "INDIC_SVC" and $key != "idpatient") { $this->patient[$key] = $res[$key][0]; } } } else { //$errs->addErreur ( "clPatient : Le patient spécifié (idpatient=".$this->idpatient.") est introuvable dans la table \"".$this->table."\"." ) ; $this->idpatient = 0; } if (DEBUGPATIENT) { print affTab($this->patient); } }
function modifierActeur() { $param['ob'] = ''; $param['cw'] = "WHERE idActeur=" . $_POST['idActeur']; $req = new clResultQuery(); $res = $req->Execute("Fichier", "authCodeAcces", $param, "ResultQuery"); //print affTab ( $res['INDIC_SVC'] ) ; if (!$res['INDIC_SVC'][2]) { $this->erreur .= "L'acteur demandé est introuvable. Aucune modification n'a été effectuée."; $errs->addErreur("L'acteur demandé est introuvable. Aucune modification n'a été effectuée." . affTab($res['INDIC_SVC'])); } $param['ob'] = ''; $param['cw'] = "WHERE password='******'password'])) . "' AND idActeur!=" . $_POST['idActeur']; $req = new clResultQuery(); $res = $req->Execute("Fichier", "authCodeAcces", $param, "ResultQuery"); if ($res['INDIC_SVC'][2]) { $this->erreurs .= "Ce mot de passe est déjà utilisé. La modification est annulée.<br/>"; } if (!$_POST['nomActeur']) { $this->erreurs .= "Le nom ne doit pas être vide. La modification est annulée.<br/>"; } if (!$this->erreurs) { $data['nomActeur'] = stripslashes($_POST['nomActeur']); $data['mailActeur'] = stripslashes($_POST['mailActeur']); $data['password'] = stripslashes($_POST['password']); $req = new clRequete(BASEXHAM, TABLEACTEURS, $data); $ris = $req->updRecord("idActeur=" . $_POST['idActeur']); $this->infos .= "La modification a réussi."; unset($_POST['idActeur']); } }
function setSessionSQL() { global $options; // Date actuelle. $date = new clDate(); // On met à jour la session actuelle. $data['nombre'] = "nombre+1"; $data['last'] = $date->getDatetime(); $data['localisation'] = $this->navi; $data['idapplication'] = IDAPPLICATION; // Appel de la classe Requete. $requete = new clRequete(BASEXHAM, TABLESACTU, $data); // Exécution de la requete. $res = $requete->updRecord("uid='" . $this->informations['iduser'] . "' AND type='" . $this->informations['type'] . "' AND idsession='" . $_SESSION['sidtuv2' . $this->index] . "'"); // Affichage pour débugage. if (DEBUGLOGSESSION) { print affTab($res); } // Si la session n'a pas pu mettre à jour, on regarde les différents cas possibles. if (!$res['affected_rows']) { // La session existe-t-elle ? $param['cw'] = "WHERE idsession='" . $_SESSION['sidtuv2' . $this->index] . "'"; $req = new clResultQuery(); $res = $req->Execute("Fichier", "getSessionsActuelles", $param, "ResultQuery"); // Affichage pour débugage. if (DEBUGLOGSESSION) { print affTab($res['INDIC_SVC']); } // Si la session existe. if ($res['INDIC_SVC'][2]) { // On historise son état actuel. unset($data); $data['idapplication'] = IDAPPLICATION; $data['nombre'] = $res['nombre'][0]; $data['uid'] = $res['uid'][0]; $data['type'] = $res['type'][0]; $data['ip'] = $res['ip'][0]; $data['dateshisto'] = $res['date'][0]; $data['dateslast'] = $res['last'][0]; $data['navigateur'] = $res['navigateur'][0]; $data['fonctions'] = $res['fonctions'][0]; $data['equipes'] = $res['equipes'][0]; $data['organisations'] = $res['organisations'][0]; // Appel de la classe Requete. $requete = new clRequete(BASEXHAM, TABLESHIST, $data); // Exécution de la requete. $res = $requete->addRecord(); // Affichage pour débugage. if (DEBUGLOGSESSION) { affTab($res); } // Puis on met à jour cette session. unset($data); $data['idapplication'] = IDAPPLICATION; $data['nombre'] = "1"; $data['localisation'] = $this->navi; $data['uid'] = $this->informations['iduser']; $data['type'] = $this->informations['type']; $data['ip'] = $_SERVER['REMOTE_ADDR']; $data['date'] = $date->getDatetime(); $data['last'] = $date->getDatetime(); $data['navigateur'] = $this->informations['navigateur']; $data['fonctions'] = implode('|', isset($this->informations['fonctions']) ? $this->informations['fonctions'] : array()); $data['equipes'] = implode('|', isset($this->informations['service']) ? $this->informations['service'] : array()); $data['organisations'] = $this->informations['org']; // Appel de la classe Requete. $requete = new clRequete(BASEXHAM, TABLESACTU, $data); // Exécution de la requete. $res = $requete->updRecord("idsession='" . $_SESSION['sidtuv2' . $this->index] . "'"); // Affichage pour débugage. if (DEBUGLOGSESSION) { print affTab($res); } } else { // Si la session n'existe pas, on la crée avec les bonnes informations. unset($data); if ($this->navi != "Importation" and $this->navi != "SW1wb3J0YXRpb24=" and $this->navi != "Q29uZmlndXJhdGlvbnxjcm9u") { $param[cw] = "WHERE uid='" . $this->informations['iduser'] . "'"; $req = new clResultQuery(); $res = $req->Execute("Fichier", "getSessionsActuelles", $param, "ResultQuery"); if (DEBUGLOGSESSION) { print affTab($res['INDIC_SVC']); } if ($res['INDIC_SVC'][2] and $options->getOption("UniqLogin") and !$_POST['AuthentificationDemandee']) { $this->informations = ''; $this->informations['type'] = "Echec"; $this->informations['nom'] = "Invité"; $this->informations['prenom'] = "Invité"; $this->informations['pseudo'] = "Invité"; $this->informations['mail'] = "*****@*****.**"; $this->informations['iduser'] = "******"; $this->informations['idgroupe'] = "1"; $this->informations['ip'] = $_SERVER['REMOTE_ADDR']; $this->informations['navigateur'] = $_SERVER["HTTP_USER_AGENT"]; $this->informations['fonctions'] = array(); $this->informations['service'] = array(); $this->informations['org'] = ''; // Sauvegarde des informations. $_SESSION['informations'] = $this->informations; } else { $data['idapplication'] = IDAPPLICATION; $data['nombre'] = "1"; $data['localisation'] = $this->navi; $data['uid'] = $this->informations['iduser']; $data['type'] = $this->informations['type']; $data['ip'] = $_SERVER['REMOTE_ADDR']; $data['date'] = $date->getDatetime(); $data['last'] = $date->getDatetime(); $data['idsession'] = $_SESSION['sidtuv2' . $this->index]; $data['navigateur'] = $this->informations['navigateur']; $data['fonctions'] = implode('|', isset($this->informations['fonctions']) ? $this->informations['fonctions'] : array()); $data['equipes'] = implode('|', isset($this->informations['service']) ? $this->informations['service'] : array()); $data['organisations'] = $this->informations['org']; // Appel de la classe Requete. $requete = new clRequete(BASEXHAM, TABLESACTU, $data); // Exécution de la requete. $res = $requete->addRecord(); // Affichage pour débugage. if (DEBUGLOGSESSION) { print affTab($res); } } } } } if ($options->getOption("UniqLogin")) { $requete = new clRequete(BASEXHAM, TABLESACTU); // Exécution de la requete. $res = $requete->delRecord("uid='" . $this->informations['iduser'] . "' AND last<'" . $date->getDatetime() . "' AND idsession!='" . $_SESSION['sidtuv2' . $this->index] . "'"); if (DEBUGLOGSESSION) { print affTab($res); } } // Maintenant, on historise les sessions qui ne sont plus valides et on les supprime // de la table des sessions actuelles. $dmax = $options->getOption("DureeSession"); $dact = $date->getDatetime(); $date->addMinutes("-{$dmax}"); $param['cw'] = "WHERE last<'" . $date->getDatetime() . "' AND idapplication=" . IDAPPLICATION; $req = new clResultQuery(); $res = $req->Execute("Fichier", "getSessionsActuelles", $param, "ResultQuery"); // Affichage pour débugage. if (DEBUGLOGSESSION) { print affTab($res[INDIC_SVC]); } for ($i = 0; isset($res['idsactu'][$i]); $i++) { unset($data); $data['idapplication'] = IDAPPLICATION; $data['nombre'] = $res['nombre'][$i]; $data['uid'] = $res['uid'][$i]; $data['type'] = $res['type'][$i]; $data['ip'] = $res['ip'][$i]; $data['dateshisto'] = $res['date'][$i]; $data['dateslast'] = $res['last'][$i]; $data['navigateur'] = $res['navigateur'][$i]; $data['fonctions'] = $res['fonctions'][$i]; $data['equipes'] = $res['equipes'][$i]; $data['organisations'] = $res['organisations'][$i]; // Appel de la classe Requete. $requete = new clRequete(BASEXHAM, TABLESHIST, $data); // Exécution de la requete. $ras = $requete->addRecord(); // Affichage pour débugage. if (DEBUGLOGSESSION) { affTab($ras); } unset($data); $data['idapplication'] = IDAPPLICATION; $data['nombre'] = "1"; // Appel de la classe Requete. $requete = new clRequete(BASEXHAM, TABLESACTU, $data); // Exécution de la requete. $rus = $requete->delRecord("idsession='" . $res['idsession'][$i] . "'"); // Affichage pour débugage. if (DEBUGLOGSESSION) { print affTab($rus); } } }
function __construct($noLog = '', $logSup = '') { // Récupération de la navigation. $this->setNavi(); // Initialisation (et authentification) de l'utilisateur. $this->setUser(); // Initialisation des droits de l'utilisateur connecté. $this->setDroits(); // Variable qui indique si l'information est loguée ou non. $this->noLog = $noLog; $this->logSup = $logSup; // Débugage if (DEBUGSESSION) { print "<br />" . $this->getNaviFull(); } // echo affTab ( $this->user['fonctions'] ) ; //logue tout ce qui se passe if (defined("DEBUGALLNAVI")) { if ($fp = fopen(DEBUGALLNAVI, "a")) { fputs($fp, "<br/>"); fputs($fp, "--------------------------------------------------------"); fputs($fp, "<br/>"); $rep = date("y.d.m G:i:s"); $rep .= "<br/>"; $mess = affTab($_SESSION); $mess .= "<br/>" . affTab($_POST); $mess .= "<br/>" . affTab($_GET); fputs($fp, $rep . $mess); fclose($fp); } } }