$curr_key = CMbDT::transform("{$i} month", $date, "%Y-%m-%d"); $curr_month = CMbDT::transform("{$i} month", $date, "%B %Y"); $listMonthes[$i]["date"] = $curr_key; $listMonthes[$i]["month"] = $curr_month; } // Chargement du chirurgien $mediChir = new CMediusers(); $mediChir->load($chir); $mediChir->loadBackRefs("secondary_functions"); $secondary_functions = array(); foreach ($mediChir->_back["secondary_functions"] as $curr_sec_func) { $secondary_functions[] = $curr_sec_func->function_id; } // Chargement de la liste des blocs opératoires $bloc = new CBlocOperatoire(); $blocs = $bloc->loadGroupList(null, "nom"); foreach ($blocs as $_bloc) { $_bloc->loadRefsSalles(); $_bloc->_date_min = CMbDT::date("+ " . $_bloc->days_locked . " DAYS"); } // Chargement des plages pour le chir ou sa spécialité par bloc $where = array(); $selectPlages = "(plagesop.chir_id = %1 OR plagesop.spec_id = %2 OR plagesop.spec_id " . CSQLDataSource::prepareIn($secondary_functions) . ")"; $where[] = $ds->prepare($selectPlages, $mediChir->user_id, $mediChir->function_id); $month_min = CMbDT::transform("+ 0 month", $date, "%Y-%m-00"); $month_max = CMbDT::transform("+ 1 month", $date, "%Y-%m-00"); $where["date"] = "BETWEEN '{$month_min}' AND '{$month_max}'"; if (!$resp_bloc) { $where[] = "date >= '" . CMbDT::date() . "'"; } $order = "date, debut";
$filter = new CConsultation(); $filter->_date_min = CMbDT::date(); $filter->_date_max = CMbDT::date("+ 0 day"); $filter->_etat_paiement = CValue::getOrSession("_etat_paiement", 0); $filter->_type_affichage = CValue::getOrSession("_type_affichage", 0); $filter_reglement = new CReglement(); $filter_reglement->mode = CValue::getOrSession("mode", 0); // L'utilisateur est-il praticien ? $mediuser = CMediusers::get(); $mediuser->loadRefFunction(); $is_praticien = $mediuser->isPraticien(); $is_admin = in_array(CUser::$types[$mediuser->_user_type], array("Administrator")); $is_admin_or_secretaire = in_array(CUser::$types[$mediuser->_user_type], array("Administrator", "Secrétaire")); $listPrat = CConsultation::loadPraticiensCompta(); $bloc = new CBlocOperatoire(); $blocs = $bloc->loadGroupList(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("filter", $filter); $smarty->assign("filter_reglement", $filter_reglement); $smarty->assign("mediuser", $mediuser); $smarty->assign("is_praticien", $is_praticien); $smarty->assign("is_admin_or_secretaire", $is_admin_or_secretaire); $smarty->assign("listPrat", $listPrat); $smarty->assign("now", $now); $smarty->assign("yesterday", $yesterday); $smarty->assign("week_deb", $week_deb); $smarty->assign("week_fin", $week_fin); $smarty->assign("month_deb", $month_deb); $smarty->assign("three_month_deb", $three_month_deb); $smarty->assign("month_fin", $month_fin);
$date = CMbDT::date("last sunday", $date); $fin = CMbDT::date("next sunday", $date); $date = CMbDT::date("+1 day", $date); } else { $fin = $date; } //alerts $nbAlertes = 0; $bloc = new CBlocOperatoire(); $bloc->load($bloc_id); $where = array(); if ($bloc->_id) { $where["bloc_operatoire_id"] = "= '{$bloc->_id}'"; } /** @var CBlocOperatoire[] $blocs */ $blocs = $bloc->loadGroupList($where); foreach ($blocs as $_bloc) { $_bloc->loadRefsSalles(); $alertes = $_bloc->loadRefsAlertesIntervs(); foreach ($alertes as $_alerte) { $nbAlertes++; /** @var COperation $operation */ $operation = $_alerte->loadTargetObject(); $operation->loadExtCodesCCAM(); $operation->loadRefPlageOp(); $operation->loadRefPraticien()->loadRefFunction(); $operation->loadRefPatient(); } } $operation = new COperation(); // Liste des interventions non validées