本文整理汇总了PHP中CMbDT::transform方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT::transform方法的具体用法?PHP CMbDT::transform怎么用?PHP CMbDT::transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbDT
的用法示例。
在下文中一共展示了CMbDT::transform方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateFormFields
/**
* @see parent::updateFormFields()
*/
function updateFormFields()
{
parent::updateFormFields();
$this->_view = "Allaitement du " . CMbDT::transform($this->date_debut, null, CAppUI::conf("date")) . " à " . CMbDT::transform($this->date_debut, null, CAppUI::conf("time"));
if ($this->date_fin) {
$this->_view .= " au " . CMbDT::transform($this->date_fin, null, CAppUI::conf("date")) . " à " . CMbDT::transform($this->date_fin, null, CAppUI::conf("time"));
}
}
示例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: __construct
/**
* constructor
*
* @param string $date current date in the planning
* @param null $date_min min date of the planning
* @param null $date_max max
* @param bool $selectable is the planning selectable
* @param string $height [optional] height of the planning, default : auto
* @param bool $large [optional] is the planning a large one
* @param bool $adapt_range [optional] can the planning adapt the range
*/
function __construct($date, $date_min = null, $date_max = null, $selectable = false, $height = "auto", $large = false, $adapt_range = false)
{
parent::__construct($date);
$this->today = CMbDT::date();
$this->type = "month";
$this->selectable = $selectable;
$this->height = $height ? $height : "auto";
$this->large = $large;
$this->adapt_range = $adapt_range;
$this->no_dates = true;
if (is_int($date) || is_int($date_min) || is_int($date_max)) {
$this->no_dates = true;
$this->date_min = $this->date_min_active = $this->_date_min_planning = $date_min;
$this->date_max = $this->date_max_active = $this->_date_max_planning = $date_max;
$this->nb_days = CMbDT::transform(null, $this->date_max, "%d") - CMbDT::transform(null, $this->date_min, "%d");
for ($i = 0; $i < $this->nb_days; $i++) {
$this->days[$i] = array();
$this->load_data[$i] = array();
}
} else {
$this->date_min = $this->date_min_active = $this->_date_min_planning = CMbDT::date("first day of this month", $date);
$this->date_max = $this->date_max_active = $this->_date_max_planning = CMbDT::date("last day of this month", $this->date_min);
// add the last days of previous month
$min_day_number = CMbDT::format($this->date_min, "%w");
$this->first_day_of_first_week = $first_day = CMbDT::date("this week", $min_day_number == 0 ? CMbDT::date("-1 DAY", $this->date_min) : $this->date_min);
while ($first_day != $this->date_min) {
$this->days[$first_day] = array();
$first_day = CMbDT::date("+1 DAY", $first_day);
}
$this->nb_days = CMbDT::transform(null, $this->date_max, "%d");
for ($i = 0; $i < $this->nb_days; $i++) {
$_day = CMbDT::date("+{$i} day", $this->date_min);
$this->days[$_day] = array();
$this->load_data[$_day] = array();
}
//fill the rest of the last week
$max_day_number = CMbDT::format($this->date_max, "%w");
if ($max_day_number != 0) {
$last_day_of_week = CMbDT::date("this week +6 days", $this->date_max);
$last_day_of_month = $this->date_max;
while ($last_day_of_month <= $last_day_of_week) {
$this->days[$last_day_of_month] = array();
$last_day_of_month = CMbDT::date("+1 DAY", $last_day_of_month);
}
}
$this->classes_for_days = $this->days;
}
$this->previous_month = CMbDT::date("-1 DAY", $this->date_min);
$this->next_month = CMbDT::date("+1 DAY", $this->date_max);
$this->_date_min_planning = reset(array_keys($this->days));
$this->_date_max_planning = end(array_keys($this->days));
$this->_hours = array();
}
示例4: __construct
/**
* constructor
*
* @param string $date date chosen
*/
public function __construct($date = null)
{
if (!$date) {
$date = CMbDT::date();
}
$this->date = $date;
$this->number = (int) CMbDT::transform("", $date, "%j");
$dateTmp = explode("-", $date);
$this->name = CMbDate::$days_name[(int) $dateTmp[1]][(int) ($dateTmp[2] - 1)];
$this->_nbDaysYear = CMbDT::format($date, "L") ? 366 : 365;
$this->days_left = $this->_nbDaysYear - $this->number;
//jour férie ?
$holidays = CMbDate::getHolidays($this->date);
if (array_key_exists($this->date, $holidays)) {
$this->ferie = $holidays[$this->date];
}
}
示例5: updateFormFields
function updateFormFields()
{
parent::updateFormFields();
$this->_hour_deb = CMbDT::transform($this->debut, null, "%H");
$this->_hour_fin = CMbDT::transform($this->fin, null, "%H");
// State rules
if ($this->paye == 1) {
$this->_state = self::PAYED;
} elseif ($this->date < CMbDT::date()) {
$this->_state = self::OUT;
} elseif ($this->prat_id) {
if (CMbDT::date("+ 15 DAYS") > $this->date) {
$this->_state = self::BLOCKED;
} else {
$this->_state = self::BUSY;
}
} elseif (CMbDT::date("+ 1 MONTH") < $this->date) {
$this->_state = self::FREEB;
} else {
$this->_state = self::FREE;
}
}
示例6: array
$date_max = CMbDT::dateTime("-1 second", $date_max);
}
for ($i = 0; $i < $nb_ticks; $i++) {
$offset = $i * $nb_unite;
$datetime = CMbDT::dateTime("+ {$offset} {$unite}", $date_min);
$datetimes[] = $datetime;
if ($granularite == "4weeks") {
if (CMbDT::date($current) == CMbDT::date($temp_datetime) && CMbDT::time($current) >= CMbDT::time($temp_datetime) && CMbDT::time($current) > CMbDT::time($datetime)) {
$current = $temp_datetime;
}
$week_a = CMbDT::transform($temp_datetime, null, "%V");
$week_b = CMbDT::transform($datetime, null, "%V");
// les semaines
$days[$datetime] = $week_b;
// On stocke le changement de mois s'il advient
if (CMbDT::transform($datetime, null, "%m") != CMbDT::transform($temp_datetime, null, "%m")) {
// Entre deux semaines
if ($i % 7 == 0) {
$change_month[$week_a] = array("right" => $temp_datetime);
$change_month[$week_b] = array("left" => $datetime);
} else {
$change_month[$week_b] = array("left" => $temp_datetime, "right" => $datetime);
}
}
} else {
if ($granularite == "week" && CMbDT::date($current) == CMbDT::date($temp_datetime) && CMbDT::time($datetime) >= CMbDT::time($temp_datetime) && CMbDT::time($current) <= CMbDT::time($datetime)) {
$current = $temp_datetime;
}
// le datetime, pour avoir soit le jour soit l'heure
$days[] = CMbDT::date($datetime);
}
示例7: buildGridLatest
/**
* Build constantes grid
*
* @param self $constante The CConstantesMedicales object containing the latest values
* @param array $dates An array containing the date of the
* @param bool $full Display the full list of constantes
* @param bool $only_with_value Only display not null values
*
* @return array
*/
static function buildGridLatest($constante, $dates, $full = true, $only_with_value = false)
{
$dates = CMbArray::flip($dates);
if (array_key_exists('', $dates)) {
unset($dates['']);
}
$grid = array();
$selection = array_keys(CConstantesMedicales::$list_constantes);
$cumuls_day = array();
$reset_hours = array();
$cumul_names = array();
if (!$full) {
$conf_constantes = array_filter(CConstantesMedicales::getRanksFor());
$selection = array_keys($conf_constantes);
foreach (CConstantesMedicales::$list_constantes as $_name => $_params) {
if ($constante->{$_name} != '' && !empty($_params["cumul_in"])) {
$selection = array_merge($selection, $_params["cumul_in"]);
$cumul_names = array_merge($selection, $_params["cumul_in"]);
}
}
$selection = array_unique($selection);
}
if ($only_with_value) {
$selection = array();
}
$names = $selection;
foreach ($dates as $_date => $_constants) {
if (!isset($grid["{$_date}"])) {
$grid["{$_date}"] = array('comment' => '', "values" => array());
}
foreach ($_constants as $_name) {
$_params = CConstantesMedicales::$list_constantes[$_name];
if (in_array($_name, $selection) || in_array($_name, $cumul_names) || $constante->{$_name} != '') {
$value = null;
if (isset($_params["cumul_for"]) || isset($_params["formula"])) {
// cumul
if (!isset($reset_hours[$_name])) {
$reset_hours[$_name] = self::getResetHour($_name);
}
$reset_hour = $reset_hours[$_name];
$day_24h = CMbDT::transform("-{$reset_hour} hours", $_date, '%y-%m-%d');
if (!isset($cumuls_day[$_name][$day_24h])) {
$cumuls_day[$_name][$day_24h] = array("id" => $constante->_id, "datetime" => $_date, "value" => null, "span" => 0, "pair" => @count($cumuls_day[$_name]) % 2 ? "odd" : "even", "day" => CMbDT::transform($day_24h, null, "%a"));
}
if (isset($_params["cumul_for"])) {
// cumul simple sur le meme champ
$cumul_for = $_params["cumul_for"];
if ($constante->{$cumul_for} !== null) {
$cumuls_day[$_name][$day_24h]["value"] += $constante->{$cumul_for};
}
} else {
// cumul de plusieurs champs (avec formule)
$formula = $_params["formula"];
foreach ($formula as $_field => $_sign) {
$_value = $constante->{$_field};
if ($constante->{$_field} !== null) {
if ($_sign === "+") {
$cumuls_day[$_name][$day_24h]["value"] += $_value;
} else {
$cumuls_day[$_name][$day_24h]["value"] -= $_value;
}
}
}
}
$cumuls_day[$_name][$day_24h]["span"]++;
$value = "__empty__";
} else {
// valeur normale
$spec = self::$list_constantes[$_name];
$value = $constante->{$_name};
if (isset($spec["formfields"])) {
$arr = array();
foreach ($spec["formfields"] as $ff) {
if ($constante->{$ff} != "") {
$arr[] = $constante->{$ff};
}
}
$value = implode(" / ", $arr);
}
}
$grid["{$_date}"]["values"][$_name] = $value;
if (!in_array($_name, $names)) {
$names[] = $_name;
}
}
}
}
foreach ($cumuls_day as $_name => &$_days) {
$_params = CConstantesMedicales::$list_constantes[$_name];
foreach ($_days as &$_values) {
//.........这里部分代码省略.........
示例8: date
} else {
$tab_start[$j] = date("w", mktime(0, 0, 0, $i, 1, $year));
}
$j++;
$tab_start[$j] = date("t", mktime(0, 0, 0, $i, 1, $year));
$j++;
}
} else {
list($a, $m, $j) = explode("-", $filter->date_debut);
$debut_periode = "{$a}-{$m}-01";
$fin_periode = CMbDT::transform('+1 month', $debut_periode, '%Y-%m-%d');
$fin_periode = CMbDT::transform('-1 day', $fin_periode, '%Y-%m-%d');
}
$tableau_periode = array();
for ($i = 0; $i < CMbDT::daysRelative($debut_periode, $fin_periode) + 1; $i++) {
$tableau_periode[$i] = CMbDT::transform('+' . $i . 'day', $debut_periode, '%Y-%m-%d');
}
$where = array();
$where[] = "((date_debut >= '{$debut_periode}' AND date_debut <= '{$fin_periode}'" . ")OR (date_fin >= '{$debut_periode}' AND date_fin <= '{$fin_periode}')" . "OR (date_debut <='{$debut_periode}' AND date_fin >= '{$fin_periode}'))";
$where["user_id"] = CSQLDataSource::prepareIn(array_keys($mediusers), $filter->user_id);
$plageconge = new CPlageConge();
$plagesconge = array();
$orderby = "user_id";
/** @var CPlageConge[] $plagesconge */
$plagesconge = $plageconge->loadList($where, $orderby);
$tabUser_plage = array();
$tabUser_plage_indices = array();
foreach ($plagesconge as $_plage) {
$_plage->loadRefUser();
$_plage->_ref_user->loadRefFunction();
$_plage->_deb = CMbDT::daysRelative($debut_periode, $_plage->date_debut);
示例9: mappingMovement
/**
* Mapping mouvements
*
* @param DOMNode $node Node
* @param CSejour $newVenue Venue
* @param CAffectation $affectation Affectation
*
* @return string
*/
function mappingMovement(DOMNode $node, CSejour $newVenue, CAffectation $affectation)
{
$xpath = new CHPrimXPath($node->ownerDocument);
$sender = $this->_ref_echange_hprim->_ref_sender;
// Recherche d'une affectation existante
$id = $newVenue->_guid . "-" . $xpath->queryTextNode("hprim:identifiant/hprim:emetteur", $node);
$tag = $sender->_tag_hprimxml;
$idex = CIdSante400::getMatch("CAffectation", $tag, $id);
if ($idex->_id) {
$affectation->load($idex->object_id);
if ($affectation->sejour_id != $newVenue->_id) {
return CAppUI::tr("hprimxml-error-E301");
}
}
$affectation->sejour_id = $newVenue->_id;
// Praticien responsable
$medecinResponsable = $xpath->queryUniqueNode("hprim:medecinResponsable", $node);
$affectation->praticien_id = $this->getMedecin($medecinResponsable);
// Emplacement
$this->getEmplacement($node, $newVenue, $affectation);
// Début de l'affectation
$debut = $xpath->queryUniqueNode("hprim:debut", $node);
$date = $xpath->queryTextNode("hprim:date", $debut);
$heure = CMbDT::transform($xpath->queryTextNode("hprim:heure", $debut), null, "%H:%M:%S");
$affectation->entree = "{$date} {$heure}";
// Fin de l'affectation
$fin = $xpath->queryUniqueNode("hprim:fin", $node);
if ($fin) {
$date = $xpath->queryTextNode("hprim:date", $fin);
$heure = CMbDT::transform($xpath->queryTextNode("hprim:heure", $fin), null, "%H:%M:%S");
$affectation->sortie = "{$date} {$heure}";
}
if (!$affectation->_id) {
$affectation = $newVenue->forceAffectation($affectation, true);
if (is_string($affectation)) {
return $affectation;
}
} else {
if ($msg = $affectation->store()) {
return $msg;
}
}
if (!$idex->_id) {
$idex->object_id = $affectation->_id;
if ($msg = $idex->store()) {
return $msg;
}
}
return null;
}
示例10: array
}
$where = array();
$where["entree"] = "<= '" . $sortie_sejour . "'";
$where["sortie"] = ">= '" . $sortie_sejour . "'";
$where["function_id"] = "IS NOT NULL";
$affectatione = new CAffectation();
/** @var CAffectation[] $blocages_lit */
$blocages_lit = $affectatione->loadList($where);
$where["function_id"] = "IS NULL";
foreach ($blocages_lit as $key => $blocage) {
$blocage->loadRefLit()->loadRefChambre()->loadRefService();
$where["lit_id"] = "= '{$blocage->lit_id}'";
if (!$sejour->_id && $affectatione->loadObject($where)) {
$affectatione->loadRefSejour();
$affectatione->_ref_sejour->loadRefPatient();
$jusqua = CMbDT::transform($affectatione->sortie, null, "%Hh%Mmin %d-%m-%Y") . " (" . $affectatione->_ref_sejour->_ref_patient->_view;
$blocage->_ref_lit->_view .= " indisponible jusqu'à " . $jusqua . ")";
}
}
$exchange_source = CExchangeSource::get("mediuser-" . CAppUI::$user->_id, "smtp");
$_functions = array();
if ($chir->_id) {
$_functions = $chir->loadBackRefs("secondary_functions");
}
$op->loadRefChir2();
$op->loadRefChir3();
$op->loadRefChir4();
if (!$op->_id) {
$op->_time_op = $op->temp_operation = "00:00:00";
if ($hour_urgence && $min_urgence) {
$time = "{$hour_urgence}:{$min_urgence}:00";
示例11: preg_match
$format = $_format;
}
}
}
preg_match($format_regexp, $line, $date_reg);
$date_reg = $date_reg[0];
$date = DateTime::createFromFormat($format, $date_reg);
$date = $date->format("Y-m-d H:i:s");
preg_match("/[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+/", $line, $ip);
// If a domain name, next line
if (!isset($ip[0])) {
continue;
}
$ip = $ip[0];
$day = CMbDT::transform(CMbDT::dateTime($date), null, "%Y-%m-%d");
$hour = CMbDT::transform(CMbDT::dateTime($date), null, "%H");
if (!isset($count_by_day[$day])) {
$count_by_day[$day] = 0;
}
if (!isset($count_by_hour[$hour])) {
$count_by_hour[$hour] = 0;
}
if (!isset($count_by_ip[$ip])) {
$count_by_ip[$ip] = 0;
}
if (!isset($count_by_hour_ip[$hour])) {
$count_by_hour_ip[$hour] = array();
}
if (!isset($count_by_hour_ip[$hour][$ip])) {
$count_by_hour_ip[$hour][$ip] = 0;
}
示例12: CSmartyDP
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage Stock
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkRead();
$invoiced = CValue::get('invoiced');
$date_min = CMbDT::transform("-1 MONTH", null, "%Y-%m-01");
$date_max = CMbDT::date("+1 MONTH -1 DAY", $date_min);
// Smarty template
$smarty = new CSmartyDP();
$smarty->assign("date_min", $date_min);
$smarty->assign("date_max", $date_max);
$smarty->assign("invoiced", $invoiced);
$smarty->display("inc_orders_filter.tpl");
示例13: CConsultation
* $Id: vw_compta.php 28340 2015-05-20 10:14:30Z aurelie17 $
*
* @package Mediboard
* @subpackage Cabinet
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 28340 $
*/
CCanDo::checkEdit();
// Gestion des bouton radio des dates
$now = CMbDT::date();
$yesterday = CMbDT::date("-1 DAY", $now);
$week_deb = CMbDT::date("last sunday", $now);
$week_fin = CMbDT::date("next sunday", $week_deb);
$week_deb = CMbDT::date("+1 day", $week_deb);
$rectif = CMbDT::transform("+0 DAY", $now, "%d") - 1;
$month_deb = CMbDT::date("-{$rectif} DAYS", $now);
$month_fin = CMbDT::date("+1 month", $month_deb);
$three_month_deb = CMbDT::date("-3 month", $month_fin);
$month_fin = CMbDT::date("-1 day", $month_fin);
$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();
示例14: 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"];
//.........这里部分代码省略.........
示例15: precodeModifiers
/**
* Check the modifiers of the given act
*
* @param CObject &$modifiers The modifiers to check
* @param CActeCCAM &$act The dateTime of the execution of the act
* @param CCodable $codable The codable
*
* @return void
*/
public static function precodeModifiers(&$modifiers, &$act, $codable)
{
$date = CMbDT::date(null, $act->execution);
$time = CMbDT::time(null, $act->execution);
$act->loadRefExecutant();
$act->_ref_executant->loadRefDiscipline();
$discipline = $act->_ref_executant->_ref_discipline;
$patient = $codable->loadRefPatient();
$patient->evalAge();
$checked = 0;
$spe_gyneco = $spe_gyneco = array('GYNECOLOGIE MEDICALE, OBSTETRIQUE', 'GYNECOLOGIE-OBSTETRIQUE', 'MEDECINE DE LA REPRODUCTION ET GYNECOLOGIE MEDICAL');
$spe_gen_pediatre = array("MEDECINE GENERALE", "PEDIATRIE");
$count_exclusive_modifiers = self::countExclusiveModifiers($act);
$store_act = 0;
$modifiers_to_add = "";
$achieved = CMbDate::achievedDurations($patient->naissance, CMbDT::date(null, $act->execution));
$patient_age = $achieved["year"];
foreach ($modifiers as $_modifier) {
switch ($_modifier->code) {
case 'A':
$checked = $patient_age < 4 || $patient_age >= 80;
$_modifier->_state = $checked ? 'prechecked' : 'not_recommended';
break;
case 'E':
$checked = $patient->_annees < 5;
$_modifier->_state = $checked ? 'prechecked' : 'not_recommended';
break;
case 'F':
$checked = ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers == 0) && (CMbDT::transform('', $act->execution, '%w') == 0 || CMbDate::isHoliday($date)) && ($time > '08:00:00' && $time < '20:00:00');
if ($checked) {
$_modifier->_state = 'prechecked';
} elseif ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers > 0) {
$_modifier->_state = 'forbidden';
} else {
$_modifier->_state = 'not_recommended';
}
break;
case "J":
$checked = $codable->_class == 'COperation' && CAppUI::pref('precode_modificateur_J');
$_modifier->_state = $checked ? 'prechecked' : null;
break;
case 'K':
$checked = !$act->montant_depassement && ($act->_ref_executant->secteur == 1 || $act->_ref_executant->secteur == 2 && $patient->cmu || $act->_ref_executant->contrat_acces_soins || $act->_ref_executant->option_coordination);
if ($checked) {
$_modifier->_state = 'prechecked';
} elseif (!in_array($discipline, $spe_gyneco)) {
$_modifier->_state = 'not_recommended';
}
if (self::isModifierchecked('K', $act) && !$act->montant_depassement) {
$checked = true;
}
break;
case 'L':
if (self::isModifierchecked('L', $act)) {
$_modifier->_state = 'prechecked';
$checked = true;
}
break;
case 'M':
$checked = 0;
if (!in_array($discipline->text, $spe_gen_pediatre)) {
$_modifier->_state = 'not_recommended';
}
break;
case 'N':
$checked = $patient->_annees < 13;
$_modifier->_state = $checked ? 'prechecked' : 'not_recommended';
break;
case 'P':
$checked = ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers == 0) && in_array($discipline->text, $spe_gen_pediatre) && ($time > "20:00:00" && $time < "23:59:59");
if ($checked) {
$_modifier->_state = 'prechecked';
} elseif ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers > 0) {
$_modifier->_state = 'forbidden';
} else {
$_modifier->_state = 'not_recommended';
}
break;
case 'R':
if (self::isModifierchecked('R', $act)) {
$_modifier->_state = 'prechecked';
$checked = true;
}
break;
case 'S':
$checked = (in_array($discipline->text, $spe_gen_pediatre) || $codable->_class == "COperation" && $codable->_lu_type_anesth) && ($time >= "00:00:00" && $time < "08:00:00") && ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers == 0);
if ($checked) {
$_modifier->_state = 'prechecked';
} elseif ($count_exclusive_modifiers == 1 && $_modifier->_checked || $count_exclusive_modifiers > 0) {
$_modifier->_state = 'forbidden';
} else {
//.........这里部分代码省略.........