本文整理汇总了PHP中CMbDT::workDaysInMonth方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT::workDaysInMonth方法的具体用法?PHP CMbDT::workDaysInMonth怎么用?PHP CMbDT::workDaysInMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbDT
的用法示例。
在下文中一共展示了CMbDT::workDaysInMonth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: graphPatParHeureReveil
/**
* Récuparation du graphique de répartition des patients en salle de reveil
* par tranche horaire
*
* @param string $debut Date de début
* @param string $fin Date de fin
* @param int $prat_id Identifiant du praticien
* @param int $bloc_id Identifiant du bloc
* @param int $discipline_id Identifiant de la discipline
* @param string $codeCCAM Code CCAM
*
* @return array
*/
function graphPatParHeureReveil($debut = null, $fin = null, $prat_id = 0, $bloc_id = 0, $func_id = 0, $discipline_id = null, $codeCCAM = '')
{
// This stats uses temporary table, impossible on slave
// @todo Get rid of temporary table
CView::disableSlave();
$ds = CSQLDataSource::get("std");
if (!$debut) {
$debut = CMbDT::date("-1 YEAR");
}
if (!$fin) {
$fin = CMbDT::date();
}
$totalWorkDays = 0;
for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
$totalWorkDays += CMbDT::workDaysInMonth(CMbDT::transform("+0 DAY", $i, "%Y-%m-01"));
}
$prat = new CMediusers();
$prat->load($prat_id);
$discipline = new CDiscipline();
$discipline->load($discipline_id);
$ticks = array();
for ($i = 7; $i <= 21; $i++) {
$ticks[] = array(count($ticks), CMbDT::transform("+0 DAY", "{$i}:00:00", "%Hh%M"));
}
$bloc = new CBlocOperatoire();
if ($bloc_id) {
$bloc->load($bloc_id);
}
$series = array();
// Nombre de patients par heure
foreach ($ticks as $i => $tick) {
$query = "DROP TEMPORARY TABLE IF EXISTS pat_par_heure";
$ds->exec($query);
$query = "CREATE TEMPORARY TABLE pat_par_heure\n SELECT COUNT(operations.operation_id) AS total_by_day,\n '" . $tick[1] . "' AS heure,\n operations.date AS date\n FROM operations\n INNER JOIN sallesbloc ON operations.salle_id = sallesbloc.salle_id\n LEFT JOIN users_mediboard ON operations.chir_id = users_mediboard.user_id\n WHERE sallesbloc.stats = '1'\n AND operations.date BETWEEN '{$debut}' AND '{$fin}'\n AND '" . $tick[1] . ":00' BETWEEN operations.entree_reveil AND operations.sortie_reveil_reel\n AND operations.annulee = '0'";
if ($prat_id) {
$query .= "\nAND operations.chir_id = '{$prat_id}'";
}
if ($discipline_id) {
$query .= "\nAND users_mediboard.discipline_id = '{$discipline_id}'";
}
if ($codeCCAM) {
$query .= "\nAND operations.codes_ccam LIKE '%{$codeCCAM}%'";
}
if ($bloc_id) {
$query .= "\nAND sallesbloc.bloc_id = '{$bloc_id}'";
}
$query .= "\nGROUP BY operations.date";
$ds->exec($query);
$query = "SELECT SUM(total_by_day) AS total, MAX(total_by_day) AS max,heure\n FROM pat_par_heure\n GROUP BY heure";
$result = $ds->loadlist($query);
if (count($result)) {
$serie_moyenne["data"][] = array($i, $result[0]["total"] / $totalWorkDays);
$serie_max["data"][] = array($i, $result[0]["max"]);
} else {
$serie_moyenne["data"][] = array($i, 0);
$serie_max["data"][] = array($i, 0);
}
}
// Nombre de patients non renseignés
$query = "SELECT COUNT(operations.operation_id) AS total,\n 'err' AS heure\n FROM operations\n INNER JOIN sallesbloc ON operations.salle_id = sallesbloc.salle_id\n LEFT JOIN users_mediboard ON operations.chir_id = users_mediboard.user_id\n WHERE sallesbloc.stats = '1'\n AND operations.date BETWEEN '{$debut}' AND '{$fin}'\n AND (operations.entree_reveil IS NULL OR operations.sortie_reveil_reel IS NULL)\n AND operations.annulee = '0'";
if ($prat_id) {
$query .= "\nAND operations.chir_id = '{$prat_id}'";
}
if ($discipline_id) {
$query .= "\nAND users_mediboard.discipline_id = '{$discipline_id}'";
}
if ($codeCCAM) {
$query .= "\nAND operations.codes_ccam LIKE '%{$codeCCAM}%'";
}
if ($bloc_id) {
$query .= "\nAND sallesbloc.bloc_id = '{$bloc_id}'";
}
$query .= "\nGROUP BY heure";
$result = $ds->loadlist($query);
if (count($result)) {
$serie_moyenne["data"][] = array(count($ticks), $result[0]["total"] / $totalWorkDays);
} else {
$serie_moyenne["data"][] = array(count($ticks), 0);
}
//$serie_max["data"][] = array(count($ticks), 0);
$ticks[] = array(count($ticks), "Erreurs");
$serie_moyenne["label"] = "moyenne";
$serie_max["label"] = "max";
$series[] = $serie_moyenne;
$series[] = $serie_max;
// Set up the title for the graph
$title = "Patients moyens et max / heure du jour";
//.........这里部分代码省略.........