本文整理汇总了PHP中Time::getTimeOfDMYHI方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::getTimeOfDMYHI方法的具体用法?PHP Time::getTimeOfDMYHI怎么用?PHP Time::getTimeOfDMYHI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time::getTimeOfDMYHI方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printTable
//.........这里部分代码省略.........
}
}
//-----------------------------------------------------------------------------
for ($i = 0; $i < $Entries['count']; $i++) {
$n = $i + 1;
if ($n % 2) {
$CssClass = 'even';
} else {
$CssClass = 'odd';
}
echo "<tr class='" . $CssClass . "'>";
if ($this->Numbering) {
echo "<td>" . $n . "</td>";
}
for ($j = 0; $j < $SizeOf; $j++) {
//-----------------------------------------------------------------------------
if ($this->SortColumn) {
if (strpos($this->Attributes['name'][$j], ",")) {
$Value = "";
foreach (explode(",", $this->Attributes['name'][$j]) as $V) {
@($Value .= self::convertValue($Entries[$AS[$i]][trim($V)][$this->Attributes['i'][array_search($ADAttributes[$j], $this->Attributes['name'])]]));
}
} else {
@($Value = self::convertValue($Entries[$AS[$i]][$this->Attributes['name'][$j]][$this->Attributes['i'][array_search($ADAttributes[$j], $this->Attributes['name'])]]));
}
} else {
if (strpos($this->Attributes['name'][$j], ",")) {
$Value = "";
foreach (explode(",", $this->Attributes['name'][$j]) as $V) {
$Value .= self::convertValue($Entries[$i][trim($V)][$this->Attributes['i'][array_search($ADAttributes[$j], $this->Attributes['name'])]]);
}
} else {
$Value = self::convertValue($Entries[$i][$this->Attributes['name'][$j]][$this->Attributes['i'][array_search($ADAttributes[$j], $this->Attributes['name'])]]);
}
}
//-----------------------------------------------------------------------------
//Проверка применимости замены на рег. выражениях
//-----------------------------------------------------------------------------
if (is_array(@$this->PregReplace[$this->Attributes[title][$j]]['conditions'])) {
foreach (@$this->PregReplace[$this->Attributes[title][$j]]['conditions'] as $key => $value) {
@($this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = true);
//$PreviousFlag=true;
foreach (@$this->PregReplace[$this->Attributes[title][$j]]['conditions'][$key] as $key1 => $value1) {
foreach (@$this->PregReplace[$this->Attributes[title][$j]]['conditions'][$key][$key1] as $key2 => $value2) {
if ($this->SortColumn) {
@($ConditionValue = self::convertValue($Entries[$AS[$i]][$key1][$this->Attributes['i'][array_search($key1, $this->Attributes['name'])]]));
} else {
$ConditionValue = self::convertValue($Entries[$i][$key1][$this->Attributes['i'][array_search($key1, $this->Attributes['name'])]]);
}
switch ($key2) {
case "=":
//echo $ConditionValue."--------".$value2."<br>";
if ($ConditionValue == $value2) {
@($this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = $this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] && true);
} else {
@($this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = $this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] && false);
}
break;
case "!=":
if ($ConditionValue != $value2) {
@($this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = $this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] && true);
} else {
@($this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = $this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] && false);
}
break;
case "in_range_date":
if (preg_match("/^[0-9]{2}\\.[0-9]{2}\\.[0-9]{4}\\s-\\s[0-9]{2}\\.[0-9]{2}\\.[0-9]{4}\$/", $ConditionValue)) {
$e = explode(" - ", $ConditionValue);
if (Time::getTimeOfDMYHI($e[1]) >= $value2 && Time::getTimeOfDMYHI($e[0]) <= $value2) {
$this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = $this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] && true;
} else {
$this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = $this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] && false;
}
} else {
@($this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = $this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] && false);
}
break;
default:
$this->PregReplace[$this->Attributes[title][$j]]['apply'][$key] = true;
}
}
}
}
unset($key, $key1, $key2, $value, $value1, $value2, $ConditionValue);
}
//-----------------------------------------------------------------------------
@($Value = self::PregReplace($this->Attributes[title][$j], $Value));
//$Value=self::LogicReplace($this->Attributes[title][$j], $Value);
if (!$this->Attributes['notshow'][$j]) {
echo "<td>";
echo $Value;
echo "</td>";
}
}
echo "</tr>";
unset($Value);
}
echo "</table>";
}
}
示例2: getVacationState
public static function getVacationState($StDate, $EndDate)
{
if($StDate&&$EndDate)
{
$end_time=Time::getTimeOfDMYHI($EndDate, $GLOBALS['VAC_DATE_FORMAT']);
$start_time=Time::getTimeOfDMYHI($StDate, $GLOBALS['VAC_DATE_FORMAT']);
$time=time();
if(($end_time>=$time)&&($start_time<=$time))
return 0; // в отпуске
else
{
if($start_time>$time)
return 1; // отпуск еще предстоит
else
return -1; // отпуск закончился
}
}
}
示例3: getVacationState
public static function getVacationState($StDate, $EndDate)
{
if ($StDate && $EndDate) {
$end_time = Time::getTimeOfDMYHI($EndDate, $GLOBALS['VAC_DATE_FORMAT']);
$start_time = Time::getTimeOfDMYHI($StDate, $GLOBALS['VAC_DATE_FORMAT']);
$time = time();
if ($end_time >= $time && $start_time <= $time) {
return 0;
} else {
if ($start_time > $time) {
return 1;
} else {
return -1;
}
// отпуск закончился
}
}
}
示例4: array
<?php
require_once "../libs/require_once.php";
if ($Valid) {
if ($_POST['vac_from']) {
if ($_POST['vac_to']) {
if (Time::checkDate($_POST['vac_from'])) {
if (Time::checkDate($_POST['vac_to'])) {
if (Time::getTimeOfDMYHI($_POST['vac_from']) >= time()) {
if (Time::getTimeOfDMYHI($_POST['vac_from']) <= Time::getTimeOfDMYHI($_POST['vac_to'])) {
$ldap->ldap_modify($_COOKIE['dn'], array($LDAP_ST_DATE_VACATION_FIELD => Time::modifyDateFormat($_POST['vac_from'], "dd.mm.yyyy", $VAC_DATE_FORMAT)));
$ldap->ldap_modify($_COOKIE['dn'], array($LDAP_END_DATE_VACATION_FIELD => Time::modifyDateFormat($_POST['vac_to'], "dd.mm.yyyy", $VAC_DATE_FORMAT)));
echo "{\"success\": \"true\", \"dn\": \"" . Time::getTimeOfDMYHI($_POST['vac_from']) . "\"}";
} else {
echo "{\"success\": \"false\", \"field\": \"vac_to\", \"answer\": \"Дата окончания отпуска должна быть позже даты начала.\"}";
}
} else {
echo "{\"success\": \"false\", \"field\": \"vac_from\", \"answer\": \"Дата начала планируемого отпуска должна быть позже текущей\"}";
}
} else {
echo "{\"success\": \"false\", \"field\": \"vac_to\", \"answer\": \"Дата не соответствует формату\"}";
}
} else {
echo "{\"success\": \"false\", \"field\": \"vac_from\", \"answer\": \"Дата не соответствует формату\"}";
}
} else {
echo "{\"success\": \"false\", \"field\": \"vac_to\", \"answer\": \"Не заполнена дата окончания отпуска\"}";
}
} else {
echo "{\"success\": \"false\", \"field\": \"vac_from\", \"answer\": \"Не заполнена дата начала отпуска \"}";
}
示例5: preg_replace
} else {
echo "<div class=\"photo\"><img src=\"./skins/" . $CURRENT_SKIN . "/images/ldap/user.png\"></div>";
}
echo "</td>";
echo "<td>";
if ($USE_DISPLAY_NAME) {
$Name = $ldap->getValue($dn, $DISPLAY_NAME_FIELD);
} else {
$Name = $ldap->getValue($dn, "name");
}
$FIO = preg_replace("/^([ёA-zА-я-]+)[\\s]{1}([ёA-zА-я-]+[\\s]{1}[ёA-zА-я-]+)\$/u", "<div class=\"surname_head\">\$1</div><div class=\"name\">\$2</div>", $Name);
$FIO = preg_replace("/^([ёA-zА-я-]+[\\s]{1}[ёA-zА-я-]{1}.)[\\s]{1}([ёA-zА-я-]+)\$/u", "<div class=\"surname_head\">\$2</div><div class=\"name\">\$1</div>", $FIO);
echo $FIO;
if ($SHOW_EVALUATION_PERIOD_MESSAGE && $LDAP_CREATED_DATE_FIELD) {
$Created = $ldap->getValue($dn, $LDAP_CREATED_DATE_FIELD);
$CreatedUnixTime = Time::getTimeOfDMYHI($Created, $LDAP_CREATED_DATE_FORMAT);
$NumWorkDays = round((Time::getOnlyDatePartFromTime(time()) - Time::getOnlyDatePartFromTime($CreatedUnixTime)) / (24 * 60 * 60));
if ($NumWorkDays <= $EVALUATION_PERIOD) {
echo "<h6 class=\"alarm\">Новый сотрудник</h6> — <small>работает в компании <big>" . $L->ending($NumWorkDays, 'день', 'дня', 'дней') . "</big></small>";
}
}
$Department = $ldap->getValue($dn, $LDAP_DEPARTMENT_FIELD);
$Title = $ldap->getValue($dn, $LDAP_TITLE_FIELD);
if ($Department) {
echo "<div class=\"position\"><nobr class=\"department\">" . Staff::makeDepartment($Department) . "</nobr> <br/><span class=\"position\">" . Staff::makeTitle($Title) . "</span></div>";
}
if ($VACATION) {
$e[0] = $ldap->getValue($dn, $LDAP_ST_DATE_VACATION_FIELD);
$e[1] = $ldap->getValue($dn, $LDAP_END_DATE_VACATION_FIELD);
if ($e[0] && $e[1]) {
$VacationState = Staff::getVacationState($e[0], $e[1]);
示例6:
if ($_COOKIE['dn']) {
if ($WhoAreYou !== false) {
echo "<fieldset class=\"whoareyou\">";
echo "<legend>" . $WhoAreYou . "</legend>";
echo "<ul>";
if ($Login = $ldap->getValue($_COOKIE['dn'], "userprincipalname")) {
if (in_array($Login, $ADMIN_LOGINS)) {
echo "<li><a href=\"" . $_SERVER['PHP_SELF'] . "?menu_marker=si_staffedit\">" . $L->l("admin_panel") . "</a></li>";
}
}
if ($vac_from = $ldap->getValue($_COOKIE['dn'], $LDAP_ST_DATE_VACATION_FIELD)) {
$vac_from = Time::modifyDateFormat($vac_from, $VAC_DATE_FORMAT, 'dd.mm.yyyy');
}
if ($vac_to = $ldap->getValue($_COOKIE['dn'], $LDAP_END_DATE_VACATION_FIELD)) {
$vac_to = Time::modifyDateFormat($vac_to, $VAC_DATE_FORMAT, 'dd.mm.yyyy');
}
echo "<li><a href=\"newwin.php?menu_marker=si_employeeview&dn=" . $_COOKIE['dn'] . "\" data-lightview-type=\"iframe\" data-lightview-options=\"width: '80%', height: '100%', keyboard: {esc: true}, skin: 'light'\" class=\"lightview\">" . $L->l("profile") . "</a></li>";
if ($VACATION) {
echo "<li><span id=\"Vac\">" . $L->l("vacation_plan") . "<big><big>→</big></big> <span class=\"\">\r\n\t\t\t<input type=\"text\" name=\"vac_from\" id=\"vac_from\" class=\"date\" value=\"" . $vac_from . "\"/>\r\n\t\t\t<em><i></i></em></span> — <span class=\"\">\r\n\t\t\t<input type=\"text\" name=\"vac_to\" id=\"vac_to\" class=\"date\" value=\"" . $vac_to . "\" />\r\n\t\t\t<em><i></i></em></span>\r\n\t\t\t<img id=\"vac_apply\" src=\"./skins/" . $CURRENT_SKIN . "/images/true24.png\" width=\"24\" height=\"24\"/><img id=\"vac_loader\" class=\"hidden\" src=\"./skins/" . $CURRENT_SKIN . "/images/load.gif\" width=\"16\" height=\"16\"/></span>\r\n\t\t\t</li>\r\n\t\t\t<script type='text/javascript'>\r\n\t\t\tCalendar.setup({inputField:'vac_from', ifFormat:'%d.%m.%Y', button:'vac_from', firstDay:1, weekNumbers:false, showOthers:true});\r\n\t\t\tCalendar.setup({inputField: 'vac_to', ifFormat: '%d.%m.%Y', button: 'vac_to', firstDay:1, weekNumbers:false, showOthers:true});\r\n\t\t\t</script>\r\n\t\t\t";
if ($VAC_CLAIM_ALARM && $vac_from && $vac_to) {
if (Time::getTimeOfDMYHI($vac_from) - $VAC_CLAIM_ALARM_DAYES_FROM * 24 * 60 * 60 <= time() && Time::getTimeOfDMYHI($vac_to) - $VAC_CLAIM_ALARM_DAYES_TO * 24 * 60 * 60 >= time()) {
echo "<li><a href=\"newwin.php?menu_marker=si_print_vacation_claim&dn=" . $_COOKIE['dn'] . "\" title=\":: :: width: 900, height: 700\" class=\"lightview alert\">Заявление на отпуск</a></li>";
}
}
}
if (@(!$_SERVER['REMOTE_USER'])) {
echo "<li><a href=\"" . $_SERVER['PHP_SELF'] . "?iamnot=1\" title=\"Нет! \">" . $L->l("exit") . "</a></li>";
}
echo "</ul></fieldset>";
}
}