本文整理汇总了PHP中CMediusers::load方法的典型用法代码示例。如果您正苦于以下问题:PHP CMediusers::load方法的具体用法?PHP CMediusers::load怎么用?PHP CMediusers::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMediusers
的用法示例。
在下文中一共展示了CMediusers::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadRefsFwd
/**
* @see parent::loadRefsFwd()
*/
function loadRefsFwd()
{
parent::loadRefsFwd();
$this->_ref_user = new CMediusers();
$this->_ref_user->load($this->user_id);
$this->_view = "Note écrite par " . $this->_ref_user->_view;
}
示例2: graphConsultations
/**
* Récupération des statistiques du nombre de consultations par mois
* selon plusieurs filtres
*
* @param string $debut Date de début
* @param string $fin Date de fin
* @param int $prat_id Identifiant du praticien
*
* @return array
*/
function graphConsultations($debut = null, $fin = null, $prat_id = 0)
{
if (!$debut) {
$debut = CMbDT::date("-1 YEAR");
}
if (!$fin) {
$fin = CMbDT::date();
}
$rectif = CMbDT::transform("+0 DAY", $debut, "%d") - 1;
$debutact = CMbDT::date("-{$rectif} DAYS", $debut);
$rectif = CMbDT::transform("+0 DAY", $fin, "%d") - 1;
$finact = CMbDT::date("-{$rectif} DAYS", $fin);
$finact = CMbDT::date("+ 1 MONTH", $finact);
$finact = CMbDT::date("-1 DAY", $finact);
$pratSel = new CMediusers();
$pratSel->load($prat_id);
$ticks = array();
$serie_total = array('label' => 'Total', 'data' => array(), 'markers' => array('show' => true), 'bars' => array('show' => false));
for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
$ticks[] = array(count($ticks), CMbDT::transform("+0 DAY", $i, "%m/%Y"));
$serie_total['data'][] = array(count($serie_total['data']), 0);
}
$ds = CSQLDataSource::get("std");
$total = 0;
$series = array();
$query = "SELECT COUNT(consultation.consultation_id) AS total,\r\n DATE_FORMAT(plageconsult.date, '%m/%Y') AS mois,\r\n DATE_FORMAT(plageconsult.date, '%Y%m') AS orderitem\r\n FROM consultation\r\n INNER JOIN plageconsult\r\n ON consultation.plageconsult_id = plageconsult.plageconsult_id\r\n INNER JOIN users_mediboard\r\n ON plageconsult.chir_id = users_mediboard.user_id\r\n WHERE plageconsult.date BETWEEN '{$debutact}' AND '{$finact}'\r\n AND consultation.annule = '0'";
if ($prat_id) {
$query .= "\nAND plageconsult.chir_id = '{$prat_id}'";
}
$query .= "\nGROUP BY mois ORDER BY orderitem";
$serie = array('data' => array());
$result = $ds->loadlist($query);
foreach ($ticks as $i => $tick) {
$f = true;
foreach ($result as $r) {
if ($tick[1] == $r["mois"]) {
$serie["data"][] = array($i, $r["total"]);
$serie_total["data"][$i][1] += $r["total"];
$total += $r["total"];
$f = false;
break;
}
}
if ($f) {
$serie["data"][] = array(count($serie["data"]), 0);
}
}
$series[] = $serie;
// Set up the title for the graph
$title = "Nombre de consultations";
$subtitle = "- {$total} consultations -";
if ($prat_id) {
$subtitle .= " Dr {$pratSel->_view} -";
}
$options = CFlotrGraph::merge("bars", array('title' => utf8_encode($title), 'subtitle' => utf8_encode($subtitle), 'xaxis' => array('ticks' => $ticks), 'bars' => array('stacked' => true, 'barWidth' => 0.8)));
return array('series' => $series, 'options' => $options);
}
示例3: createEmployes
/**
* Crée les employés du cabinet
*
* @return bool
*/
protected function createEmployes()
{
$param = new CParamsPaie();
$params = $param->loadList();
if (!is_array($params)) {
return true;
}
foreach ($params as $key => $curr_param) {
$user = new CMediusers();
$user->load($params[$key]->employecab_id);
$employe = new CEmployeCab();
$employe->function_id = $user->function_id;
$employe->nom = $user->_user_last_name;
$employe->prenom = $user->_user_first_name;
$employe->function = $user->_user_type;
$employe->adresse = $user->_user_adresse;
$employe->cp = $user->_user_cp;
$employe->ville = $user->_user_ville;
$employe->store();
$params[$key]->employecab_id = $employe->employecab_id;
$params[$key]->store();
}
return true;
}
示例4: CSejour
* @category Soins
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkEdit();
$consult_id = CValue::get("consult_id", 0);
$sejour_id = CValue::get("sejour_id", 0);
$chir_id = CValue::get("chir_id", 0);
$sejour = new CSejour();
$sejour->load($sejour_id);
if ($sejour->_id) {
$chir = new CMediusers();
if ($chir_id) {
$chir->load($chir_id);
} else {
$chir->load($sejour->praticien_id);
}
$sejour->loadRefPraticien();
$sejour->loadRefsActes();
$sejour->updateFormFields();
$sejour->_datetime = CMbDT::dateTime();
// Récupération des tarifs
/** @var CTarif $tarif */
$tarif = new CTarif();
$tarifs = array();
$order = "description";
$where = array();
$where["chir_id"] = "= '{$chir->_id}'";
$tarifs["user"] = $tarif->loadList($where, $order);
示例5: CMediusers
}
// L'utilisateur est-il chirurgien?
$chir_id = CValue::getOrSession("chir_id");
$mediuser = CMediusers::get($chir_id);
if (!$mediuser->isPraticien()) {
$mediuser = new CMediusers();
}
$function_id = CValue::getOrSession("function_id");
$type = CValue::getOrSession("type", "interv");
$page = CValue::get("page");
$sejour_type = CValue::get("sejour_type");
$step = 30;
$protocole = new CProtocole();
$where = array();
$chir = new CMediusers();
$chir->load($chir_id);
if ($chir->_id) {
$chir->loadRefFunction();
$functions = array($chir->function_id);
$chir->loadBackRefs("secondary_functions");
foreach ($chir->_back["secondary_functions"] as $curr_sec_func) {
$functions[] = $curr_sec_func->function_id;
}
$list_functions = implode(",", $functions);
$where[] = "protocole.chir_id = '{$chir->_id}' OR protocole.function_id IN ({$list_functions})";
} else {
$where["function_id"] = " = '{$function_id}'";
}
$where["for_sejour"] = $type == 'interv' ? "= '0'" : "= '1'";
if ($sejour_type) {
$where["type"] = "= '{$sejour_type}'";
示例6: CMediusers
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage SSR
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCando::checkEdit();
$date = CValue::get("date", CMbDT::date());
$kine_id = CValue::getOrSession("kine_id", CAppUI::$instance->user_id);
// Chargement de la liste des utilisateurs
$user = new CMediusers();
$kines = CModule::getActive("dPprescription") ? CFunctionCategoryPrescription::getAllExecutants() : $user->loadKines();
$kine = new CMediusers();
$kine->load($kine_id);
$kine->loadRefIntervenantCdARR();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("kine", $kine);
$smarty->assign("kines", $kines);
$smarty->assign("kine_id", $kine_id);
$smarty->display("vw_kine_board.tpl");
示例7: CConsultation
$consult = new CConsultation();
$userSel = new CMediusers();
$operation = new COperation();
$operation->load($op);
$operation->loadRefChir();
$operation->loadRefSejour();
$consult_anesth = $operation->loadRefsConsultAnesth();
if ($consult_anesth->_id) {
$consult_anesth->loadRefConsultation();
$consult = $consult_anesth->_ref_consultation;
$consult->_ref_consult_anesth = $consultAnesth;
$consult->loadRefPlageConsult();
$consult->loadRefsDocItems();
$consult->loadRefPatient();
$prat_id = $consult->_ref_plageconsult->chir_id;
$consult_anesth->loadRefs();
// On charge le praticien
$userSel->load($prat_id);
$userSel->loadRefs();
}
$anesth = new CTypeAnesth();
$anesth = $anesth->loadGroupList();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("op", $op);
$smarty->assign("date", $date);
$smarty->assign("operation", $operation);
$smarty->assign("anesth", $anesth);
$smarty->assign("techniquesComp", new CTechniqueComp());
$smarty->assign("isPrescriptionInstalled", CModule::getActive("prescription"));
$smarty->display("vw_anesthesie.tpl");
示例8: CDoObjectAddEdit
<?php
/**
* dPccam
*
* @category Ccam
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id: do_favoris_aed.php 19221 2013-05-21 14:24:43Z rhum1 $
* @link http://www.mediboard.org
*/
$do = new CDoObjectAddEdit("CFavoriCCAM", "favoris_id");
// Amélioration des textes
if ($favori_user = CValue::post("favoris_user")) {
$user = new CMediusers();
$user->load($favori_user);
$for = " pour {$user->_view}";
$do->createMsg .= $for;
$do->modifyMsg .= $for;
$do->deleteMsg .= $for;
}
$do->redirect = null;
$do->doIt();
if (CAppUI::pref("new_search_ccam") == 1) {
echo CAppUI::getMsg();
CApp::rip();
}
示例9: CMediusers
* dPboard
*
* @category Board
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id$
* @link http://www.mediboard.org
*/
CCanDo::checkRead();
$ds = CSQLDataSource::get("std");
// Récupération des paramètres
$chirSel = CValue::getOrSession("chirSel");
$date = CValue::getOrSession("date", CMbDT::date());
$praticien = new CMediusers();
$praticien->load($chirSel);
$where = array();
$ljoin = array();
if ($praticien->isAnesth()) {
$ljoin = array();
$ljoin["operations"] = "operations.sejour_id = sejour.sejour_id";
$ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
$where[] = "operations.anesth_id = '{$chirSel}' OR (operations.anesth_id IS NULL AND plagesop.anesth_id = '{$chirSel}')";
} else {
$where["sejour.praticien_id"] = "= '{$chirSel}'";
}
$where["sejour.entree"] = "<= '{$date} 23:59:59'";
$where["sejour.sortie"] = ">= '{$date} 00:00:00'";
$where["sejour.annule"] = "= '0'";
$where["sejour.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$sejour = new CSejour();
示例10: graphPatParService
/**
* Affichage du graphique de la réparition des patients par service
*
* @param date $debut Début de la période
* @param date $fin Fin de la période
* @param int $prat_id Filtre sur un praticien
* @param int $service_id Filtre sur un service
* @param string $type_adm Filtre sur le type d'admission
* @param int $func_id Filtre sur un cabinet
* @param int $discipline_id Filtre sur une discipline
* @param int $septique Filtre sur les patients septiques
* @param string $type_data Choix du type de données
*
* @return array
*/
function graphPatParService($debut = null, $fin = null, $prat_id = 0, $service_id = 0, $type_adm = "", $func_id = 0, $discipline_id = 0, $septique = 0, $type_data = "prevue")
{
if (!$debut) {
$debut = CMbDT::date("-1 YEAR");
}
if (!$fin) {
$fin = CMbDT::date();
}
$group_id = CGroups::loadCurrent()->_id;
$prat = new CMediusers();
$prat->load($prat_id);
$discipline = new CDiscipline();
$discipline->load($discipline_id);
$ticks = array();
$serie_total = array('label' => 'Total', 'data' => array(), 'markers' => array('show' => true), 'bars' => array('show' => false));
for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
$ticks[] = array(count($ticks), CMbDT::transform("+0 DAY", $i, "%m/%Y"));
$serie_total['data'][] = array(count($serie_total['data']), 0);
}
$where = array();
if ($service_id) {
$where["service_id"] = "= '{$service_id}'";
}
$service = new CService();
$services = $service->loadGroupList($where);
$sejour = new CSejour();
$listHospis = array(1 => "Hospi complètes + ambu") + $sejour->_specs["type"]->_locales;
$total = 0;
$series = array();
// Patients placés
foreach ($services as $service) {
$serie = array('data' => array(), 'label' => utf8_encode($service->nom));
$query = "SELECT COUNT(DISTINCT sejour.sejour_id) AS total, service.nom AS nom,\r\n DATE_FORMAT(affectation.entree, '%m/%Y') AS mois,\r\n DATE_FORMAT(affectation.entree, '%Y%m') AS orderitem\r\n FROM sejour\r\n LEFT JOIN users_mediboard ON sejour.praticien_id = users_mediboard.user_id\r\n LEFT JOIN affectation ON sejour.sejour_id = affectation.sejour_id\r\n LEFT JOIN service ON affectation.service_id = service.service_id\r\n WHERE\r\n sejour.annule = '0' AND\r\n sejour.group_id = '{$group_id}' AND\r\n affectation.entree < '{$fin} 23:59:59' AND\r\n affectation.sortie > '{$debut} 00:00:00' AND\r\n service.service_id = '{$service->_id}'";
if ($type_data == "reelle") {
$query .= "\nAND sejour.entree_reelle BETWEEN '{$debut} 00:00:00' AND '{$fin} 23:59:59'";
}
if ($prat_id) {
$query .= "\nAND sejour.praticien_id = '{$prat_id}'";
}
if ($discipline_id) {
$query .= "\nAND users_mediboard.discipline_id = '{$discipline_id}'";
}
if ($septique) {
$query .= "\nAND sejour.septique = '{$septique}'";
}
if ($type_adm) {
if ($type_adm == 1) {
$query .= "\nAND (sejour.type = 'comp' OR sejour.type = 'ambu')";
} else {
$query .= "\nAND sejour.type = '{$type_adm}'";
}
}
$query .= "\nGROUP BY mois ORDER BY orderitem";
$result = $sejour->_spec->ds->loadlist($query);
foreach ($ticks as $i => $tick) {
$f = true;
foreach ($result as $r) {
if ($tick[1] == $r["mois"]) {
$serie["data"][] = array($i, $r["total"]);
$serie_total["data"][$i][1] += $r["total"];
$total += $r["total"];
$f = false;
break;
}
}
if ($f) {
$serie["data"][] = array(count($serie["data"]), 0);
}
}
$series[] = $serie;
}
// Patients non placés
if (!$service_id) {
$serie = array('data' => array(), 'label' => utf8_encode("Non placés"));
$query = "SELECT COUNT(DISTINCT sejour.sejour_id) AS total, 'Non placés' AS nom,\r\n DATE_FORMAT(sejour.entree_{$type_data}, '%m/%Y') AS mois,\r\n DATE_FORMAT(sejour.entree_{$type_data}, '%Y%m') AS orderitem\r\n FROM sejour\r\n LEFT JOIN users_mediboard ON sejour.praticien_id = users_mediboard.user_id\r\n LEFT JOIN affectation ON sejour.sejour_id = affectation.sejour_id\r\n WHERE \r\n sejour.annule = '0' AND\r\n sejour.group_id = '{$group_id}' AND\r\n sejour.entree_{$type_data} < '{$fin} 23:59:59' AND\r\n sejour.sortie_{$type_data} > '{$debut} 00:00:00' AND\r\n\r\n affectation.affectation_id IS NULL";
if ($prat_id) {
$query .= "\nAND sejour.praticien_id = '{$prat_id}'";
}
if ($discipline_id) {
$query .= "\nAND users_mediboard.discipline_id = '{$discipline_id}'";
}
if ($septique) {
$query .= "\nAND sejour.septique = '{$septique}'";
}
if ($type_adm) {
//.........这里部分代码省略.........
示例11: CMediusers
/**
* $Id: ajax_board_sejours.php 28613 2015-06-16 14:21:17Z aurelie17 $
*
* @package Mediboard
* @subpackage SSR
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 28613 $
*/
CCanDo::checkEdit();
$mode = CValue::get("mode", "count");
$date = CValue::getOrSession("date", CMbDT::date());
$kine_id = CValue::getOrSession("kine_id");
$hide_noevents = CValue::getOrSession("hide_noevents");
$mediuser = new CMediusers();
$mediuser->load($kine_id);
$planning = new CPlanningWeek($date);
// Sejour SSR
$sejour = new CSejour();
$counts = array();
/** @var CSejour[] $sejours */
$sejours = array();
$ds = CSQLDataSource::get("std");
// Sejours pour lesquels le kine est référent
if ($mode == "count" || $mode == "referenced") {
$join = array();
$join["patients"] = "patients.patient_id = sejour.patient_id";
$order = "nom, prenom";
$join["bilan_ssr"] = "bilan_ssr.sejour_id = sejour.sejour_id";
$join["technicien"] = "technicien.technicien_id = bilan_ssr.technicien_id";
$where = array();
示例12: CMediusers
$filter->_date_max = CValue::getOrSession("_date_max", CMbDT::date());
$filter->prat_id = CValue::getOrSession("prat_id");
$filter->paye = CValue::getOrSession("type");
$prat_id = CValue::get("prat_id", 0);
if (!$prat_id) {
echo "Vous devez choisir un praticien valide";
CApp::rip();
}
if ($filter->_date_max > CMbDT::date()) {
$filter->_date_max = CMbDT::date();
}
$filter->paye = CValue::get("type", 0);
$total = 0;
// Chargement du praticien
$prat = new CMediusers();
$prat->load($filter->prat_id);
// Chargement des plages de ressource
$plages = new CPlageressource();
$where["date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
$where["prat_id"] = "= '{$filter->prat_id}'";
$where["paye"] = "= '{$filter->paye}'";
$order = "date";
$plages = $plages->loadList($where, $order);
foreach ($plages as $key => $value) {
$total += $value->tarif;
}
$smarty = new CSmartyDP();
$smarty->debugging = false;
$smarty->assign("filter", $filter);
$smarty->assign("prat", $prat);
$smarty->assign("plages", $plages);
示例13: foreach
if ($presc && $presc->_id) {
$presc->countLinesMedsElements($userSel->_id);
}
foreach ($_sejour->_ref_documents as $_doc) {
$_doc->canDo();
}
}
}
}
// Praticien concerné
$user = CMediusers::get();
if ($user->isPraticien()) {
$praticien = $user;
} else {
$praticien = new CMediusers();
$praticien->load(CValue::getOrSession("pratSel", CValue::getOrSession("praticien_id")));
}
$praticien->loadRefFunction();
$praticien->_ref_function->loadRefGroup();
$praticien->canDo();
// Compter les modèles d'étiquettes
$modele_etiquette = new CModeleEtiquette();
$where = array();
$where['object_class'] = "= 'COperation'";
$where["group_id"] = " = '" . CGroups::loadCurrent()->_id . "'";
$nb_modeles_etiquettes_operation = $modele_etiquette->countList($where);
$where['object_class'] = "= 'CSejour'";
$nb_modeles_etiquettes_sejour = $modele_etiquette->countList($where);
$nb_printers = 0;
if (CModule::getActive("printing")) {
// Chargement des imprimantes pour l'impression d'étiquettes
示例14: array
$chir = CValue::get("chir");
$anesth = CValue::get("anesth");
$object_class = CValue::get("object_class");
$profiles = array("chir" => $chir, "anesth" => $anesth, "user" => $user->_id);
if ($profiles["user"] == $profiles["anesth"] || $profiles["user"] == $profiles["chir"]) {
unset($profiles["user"]);
}
if (!$profiles["anesth"]) {
unset($profiles["anesth"]);
}
$listByProfile = array();
$users = array();
foreach ($profiles as $profile => $_user_id) {
// Chargement du user du profile
$_user = new CMediusers();
$_user->load($_user_id);
$users[$profile] = $_user;
$list = array();
if ($type == "ccam") {
/**
* Favoris
*/
if ($mode == "favoris") {
$condition = "favoris_user = '{$_user_id}'";
if ($object_class != "") {
$condition .= " AND object_class = '{$object_class}'";
}
$sql = "select favoris_code\r\n from ccamfavoris\r\n where {$condition}\r\n group by favoris_code\r\n order by favoris_code";
$codes = $ds->loadlist($sql);
foreach ($codes as $key => $value) {
// Attention à bien cloner le code CCAM car on rajoute une champ à la volée
示例15: graphActiviteZoom
/**
* Récupération des statistiques du nombre d'interventions par jour
* selon plusieurs filtres
*
* @param string $date Date de début
* @param int $prat_id Identifiant du praticien
* @param int $salle_id Identifiant de la sall
* @param int $bloc_id Identifiant du bloc
* @param int $discipline_id Identifiant de la discipline
* @param string $codes_ccam Code CCAM
* @param string $type_hospi Type d'hospitalisation
* @param bool $hors_plage Prise en compte des hors plage
*
* @return array
*/
function graphActiviteZoom($date, $prat_id = 0, $salle_id = 0, $bloc_id = 0, $func_id = 0, $discipline_id = 0, $codes_ccam = '', $type_hospi = "", $hors_plage = true)
{
if (!$date) {
$date = CMbDT::transform("+0 DAY", CMbDT::date(), "%m/%Y");
}
$prat = new CMediusers();
$prat->load($prat_id);
$salle = new CSalle();
$salle->load($salle_id);
$discipline = new CDiscipline();
$discipline->load($discipline_id);
// Gestion de la date
$debut = substr($date, 3, 7) . "-" . substr($date, 0, 2) . "-01";
$fin = CMbDT::date("+1 MONTH", $debut);
$fin = CMbDT::date("-1 DAY", $fin);
$step = "+1 DAY";
// Tableaux des jours
$ticks = array();
$ticks2 = array();
$serie_total = array('label' => 'Total', 'data' => array(), 'markers' => array('show' => true), 'bars' => array('show' => false));
for ($i = $debut; $i <= $fin; $i = CMbDT::date($step, $i)) {
$ticks[] = array(count($ticks), CMbDT::format($i, "%a %d"));
$ticks2[] = array(count($ticks), CMbDT::format($i, "%d"));
$serie_total['data'][] = array(count($serie_total['data']), 0);
}
$salles = CSalle::getSallesStats($salle_id, $bloc_id);
$series = array();
$total = 0;
foreach ($salles as $salle) {
$serie = array('data' => array(), 'label' => utf8_encode($salle->nom));
$query = "SELECT COUNT(operations.operation_id) AS total,\r\n DATE_FORMAT(operations.date, '%d') AS jour,\r\n sallesbloc.nom AS nom\r\n FROM operations\r\n INNER JOIN sejour ON operations.sejour_id = sejour.sejour_id\r\n INNER JOIN sallesbloc ON operations.salle_id = sallesbloc.salle_id\r\n INNER JOIN plagesop ON operations.plageop_id = plagesop.plageop_id\r\n INNER JOIN users_mediboard ON operations.chir_id = users_mediboard.user_id\r\n WHERE operations.date BETWEEN '{$debut}' AND '{$fin}'\r\n AND operations.plageop_id IS NOT NULL\r\n AND operations.annulee = '0'\r\n AND sallesbloc.salle_id = '{$salle->_id}'";
if ($prat_id && !$prat->isFromType(array("Anesthésiste"))) {
$query .= "\nAND operations.chir_id = '{$prat_id}'";
}
if ($prat_id && $prat->isFromType(array("Anesthésiste"))) {
$query .= "\nAND (operations.anesth_id = '{$prat_id}' OR \r\n (plagesop.anesth_id = '{$prat_id}' AND (operations.anesth_id = '0' OR operations.anesth_id IS NULL)))";
}
if ($discipline_id) {
$query .= "\nAND users_mediboard.discipline_id = '{$discipline_id}'";
}
if ($codes_ccam) {
$query .= "\nAND operations.codes_ccam LIKE '%{$codes_ccam}%'";
}
if ($type_hospi) {
$query .= "\nAND sejour.type = '{$type_hospi}'";
}
$query .= "\nGROUP BY jour ORDER BY jour";
$result = $salle->_spec->ds->loadlist($query);
$result_hors_plage = array();
if ($hors_plage) {
$query_hors_plage = "SELECT COUNT(operations.operation_id) AS total,\r\n DATE_FORMAT(operations.date, '%d') AS jour,\r\n sallesbloc.nom AS nom\r\n FROM operations\r\n INNER JOIN sejour ON operations.sejour_id = sejour.sejour_id\r\n INNER JOIN sallesbloc ON operations.salle_id = sallesbloc.salle_id\r\n INNER JOIN users_mediboard ON operations.chir_id = users_mediboard.user_id\r\n WHERE operations.date BETWEEN '{$debut}' AND '{$fin}'\r\n AND operations.plageop_id IS NULL\r\n AND operations.annulee = '0'\r\n AND sallesbloc.salle_id = '{$salle->_id}'";
if ($prat_id && !$prat->isFromType(array("Anesthésiste"))) {
$query_hors_plage .= "\nAND operations.chir_id = '{$prat_id}'";
}
if ($prat_id && $prat->isFromType(array("Anesthésiste"))) {
$query_hors_plage .= "\nAND operations.anesth_id = '{$prat_id}'";
}
if ($discipline_id) {
$query_hors_plage .= "\nAND users_mediboard.discipline_id = '{$discipline_id}'";
}
if ($codes_ccam) {
$query_hors_plage .= "\nAND operations.codes_ccam LIKE '%{$codes_ccam}%'";
}
if ($type_hospi) {
$query_hors_plage .= "\nAND sejour.type = '{$type_hospi}'";
}
$query_hors_plage .= "\nGROUP BY jour ORDER BY jour";
$result_hors_plage = $salle->_spec->ds->loadlist($query_hors_plage);
}
foreach ($ticks2 as $i => $tick) {
$f = true;
foreach ($result as $r) {
if ($tick[1] == $r["jour"]) {
if ($hors_plage) {
foreach ($result_hors_plage as &$_r_h) {
if ($tick[1] == $_r_h["jour"]) {
$r["total"] += $_r_h["total"];
unset($_r_h);
break;
}
}
}
$serie["data"][] = array($i, $r["total"]);
$serie_total["data"][$i][1] += $r["total"];
$total += $r["total"];
//.........这里部分代码省略.........