本文整理汇总了PHP中FmtDate函数的典型用法代码示例。如果您正苦于以下问题:PHP FmtDate函数的具体用法?PHP FmtDate怎么用?PHP FmtDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FmtDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckFilter
function CheckFilter() // проверка введенных полей
{
global $strError, $find_timestamp_1, $find_timestamp_2;
$str = "";
if (strlen(trim($find_timestamp_1))>0 || strlen(trim($find_timestamp_2))>0)
{
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_timestamp_1,"D.M.Y"),"d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_timestamp_2,"D.M.Y")." 23:59","d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_timestamp_1))>0)
$str.= GetMessage("MAIN_WRONG_DATE_FROM")."<br>";
else $date_1_ok = true;
if (!$date2_stm && strlen(trim($find_timestamp_2))>0)
$str.= GetMessage("MAIN_WRONG_DATE_TILL")."<br>";
elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm)>0)
$str.= GetMessage("MAIN_FROM_TILL_DATE")."<br>";
}
$strError .= $str;
if(strlen($str)>0)
{
global $lAdmin;
$lAdmin->AddFilterError($str);
return false;
}
return true;
}
示例2: CheckFilter
function CheckFilter($FilterArr)
{
foreach ($FilterArr as $f) {
global ${$f};
}
$str = "";
if (strlen(trim($find_last_exec)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_last_exec, "D.M.Y"), "d.m.Y");
if (!$date1_stm && strlen(trim($find_last_exec)) > 0) {
$str .= GetMessage("MAIN_AGENT_WRONG_LAST_EXEC") . "<br>";
} else {
$date_1_ok = true;
}
}
if (strlen(trim($find_next_exec)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_next_exec, "D.M.Y"), "d.m.Y");
if (!$date1_stm && strlen(trim($find_next_exec)) > 0) {
$str .= GetMessage("MAIN_AGENT_WRONG_NEXT_EXEC") . "<br>";
} else {
$date_1_ok = true;
}
}
if (strlen($str) > 0) {
global $lAdmin;
$lAdmin->AddFilterError($str);
return false;
}
return true;
}
示例3: CheckFilter
function CheckFilter($arFilterFields)
{
global $lAdmin;
$FilterArr = $arFilterFields;
reset($FilterArr);
foreach ($FilterArr as $f) {
global ${$f};
}
$str = "";
if (strlen(trim($find_timestamp_1)) > 0 || strlen(trim($find_timestamp_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_timestamp_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_timestamp_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_timestamp_1)) > 0) {
$str .= GetMessage("MAIN_WRONG_TIMESTAMP_FROM") . "<br>";
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_timestamp_2)) > 0) {
$str .= GetMessage("MAIN_WRONG_TIMESTAMP_TILL") . "<br>";
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$str .= GetMessage("MAIN_FROM_TILL_TIMESTAMP") . "<br>";
}
}
$lAdmin->AddFilterError($str);
if (strlen($str) > 0) {
return false;
}
return true;
}
示例4: CheckFilter
function CheckFilter()
{
if (isset($_REQUEST['del_filter']) && $_REQUEST['del_filter'] == 'Y') {
return false;
}
global $strError, $find_timestamp_1, $find_timestamp_2, $lAdmin;
$str = "";
if (strlen(trim($find_timestamp_1)) > 0 || strlen(trim($find_timestamp_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_timestamp_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_timestamp_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_timestamp_1)) > 0) {
$str .= GetMessage("MAIN_WRONG_DATE_FROM") . "<br>";
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_timestamp_2)) > 0) {
$str .= GetMessage("MAIN_WRONG_DATE_TILL") . "<br>";
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$str .= GetMessage("MAIN_FROM_TILL_DATE") . "<br>";
}
}
$strError .= $str;
if (strlen($str) > 0) {
$lAdmin->AddFilterError($str);
return false;
}
return true;
}
示例5: CheckFilter
function CheckFilter() // проверка введенных полей
{
global $FilterArr, $lAdmin;
foreach ($FilterArr as $f) global $$f;
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_date1,"D.M.Y"),"d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_date2,"D.M.Y")." 23:59","d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_date1))>0)
$lAdmin->AddFilterError(GetMessage("MAIN_WRONG_DATE_FROM"));
else
$date_1_ok = true;
if(!$date2_stm && strlen(trim($find_date2))>0)
$lAdmin->AddFilterError(GetMessage("MAIN_WRONG_DATE_TILL"));
elseif($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm)>0)
$lAdmin->AddFilterError(GetMessage("MAIN_FROM_TILL_DATE"));
return count($lAdmin->arFilterErrors)==0;
}
示例6: CheckFilter
function CheckFilter($FilterArr)
{
global $strError;
foreach($FilterArr as $f)
global $$f;
$str = "";
if(strlen(trim($find_timestamp_1))>0 || strlen(trim($find_timestamp_2))>0)
{
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_timestamp_1,"D.M.Y"),"d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_timestamp_2,"D.M.Y")." 23:59","d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_timestamp_1))>0)
$str.= GetMessage("MAIN_WRONG_TIMESTAMP_FROM")."<br>";
else $date_1_ok = true;
if (!$date2_stm && strlen(trim($find_timestamp_2))>0)
$str.= GetMessage("MAIN_WRONG_TIMESTAMP_TILL")."<br>";
elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm)>0)
$str.= GetMessage("MAIN_FROM_TILL_TIMESTAMP")."<br>";
}
if(strlen(trim($find_last_login_1))>0 || strlen(trim($find_last_login_2))>0)
{
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_last_login_1,"D.M.Y"),"d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_last_login_2,"D.M.Y")." 23:59","d.m.Y H:i");
if(!$date1_stm && strlen(trim($find_last_login_1))>0)
$str.= GetMessage("MAIN_WRONG_LAST_LOGIN_FROM")."<br>";
else
$date_1_ok = true;
if(!$date2_stm && strlen(trim($find_last_login_2))>0)
$str.= GetMessage("MAIN_WRONG_LAST_LOGIN_TILL")."<br>";
elseif($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm)>0)
$str.= GetMessage("MAIN_FROM_TILL_LAST_LOGIN")."<br>";
}
$strError .= $str;
if(strlen($str)>0)
{
global $lAdmin;
$lAdmin->AddFilterError($str);
return false;
}
return true;
}
示例7: CheckFilter
function CheckFilter()
{
global $strError, $FilterArr;
reset($FilterArr);
foreach ($FilterArr as $f) {
global ${$f};
}
$str = "";
if (strlen(trim($find_timestamp_1)) > 0 || strlen(trim($find_timestamp_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_timestamp_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_timestamp_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_timestamp_1)) > 0) {
$str .= GetMessage("SALE_WRONG_TIMESTAMP_FROM") . "<br>";
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_timestamp_2)) > 0) {
$str .= GetMessage("SALE_WRONG_TIMESTAMP_TILL") . "<br>";
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$str .= GetMessage("SALE_FROM_TILL_TIMESTAMP") . "<br>";
}
}
if (strlen(trim($find_last_login_1)) > 0 || strlen(trim($find_last_login_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_last_login_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_last_login_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_last_login_1)) > 0) {
$str .= GetMessage("SALE_WRONG_LAST_LOGIN_FROM") . "<br>";
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_last_login_2)) > 0) {
$str .= GetMessage("SALE_WRONG_LAST_LOGIN_TILL") . "<br>";
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$str .= GetMessage("SALE_FROM_TILL_LAST_LOGIN") . "<br>";
}
}
$strError .= $str;
if (strlen($str) > 0) {
return false;
} else {
return true;
}
}
示例8: CheckFilter
function CheckFilter()
{
global $FilterArr, $lAdmin;
foreach ($FilterArr as $f) {
global ${$f};
}
if (strlen(trim($find_update_1)) > 0 || strlen(trim($find_update_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_update_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_update_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_update_1)) > 0) {
$lAdmin->AddFilterError(GetMessage("POST_WRONG_UPDATE_FROM"));
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_update_2)) > 0) {
$lAdmin->AddFilterError(GetMessage("POST_WRONG_UPDATE_TILL"));
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$lAdmin->AddFilterError(GetMessage("POST_FROM_TILL_UPDATE"));
}
}
if (strlen(trim($find_insert_1)) > 0 || strlen(trim($find_insert_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_insert_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_insert_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_insert_1)) > 0) {
$lAdmin->AddFilterError(GetMessage("POST_WRONG_INSERT_FROM"));
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_insert_2)) > 0) {
$lAdmin->AddFilterError(GetMessage("POST_WRONG_INSERT_TILL"));
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$lAdmin->AddFilterError(GetMessage("POST_FROM_TILL_INSERT"));
}
}
return count($lAdmin->arFilterErrors) == 0;
}
示例9: CheckFilter
function CheckFilter()
{
global $FilterArr, $lAdmin;
foreach ($FilterArr as $f) {
global ${$f};
}
if (strlen(trim($find_last_executed_1)) > 0 || strlen(trim($find_last_executed_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_last_executed_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_last_executed_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_last_executed_1)) > 0) {
$lAdmin->AddFilterError(GetMessage("rub_wrong_generation_from"));
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_last_executed_2)) > 0) {
$lAdmin->AddFilterError(GetMessage("rub_wrong_generation_till"));
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$lAdmin->AddFilterError(GetMessage("rub_wrong_generation_from_till"));
}
}
return count($lAdmin->arFilterErrors) == 0;
}
示例10: GetList
//.........这里部分代码省略.........
$bIsLang = false;
if (is_array($arFilter))
{
foreach ($arFilter as $key => $val)
{
if(is_array($val))
{
if(count($val) <= 0)
continue;
}
else
{
if( (strlen($val) <= 0) || ($val === "NOT_REF") )
continue;
}
$match_value_set = array_key_exists($key."_EXACT_MATCH", $arFilter);
$key = strtoupper($key);
switch($key)
{
case "ID":
$match = ($arFilter[$key."_EXACT_MATCH"]=="N" && $match_value_set) ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("M.ID", $val, $match);
break;
case "TYPE":
$match = ($arFilter[$key."_EXACT_MATCH"]=="Y" && $match_value_set) ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("M.EVENT_NAME, T.NAME", $val, $match);
break;
case "EVENT_NAME":
case "TYPE_ID":
$match = ($arFilter[$key."_EXACT_MATCH"]=="N" && $match_value_set) ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("M.EVENT_NAME", $val, $match);
break;
case "TIMESTAMP_1":
$arSqlSearch[] = "M.TIMESTAMP_X >= FROM_UNIXTIME('".MkDateTime(FmtDate($val,"D.M.Y"),"d.m.Y")."')";
break;
case "TIMESTAMP_2":
$arSqlSearch[] = "M.TIMESTAMP_X <= FROM_UNIXTIME('".MkDateTime(FmtDate($val,"D.M.Y")." 23:59:59","d.m.Y")."')";
break;
case "LID":
case "LANG":
case "SITE_ID":
if (is_array($val)) $val = implode(" | ",$val);
$arSqlSearch[] = GetFilterQuery("MS.SITE_ID",$val,"N");
$bIsLang = true;
break;
case "ACTIVE":
$arSqlSearch[] = ($val=="Y") ? "M.ACTIVE = 'Y'" : "M.ACTIVE = 'N'";
break;
case "FROM":
$match = ($arFilter[$key."_EXACT_MATCH"]=="Y" && $match_value_set) ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("M.EMAIL_FROM", $val, $match);
break;
case "TO":
$match = ($arFilter[$key."_EXACT_MATCH"]=="Y" && $match_value_set) ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("M.EMAIL_TO", $val, $match);
break;
case "BCC":
$match = ($arFilter[$key."_EXACT_MATCH"]=="Y" && $match_value_set) ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("M.BCC", $val, $match);
break;
case "SUBJECT":
$match = ($arFilter[$key."_EXACT_MATCH"]=="Y" && $match_value_set) ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("M.SUBJECT", $val, $match);
break;
case "BODY_TYPE":
$arSqlSearch[] = ($val=="text") ? "M.BODY_TYPE = 'text'" : "M.BODY_TYPE = 'html'";
示例11: GetAbsent
public static function GetAbsent($users = false, $Params = array())
{
global $DB;
// Can be called from agent... So we have to create $USER if it is not exists
$tempUser = CCalendar::TempUser(false, true);
$curUserId = isset($Params['userId']) ? intVal($Params['userId']) : CCalendar::GetCurUserId();
$arUsers = array();
if ($users !== false && is_array($users)) {
foreach ($users as $id) {
if ($id > 0) {
$arUsers[] = intVal($id);
}
}
}
if (!count($arUsers)) {
$users = false;
}
// Part 1: select ordinary events
$arFilter = array('CAL_TYPE' => 'user', 'DELETED' => 'N', 'ACCESSIBILITY' => 'absent');
if (isset($Params['fromLimit'])) {
$arFilter['FROM_LIMIT'] = CCalendar::Date(CCalendar::Timestamp($Params['fromLimit'], false), true, false);
}
if (isset($Params['toLimit'])) {
$arFilter['TO_LIMIT'] = CCalendar::Date(CCalendar::Timestamp($Params['toLimit'], false), true, false);
}
$arEvents = CCalendarEvent::GetList(array('arFilter' => $arFilter, 'getUserfields' => false, 'parseRecursion' => true, 'fetchAttendees' => false, 'fetchMeetings' => true, 'userId' => $curUserId, 'checkPermissions' => false, 'preciseLimits' => true));
// Part 2: select attendees
CTimeZone::Disable();
if (count($arUsers) > 0) {
$userQ = ' AND CA.USER_ID in (' . implode(',', $arUsers) . ')';
} else {
$userQ = '';
}
$strSql = "\n\t\t\tSELECT\n\t\t\t\tCA.EVENT_ID as ID, CA.USER_ID, CA.STATUS, CA.ACCESSIBILITY,\n\t\t\t\tCE.CAL_TYPE,CE.OWNER_ID,CE.NAME," . $DB->DateToCharFunction("CE.DT_FROM") . " as DT_FROM," . $DB->DateToCharFunction("CE.DT_TO") . " as DT_TO, CE.DT_LENGTH, CE.PRIVATE_EVENT, CE.ACCESSIBILITY, CE.IMPORTANCE, CE.IS_MEETING, CE.MEETING_HOST, CE.MEETING, CE.LOCATION, CE.RRULE, CE.EXRULE, CE.RDATE, CE.EXDATE,\n\t\t\t\tCES.SECT_ID\n\t\t\tFROM b_calendar_attendees CA\n\t\t\tLEFT JOIN\n\t\t\t\tb_calendar_event CE ON(CA.EVENT_ID=CE.ID)\n\t\t\tLEFT JOIN\n\t\t\t\tb_calendar_event_sect CES ON (CA.EVENT_ID=CES.EVENT_ID)\n\t\t\tWHERE\n\t\t\t\t\tCE.ID IS NOT NULL\n\t\t\t\tAND\n\t\t\t\t\tCE.DELETED='N'\n\t\t\t\tAND\n\t\t\t\t\tSTATUS='Y'\n\t\t\t\tAND\n\t\t\t\t\tCA.ACCESSIBILITY='absent'\n\t\t\t\t{$userQ}\n\t\t\t";
if (isset($arFilter['FROM_LIMIT'])) {
$strSql .= "AND ";
if (strtoupper($DB->type) == "MYSQL") {
$strSql .= "CE.DT_TO>=FROM_UNIXTIME('" . MkDateTime(FmtDate($arFilter['FROM_LIMIT'], "D.M.Y"), "d.m.Y") . "')";
} elseif (strtoupper($DB->type) == "MSSQL") {
$strSql .= "CE.DT_TO>=" . $DB->CharToDateFunction($arFilter['FROM_LIMIT'], "SHORT");
} elseif (strtoupper($DB->type) == "ORACLE") {
$strSql .= "CE.DT_TO>=TO_DATE('" . FmtDate($arFilter['FROM_LIMIT'], "D.M.Y") . " 00:00:00','dd.mm.yyyy hh24:mi:ss')";
}
}
if ($arFilter['TO_LIMIT']) {
$strSql .= "AND ";
if (strtoupper($DB->type) == "MYSQL") {
$strSql .= "CE.DT_FROM<=FROM_UNIXTIME('" . MkDateTime(FmtDate($arFilter['TO_LIMIT'], "D.M.Y") . " 23:59:59", "d.m.Y H:i:s") . "')";
} elseif (strtoupper($DB->type) == "MSSQL") {
$strSql .= "CE.DT_FROM<=dateadd(day, 1, " . $DB->CharToDateFunction($arFilter['TO_LIMIT'], "SHORT") . ")";
} elseif (strtoupper($DB->type) == "ORACLE") {
$strSql .= "CE.DT_FROM<=TO_DATE('" . FmtDate($arFilter['TO_LIMIT'], "D.M.Y") . " 23:59:59','dd.mm.yyyy hh24:mi:ss')";
}
}
$res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$arEvents2 = array();
while ($event = $res->Fetch()) {
$event = self::PreHandleEvent($event);
if ($event['CAL_TYPE'] == 'user' && $event['IS_MEETING'] && $event['OWNER_ID'] == $event['USER_ID']) {
continue;
}
if (self::CheckRecurcion($event)) {
self::ParseRecursion($arEvents2, $event, array('fromLimit' => $arFilter["FROM_LIMIT"], 'toLimit' => $arFilter["TO_LIMIT"]));
} else {
self::HandleEvent($arEvents2, $event);
}
}
CTimeZone::Enable();
$arEvents = array_merge($arEvents, $arEvents2);
$bSocNet = CModule::IncludeModule("socialnetwork");
$result = array();
$settings = CCalendar::GetSettings(array('request' => false));
foreach ($arEvents as $event) {
$userId = isset($event['USER_ID']) ? $event['USER_ID'] : $event['OWNER_ID'];
if ($users !== false && !in_array($userId, $arUsers)) {
continue;
}
if ($bSocNet && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $userId, "calendar")) {
continue;
}
if ((!$event['CAL_TYPE'] != 'user' || $curUserId != $event['OWNER_ID']) && $curUserId != $event['CREATED_BY'] && !isset($arUserMeeting[$event['ID']])) {
$sectId = $event['SECT_ID'];
if (!$event['ACCESSIBILITY']) {
$event['ACCESSIBILITY'] = 'busy';
}
$private = $event['PRIVATE_EVENT'] && $event['CAL_TYPE'] == 'user';
$bManager = false;
if (!$private && CCalendar::IsIntranetEnabled() && CModule::IncludeModule('intranet') && $event['CAL_TYPE'] == 'user' && $settings['dep_manager_sub']) {
$bManager = in_array($curUserId, CCalendar::GetUserManagers($event['OWNER_ID'], true));
}
if ($private || !CCalendarSect::CanDo('calendar_view_full', $sectId) && !$bManager) {
if ($private) {
$event['NAME'] = '[' . GetMessage('EC_ACCESSIBILITY_' . strtoupper($event['ACCESSIBILITY'])) . ']';
} else {
if (!CCalendarSect::CanDo('calendar_view_title', $sectId)) {
$event['NAME'] = '[' . GetMessage('EC_ACCESSIBILITY_' . strtoupper($event['ACCESSIBILITY'])) . ']';
} else {
$event['NAME'] = $event['NAME'] . ' [' . GetMessage('EC_ACCESSIBILITY_' . strtoupper($event['ACCESSIBILITY'])) . ']';
}
}
//.........这里部分代码省略.........
示例12: SetMaxDayTime
public static function SetMaxDayTime($date)
{
return ConvertTimeStamp(MakeTimeStamp(FmtDate($date, 'YYYY-MM-DD') . ' 23:59:59', 'YYYY-MM-DD HH:MI:SS'), 'FULL');
}
示例13: GetList
//.........这里部分代码省略.........
* <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cgroup/getbyid.php">CGroup::GetByID</a> </li> </ul></b<a
* name="examples"></a>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/main/reference/cgroup/getlist.php
* @author Bitrix
*/
public static function GetList(&$by, &$order, $arFilter = array(), $SHOW_USERS_AMOUNT = "N")
{
global $DB;
$err_mess = CGroup::err_mess() . "<br>Function: GetList<br>Line: ";
$arSqlSearch = $arSqlSearch_h = array();
$strSqlSearch_h = "";
if (is_array($arFilter)) {
foreach ($arFilter as $key => $val) {
if (is_array($val)) {
if (count($val) <= 0) {
continue;
}
} else {
if (strlen($val) <= 0 || "{$val}" == "NOT_REF") {
continue;
}
}
$key = strtoupper($key);
$match_value_set = array_key_exists($key . "_EXACT_MATCH", $arFilter);
switch ($key) {
case "ID":
$match = $match_value_set && $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("G.ID", $val, $match);
break;
case "TIMESTAMP_1":
$arSqlSearch[] = "G.TIMESTAMP_X >= FROM_UNIXTIME('" . MkDateTime(FmtDate($val, "D.M.Y"), "d.m.Y") . "')";
break;
case "TIMESTAMP_2":
$arSqlSearch[] = "G.TIMESTAMP_X <= FROM_UNIXTIME('" . MkDateTime(FmtDate($val, "D.M.Y") . " 23:59:59", "d.m.Y") . "')";
break;
case "ACTIVE":
$arSqlSearch[] = $val == "Y" ? "G.ACTIVE='Y'" : "G.ACTIVE='N'";
break;
case "ADMIN":
if (COption::GetOptionString("main", "controller_member", "N") == "Y" && COption::GetOptionString("main", "~controller_limited_admin", "N") == "Y") {
if ($val == "Y") {
$arSqlSearch[] = "G.ID=0";
}
break;
} else {
$arSqlSearch[] = $val == "Y" ? "G.ID=1" : "G.ID>1";
}
break;
case "NAME":
$match = $match_value_set && $arFilter[$key . "_EXACT_MATCH"] == "Y" ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("G.NAME", $val, $match);
break;
case "STRING_ID":
$match = $match_value_set && $arFilter[$key . "_EXACT_MATCH"] == "N" ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("G.STRING_ID", $val, $match);
break;
case "DESCRIPTION":
$match = $match_value_set && $arFilter[$key . "_EXACT_MATCH"] == "Y" ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("G.DESCRIPTION", $val, $match);
break;
case "USERS_1":
$SHOW_USERS_AMOUNT = "Y";
$arSqlSearch_h[] = "USERS>=" . intval($val);
示例14: CAdminSorting
//END BUYERS BASKET
//BUYERS VIEWED PRODUCT
$sTableID_tab5 = "t_stat_list_tab5";
$oSort_tab5 = new CAdminSorting($sTableID_tab5);
$lAdmin_tab5 = new CAdminList($sTableID_tab5, $oSort_tab5);
//FILTER VIEWED
$arFilterFields = array("filter_viewed_date_visit", "filter_date_visit_from", "filter_date_visit_to", "filter_viewed_lid");
$lAdmin_tab5->InitFilter($arFilterFields);
$arFilter = array();
$arFuserItems = CSaleUser::GetList(array("USER_ID" => $ID));
$arFilter["FUSER_ID"] = $arFuserItems["ID"];
if (strlen($filter_viewed_lid) > 0) {
$arFilter["LID"] = trim($filter_viewed_lid);
}
if (strlen(trim($filter_date_visit_from)) > 0) {
$arFilter["DATE_FROM"] = FmtDate($filter_date_visit_from, "D.M.Y");
}
if (strlen(trim($filter_date_visit_to)) > 0) {
if ($arDate = ParseDateTime($filter_date_visit_to, CSite::GetDateFormat("FULL", SITE_ID))) {
if (StrLen($filter_date_visit_to) < 11) {
$arDate["HH"] = 23;
$arDate["MI"] = 59;
$arDate["SS"] = 59;
}
$filter_date_visit_to = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), mktime($arDate["HH"], $arDate["MI"], $arDate["SS"], $arDate["MM"], $arDate["DD"], $arDate["YYYY"]));
$arFilter["DATE_TO"] = $filter_date_visit_to;
} else {
$filter_date_visit_to = "";
}
}
if (strlen(trim($filter_date_visit_from_DAYS_TO_BACK)) > 0) {
示例15: WF_GetHistoryList
function WF_GetHistoryList($ELEMENT_ID, &$by, &$order, $arFilter = array(), &$is_filtered)
{
$err_mess = "FILE: " . __FILE__ . "<br>LINE: ";
global $DB;
$ELEMENT_ID = intval($ELEMENT_ID);
$strSqlSearch = "";
if (is_array($arFilter)) {
foreach ($arFilter as $key => $val) {
if (strlen($val) <= 0 || $val == "NOT_REF") {
continue;
}
$val = $DB->ForSql($val);
$key = strtoupper($key);
switch ($key) {
case "ID":
$arr = explode(",", $val);
if (!empty($arr)) {
$arr = array_map("intval", $arr);
$str = implode(", ", $arr);
$strSqlSearch .= " and E.ID in (" . $str . ")";
}
break;
case "TIMESTAMP_FROM":
$strSqlSearch .= " and E.TIMESTAMP_X>=FROM_UNIXTIME('" . MkDateTime(FmtDate($val, "D.M.Y"), "d.m.Y") . "')";
break;
case "TIMESTAMP_TO":
$strSqlSearch .= " and E.TIMESTAMP_X<=FROM_UNIXTIME('" . MkDateTime(FmtDate($val, "D.M.Y") . " 23:59:59", "d.m.Y H:i:s") . "')";
break;
case "MODIFIED_BY":
case "MODIFIED_USER_ID":
$strSqlSearch .= " and E.MODIFIED_BY='" . intval($val) . "'";
break;
case "IBLOCK_ID":
$strSqlSearch .= " and E.IBLOCK_ID='" . intval($val) . "'";
break;
case "NAME":
if ($val != "%%") {
$strSqlSearch .= " and upper(E.NAME) like upper('" . $DB->ForSQL($val, 255) . "')";
}
break;
case "STATUS":
case "STATUS_ID":
$strSqlSearch .= " and E.WF_STATUS_ID='" . intval($val) . "'";
break;
}
}
}
if ($by == "s_id") {
$strSqlOrder = "ORDER BY E.ID";
} elseif ($by == "s_timestamp") {
$strSqlOrder = "ORDER BY E.TIMESTAMP_X";
} elseif ($by == "s_modified_by") {
$strSqlOrder = "ORDER BY E.MODIFIED_BY";
} elseif ($by == "s_name") {
$strSqlOrder = "ORDER BY E.NAME";
} elseif ($by == "s_status") {
$strSqlOrder = "ORDER BY E.WF_STATUS_ID";
} else {
$by = "s_id";
$strSqlOrder = "ORDER BY E.ID";
}
if ($order != "asc") {
$strSqlOrder .= " desc ";
$order = "desc";
}
$strSql = "\n\t\t\tSELECT\n\t\t\t\tE.*,\n\t\t\t\t" . $DB->DateToCharFunction("E.TIMESTAMP_X") . " TIMESTAMP_X,\n\t\t\t\tconcat('(', U.LOGIN, ') ', ifnull(U.NAME,''), ' ', ifnull(U.LAST_NAME,'')) USER_NAME,\n\t\t\t\tS.TITLE STATUS_TITLE\n\t\t\tFROM\n\t\t\t\tb_iblock_element E\n\t\t\t\tINNER JOIN b_workflow_status S on S.ID = E.WF_STATUS_ID\n\t\t\t\tLEFT JOIN b_user U ON U.ID = E.MODIFIED_BY\n\t\t\tWHERE\n\t\t\t\tE.WF_PARENT_ELEMENT_ID = " . $ELEMENT_ID . "\n\t\t\t\t" . $strSqlSearch . "\n\t\t\t" . $strSqlOrder . "\n\t\t";
$res = $DB->Query($strSql, false, $err_mess . __LINE__);
$is_filtered = strlen($strSqlSearch) > 0;
return $res;
}