当前位置: 首页>>代码示例>>PHP>>正文


PHP CMbDT类代码示例

本文整理汇总了PHP中CMbDT的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT类的具体用法?PHP CMbDT怎么用?PHP CMbDT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CMbDT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateFormFields

 /**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     if ($this->end_datetime && $this->start_datetime) {
         $this->_duration = CMbDT::timeRelative($this->start_datetime, $this->end_datetime);
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:10,代码来源:CCronJobLog.class.php

示例2: loadAffected

/**
 * $Id: inc_personnel.php 20938 2013-11-13 11:02:47Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage bloodSalvage
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 20938 $
 */
function loadAffected(&$blood_salvage_id, &$list_nurse_sspi, &$tabAffected, &$timingAffect)
{
    $affectation = new CAffectationPersonnel();
    $affectation->object_class = "CBloodSalvage";
    $affectation->object_id = $blood_salvage_id;
    $tabAffected = $affectation->loadMatchingList();
    foreach ($tabAffected as $key => $affect) {
        if (array_key_exists($affect->personnel_id, $list_nurse_sspi)) {
            unset($list_nurse_sspi[$affect->personnel_id]);
        }
        $affect->_ref_personnel->loadRefUser();
    }
    // Initialisations des tableaux des timings
    foreach ($tabAffected as $key => $affectation) {
        $timingAffect[$affectation->_id]["_debut"] = array();
        $timingAffect[$affectation->_id]["_fin"] = array();
    }
    // Remplissage des tableaux des timings
    foreach ($tabAffected as $id => $affectation) {
        foreach ($timingAffect[$affectation->_id] as $key => $value) {
            for ($i = -10; $i < 10 && $affectation->{$key} !== null; $i++) {
                $timingAffect[$affectation->_id][$key][] = CMbDT::time("{$i} minutes", $affectation->{$key});
            }
        }
    }
}
开发者ID:fbone,项目名称:mediboard4,代码行数:35,代码来源:inc_personnel.php

示例3: build

 /**
  * @see parent::build
  */
 function build(CHPREvent $event)
 {
     parent::build($event);
     $message = $event->message;
     $data = array();
     // H-1 : Field Separator
     $data[] = $message->fieldSeparator;
     // H-2: Encoding Characters (ST)
     $data[] = substr($message->getEncodingCharacters(), 1);
     // H-3 : Message ID
     $data[] = $event->_exchange_hpr->_id;
     // H-4 : Password
     $data[] = null;
     // H-5 : Sender ID
     $data[] = $event->_sender->nom;
     // H-6 : Sender address
     $data[] = null;
     // H-7 : Context
     $data[] = $event->event_type;
     // H-8 : Sender phone
     $data[] = null;
     // H-9 : Transmission characteristics
     $data[] = null;
     // H-10 : Receiver ID
     $data[] = array($event->_receiver->_id, $event->_receiver->nom);
     // H-11 : Comment
     $data[] = null;
     // H-12 : Processing ID
     $data[] = null;
     // H-13 : Version and Type
     $data[] = array(array($event->version, $event->_exchange_hpr->type));
     // H-14 : Date/Time of Message
     $data[] = CMbDT::dateTime();
     $this->fill($data);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:38,代码来源:CHPRSegmentH.class.php

示例4: 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;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:25,代码来源:setup.php

示例5: checkProperty

 /**
  * @see parent::checkProperty()
  */
 function checkProperty($object)
 {
     $propValue =& $object->{$this->fieldName};
     $time_format = "/^\\d{1,2}:\\d{1,2}(:\\d{1,2})?\$/";
     // Format
     if (!preg_match($time_format, $propValue)) {
         if ($propValue === 'current' || $propValue === 'now') {
             $propValue = CMbDT::time();
             return null;
         }
         return "Format d'heure invalide";
     }
     // min
     if ($this->min) {
         if (!preg_match($time_format, $this->min)) {
             trigger_error("Spécification de minimum time invalide (min = {$this->min})", E_USER_WARNING);
             return "Erreur système";
         }
         if ($propValue < $this->min) {
             return "Doit avoir une valeur minimale de {$this->min}";
         }
     }
     // max
     if ($this->max) {
         if (!preg_match($time_format, $this->max)) {
             trigger_error("Spécification de maximum time invalide (max = {$this->max})", E_USER_WARNING);
             return "Erreur système";
         }
         if ($propValue > $this->max) {
             return "Doit avoir une valeur maximale de {$this->max}";
         }
     }
     return null;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:37,代码来源:CTimeSpec.class.php

示例6: store

 /**
  * @see parent::store()
  */
 function store()
 {
     if ($this->fieldModified("content") || !$this->last_modified) {
         $this->last_modified = CMbDT::dateTime();
     }
     return parent::store();
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:10,代码来源:CContentHTML.class.php

示例7: store

 /**
  * @see parent::store()
  */
 function store()
 {
     $this->completeField("handled");
     if (!$this->creation_date) {
         $this->creation_date = CMbDT::dateTime();
         if ($this->_id) {
             $this->creation_date = $this->loadFirstLog()->date;
         }
     }
     if ($this->fieldModified("handled", "1") || $this->handled && !$this->handled_date && !$this->handled_user_id) {
         $this->handled_date = CMbDT::dateTime();
         $this->handled_user_id = CMediusers::get()->_id;
         if ($this->handled) {
             $last_log = $this->loadLastLog();
             $this->handled_date = $last_log->date;
             $this->handled_user_id = $last_log->user_id;
         }
     }
     if ($this->fieldModified("handled", "0")) {
         $this->handled_date = $this->handled_user_id = "";
     }
     if ($msg = parent::store()) {
         return $msg;
     }
 }
开发者ID:OpenXtrem,项目名称:mediboard_save,代码行数:28,代码来源:CAlert.class.php

示例8: build

 /**
  * Build EVN segement
  *
  * @param CHL7v2Event $event Event
  *
  * @return null
  */
 function build(CHL7v2Event $event)
 {
     parent::build($event);
     $version = $event->message->version;
     $data = array();
     // EVN-1: Event Type Code (ID) (optional)
     // This field has been retained for backward compatibility only
     $data[] = $version < "2.5" ? $event->code : null;
     // EVN-2: Recorded Date/Time (TS)
     $data[] = CMbDT::dateTime();
     // EVN-3: Date/Time Planned Event (TS)(optional)
     $data[] = $this->planned_datetime;
     // EVN-4: Event Reason Code (IS) (optional)
     // Table 062
     // 01 - Patient request
     // 02 - Physician/health practitioner order
     // 03 - Census management
     // O  - Other
     // U  - Unknown
     $data[] = null;
     // EVN-5: Operator ID (XCN) (optional repeating)
     //$data[] = $this->getXCN($event->last_log->loadRefUser());
     $data[] = null;
     // EVN-6: Event Occurred (TS) (optional)
     $data[] = $this->occured_datetime;
     // EVN-7: Event Facility (HD) (optional)
     $data[] = null;
     $this->fill($data);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:36,代码来源:CHL7v2SegmentEVN.class.php

示例9: fixRepet

 /**
  * Menu upgrade
  *
  * @return bool
  */
 protected function fixRepet()
 {
     $ds = $this->ds;
     $query = "SELECT * FROM menu";
     $menus = $ds->loadList($query);
     foreach ($menus as $menu) {
         $nbDays = CMbDT::daysRelative($menu["debut"], $menu["fin"]);
         $nbWeeks = floor($nbDays / 7);
         if (!$nbWeeks) {
             $menu["nb_repet"] = 1;
         } else {
             $menu["nb_repet"] = ceil($nbWeeks / $menu["repetition"]);
         }
         $query = "UPDATE `menu` SET `nb_repet` = '" . $menu["nb_repet"] . "' WHERE(`menu_id`='" . $menu["menu_id"] . "');";
         $ds->exec($query);
         $ds->error();
         $query = "UPDATE `repas` SET `typerepas_id`='" . $menu["typerepas"] . "' WHERE(`menu_id`='" . $menu["menu_id"] . "');";
         $ds->exec($query);
         $ds->error();
     }
     $query = "ALTER TABLE `menu` DROP `fin`;";
     $ds->exec($query);
     $ds->error();
     return true;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:30,代码来源:setup.php

示例10: loadPublications

 /**
  * Loads messages from a publication date perspective
  *
  * @param string $status   Wanted status, null for all
  * @param string $mod_name Module name restriction, null for all
  * @param int    $group_id Group ID
  *
  * @return self[] Published messages
  */
 function loadPublications($status = null, $mod_name = null, $group_id = null)
 {
     $now = CMbDT::dateTime();
     $where = array();
     switch ($status) {
         case "past":
             $where["fin"] = "< '{$now}'";
             break;
         case "present":
             $where["deb"] = "< '{$now}'";
             $where["fin"] = "> '{$now}'";
             break;
         case "future":
             $where["deb"] = "> '{$now}'";
             break;
     }
     if ($group_id) {
         $where[] = "group_id = '{$group_id}' OR group_id IS NULL";
     }
     /** @var self[] $messages */
     $messages = $this->loadList($where, "deb DESC");
     // Module name restriction
     if ($mod_name) {
         foreach ($messages as $message_id => $_message) {
             if ($_message->module_id) {
                 if ($_message->loadRefModuleObject()->mod_name != $mod_name) {
                     unset($messages[$message_id]);
                 }
             }
         }
     }
     return $messages;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:42,代码来源:CMessage.class.php

示例11: mine

 static function mine($parent_class)
 {
     $classes = CApp::getChildClasses($parent_class);
     $limit = CAppUI::conf("dataminer_limit");
     foreach ($classes as $_class) {
         $miner = new $_class();
         $report = $miner->mineSome($limit, "mine");
         $dt = CMbDT::dateTime();
         echo "<{$dt}> Miner: {$_class}. Success mining count is '" . $report["success"] . "'\n";
         if (!$report["failure"]) {
             echo "<{$dt}> Miner: {$_class}. Failure mining counts is '" . $report["failure"] . "'\n";
         }
         $miner = new $_class();
         $report = $miner->mineSome($limit, "remine");
         $dt = CMbDT::dateTime();
         echo "<{$dt}> Reminer: {$_class}. Success remining count is '" . $report["success"] . "'\n";
         if (!$report["failure"]) {
             echo "<{$dt}> Reminer: {$_class}. Failure remining counts is '" . $report["failure"] . "'\n";
         }
         $miner = new $_class();
         $report = $miner->mineSome($limit, "postmine");
         $dt = CMbDT::dateTime();
         echo "<{$dt}> Postminer: {$_class}. Success postmining count is '" . $report["success"] . "'\n";
         if (!$report["failure"]) {
             echo "<{$dt}> Postminer: {$_class}. Failure postmining counts is '" . $report["failure"] . "'\n";
         }
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:28,代码来源:CDataMinerWorker.class.php

示例12: __call

 /**
  * Magic method (do not call directly)
  *
  * @param string $name method name
  * @param array  $args arguments
  *
  * @return mixed
  *
  * @throws Exception
  * @throws CMbException
  */
 function __call($name, $args)
 {
     $name = strtolower($name);
     $silent = strncmp($name, 'try', 3) === 0;
     $function_name = $silent ? substr($name, 3) : $name;
     $function_name = '_' . (isset(self::$aliases[$function_name]) ? self::$aliases[$function_name] : $function_name);
     if (!method_exists($this, $function_name)) {
         throw new CMbException("CSourceSFTP-call-undefined-method", $name);
     }
     if ($function_name == "_init") {
         return call_user_func_array(array($this, $function_name), $args);
     }
     if (!$this->loggable) {
         try {
             return call_user_func_array(array($this, $function_name), $args);
         } catch (CMbException $fault) {
             throw $fault;
         }
     }
     $echange_ftp = new CExchangeFTP();
     $echange_ftp->date_echange = CMbDT::dateTime();
     $echange_ftp->emetteur = CAppUI::conf("mb_id");
     $echange_ftp->destinataire = $this->hostname;
     $echange_ftp->function_name = $name;
     CApp::$chrono->stop();
     $chrono = new Chronometer();
     $chrono->start();
     $output = null;
     try {
         $output = call_user_func_array(array($this, $function_name), $args);
     } catch (CMbException $fault) {
         $echange_ftp->date_echange = CMbDT::dateTime();
         $echange_ftp->output = $fault->getMessage();
         $echange_ftp->ftp_fault = 1;
         $echange_ftp->store();
         CApp::$chrono->start();
         throw $fault;
     }
     $chrono->stop();
     CApp::$chrono->start();
     // response time
     $echange_ftp->response_time = $chrono->total;
     // Truncate input and output before storing
     $args = array_map_recursive(array("CFTP", "truncate"), $args);
     $echange_ftp->input = serialize($args);
     if ($echange_ftp->ftp_fault != 1) {
         if ($function_name == "_getlistfiles") {
             // Truncate le tableau des fichiers reçus dans le cas où c'est > 100
             $array_count = count($output);
             if ($array_count > 100) {
                 $output = array_slice($output, 0, 100);
                 $output["count"] = "{$array_count} files";
             }
         }
         $echange_ftp->output = serialize(array_map_recursive(array("CSFTP", "truncate"), $output));
     }
     $echange_ftp->store();
     return $output;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:70,代码来源:CSFTP.class.php

示例13: 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"));
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:11,代码来源:CAllaitement.class.php

示例14: updateFormFields

 /**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->_view = "Indisponibilité du " . CMbDT::dateToLocale($this->deb);
     if ($this->deb != $this->fin) {
         $this->_view .= " au " . CMbDT::dateToLocale($this->fin);
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:11,代码来源:CIndispoRessource.class.php

示例15: 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);
}
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:67,代码来源:graph_consultations.php


注:本文中的CMbDT类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。