本文整理汇总了PHP中CMbDT::format方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbDT::format方法的具体用法?PHP CMbDT::format怎么用?PHP CMbDT::format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbDT
的用法示例。
在下文中一共展示了CMbDT::format方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUniqueNumber
/**
* Get a unique order number
*
* @return string
*/
private function getUniqueNumber()
{
$format = CAppUI::conf('dPstock CProductOrder order_number_format');
if (strpos($format, '%id') === false) {
$format .= '%id';
}
$format = str_replace('%id', str_pad($this->_id ? $this->_id : 0, 4, '0', STR_PAD_LEFT), $format);
return CMbDT::format(null, $format);
}
示例2: __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();
}
示例3: __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];
}
}
示例4: __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;
}
示例5: generatePDF
/**
* Génération d'un pdf à partir d'une source, avec stream au client si demandé
*
* @param string $content source html
* @param boolean $stream envoi du pdf au navigateur
* @param CCompteRendu $compte_rendu compte-rendu ciblé
* @param CFile $file le CFile pour lequel générer le pdf
*
* @return string
*/
function generatePDF($content, $stream, $compte_rendu, $file)
{
$this->content = $this->fixBlockElements($content);
// Remplacement des champs seulement à l'impression
$this->content = str_replace("[Général - numéro de page]", "<span class='page'></span>", $this->content);
$date_lock = "";
$locker = new CMediusers();
if ($compte_rendu->valide) {
$locker = $compte_rendu->loadRefLocker();
$log_lock = $compte_rendu->loadLastLogForField("valide");
$date_lock = $log_lock->date;
}
$this->content = str_replace("[Meta Données - Date de verrouillage - Date]", $compte_rendu->valide ? CMbDT::format($date_lock, "%d/%m/%Y") : "", $this->content);
$this->content = str_replace("[Meta Données - Date de verrouillage - Heure]", $compte_rendu->valide ? CMbDT::format($date_lock, "%Hh%M") : "", $this->content);
$this->content = str_replace("[Meta Données - Verrouilleur - Nom]", $locker->_user_last_name, $this->content);
$this->content = str_replace("[Meta Données - Verrouilleur - Prénom]", $locker->_user_first_name, $this->content);
$this->content = str_replace("[Meta Données - Verrouilleur - Initiales]", $locker->_shortview, $this->content);
CHtmlToPDFConverter::$_page_ordonnance = $compte_rendu->_page_ordonnance;
$pdf_content = CHtmlToPDFConverter::convert($this->content, $compte_rendu->_page_format, $compte_rendu->_orientation);
if ($file->_file_path) {
file_put_contents($file->_file_path, $pdf_content);
}
$this->nbpages = preg_match_all("/\\/Page\\W/", $pdf_content, $matches);
if ($stream) {
header("Pragma: ");
header("Cache-Control: ");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
//HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
// END extra headers to resolve IE caching bug
header("MIME-Version: 1.0");
header("Content-length: " . strlen($pdf_content));
header('Content-type: application/pdf');
header("Content-disposition: inline; filename=\"" . $file->file_name . "\"");
echo $pdf_content;
}
return $pdf_content;
}
示例6: __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");
}
}
示例7: updateFormFields
/**
* @see parent::updateFormFields()
*/
function updateFormFields()
{
$this->_view = "Séjour du " . CMbDT::format($this->date_mouvement, "%d/%m/%Y") . " [" . $this->external_id . "]";
}
示例8: addDateTimeProperty
/**
* Ajoute un champ de type date et heure
*
* @param string $field Nom du champ
* @param string $value Valeur du champ
*
* @return void
*/
function addDateTimeProperty($field, $value = null)
{
$value = $value ? CMbDT::format($value, CAppUI::conf("datetime")) : "";
$this->addProperty($field, $value);
}
示例9: CSearchTargetEntry
$targets = new CSearchTargetEntry();
$actes_ccam = array();
$diags_cim = array();
$results = array();
$tab_favoris = array();
$date = CMbDT::date("-1 month");
$types = array();
$group = CGroups::loadCurrent();
if (CAppUI::conf("search active_handler active_handler_search_types", $group)) {
$types = explode("|", CAppUI::conf("search active_handler active_handler_search_types", $group));
}
$test_search = new CSearch();
$test_search->testConnection($group);
// On récupère les favoris
if ($_ref_object instanceof CSejour) {
$date = CMbDT::format($_ref_object->entree_reelle, "%Y-%m-%d");
/** @var $_ref_object CSejour */
// actes CCAM du séjour
foreach ($_ref_object->loadRefsActesCCAM() as $_ccam) {
$diags_actes[] = $_ccam->code_acte;
}
// actes CCAM du l'intervention
foreach ($_ref_object->loadRefsOperations() as $_op) {
foreach ($_op->loadRefsActesCCAM() as $_ccam) {
$diags_actes[] = $_ccam->code_acte;
}
}
if ($_ref_object->DP || $_ref_object->DR) {
if ($_ref_object->DP) {
$diags_actes[] = $_ref_object->DP;
}
示例10: loadExtCodesCCAM
/**
* Charge les codes CCAM en tant qu'objets externes
*
* @return void
*/
function loadExtCodesCCAM()
{
$this->_ext_codes_ccam = array();
$this->_ext_codes_ccam_princ = array();
$dateActe = CMbDT::format($this->_datetime, "%Y-%m-%d");
if ($this->_codes_ccam !== null) {
foreach ($this->_codes_ccam as $code) {
$code = CDatedCodeCCAM::get($code, $dateActe);
/* On supprime l'activité 1 du code si celui fait partie de la liste */
if (in_array($code->code, self::$hidden_activity_1)) {
unset($code->activites[1]);
}
$this->_ext_codes_ccam[] = $code;
if ($code->type != 2) {
$this->_ext_codes_ccam_princ[] = $code;
}
}
CMbArray::ksortByProp($this->_ext_codes_ccam, "type", "_sorted_tarif");
}
}
示例11: getVars
/**
* @param CMbObject|CPatient|CSejour $object Object to build the vars array
*
* @return array
*/
static function getVars(CMbObject $object)
{
$vars = $object->getIncrementVars();
$default_vars = array("YYYY" => CMbDT::format(null, "%Y"), "YY" => CMbDT::format(null, "%y"));
$vars = array_merge($vars, $default_vars);
return $vars;
}
示例12: addDateTimeAttribute
function addDateTimeAttribute($elParent, $atName, $dateValue = null)
{
$this->addAttribute($elParent, $atName, CMbDT::format($dateValue, "%Y-%m-%dT%H:%M:%S"));
}
示例13: getDateTime
function getDateTime()
{
static $datetime = null;
if ($datetime === null) {
$datetime = CMbDT::format(null, "%Y-%m-%d_%H-%M-%S");
}
return $datetime;
}
示例14: CMediusers
* @link http://www.mediboard.org
*/
global $date, $chir_id, $print;
$print = 1;
$function_id = CValue::get("function_id");
$date = CValue::get("date");
$start = CMbDT::date("this monday", $date);
if ($start > $date) {
$start = CMbDT::date("last monday", $date);
}
$end = CMbDT::date("next sunday", $start);
$muser = new CMediusers();
$musers = $muser->loadProfessionnelDeSanteByPref(PERM_READ, $function_id);
$function = new CFunctions();
$function->load($function_id);
echo "<h1>" . $function->_view . " (" . CMbDT::format($start, CAppUI::conf('longdate')) . " - " . CMbDT::format($end, CAppUI::conf('longdate')) . ")</h1>";
$pconsult = new CPlageconsult();
$ds = $pconsult->getDS();
$where = array();
$where[] = "chir_id " . $ds->prepareIn(array_keys($musers)) . " OR remplacant_id " . $ds->prepareIn(array_keys($musers));
$where["date"] = " BETWEEN '{$start}' AND '{$end}' ";
/** @var CPlageconsult[] $pconsults */
$pconsults = $pconsult->loadList($where, "date", null, "chir_id");
$pconsults_by_date_and_prat = array();
if (!count($pconsults)) {
echo "<div class='small-info'>Les praticiens de ce cabinet n'ont pas de plages de consultations sur cette période</div>";
CApp::rip();
}
foreach ($pconsults as $_pc) {
$chir_id = CValue::get("chir_id", $_pc->chir_id);
$_pc->loadRefChir();
示例15: array
* @package Mediboard
* @subpackage PlanningOp
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 22873 $
*/
CCanDo::checkRead();
$ds = CSQLDataSource::get("std");
$chir = CValue::get("chir", 0);
$date = CValue::getOrSession("date_plagesel", CMbDT::date());
$group_id = CValue::get("group_id", CGroups::loadCurrent()->_id);
$operation_id = CValue::get("operation_id", null);
$curr_op_time = CValue::get("curr_op_time", "25:00");
$resp_bloc = CModule::getInstalled("dPbloc")->canEdit();
// Liste des mois selectionnables
$date = CMbDT::format($date, "%Y-%m-01");
$listMonthes = array();
for ($i = -6; $i <= 12; $i++) {
$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;
}