本文整理汇总了PHP中date::add方法的典型用法代码示例。如果您正苦于以下问题:PHP date::add方法的具体用法?PHP date::add怎么用?PHP date::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类date
的用法示例。
在下文中一共展示了date::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($param = "")
{
global $formMaj;
global $datas_lang;
global $smarty;
global $thisSite;
$fieldRacine = $this->field;
$fieldBegin = $fieldRacine . "_beg";
$fieldEnd = $fieldRacine . "_end";
$data = "";
// date départ
$this->field = $fieldBegin;
$this->value = $this->valuesPeriode[0];
$this->defaultValue = $this->defaultValuesPeriode[0];
$value = $this->getValue("");
$this->controleRange = "onSelect: function( selectedDate ){\$('#scr_" . $fieldEnd . "').datepicker('option', 'minDate', selectedDate);},";
$this->widthField = 0;
parent::add();
if (strpos($this->required, "beg") === 0) {
$this->rule("required", true);
}
$smarty->assign('this', $this);
$data .= $smarty->fetch($this->pathTemplate . 'inc/fields/class.date.tpl');
// date fin
$this->field = $fieldEnd;
$this->value = $this->valuesPeriode[1];
$this->defaultValue = $this->defaultValuesPeriode[1];
$value = $this->getValue("");
$this->controleRange = "onSelect: function( selectedDate ){\$('#scr_" . $fieldBegin . "').datepicker('option', 'maxDate', selectedDate);},";
$this->widthField = 0;
parent::add();
if (strpos($this->required, "end")) {
$this->rule("required", true);
}
$this->str_label = "<label class='label col'><i class='fa fa-caret-right'></i></label>";
$smarty->assign('this', $this);
$data .= $smarty->fetch($this->pathTemplate . 'inc/fields/class.date.tpl');
$this->smartAssign($fieldRacine, $data);
return $data;
}
示例2: date
$newfield->allItems = true;
$newfield->items = $filtre["items"];
$newfield->value = ${$newfield->field};
$datasArticle["filtre"][$f]["HTML_Filtre"] = $newfield->add();
}
if ($filtre["type"] == "date") {
$newfield = new date();
$newfield->field = "F__filtre_" . $filtre["field"];
$newfield->label = $filtre["label"];
$newfield->widthLabel = 1;
$newfield->changeYear = true;
$newfield->numberOfMonths = 1;
$newfield->dateFormat = "dd.mm.yy";
$newfield->javascript = "onChange='submitFiltres()'";
$newfield->value = ${$newfield->field};
$datasArticle["filtre"][$f]["HTML_Filtre"] = $newfield->add();
}
}
}
// FIN FILTRES //////////////////////////////////////////
// CHARGEMENT LISTE //////////////////////////////////////////
$formList = new formList();
$formList->tables = $myTable;
$formList->fields = "*";
$formList->orderby = $orderby;
$formList->where = "art='" . $datasArticle["name"] . "'";
$formList->where .= " AND lg='" . $myAdmin->LANG_DATAS . "'";
// Filtres ///////////////////////////////////////
if (is_array($datasArticle["filtre"])) {
foreach ($datasArticle["filtre"] as $f => $filtre) {
if ($filtre["type"] == "select") {
示例3: date
$newfield->label = "Niveau 1";
$newfield->noneItem = true;
$newfield->items = $list;
$newfield->value = $F__niveau1;
$newfield->javascript = "onChange='submitFiltres()'";
$newfield->add();
}
$newfield = new date();
$newfield->field = "F__date";
$newfield->label = "Date";
$newfield->widthLabel = 0;
$newfield->changeYear = true;
$newfield->numberOfMonths = 1;
$newfield->dateFormat = "dd.mm.yy";
$newfield->value = $F__date;
$newfield->add();
if ($F__niveau1 == "") {
// RemoveActionPage("ajouter");
// $F__niveau1="-1*";
}
// FIN FILTRES //////////////////////////////////////////
// CHARGEMENT LISTE //////////////////////////////////////////
$formList = new formList();
$formList->tables = $myTable;
$formList->fields = "*";
$formList->orderby = $orderby;
$formList->where = "lg='" . $myAdmin->LANG_DATAS . "'";
$formList->pagination = true;
// Filtres
if ($F__niveau1 != "") {
$formList->where .= " AND id1='" . $F__niveau1 . "'";