本文整理汇总了PHP中CMbDT::date方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT::date方法的具体用法?PHP CMbDT::date怎么用?PHP CMbDT::date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbDT
的用法示例。
在下文中一共展示了CMbDT::date方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateDateCodage
protected function updateDateCodage()
{
$ds = $this->ds;
$query = "SELECT * FROM `codage_ccam`;";
$rows = $ds->exec($query);
while ($_codage = $ds->fetchObject($rows, 'CCodageCCAM')) {
$_codage->loadCodable();
$date = null;
switch ($_codage->codable_class) {
case 'CConsultation':
$_codage->_ref_codable->loadRefPlageConsult();
$date = $_codage->_ref_codable->_date;
break;
case 'COperation':
$date = $_codage->_ref_codable->date;
break;
case 'CSejour':
$date = CMbDT::date('', $_codage->_ref_codable->entree);
break;
}
$query = "UPDATE `codage_ccam`\r\n SET `date` = '{$date}' WHERE `codage_ccam_id` = {$_codage->_id};";
$ds->exec($query);
}
return true;
}
示例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: fillOtherIdentifiers
/**
* Fill other identifiers
*
* @param array &$identifiers Identifiers
* @param CPatient $patient Person
* @param CInteropActor $actor Interop actor
*
* @return null
*/
function fillOtherIdentifiers(&$identifiers, CPatient $patient, CInteropActor $actor = null)
{
$ins = $patient->loadLastINS();
if ($ins) {
$identifiers[] = array($ins->ins, null, null, $this->getAssigningAuthority("INS-{$ins->type}"), "INS-{$ins->type}", null, CMbDT::date($ins->date));
}
if ($patient->matricule) {
$identifiers[] = array($patient->matricule, null, null, $this->getAssigningAuthority("INSEE"), "SS");
}
if ($actor->_configs["send_own_identifier"]) {
$identifiers[] = array($patient->_id, null, null, $this->getAssigningAuthority("mediboard"), $actor->_configs["build_identifier_authority"] == "PI_AN" ? "PI" : "RI");
}
}
示例4: store
/**
* @see parent::store()
*/
function store()
{
// Transfert de séjours vers un autre technicien
if ($this->_transfer_id) {
foreach ($this->loadRefsSejours(CMbDT::date()) as $_sejour) {
$bilan = $_sejour->loadRefBilanSSR();
$bilan->technicien_id = $this->_transfer_id;
if ($msg = $bilan->store()) {
return $msg;
}
}
}
return parent::store();
}
示例5: __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];
}
}
示例6: getValue
/**
* @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 = CMbArray::extract($params, "format", CAppUI::conf("datetime"));
if ($format === "relative") {
$relative = CMbDate::relative($propValue, CMbDT::dateTime());
return $relative["count"] . " " . CAppUI::tr($relative["unit"] . ($relative["count"] > 1 ? "s" : ""));
}
$date = CMbArray::extract($params, "date");
if ($date && CMbDT::date($propValue) == $date) {
$format = CAppUI::conf("time");
}
return $propValue && $propValue != "0000-00-00 00:00:00" ? smarty_modifier_date_format($propValue, $format) : "";
}
示例7: __construct
/**
* Standard constructor
*
* @param date $date Reference ISO date
* @param string $period One of day, week, month, year
* @param string $date_column SELECT-like column, might be a expression such as DATE(when)
* @param int $nb_periods Number of periods to display
*/
public function __construct($date, $period, $date_column, $nb_periods = 30)
{
// Prepare periods
switch ($period) {
case "day":
$php_period = "days";
$sql_date = "{$date_column}";
break;
case "week":
$date = CMbDT::date("next monday", $date);
$php_period = "weeks";
$sql_date = "DATE_ADD({$date_column}, INTERVAL (2 - DAYOFWEEK({$date_column})) DAY)";
break;
case "month":
$date = CMbDT::date("first day of +0 month", $date);
$php_period = "months";
$sql_date = "DATE_ADD({$date_column}, INTERVAL (1 - DAYOFMONTH({$date_column})) DAY)";
break;
case "year":
$date = CMbDT::format($date, "%Y-01-01");
$php_period = "years";
$sql_date = "DATE_ADD({$date_column}, INTERVAL (1 - DAYOFYEAR({$date_column})) DAY)";
break;
default:
$php_period = null;
$min_date = null;
$sql_date = null;
break;
}
// Prepare dates
$dates = array();
foreach (range(0, $nb_periods - 1) as $n) {
$dates[] = $min_date = CMbDT::date("- {$n} {$php_period}", $date);
}
$dates = array_reverse($dates);
$min_date = reset($dates);
$max_date = CMbDT::date("+1 {$this->period} -1 day", end($dates));
// Members
$this->date = $date;
$this->period = $period;
$this->dates = $dates;
$this->min_date = $min_date;
$this->max_date = $max_date;
$this->php_period = $php_period;
$this->sql_date = $sql_date;
}
示例8: addEvent
/**
* add an event to the present planning
*
* @param CPlanningEvent $event an event
*
* @return null
*/
function addEvent(CPlanningEvent $event)
{
//start plage out of borne
$date_start = CMbDT::date($event->start);
if ($date_start != $this->date) {
$event->day = $this->date;
$event->start = $this->date . " 00:00:00";
$event->hour = "00";
$event->minutes = "00";
$event->length = CMbDT::minutesRelative($event->start, $event->end);
}
//end of plage is out of borne
$date_end = CMbDT::date($event->end);
if ($date_end != $this->date) {
$event->length = CMbDT::minutesRelative($event->start, $this->date . " 23:59:59");
}
parent::addEvent($event);
}
示例9: buildPartialTables
/**
* 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);
}
}
示例10: __construct
/**
* Range constructor
*
* @param string $guid GUID
* @param string $date Date
* @param int $length Length
* @param string $title Title
* @param null $color Color
* @param null $css_class CSS class
*/
function __construct($guid, $date, $length = 0, $title = "", $color = null, $css_class = null)
{
$this->guid = $guid;
$this->internal_id = "CPlanningRange-" . uniqid();
$this->start = $date;
$this->length = $length;
$this->title = CMbString::htmlEntities($title);
$this->color = $color;
$this->css_class = is_array($css_class) ? implode(" ", $css_class) : $css_class;
if (preg_match("/[0-9]+ /", $this->start)) {
$parts = split(" ", $this->start);
$this->end = "{$parts[0]} " . CMbDT::time("+{$this->length} MINUTES", $parts[1]);
$this->day = $parts[0];
$this->hour = CMbDT::format($parts[1], "%H");
$this->minutes = CMbDT::format($parts[1], "%M");
} else {
$this->day = CMbDT::date($date);
$this->end = CMbDT::dateTime("+{$this->length} MINUTES", $date);
$this->hour = CMbDT::format($date, "%H");
$this->minutes = CMbDT::format($date, "%M");
}
}
示例11: is_actif
function is_actif($date)
{
$date_debut = CMbDT::date("last sunday", $this->debut);
$date_debut = CMbDT::date("+1 day", $date_debut);
$numDayMenu = CMbDT::daysRelative($date_debut, $this->debut);
$nb_weeks = $this->nb_repet * $this->repetition - 1;
$date_fin = CMbDT::date("+{$nb_weeks} week", $date_debut);
$date_fin = CMbDT::date("next monday", $date_fin);
$date_fin = CMbDT::date("-1 day", $date_fin);
if ($date < $this->debut || $date > $date_fin) {
return false;
}
$nbDays = CMbDT::daysRelative($date_debut, $date);
$nbWeeks = floor($nbDays / 7);
$numDay = $nbDays - $nbWeeks * 7;
if (!$nbWeeks || !fmod($nbWeeks, $this->repetition)) {
if ($numDay == $numDayMenu) {
return true;
}
}
return false;
}
示例12: checkProperty
/**
* @see parent::checkProperty()
*/
function checkProperty($object)
{
$propValue =& $object->{$this->fieldName};
// Vérification du format
$matches = array();
if (!preg_match("/^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})\$/", $propValue, $matches)) {
if ($propValue === 'current' || $propValue === 'now') {
$propValue = CMbDT::date();
return null;
}
return "Format de date invalide : '{$propValue}'";
}
// Mois grégorien
$mois = intval($matches[2]);
if (!CMbRange::in($mois, $this->progressive ? 0 : 1, 12)) {
// Possibilité de mettre des mois vides ()
return "Mois '{$mois}' non compris entre 1 et 12 ('{$propValue}')";
}
// Jour grégorien
$jour = intval($matches[3]);
if (!CMbRange::in($jour, $this->progressive ? 0 : 1, 31)) {
return "Jour '{$jour}' non compris entre 1 et 31 ('{$propValue}')";
}
}
示例13: CPlateauTechnique
/**
* $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::checkRead();
// Plateau du contexte
$plateau = new CPlateauTechnique();
$plateau->load(CValue::get("plateau_id"));
// Détails des techniciens
$date = CMbDT::date();
foreach ($plateau->loadRefsTechniciens(false) as $_technicien) {
$_technicien->countSejoursDate($date);
}
// Technicien à editer
$technicien = new CTechnicien();
$technicien->load(CValue::get("technicien_id"));
$technicien->plateau_id = $plateau->_id;
$technicien->loadRefsNotes();
$technicien->loadRefPlateau();
$technicien->loadRefKine();
$technicien->countSejoursDate($date);
// Alter egos pour les transferts de séjours
$where["kine_id"] = "= '{$technicien->kine_id}'";
/** @var CTechnicien[] $alteregos */
$alteregos = $technicien->loadList($where);
示例14: parse
/**
* Main parse function, trying all barcode standards sequentially
*
* @param string $barcode Row barcode
*
* @return array Array of data
* @todo Way too long, explode in smaller functions
*/
static function parse($barcode)
{
$orig_barcode = $barcode;
$barcode = str_replace(" ", "\t", $barcode);
$comp = array();
$type = "raw";
$patt = "";
if (!$barcode) {
return array("type" => $type, "comp" => $comp, "patt" => $patt);
}
// code 128 with sepataror char
$separator = self::$code128separator;
if (preg_match('/^[0-9a-z]+' . $separator . '[0-9a-z]+[0-9a-z\\' . $separator . ']*$/ims', $barcode)) {
$type = "code128";
$parts = explode($separator, $barcode);
foreach ($parts as $p) {
foreach (self::$code128prefixes as $code => $text) {
//if (strpos($p, $code) === 0) { // strpos won't work :(
if (substr($p, 0, strlen($code)) == $code) {
$comp[self::$code128table[$code]] = substr($p, strlen($code), strlen($p) - strlen($code));
break;
}
}
}
}
// code 128
if (empty($comp) && preg_match('/^(?:(01)(\\d{14}))?(10)([a-z0-9\\/-]{4,20})[^a-z0-9\\/-]?(17)(\\d{6})$/ims', $barcode, $parts) || preg_match('/^(?:(01)(\\d{14}))?(17)(\\d{6})(10)([a-z0-9\\/-]{4,20})[^a-z0-9\\/-]?$/ims', $barcode, $parts) || preg_match('/^(?:(01)(\\d{14}))?(17)(\\d{6})(21)([a-z0-9]{6,20})(30)(\\d{1,2})$/ims', $barcode, $parts) || preg_match('/^(?:(01)(\\d{14}))?(17)(\\d{6})(21)([a-z0-9]{6,20})$/ims', $barcode, $parts) || preg_match('/^(01)(\\d{14})$/i', $barcode, $parts)) {
$type = "code128";
$prop = null;
foreach ($parts as $p) {
if (array_key_exists($p, self::$code128table)) {
$prop = $p;
} else {
if ($prop) {
$comp[self::$code128table[$prop]] = $p;
} else {
$prop = null;
}
}
}
}
// EAN code (13 digits)
$pattern = '/^(\\d{13})$/ims';
if (empty($comp) && preg_match($pattern, $barcode, $parts)) {
$type = "ean13";
$comp["scc"] = "0{$parts[1]}";
}
// 2016-08
if (empty($comp) && preg_match('/^(20\\d{2})-(\\d{2})$/ms', $barcode, $parts)) {
$type = "date";
$date = CMbDT::date("+1 MONTH", $parts[1] . "-" . $parts[2] . "-01");
$comp["per"] = CMbDT::date("-1 DAY", $date);
}
// 130828
/*if (empty($comp) && preg_match('/^(\d{2})(\d{2})(\d{2})$/ms', $barcode, $parts)){
$type = "date";
$comp = CMbDT::date("+1 MONTH", "20".$parts[1]."-".$parts[2]."-01");
$comp = CMbDT::date("-1 DAY", $comp);
}*/
if (empty($comp) && $barcode[0] === "+") {
$type = "code39";
$barcode = self::decodeCode39($barcode);
// _PER__ __LOT__
// +$$3130331 3414899 .
if (empty($comp) && preg_match('/^\\+?\\$\\$[23456789](\\d{6})(\\d+).{2}$/ms', $barcode, $parts)) {
$comp["per"] = $parts[1];
$comp["lot"] = $parts[2];
}
// _LOT__
// +$$03151005377M
// __LOT___
// +$$01150910199AD6
if (empty($comp) && preg_match('/^\\+?\\$\\$(\\d{4})([A-Z0-9]+).{2}$/ms', $barcode, $parts)) {
$comp["per"] = $parts[1];
$comp["lot"] = $parts[2];
}
// __REF___ PER_ __LOT__
// +M423104003921/$$081309091602Y
if (empty($comp) && preg_match('/^[a-z]\\d{3}(\\d+).\\/\\$\\$(\\d{4})(.+).$/ms', $barcode, $parts)) {
$comp["ref"] = $parts[1];
$comp["per"] = $parts[2];
$comp["lot"] = $parts[3];
}
// __REF______ ____LOT___
// +M114EC1YHPAL2301/$1089171008M
if (empty($comp) && preg_match('/^[a-z]\\d{3}.([^\\/]+)\\/\\$(.+).$/ms', $barcode, $parts)) {
$comp["ref"] = $parts[1];
$comp["lot"] = $parts[2];
}
// ___REF___ PER_ __LOT___
// +H7036307002101/1830461324862J09C
// +H703630701210 1/1827361332390I09C
//.........这里部分代码省略.........
示例15: CConsultation
<?php
/**
* $Id$
*
* @category Admissions
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
CCanDo::checkRead();
//Initialisations des variables
$date = CValue::getOrSession("date", CMbDT::date());
$today = CMbDT::date();
$hour = CMbDT::time(null);
$board = CValue::get("board", 1);
$boardItem = CValue::get("boardItem", 1);
$consult = new CConsultation();
// Récupération des fonctions
$cabinets = CMediusers::loadFonctions();
// Récupération de la liste des anesthésistes
$mediuser = new CMediusers();
$anesthesistes = $mediuser->loadAnesthesistes(PERM_READ);
if ($consult->consultation_id) {
$date = $consult->_ref_plageconsult->date;
CValue::setSession("date", $date);
}
// Récupération des plages de consultation du jour et chargement des références
$listPlages = array();