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


PHP normalize_day_of_month函数代码示例

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


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

示例1: prepare_list_subselection

 /**
  * Function to prepare the clause from the session filter
  * @public
  */
 function prepare_list_subselection($form_action)
 {
     $processed = $this->getProcessed();
     if ($form_action == "list" && $this->FG_FILTER_SEARCH_FORM) {
         if (isset($processed['cancelsearch']) && $processed['cancelsearch'] == true) {
             $_SESSION[$this->FG_FILTER_SEARCH_SESSION_NAME] = '';
         }
         // RETRIEVE THE CONTENT OF THE SEARCH SESSION AND
         if (strlen($_SESSION[$this->FG_FILTER_SEARCH_SESSION_NAME]) > 5 && $processed['posted_search'] != 1) {
             $element_arr = preg_split("/\\|/", $_SESSION[$this->FG_FILTER_SEARCH_SESSION_NAME]);
             foreach ($element_arr as $val_element_arr) {
                 $pos = strpos($val_element_arr, '=');
                 if ($pos !== false) {
                     $entity_name = substr($val_element_arr, 0, $pos);
                     $entity_value = substr($val_element_arr, $pos + 1);
                     $this->_processed[$entity_name] = $entity_value;
                 }
             }
         }
         if ($processed['posted_search'] != 1 && isset($_SESSION[$this->FG_FILTER_SEARCH_SESSION_NAME]) && strlen($_SESSION[$this->FG_FILTER_SEARCH_SESSION_NAME]) > 10) {
             $arr_session_var = preg_split("/\\|/", $_SESSION[$this->FG_FILTER_SEARCH_SESSION_NAME]);
             foreach ($arr_session_var as $arr_val) {
                 list($namevar, $valuevar) = preg_split("/=/", $arr_val);
                 $this->_processed[$namevar] = $valuevar;
                 $processed[$namevar] = $valuevar;
                 $_POST[$namevar] = $valuevar;
             }
             $processed['posted_search'] = 1;
         }
         // Search Form On
         if ($processed['posted_search'] == 1) {
             $this->_processed[fromstatsday_sday] = normalize_day_of_month($processed[fromstatsday_sday], $processed[fromstatsmonth_sday], 1);
             $this->_processed[tostatsday_sday] = normalize_day_of_month($processed[tostatsday_sday], $processed[tostatsmonth_sday], 1);
             $this->_processed[fromstatsday_sday_bis] = normalize_day_of_month($processed[fromstatsday_sday_bis], $processed[fromstatsmonth_sday_bis], 1);
             $this->_processed[tostatsday_sday_bis] = normalize_day_of_month($processed[tostatsday_sday_bis], $processed[tostatsmonth_sday_bis], 1);
             $SQLcmd = '';
             $search_parameters = "Period={$processed['Period']}|frommonth={$processed['frommonth']}|fromstatsmonth={$processed['fromstatsmonth']}|tomonth={$processed['tomonth']}";
             $search_parameters .= "|tostatsmonth={$processed['tostatsmonth']}|fromday={$processed['fromday']}|fromstatsday_sday={$processed['fromstatsday_sday']}";
             $search_parameters .= "|fromstatsmonth_sday={$processed['fromstatsmonth_sday']}|today={$processed['today']}|tostatsday_sday={$processed['tostatsday_sday']}";
             $search_parameters .= "|tostatsmonth_sday={$processed['tostatsmonth_sday']}";
             $search_parameters .= "|Period_bis={$processed['Period_bis']}|frommonth_bis={$processed['frommonth_bis']}|fromstatsmonth_bis={$processed['fromstatsmonth_bis']}|tomonth_bis={$processed['tomonth_bis']}";
             $search_parameters .= "|tostatsmonth_bis={$processed['tostatsmonth_bis']}|fromday_bis={$processed['fromday_bis']}|fromstatsday_sday_bis={$processed['fromstatsday_sday_bis']}";
             $search_parameters .= "|fromstatsmonth_sday_bis={$processed['fromstatsmonth_sday_bis']}|today_bis={$processed['today_bis']}|tostatsday_sday_bis={$processed['tostatsday_sday_bis']}";
             $search_parameters .= "|tostatsmonth_sday_bis={$processed['tostatsmonth_sday_bis']}";
             foreach ($this->FG_FILTER_SEARCH_FORM_1C as $r) {
                 $search_parameters .= "|{$r['1']}=" . $processed[$r[1]] . "|{$r['2']}=" . $processed[$r[2]];
                 $SQLcmd = $this->do_field($SQLcmd, $r[1], 0, $processed);
             }
             foreach ($this->FG_FILTER_SEARCH_FORM_2C as $r) {
                 $search_parameters .= "|{$r['1']}=" . $processed[$r[1]] . "|{$r['2']}=" . $processed[$r[2]];
                 $search_parameters .= "|{$r['3']}=" . $processed[$r[3]] . "|{$r['4']}=" . $processed[$r[4]];
                 $SQLcmd = $this->do_field_duration($SQLcmd, $r[1], $r[5]);
                 $SQLcmd = $this->do_field_duration($SQLcmd, $r[3], $r[5]);
             }
             foreach ($this->FG_FILTER_SEARCH_FORM_SELECT as $r) {
                 $search_parameters .= "|{$r['2']}=" . $processed[$r[2]];
                 $SQLcmd = $this->do_field($SQLcmd, $r[2], 1, null, $r[4]);
             }
             $_SESSION[$this->FG_FILTER_SEARCH_SESSION_NAME] = $search_parameters;
             $date_clause = '';
             if ($processed[fromday] && isset($processed[fromstatsday_sday]) && isset($processed[fromstatsmonth_sday])) {
                 $date_clause .= " AND " . $this->FG_FILTER_SEARCH_1_TIME_FIELD . " >= TIMESTAMP('{$processed['fromstatsmonth_sday']}-{$processed['fromstatsday_sday']}')";
             }
             if ($processed[today] && isset($processed[tostatsday_sday]) && isset($processed[tostatsmonth_sday])) {
                 $date_clause .= " AND " . $this->FG_FILTER_SEARCH_1_TIME_FIELD . " <= TIMESTAMP('{$processed['tostatsmonth_sday']}-" . sprintf("%02d", intval($processed[tostatsday_sday])) . " 23:59:59')";
             }
             if ($processed[Period] == "month_older_rad") {
                 $from_month = $processed[month_earlier];
                 $date_clause .= " AND DATE_SUB(NOW(),INTERVAL {$from_month} MONTH) > " . $this->FG_FILTER_SEARCH_3_TIME_FIELD . "";
             }
             //BIS FIELD
             if ($processed[fromday_bis] && isset($processed[fromstatsday_sday_bis]) && isset($processed[fromstatsmonth_sday_bis])) {
                 $date_clause .= " AND " . $this->FG_FILTER_SEARCH_1_TIME_FIELD_BIS . " >= TIMESTAMP('{$processed['fromstatsmonth_sday_bis']}-{$processed['fromstatsday_sday_bis']}')";
             }
             if ($processed[today_bis] && isset($processed[tostatsday_sday_bis]) && isset($processed[tostatsmonth_sday_bis])) {
                 $date_clause .= " AND " . $this->FG_FILTER_SEARCH_1_TIME_FIELD_BIS . " <= TIMESTAMP('{$processed['tostatsmonth_sday_bis']}-" . sprintf("%02d", intval($processed[tostatsday_sday_bis])) . " 23:59:59')";
             }
             if ($processed[Period_bis] == "month_older_rad") {
                 $from_month = $processed[month_earlier_bis];
                 $date_clause .= " AND DATE_SUB(NOW(),INTERVAL {$from_month} MONTH) > " . $this->FG_FILTER_SEARCH_3_TIME_FIELD_BIS . "";
             }
             if (strpos($SQLcmd, 'WHERE') > 0) {
                 if (strlen($this->FG_TABLE_CLAUSE) > 0) {
                     $this->FG_TABLE_CLAUSE .= " AND ";
                 }
                 $this->FG_TABLE_CLAUSE .= substr($SQLcmd, 6) . $date_clause;
             } elseif (strpos($date_clause, 'AND') > 0) {
                 if (strlen($this->FG_TABLE_CLAUSE) > 0) {
                     $this->FG_TABLE_CLAUSE .= " AND ";
                 }
                 $this->FG_TABLE_CLAUSE .= substr($date_clause, 5);
             }
         }
     }
 }
开发者ID:hellbound,项目名称:a2billing-mod,代码行数:99,代码来源:Class.FormHandler.inc.php

示例2: normalize_day_of_month

	'lst_time',
	'group_id',
	'report_type'
));

//     Initialization of variables	///////////////////////////////

$condition = "";
$QUERY = '';
$from_to = '';
$bool = false;

//     Generating WHERE CLAUSE		///////////////////////////////

normalize_day_of_month($fromstatsday_sday, $fromstatsmonth_sday, 1);
normalize_day_of_month($tostatsday_sday, $tostatsmonth_sday, 1);
if ($Period == "Time" && $lst_time != "") {
	if (strlen($condition) > 0)
		$condition .= " AND ";
	if (DB_TYPE == "postgres") {
		switch ($lst_time) {
			case 1 :
				$condition .= "CURRENT_TIMESTAMP - interval '1 hour' <= cdr.starttime";
				break;
			case 2 :
				$condition .= "CURRENT_TIMESTAMP - interval '6 hours' <= cdr.starttime";
				break;
			case 3 :
				$condition .= "CURRENT_TIMESTAMP - interval '1 day' <= cdr.starttime";
				break;
			case 4 :
开发者ID:nixonch,项目名称:a2billing,代码行数:31,代码来源:call-pnl-report.php


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