/** * @see parent::getHtmlValue() */ function getHtmlValue($object, $smarty = null, $params = array()) { $value = $object->{$this->fieldName}; // Empty value: no paragraph if (!$value) { return ""; } // Truncate case: no breakers but inline bullets instead if ($truncate = CValue::read($params, "truncate")) { $value = CMbString::truncate($value, $truncate === true ? null : $truncate); $value = CMbString::nl2bull($value); return CMbString::htmlSpecialChars($value); } // Markdown case: full delegation if ($this->markdown) { // In order to prevent from double escaping $content = CMbString::markdown(html_entity_decode($value)); return "<div class='markdown'>{$content}</div>"; } // Standard case: breakers and paragraph enhancers $text = ""; $value = str_replace(array("\r\n", "\r"), "\n", $value); $paragraphs = preg_split("/\n{2,}/", $value); foreach ($paragraphs as $_paragraph) { if (!empty($_paragraph)) { $_paragraph = nl2br(CMbString::htmlSpecialChars($_paragraph)); $text .= "<p>{$_paragraph}</p>"; } } return $text; }
/** * @see parent::getValue() */ function getValue($object, $smarty = null, $params = array()) { include_once $smarty->_get_plugin_filepath('modifier', 'date_format'); $propValue = $object->{$this->fieldName}; $format = CValue::first(@$params["format"], CAppUI::conf("time")); return $propValue ? smarty_modifier_date_format($propValue, $format) : ""; }
/** * Store * * @return void */ function doStore() { // keep track of former values for fieldModified below $obj = $this->_obj; $old = $obj->loadOldObject(); if ($msg = $obj->store()) { CAppUI::setMsg($msg, UI_MSG_ERROR); if ($this->redirectError) { CAppUI::redirect($this->redirectError); } } else { // Keep trace for redirections CValue::setSession($this->objectKey, $obj->_id); // Insert new group and function permission if ($obj->fieldModified("function_id") || !$old->_id) { $obj->insFunctionPermission(); $obj->insGroupPermission(); } // Message CAppUI::setMsg($old->_id ? $this->modifyMsg : $this->createMsg, UI_MSG_OK); // Redirection if ($this->redirectStore) { CAppUI::redirect($this->redirectStore); } } }
/** * Check anti-CSRF protection */ static function checkProtection() { if (!CAppUI::conf("csrf_protection") || strtoupper($_SERVER['REQUEST_METHOD']) != 'POST') { return; } if (!isset($_POST["csrf"])) { CAppUI::setMsg("CCSRF-no_token", UI_MSG_ERROR); return; } if (array_key_exists($_POST['csrf'], $_SESSION["tokens"])) { $token = $_SESSION['tokens'][$_POST['csrf']]; if ($token["lifetime"] >= time()) { foreach ($token["fields"] as $_field => $_value) { if (CValue::read($_POST, $_field) != $_value) { CAppUI::setMsg("CCSRF-form_corrupted", UI_MSG_ERROR); unset($_SESSION['tokens'][$_POST['csrf']]); return; } } //mbTrace("Le jeton est accepté !"); unset($_SESSION['tokens'][$_POST['csrf']]); } else { CAppUI::setMsg("CCSRF-token_outdated", UI_MSG_ERROR); unset($_SESSION['tokens'][$_POST['csrf']]); } return; } CAppUI::setMsg("CCSRF-token_does_not_exist", UI_MSG_ERROR); return; }
function doDelete() { parent::doDelete(); $dialog = CValue::post("dialog"); if ($dialog) { $this->redirectDelete .= "&name=" . $this->_obj->nom . "&firstName=" . $this->_obj->prenom . "&id=0"; } }
/** * @see parent::doStore() */ function doStore() { if (isset($_FILES['attachment'])) { $mail_id = CValue::post('mail_id'); $mail = new CUserMail(); $mail->load($mail_id); $files = array(); foreach ($_FILES['attachment']['error'] as $key => $file_error) { if (isset($_FILES['attachment']['name'][$key])) { $files[] = array('name' => $_FILES['attachment']['name'][$key], 'tmp_name' => $_FILES['attachment']['tmp_name'][$key], 'error' => $_FILES['attachment']['error'][$key], 'size' => $_FILES['attachment']['size'][$key]); } } foreach ($files as $_key => $_file) { if ($_file['error'] == UPLOAD_ERR_NO_FILE) { continue; } if ($_file['error'] != 0) { CAppUI::setMsg(CAppUI::tr("CFile-msg-upload-error-" . $_file["error"]), UI_MSG_ERROR); continue; } $attachment = new CMailAttachments(); $attachment->name = $_file['name']; $content_type = mime_content_type($_file['tmp_name']); $attachment->type = $attachment->getTypeInt($content_type); $attachment->bytes = $_file['size']; $attachment->mail_id = $mail_id; $content_type = explode('/', $content_type); $attachment->subtype = strtoupper($content_type[1]); $attachment->disposition = 'ATTACHMENT'; $attachment->extension = substr(strrchr($attachment->name, '.'), 1); $attachment->part = $mail->countBackRefs('mail_attachments') + 1; $attachment->store(); $file = new CFile(); $file->setObject($attachment); $file->author_id = CAppUI::$user->_id; $file->file_name = $attachment->name; $file->file_date = CMbDT::dateTime(); $file->fillFields(); $file->updateFormFields(); $file->doc_size = $attachment->bytes; $file->file_type = mime_content_type($_file['tmp_name']); $file->moveFile($_file, true); if ($msg = $file->store()) { CAppUI::setMsg(CAppUI::tr('CMailAttachments-error-upload-file') . ':' . CAppUI::tr($msg), UI_MSG_ERROR); CApp::rip(); } $attachment->file_id = $file->_id; if ($msg = $attachment->store()) { CAppUI::setMsg($msg, UI_MSG_ERROR); CApp::rip(); } } CAppUI::setMsg('CMailAttachments-msg-added', UI_MSG_OK); } else { parent::doStore(); } }
/** * @see parent::getValue() */ function getValue($object, $smarty = null, $params = array()) { if ($smarty) { include_once $smarty->_get_plugin_filepath('modifier', 'date_format'); } $propValue = $object->{$this->fieldName}; $format = CValue::first(@$params["format"], CAppUI::conf("date")); return $propValue && $propValue != "0000-00-00" ? $this->progressive ? $this->progressiveFormat($propValue) : smarty_modifier_date_format($propValue, $format) : ""; // TODO: test and use strftime($format, strtotime($propValue)) instead of smarty }
/** * @see parent::updateFormFields() */ function updateFormFields() { $this->_query_params_get = $get = json_decode($this->query_params_get, true); $this->_query_params_post = $post = json_decode($this->query_params_post, true); $this->_session_data = $session = json_decode($this->session_data, true); $get = is_array($get) ? $get : array(); $post = is_array($post) ? $post : array(); $this->_module = CValue::first(CMbArray::extract($get, "m"), CMbArray::extract($post, "m")); $this->_action = CValue::first(CMbArray::extract($get, "tab"), CMbArray::extract($get, "a"), CMbArray::extract($post, "dosql")); }
/** * Redirect to the last page * * @return void */ function redirect() { if (CValue::post("ajax")) { echo CAppUI::getMsg(); CApp::rip(); } $m = CValue::post("m"); $tab = CValue::post("tab"); CAppUI::redirect("m={$m}&tab={$tab}"); }
function doStore() { parent::doStore(); $dialog = CValue::post("dialog"); $isNew = !CValue::post("patient_id"); $patient_id = $this->_obj->patient_id; if ($isNew) { $this->redirectStore .= "&patient_id={$patient_id}&created={$patient_id}"; } elseif ($dialog) { $this->redirectStore .= "&name=" . $this->_obj->nom . "&firstname=" . $this->_obj->prenom; } }
function doBind() { $this->ajax = CValue::post("ajax"); $this->suppressHeaders = CValue::post("suppressHeaders"); $this->callBack = CValue::post("callback"); unset($_POST["ajax"]); unset($_POST["suppressHeaders"]); unset($_POST["callback"]); // Object binding $this->_obj->bind($_POST["suivi"]); $this->_old->load($this->_obj->_id); }
/** * Run test * * @param string $code Event code * @param CCnStep $step Step * * @throws CMbException * * @return void */ static function run($code, CCnStep $step) { $receiver = $step->_ref_test->loadRefPartner()->loadReceiverHL7v2(); if ($receiver) { CValue::setSessionAbs("cn_receiver_guid", $receiver->_guid); } $transaction = str_replace("-", "", $step->transaction); if (!$transaction) { throw new CMbException("CIHETestCase-no_transaction"); } call_user_func(array("C{$transaction}Test", "test{$code}"), $step); }
function toMB($value, CHL7v2Field $field) { $parsed = $this->parseHL7($value, $field); // empty value if ($parsed === "") { return ""; } // invalid value if ($parsed === false) { return; } return CValue::read($parsed, "hour", "00") . ":" . CValue::read($parsed, "minute", "00") . ":" . CValue::read($parsed, "second", "00"); }
function toHL7($value, CHL7v2Field $field) { $parsed = $this->parseMB($value, $field); // empty value if ($parsed === "") { return ""; } // invalid value if ($parsed === false) { return; } return CValue::read($parsed, "year") . (CValue::read($parsed, "month") === "00" ? "" : CValue::read($parsed, "month")) . (CValue::read($parsed, "day") === "00" ? "" : CValue::read($parsed, "day")) . CValue::read($parsed, "hour") . CValue::read($parsed, "minute") . CValue::read($parsed, "second"); }
function toMB($value, CHL7v2Field $field) { $parsed = $this->parseHL7($value, $field); // empty value if ($parsed === "") { return ""; } // invalid value if ($parsed === false) { return; } return CValue::read($parsed, "year") . "-" . CValue::read($parsed, "month", "00") . "-" . CValue::read($parsed, "day", "00"); }
/** * Returns the CMbObject with given GET or SESSION params keys, * if it doesn't exist, a redirect is made * * @param string $class_key The class name of the object * @param string $id_key The object ID * @param string $guid_key The object GUID (classname-id) * * @return CMbObject The object loaded or nothing **/ function mbGetObjectFromGetOrSession($class_key, $id_key, $guid_key = null) { $object_class = CValue::getOrSession($class_key); $object_id = CValue::getOrSession($id_key); $object_guid = "{$object_class}-{$object_id}"; if ($guid_key) { $object_guid = CValue::getOrSession($guid_key, $object_guid); } $object = CMbObject::loadFromGuid($object_guid); // Redirection if (!$object || !$object->_id) { global $ajax; CAppUI::redirect("ajax={$ajax}" . "&suppressHeaders=1" . "&m=system" . "&a=object_not_found" . "&object_guid={$object_guid}"); } return $object; }
function doBind() { parent::doBind(); // recuperation du sejour_id $_sejour_id = CValue::post("_sejour_id", null); // si pas de sejour_id, redirection if (!$_sejour_id) { $this->doRedirect(); } // Creation du nouvel antecedent unset($_POST["antecedent_id"]); $this->_obj = $this->_old; $this->_obj->_id = null; $this->_obj->antecedent_id = null; // Calcul de la valeur de l'id du dossier_medical du sejour $this->_obj->dossier_medical_id = CDossierMedical::dossierMedicalId($_sejour_id, "CSejour"); }
/** * Changes check list categories * * @param array $category_changes Categories changes * * @return void */ private function changeCheckListCategories($category_changes) { // reverse because of the title changes $category_changes = array_reverse($category_changes); // Category changes foreach ($category_changes as $_change) { $cat_class = $_change[0]; $cat_type = $_change[1]; $cat_title = $_change[2]; $cat_new_title = addslashes($_change[3]); $cat_new_desc = addslashes(CValue::read($_change, 4, null)); $query = "UPDATE `daily_check_item_category` SET\r\n `daily_check_item_category`.`title` = '{$cat_new_title}' "; if (isset($cat_new_desc)) { $query .= ", `daily_check_item_category`.`desc` = '{$cat_new_desc}' "; } $query .= "WHERE\r\n `daily_check_item_category`.`target_class` = '{$cat_class}' AND\r\n `daily_check_item_category`.`type` = '{$cat_type}' AND\r\n `daily_check_item_category`.`title` = '{$cat_title}'"; $this->addQuery($query); } }
/** * Fonction de construction du cache d'info des durées * d'hospi et d'interv * * @param string $tableName Nom de la table de cache * @param string $tableFields Champs de la table de cache * @param array $queryFields Liste des champs du select * @param string $querySelect Chaine contenant les éléments SELECT à utiliser * @param array $queryWhere Chaine contenant les éléments WHERE à utiliser * * @return void */ function buildPartialTables($tableName, $tableFields, $queryFields, $querySelect, $queryWhere) { $ds = CSQLDataSource::get("std"); $joinedFields = join(", ", $queryFields); // Intervale de temps $intervalle = CValue::get("intervalle"); switch ($intervalle) { case "month": $deb = CMbDT::date("-1 month"); break; case "6month": $deb = CMbDT::date("-6 month"); break; case "year": $deb = CMbDT::date("-1 year"); break; default: $deb = CMbDT::date("-10 year"); } $fin = CMbDT::date(); // Suppression si existe $drop = "DROP TABLE IF EXISTS `{$tableName}`"; $ds->exec($drop); // Création de la table partielle $create = "CREATE TABLE `{$tableName}` (" . "\n`chir_id` int(11) unsigned NOT NULL default '0'," . "{$tableFields}" . "\n`ccam` varchar(255) NOT NULL default ''," . "\nKEY `chir_id` (`chir_id`)," . "\nKEY `ccam` (`ccam`)" . "\n) /*! ENGINE=MyISAM */;"; $ds->exec($create); // Remplissage de la table partielle $query = "INSERT INTO `{$tableName}` ({$joinedFields}, `chir_id`, `ccam`)\r\n SELECT {$querySelect}\r\n operations.chir_id,\r\n operations.codes_ccam AS ccam\r\n FROM operations\r\n LEFT JOIN users\r\n ON operations.chir_id = users.user_id\r\n LEFT JOIN plagesop\r\n ON operations.plageop_id = plagesop.plageop_id\r\n WHERE operations.annulee = '0'\r\n {$queryWhere}\r\n AND operations.date BETWEEN '{$deb}' AND '{$fin}'\r\n GROUP BY operations.chir_id, ccam\r\n ORDER BY ccam;"; $ds->exec($query); CAppUI::stepAjax("Nombre de valeurs pour la table '{$tableName}': " . $ds->affectedRows(), UI_MSG_OK); // Insert dans la table principale si vide if (!$ds->loadResult("SELECT COUNT(*) FROM temps_op")) { $query = "INSERT INTO temps_op ({$joinedFields}, `chir_id`, `ccam`)\r\n SELECT {$joinedFields}, `chir_id`, `ccam`\r\n FROM {$tableName}"; $ds->exec($query); } else { $query = "UPDATE temps_op, {$tableName} SET "; foreach ($queryFields as $queryField) { $query .= "\ntemps_op.{$queryField} = {$tableName}.{$queryField}, "; } $query .= "temps_op.chir_id = {$tableName}.chir_id" . "\nWHERE temps_op.chir_id = {$tableName}.chir_id" . "\nAND temps_op.ccam = {$tableName}.ccam"; $ds->exec($query); } }
/** * @see parent::onAfterMain() */ function onAfterMain() { $cron_log_id = CValue::get("execute_cron_log_id"); if (!$cron_log_id) { return; } //Mise à jour du statut du log suite à l'appel au script $cron_log = new CCronJobLog(); $cron_log->load($cron_log_id); if (CCronJobLog::$log) { $cron_log->status = "error"; $cron_log->error = CCronJobLog::$log; $cron_log->end_datetime = CMbDT::dateTime(); } else { $cron_log->status = "finished"; $cron_log->end_datetime = CMbDT::dateTime(); } $cron_log->store(); }
/** * Handle link/unlink patients message * * @param CHL7Acknowledgment $ack Acknowledgment * @param CPatient $patient Person * @param array $data Data * * @return string|void */ function handle(CHL7Acknowledgment $ack, CPatient $patient, $data) { $exchange_hl7v2 = $this->_ref_exchange_hl7v2; $sender = $exchange_hl7v2->_ref_sender; $sender->loadConfigValues(); $this->_ref_sender = $sender; if (count($data["PID"]) != 2) { return $exchange_hl7v2->setAckAR($ack, "E500", null, $patient); } foreach ($data["PID"] as $_PID) { $patientPI = CValue::read($_PID['personIdentifiers'], "PI"); // Acquittement d'erreur : identifiants PI non fournis if (!$patientPI) { return $exchange_hl7v2->setAckAR($ack, "E100", null, $patient); } } $patient_1_PI = CValue::read($data["PID"][0]['personIdentifiers'], "PI"); $patient_2_PI = CValue::read($data["PID"][1]['personIdentifiers'], "PI"); $patient_1 = new CPatient(); $patient_1->_IPP = $patient_1_PI; $patient_1->loadFromIPP($sender->group_id); // PI non connu (non fourni ou non retrouvé) if (!$patient_1->_id) { return $exchange_hl7v2->setAckAR($ack, "E501", null, $patient_1); } $patient_2 = new CPatient(); $patient_2->_IPP = $patient_2_PI; $patient_2->loadFromIPP($sender->group_id); // PI non connu (non fourni ou non retrouvé) if (!$patient_2->_id) { return $exchange_hl7v2->setAckAR($ack, "E501", null, $patient_2); } $function_handle = "handle{$exchange_hl7v2->code}"; if (!method_exists($this, $function_handle)) { return $exchange_hl7v2->setAckAR($ack, "E006", null, $patient); } return $this->{$function_handle}($ack, $patient_1, $patient_2, $data); }
function syncPatient($update = true) { $medecin_id = $this->consume("medecin_id"); // Gestion des id400 $tag = "medecin-patient"; $idex = new CIdSante400(); $idex->object_class = "CPatient"; $idex->id400 = $medecin_id; $idex->tag = $tag; // Identité $patient = new CPatient(); $patient->nom = $this->consume("nom"); $patient->prenom = CValue::first($this->consume("prenom"), $patient->nom); // Simulation de l'âge $year = 1980 - strlen($patient->nom); $month = '01'; $day = str_pad(strlen($patient->prenom) % 30, 2, '0', STR_PAD_LEFT); $patient->naissance = "{$year}-{$month}-{$day}"; // Binding $this->trace($patient->getProperties(true), "Patient à enregistrer"); $idex->bindObject($patient); $this->markStatus(self::STATUS_PATIENT); }
/** * Redirection facility * * @param string $action Action view * @param string $params HTTP GET styled paramters * * @return void */ function redirect($action = "access_denied", $params = null) { global $actionType; // on passe a null soit "tab" soit "a" selon ou l'on se trouve CValue::setSession($actionType); if ($this->setValues) { if (is_scalar($this->setValues)) { CValue::setSession($this->setValues); } else { foreach ($this->setValues as $key => $value) { CValue::setSession($key, $value); } } } $action_params = ""; foreach (array("wsdl", "info", "ajax", "raw", "dialog") as $_action_type) { $_action_flag = CValue::get($_action_type); if ($_action_flag) { $action_params .= "&{$_action_type}={$_action_flag}"; } } $context_param = $this->context ? "&context={$this->context}" : ""; CAppUI::redirect("m=system&a={$action}" . $context_param . $action_params . $params); }
<?php /** * $Id$ * * @package Mediboard * @subpackage Cabinet * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); $consult_id = CValue::get("consult_id"); $consult = new CConsultation(); $consult->_id = $consult_id; $consult->load(); $consult->loadRefPatient(); $consult->loadRefGrossesse(); $type = ""; switch ($consult->type_assurance) { case "classique": $type = "assurance_classique"; break; case "at": $type = "accident_travail"; break; case "smg": $type = "soins_medicaux_gratuits"; break; case "maternite": $type = "maternite";
<?php /** * $Id: httpreq_vw_list_techniques_comp.php 24480 2014-08-20 10:51:06Z flaviencrochard $ * * @package Mediboard * @subpackage Cabinet * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 24480 $ */ CCanDo::checkEdit(); $selConsult = CValue::getOrSession("selConsult", 0); $dossier_anesth_id = CValue::getOrSession("dossier_anesth_id", 0); $consult = new CConsultation(); $consult->load($selConsult); $consult->loadRefConsultAnesth($dossier_anesth_id); $consult->_ref_consult_anesth->loadRefsBack(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("consult_anesth", $consult->_ref_consult_anesth); $smarty->display("inc_consult_anesth/techniques_comp.tpl");
<?php /** * $Id: inc_edit_planning.php 22873 2014-04-22 07:51:07Z mytto $ * * @package Mediboard * @subpackage dPbloc * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 22873 $ */ $plageop_id = CValue::getOrSession("plageop_id"); $date = CValue::getOrSession("date", CMbDT::date()); $bloc_id = CValue::get("bloc_id"); // Informations sur la plage demandée $plagesel = new CPlageOp(); $plagesel->load($plageop_id); $plagesel->loadRefSalle(); $listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom"); //curent bloc if $bloc_id $bloc = new CBlocOperatoire(); $bloc->load($bloc_id); $listSalles = $bloc->loadRefsSalles(); $arrKeySalle = array_keys($listSalles); // cleanup listBlocs foreach ($listBlocs as $key => $curr_bloc) { $salles = $curr_bloc->loadRefsSalles(); foreach ($salles as $id => $_salle) { if (count($arrKeySalle) && !in_array($id, $arrKeySalle)) { unset($salles[$id]); continue;
<?php /** * $Id: vw_rapport.php 20186 2013-08-19 07:47:12Z phenxdesign $ * * @package Mediboard * @subpackage Hospi * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 20186 $ */ $date = CValue::getOrSession("date"); // Chargement des praticiens $med = new CMediusers(); $listPrat = $med->loadPraticiens(PERM_READ); $dateEntree = CMbDT::dateTime("23:59:00", $date); $dateSortie = CMbDT::dateTime("00:01:00", $date); $hierEntree = CMbDT::date("- 1 day", $dateEntree); $hierEntree = CMbDT::dateTime("23:59:00", $hierEntree); // Chargement des services $service = new CService(); $whereServices = array(); $whereServices["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'"; $whereServices["cancelled"] = "= '0'"; $services = $service->loadListWithPerms(PERM_READ, $whereServices, "nom"); // Initialisations $totalHospi = 0; $totalAmbulatoire = 0; $totalMedecin = 0; $total_prat = array(); foreach ($listPrat as $key => $prat) {
/** * $Id: ajax_login_as.php 20443 2013-09-23 13:48:21Z phenxdesign $ * * @category Admin * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 20443 $ * @link http://www.mediboard.org */ $user = CUser::get(); $username = trim(CValue::post('username')); $password = trim(CValue::post('password')); // If substitution happens when a session is locked $is_locked = CValue::get("is_locked"); if ($is_locked) { $_SESSION['locked'] = false; } $ldap_connection = CAppUI::conf("admin LDAP ldap_connection"); $allow_login_as_ldap = CAppUI::conf("admin LDAP allow_login_as_admin"); if (!$username) { CAppUI::setMsg("Auth-failed-nousername", UI_MSG_ERROR); } else { if ($user->user_type == 1 && (!$ldap_connection || $allow_login_as_ldap)) { // If admin: no need to give a password $_REQUEST['loginas'] = $username; CAppUI::login(); } else { if (!$password) { CAppUI::setMsg("Auth-failed-nopassword", UI_MSG_ERROR);
<?php /** * $Id$ * * @package Mediboard * @subpackage dPfacturation * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ $out = fopen('php://output', 'w'); header('Content-Type: application/csv'); header('Content-Disposition: attachment; filename="ExportCompta.xls"'); $facture_class = CValue::get("facture_class", 'CFactureEtablissement'); $factures_id = CValue::get("factures", array()); $factures_id = explode("|", $factures_id); $where = array(); $where["facture_id"] = CSQLDataSource::prepareIn(array_values($factures_id)); $facture = new $facture_class(); $factures = $facture->loadList($where); // Ligne d'entête $fields = array(); $fields[] = "Date"; $fields[] = "Facture"; $fields[] = "Patient"; $fields[] = "Montant"; fputcsv($out, $fields, ';'); foreach ($factures as $_facture) { /* @var CFactureEtablissement $_facture*/ $_facture->loadRefPatient();
/** * $Id$ * * @package Mediboard * @subpackage dPstats * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CAppUI::requireLibraryFile("jpgraph/src/mbjpgraph"); CAppUI::requireLibraryFile("jpgraph/src/jpgraph_bar"); $debut = CValue::get("debut", CMbDT::date("-1 YEAR")); $fin = CValue::get("fin", CMbDT::date()); $prat_id = CValue::get("prat_id", 0); $service_id = CValue::get("service_id", 0); $pratSel = new CMediusers(); $pratSel->load($prat_id); $service = new CSalle(); $service->load($service_id); $datax = array(); for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) { $datax[] = CMbDT::transform("+0 DAY", $i, "%m/%Y"); } $sql = "SELECT * FROM service WHERE"; if ($service_id) { $sql .= "\nAND id = '{$service_id}'"; } $ds = CSQLDataSource::get("std"); $services = $ds->loadlist($sql); $opbysalle = array();