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


PHP FormatDate函数代码示例

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


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

示例1: dateActiveFrom

function dateActiveFrom($date)
{
    $arDateStart = explode(' ', $date);
    $arDateStart = explode('.', $arDateStart[0]);
    //[0]-d [1]-m [2]-Y
    $result = $arDateStart[0] . ' ' . FormatDate("F", MakeTimeStamp($date)) . ' ' . $arDateStart[2];
    return $result;
}
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:8,代码来源:function.php

示例2: formattedTime

 /**
  * Convert time in the nice view
  *
  * @param string $time Timestamp
  * @return string
  */
 public static function formattedTime($time)
 {
     $dateDiff = date_diff(date_create('now'), date_create(FormatDate('Y-m-d', $time)));
     if ($dateDiff->days === 0) {
         $formattedTime = Loc::getMessage('ELEMENTARY_TODAY') . ', ' . date('H:i:s', $time);
     } elseif ($dateDiff->days === 1) {
         $formattedTime = Loc::getMessage('ELEMENTARY_YESTERDAY') . ', ' . date('H:i:s', $time);
     } else {
         $formattedTime = FormatDate('FULL', $time);
     }
     return $formattedTime;
 }
开发者ID:ASDAFF,项目名称:nik.elementary,代码行数:18,代码来源:helpers.php

示例3: foreach

    foreach ($arResult['ENTRIES'] as $arEntry) {
        $ts_start = MakeTimeStamp($arEntry['DATE_ACTIVE_FROM']);
        $ts_finish = MakeTimeStamp($arEntry['DATE_ACTIVE_TO']);
        $ts_now = time();
        $bNow = $ts_now >= $ts_start && $ts_now <= $ts_finish;
        ?>
	<div class="bx-user-absence-entry<?php 
        echo $bNow ? ' bx-user-absence-now' : '';
        ?>
">
		<span class="bx-user-absence-entry-title"><?php 
        echo htmlspecialcharsbx($arEntry['TITLE']);
        ?>
</span>
		<span class="bx-user-absence-entry-date"><?php 
        echo GetMessage('INTR_IAU_TPL' . ($bNow ? '_TO' : '_FROM'));
        ?>
 <?php 
        echo FormatDate($DB->DateFormatToPHP(FORMAT_DATETIME), MakeTimeStamp($arEntry['DATE_ACTIVE' . ($bNow ? '_TO' : '_FROM')]));
        ?>
</span>
	</div>
<?php 
    }
    ?>
</div>
		</td>
	</tr>
</table>
<?php 
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:template.php

示例4: array

         if ($arItem["IBLOCK_ID"] == $this->SKU_IBLOCK_ID) {
             if (!isset(${$FILTER_NAME}["OFFERS"])) {
                 ${$FILTER_NAME}["OFFERS"] = array();
             }
             ${$FILTER_NAME}["OFFERS"][$filterKey] = $filterValue;
         } else {
             ${$FILTER_NAME}[$filterKey] = $filterValue;
         }
     }
 } elseif ($arItem["USER_TYPE"] == "DateTime") {
     $datetimeFilters = array();
     foreach ($arItem["VALUES"] as $key => $ar) {
         if ($ar["CHECKED"]) {
             $filterKey = "><PROPERTY_" . $PID;
             $timestamp = MakeTimeStamp($ar["VALUE"], FORMAT_DATE);
             $filterValue = array(FormatDate("Y-m-d H:i:s", $timestamp), FormatDate("Y-m-d H:i:s", $timestamp + 23 * 3600 + 59 * 60 + 59));
             $datetimeFilters[] = array($filterKey => $filterValue);
         }
     }
     if ($datetimeFilters) {
         $datetimeFilters["LOGIC"] = "OR";
         if ($arItem["IBLOCK_ID"] == $this->SKU_IBLOCK_ID) {
             if (!isset(${$FILTER_NAME}["OFFERS"])) {
                 ${$FILTER_NAME}["OFFERS"] = array();
             }
             ${$FILTER_NAME}["OFFERS"][] = $datetimeFilters;
         } else {
             ${$FILTER_NAME}[] = $datetimeFilters;
         }
     }
 } else {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例5: __SLEGetLogCommentRecord

 function __SLEGetLogCommentRecord($arComments, $arParams, &$arAssets)
 {
     // for the same post log_update - time only, if not - date and time
     $timestamp = MakeTimeStamp(array_key_exists("LOG_DATE_FORMAT", $arComments) ? $arComments["LOG_DATE_FORMAT"] : $arComments["LOG_DATE"]);
     $timeFormated = FormatDateFromDB($arComments["LOG_DATE"], stripos($arParams["DATE_TIME_FORMAT"], 'a') || ($arParams["DATE_TIME_FORMAT"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'HH:MI');
     $dateTimeFormated = FormatDate(!empty($arParams['DATE_TIME_FORMAT']) ? $arParams['DATE_TIME_FORMAT'] == 'FULL' ? $GLOBALS['DB']->DateFormatToPHP(str_replace(':SS', '', FORMAT_DATETIME)) : $arParams['DATE_TIME_FORMAT'] : $GLOBALS['DB']->DateFormatToPHP(FORMAT_DATETIME), $timestamp);
     if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
         $dateTimeFormated = ToLower($dateTimeFormated);
     }
     // strip current year
     if (!empty($arParams['DATE_TIME_FORMAT']) && ($arParams['DATE_TIME_FORMAT'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT'] == 'j F Y g:i a')) {
         $dateTimeFormated = ltrim($dateTimeFormated, '0');
         $curYear = date('Y');
         $dateTimeFormated = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $dateTimeFormated);
     }
     $path2Entity = $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arComments["ENTITY_ID"])) : CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["ENTITY_ID"]));
     if (intval($arComments["USER_ID"]) > 0) {
         $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arComments["USER_ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
         $arTmpUser = array("NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"]);
         $bUseLogin = $arParams["SHOW_LOGIN"] != "N" ? true : false;
         $arCreatedBy = array("FORMATTED" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $bUseLogin) . $suffix, "URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["USER_ID"], "id" => $arComments["USER_ID"])));
         $arCreatedBy["TOOLTIP_FIELDS"] = array("ID" => $arComments["USER_ID"], "NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"], "USE_THUMBNAIL_LIST" => "N", "PATH_TO_SONET_MESSAGES_CHAT" => $arParams["PATH_TO_MESSAGES_CHAT"], "PATH_TO_SONET_USER_PROFILE" => $arParams["PATH_TO_USER"], "PATH_TO_VIDEO_CALL" => $arParams["PATH_TO_VIDEO_CALL"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "SHOW_YEAR" => $arParams["SHOW_YEAR"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"] . $suffix, "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"], "INLINE" => "Y");
     } else {
         $arCreatedBy = array("FORMATTED" => GetMessage("SONET_C73_CREATED_BY_ANONYMOUS"));
     }
     $arTmpUser = array("NAME" => $arComments["~USER_NAME"], "LAST_NAME" => $arComments["~USER_LAST_NAME"], "SECOND_NAME" => $arComments["~USER_SECOND_NAME"], "LOGIN" => $arComments["~USER_LOGIN"]);
     $arParamsTmp = $arParams;
     $arParamsTmp["AVATAR_SIZE"] = isset($arParams["AVATAR_SIZE_COMMON"]) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"];
     $arTmpCommentEvent = array("EVENT" => $arComments, "LOG_DATE" => $arComments["LOG_DATE"], "LOG_DATE_TS" => MakeTimeStamp($arComments["LOG_DATE"]), "LOG_DATE_DAY" => ConvertTimeStamp(MakeTimeStamp($arComments["LOG_DATE"]), "SHORT"), "LOG_TIME_FORMAT" => $timeFormated, "LOG_DATETIME_FORMAT" => $dateTimeFormated, "TITLE_TEMPLATE" => "", "TITLE" => "", "TITLE_FORMAT" => "", "ENTITY_NAME" => $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? $arComments["GROUP_NAME"] : CUser::FormatName($arParams['NAME_TEMPLATE'], $arTmpUser, $bUseLogin), "ENTITY_PATH" => $path2Entity, "CREATED_BY" => $arCreatedBy, "AVATAR_SRC" => CSocNetLogTools::FormatEvent_CreateAvatar($arComments, $arParamsTmp));
     $arEvent = CSocNetLogTools::FindLogCommentEventByID($arComments["EVENT_ID"]);
     if ($arEvent && array_key_exists("CLASS_FORMAT", $arEvent) && array_key_exists("METHOD_FORMAT", $arEvent)) {
         $arLog = $arParams["USER_COMMENTS"] == "Y" ? array() : array("TITLE" => $arComments["~LOG_TITLE"], "URL" => $arComments["~LOG_URL"], "PARAMS" => $arComments["~LOG_PARAMS"]);
         $arFIELDS_FORMATTED = call_user_func(array($arEvent["CLASS_FORMAT"], $arEvent["METHOD_FORMAT"]), $arComments, $arParams, false, $arLog);
         if ($arParams["USE_COMMENTS"] != "Y") {
             if (array_key_exists("CREATED_BY", $arFIELDS_FORMATTED) && isset($arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"])) {
                 $arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] = $arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"];
             }
         }
     }
     $message = $arFIELDS_FORMATTED && array_key_exists("EVENT_FORMATTED", $arFIELDS_FORMATTED) && array_key_exists("MESSAGE", $arFIELDS_FORMATTED["EVENT_FORMATTED"]) ? $arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"] : $arTmpCommentEvent["EVENT"]["MESSAGE"];
     if (strlen($message) > 0) {
         $arFIELDS_FORMATTED["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] = CSocNetTextParser::closetags(htmlspecialcharsback($message));
     }
     if (is_array($arTmpCommentEvent)) {
         $arFIELDS_FORMATTED["EVENT_FORMATTED"]["DATETIME"] = $arTmpCommentEvent["LOG_DATE_DAY"] == ConvertTimeStamp() ? $timeFormated : $dateTimeFormated;
         $arTmpCommentEvent["EVENT_FORMATTED"] = $arFIELDS_FORMATTED["EVENT_FORMATTED"];
         if (isset($arComments["UF"]["UF_SONET_COM_URL_PRV"]) && !empty($arComments["UF"]["UF_SONET_COM_URL_PRV"]["VALUE"])) {
             $arCss = $GLOBALS["APPLICATION"]->sPath2css;
             $arJs = $GLOBALS["APPLICATION"]->arHeadScripts;
             ob_start();
             $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:system.field.view", $arComments["UF"]["UF_SONET_COM_URL_PRV"]["USER_TYPE_ID"], array("arUserField" => $arComments["UF"]["UF_SONET_COM_URL_PRV"], "arAddField" => array("NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "PATH_TO_USER" => $arParams["~PATH_TO_USER"])), null, array("HIDE_ICONS" => "Y"));
             $urlPreviewText = ob_get_clean();
             $arTmpCommentEvent["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] .= $urlPreviewText;
             $arAssets["CSS"] = array_merge($arAssets["CSS"], array_diff($GLOBALS["APPLICATION"]->sPath2css, $arCss));
             $arAssets["JS"] = array_merge($arAssets["JS"], array_diff($GLOBALS["APPLICATION"]->arHeadScripts, $arJs));
             unset($arComments["UF"]["UF_SONET_COM_URL_PRV"]);
         }
         $arTmpCommentEvent["UF"] = $arComments["UF"];
         if (isset($arTmpCommentEvent["EVENT_FORMATTED"]) && is_array($arTmpCommentEvent["EVENT_FORMATTED"])) {
             $arFields2Cache = array("DATETIME", "MESSAGE", "FULL_MESSAGE_CUT", "ERROR_MSG");
             foreach ($arTmpCommentEvent["EVENT_FORMATTED"] as $field => $value) {
                 if (!in_array($field, $arFields2Cache)) {
                     unset($arTmpCommentEvent["EVENT_FORMATTED"][$field]);
                 }
             }
         }
         if (isset($arTmpCommentEvent["EVENT"]) && is_array($arTmpCommentEvent["EVENT"])) {
             if (!empty($arTmpCommentEvent["EVENT"]["URL"])) {
                 $arTmpCommentEvent["EVENT"]["URL"] = str_replace("#GROUPS_PATH#", COption::GetOptionString("socialnetwork", "workgroups_page", "/workgroups/", SITE_ID), $arTmpCommentEvent["EVENT"]["URL"]);
             }
             $arFields2Cache = array("ID", "SOURCE_ID", "EVENT_ID", "USER_ID", "LOG_DATE", "RATING_TYPE_ID", "RATING_ENTITY_ID", "URL");
             foreach ($arTmpCommentEvent["EVENT"] as $field => $value) {
                 if (!in_array($field, $arFields2Cache)) {
                     unset($arTmpCommentEvent["EVENT"][$field]);
                 }
             }
         }
         if (isset($arTmpCommentEvent["CREATED_BY"]) && is_array($arTmpCommentEvent["CREATED_BY"])) {
             $arFields2Cache = array("TOOLTIP_FIELDS", "FORMATTED", "URL");
             foreach ($arTmpCommentEvent["CREATED_BY"] as $field => $value) {
                 if (!in_array($field, $arFields2Cache)) {
                     unset($arTmpCommentEvent["CREATED_BY"][$field]);
                 }
             }
             if (isset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"]) && is_array($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"])) {
                 $arFields2Cache = array("ID", "PATH_TO_SONET_USER_PROFILE", "NAME", "LAST_NAME", "SECOND_NAME", "LOGIN", "EMAIL");
                 foreach ($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] as $field => $value) {
                     if (!in_array($field, $arFields2Cache)) {
                         unset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"][$field]);
                     }
                 }
             }
         }
     }
     foreach ($arTmpCommentEvent["EVENT"] as $key => $value) {
         if (strpos($key, "~") === 0) {
             unset($arTmpCommentEvent["EVENT"][$key]);
         }
     }
     return $arTmpCommentEvent;
//.........这里部分代码省略.........
开发者ID:webgksupport,项目名称:alpina,代码行数:101,代码来源:include.php

示例6: array

                 $template->assign_block_vars('gallery', array('K' => $k, 'IMAGE' => $uploaded_path . session_id() . '/' . $v));
             }
         }
         $iquantity = $atype == 2 || $buy_now_only == 'y' ? $iquantity : 1;
         if (!(strpos($a_starts, '-') === false)) {
             $a_starts = _mktime(substr($a_starts, 11, 2), substr($a_starts, 14, 2), substr($a_starts, 17, 2), substr($a_starts, 0, 2), substr($a_starts, 3, 2), substr($a_starts, 6, 4), 0);
         }
         $shippingtext = '';
         if ($shipping == 1) {
             $shippingtext = $MSG['033'];
         } elseif ($shipping == 2) {
             $shippingtext = $MSG['032'];
         } elseif ($shipping == 3) {
             $shippingtext = $MSG['867'];
         }
         $template->assign_vars(array('TITLE' => $title, 'SUBTITLE' => $subtitle, 'ERROR' => $ERR == 'ERR_' ? '' : ${$ERR}, 'PAGE' => 2, 'MINTEXT' => $atype == 2 ? $MSG['038'] : $MSG['020'], 'AUC_DESCRIPTION' => stripslashes($sdescription), 'PIC_URL' => empty($pict_url) ? $MSG['114'] : '<img src="' . $uploaded_path . session_id() . '/' . $pict_url . '" style="max-width:100%; max-height:100%;">', 'MIN_BID' => $system->print_money($minimum_bid, false), 'RESERVE' => $system->print_money($reserve_price, false), 'BN_PRICE' => $system->print_money($buy_now_price, false), 'SHIPPING_COST' => $system->print_money($shipping_cost, false), 'ADDITIONAL_SHIPPING_COST' => $system->print_money($additional_shipping_cost, false), 'STARTDATE' => empty($start_now) ? FormatDate($a_starts) : FormatDate($system->ctime), 'DURATION' => $duration_desc, 'INCREMENTS' => $increments == 1 ? $MSG['614'] : $system->print_money($customincrement, false), 'ATYPE' => $system->SETTINGS['auction_types'][$atype], 'ATYPE_PLAIN' => $atype, 'SHIPPING' => $shippingtext, 'INTERNATIONAL' => $international ? $MSG['033'] : $MSG['043'], 'SHIPPING_TERMS' => nl2br(stripslashes($shipping_terms)), 'PAYMENTS_METHODS' => $payment_methods, 'CAT_LIST1' => $category_string1, 'CAT_LIST2' => $category_string2, 'FEE' => number_format(get_fee($minimum_bid), $system->SETTINGS['moneydecimals']), 'B_USERAUTH' => $system->SETTINGS['usersauth'] == 'y', 'B_BN_ONLY' => !($system->SETTINGS['buy_now'] == 2 && $buy_now_only == 'y'), 'B_BN' => $system->SETTINGS['buy_now'] == 2, 'B_GALLERY' => $system->SETTINGS['picturesgallery'] == 1 && isset($_SESSION['UPLOADED_PICTURES']) && count($_SESSION['UPLOADED_PICTURES']) > 0, 'B_CUSINC' => $system->SETTINGS['cust_increment'] == 1, 'B_FEES' => $system->SETTINGS['fees'] == 'y', 'B_SHIPPING' => $system->SETTINGS['shipping'] == 1, 'B_SUBTITLE' => $system->SETTINGS['subtitle'] == 'y'));
         break;
     }
 case 1:
     // enter auction details
     // check time format is timestamp. If not change to timestamp
     if (!(strpos($a_starts, '-') === false)) {
         $a_starts = _mktime(substr($a_starts, 11, 2), substr($a_starts, 14, 2), substr($a_starts, 17, 2), substr($a_starts, 0, 2), substr($a_starts, 3, 2), substr($a_starts, 6, 4), 0);
     }
     $category_string1 = get_category_string($sellcat1);
     $category_string2 = get_category_string($sellcat2);
     // auction types
     $TPL_auction_type = '<select name="atype" id="atype">' . "\n";
     foreach ($system->SETTINGS['auction_types'] as $key => $val) {
         $TPL_auction_type .= "\t" . '<option value="' . $key . '" ' . ($key == $atype ? 'selected="true"' : '') . '>' . $val . '</option>' . "\n";
     }
开发者ID:laughingpain,项目名称:WeBid,代码行数:31,代码来源:sell.php

示例7: mysql_query

$high_bids = $j > 0 ? true : false;
// Build list of help topics
$query = "SELECT id, category FROM " . $DBPrefix . "faqscat_translated WHERE lang = '" . $language . "' ORDER BY category ASC";
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
$i = 0;
while ($faqscat = mysql_fetch_array($res)) {
    $template->assign_block_vars('helpbox', array('ID' => $faqscat['id'], 'TITLE' => $faqscat['category']));
    $i++;
}
$helpbox = $i > 0 ? true : false;
// -- Build news list
if ($system->SETTINGS['newsbox'] == 1) {
    $query = "SELECT n.title As t, n.new_date, t.* FROM " . $DBPrefix . "news n\r\n\t\t\tLEFT JOIN " . $DBPrefix . "news_translated t ON (t.id = n.id)\r\n\t\t\tWHERE t.lang = '" . $language . "' AND n.suspended = 0\r\n\t\t\tORDER BY new_date DESC, id DESC LIMIT " . $system->SETTINGS['newstoshow'];
    $res = mysql_query($query);
    $system->check_mysql($res, $query, __LINE__, __FILE__);
    while ($new = mysql_fetch_array($res)) {
        if (!empty($new['title'])) {
            $title = stripslashes($new['title']);
        } else {
            $title = stripslashes($new['t']);
        }
        $template->assign_block_vars('newsbox', array('ID' => $new['id'], 'DATE' => FormatDate($new['new_date']), 'TITLE' => $title));
    }
}
$template->assign_vars(array('FLAGS' => ShowFlags(), 'LOGIN_ERROR' => isset($_SESSION['loginerror']) ? $_SESSION['loginerror'] : '', 'B_AUC_LAST' => $auc_last, 'B_HIGH_BIDS' => $high_bids, 'B_AUC_ENDSOON' => $end_soon, 'B_HELPBOX' => $helpbox, 'B_MULT_LANGS' => count($LANGUAGES) > 1, 'B_LOGIN_BOX' => $system->SETTINGS['loginbox'] == 1, 'B_LOGIN_ERROR' => isset($_SESSION['loginerror']), 'B_NEWS_BOX' => $system->SETTINGS['newsbox'] == 1));
require 'header.php';
$template->set_filenames(array('body' => 'home.html'));
$template->display('body');
require 'footer.php';
unset($_SESSION['loginerror']);
开发者ID:lavsurgut,项目名称:autoauc2,代码行数:31,代码来源:index.php

示例8: header

if (!$user->logged_in) {
    $_SESSION['REDIRECT_AFTER_LOGIN'] = 'buying.php';
    header('location: user_login.php');
    exit;
}
// the user has received the item
if (isset($_GET['shipped'])) {
    $query = "UPDATE " . $DBPrefix . "winners SET shipped = 2 WHERE id = :get_shipped AND winner = :user_id";
    $params[] = array(':get_shipped', $_GET['shipped'], 'int');
    $params[] = array(':user_id', $user->user_data['id'], 'int');
    $db->query($query, $params);
}
// Get closed auctions with winners
$query = "SELECT DISTINCT a.id, a.qty, a.seller, a.paid, a.feedback_win, a.bid, a.auction, a.shipped, b.title, b.ends, b.shipping_cost, b.shipping, u.nick, u.email\n\t\tFROM " . $DBPrefix . "winners a\n\t\tLEFT JOIN " . $DBPrefix . "auctions b ON (a.auction = b.id)\n\t\tLEFT JOIN " . $DBPrefix . "users u ON (u.id = a.seller)\n\t\tWHERE (b.closed = 1 OR b.bn_only = 'y') AND b.suspended = 0\n\t\tAND a.winner = :user_id ORDER BY a.closingdate DESC";
$params = array();
$params[] = array(':user_id', $user->user_data['id'], 'int');
$db->query($query, $params);
$sslurl = $system->SETTINGS['usersauth'] == 'y' && $system->SETTINGS['https'] == 'y' ? str_replace('http://', 'https://', $system->SETTINGS['siteurl']) : $system->SETTINGS['siteurl'];
$sslurl = $system->SETTINGS['usersauth'] == 'y' && !empty($system->SETTINGS['https_url']) ? $system->SETTINGS['https_url'] : $sslurl;
while ($row = $db->fetch()) {
    $totalcost = $row['qty'] > 1 ? $row['bid'] * $row['qty'] : $row['bid'];
    $additional_shipping = $data['additional_shipping_cost'] * ($data['qty'] - 1);
    $totalcost = $row['shipping'] == 2 ? $totalcost : $totalcost + $row['shipping_cost'] + $additional_shipping;
    $template->assign_block_vars('items', array('AUC_ID' => $row['auction'], 'TITLE' => $system->uncleanvars($row['title']), 'ID' => $row['id'], 'ENDS' => FormatDate($row['ends']), 'BID' => $row['bid'], 'FBID' => $system->print_money($row['bid']), 'QTY' => $row['qty'] > 0 ? $row['qty'] : 1, 'TOTAL' => $system->print_money($totalcost), 'B_PAID' => $row['paid'] == 1, 'SHIPPED' => $row['shipped'], 'SELLNICK' => $row['nick'], 'SELLEMAIL' => $row['email'], 'FB_LINK' => $row['feedback_win'] == 0 ? '<a href="' . $sslurl . 'feedback.php?auction_id=' . $row['auction'] . '&wid=' . $user->user_data['id'] . '&sid=' . $row['seller'] . '&ws=w">' . $MSG['207'] . '</a>' : ''));
}
include 'header.php';
$TMP_usmenutitle = $MSG['454'];
include $include_path . 'user_cp.php';
$template->set_filenames(array('body' => 'buying.tpl'));
$template->display('body');
include 'footer.php';
开发者ID:janukasama,项目名称:ADCAU_SPORTE,代码行数:31,代码来源:buying.php

示例9: foreach

if (isset($arResult['USER_GROUPS'])) {
    foreach ($arResult['USER_GROUPS'] as $groupID => $arGroup) {
        if (intval($arGroup['SECTION_ID']) > 0) {
            $typeItems .= str_replace(array("#GROUP_ID#", "#GROUP_NAME#", "#LINK#", "#SECTION_ID#"), array(intval($groupID), CUtil::JSEscape($arGroup['GROUP_NAME']), CUtil::JSEscape($arGroup['PATH_FILES']), intval($arGroup['SECTION_ID'])), "'SG#GROUP_ID#' : {'id' : 'SG#GROUP_ID#', 'name' : '#GROUP_NAME#', 'type' : 'socnet', 'link' : '#LINK#', 'section_id': '#SECTION_ID#'},\n");
        }
    }
}
$typeItems .= "}";
$disabledItems = array();
$items = "{\n";
foreach ($arResult["GRID_DATA"] as $row) {
    if (!isset($row['data']['NAME'])) {
        continue;
    }
    $timeStampXUnix = $row['data']['TIMESTAMP_X_UNIX'];
    $timeStampXUnixD = FormatDate('X', $timeStampXUnix);
    if ($timeStampXUnix == null) {
        $timeStampXUnix = MakeTimeStamp($row['data']['TIMESTAMP_X']);
        $timeStampXUnixD = GetTime($timeStampXUnix, "SHORT");
    }
    //element if WF_NEW = 'Y' and WF_STATUS_ID = 2 - not public
    if ($row['data']['TYPE'] === "E" && $row['data']['WF_STATUS_ID'] != 1) {
        $disabledItems[$row['id']] = array('hint' => GetMessageJS('WD_DESCR_DISABLE_ATTACH_NON_PUBLIC_FILE'));
    }
    $data = array("#ID#" => $row['id'], "#TYPE#" => $row['data']['FTYPE'], "#NAME#" => CUtil::JSEscape($row['data']['NAME']), "#PATH#" => CUtil::JSEscape($row['data']['PATH']), "#LINK#" => CUtil::JSEscape($row['data']['TYPE'] === "S" ? $row['data']['URL']['THIS'] : $row['data']['URL']['EDIT']), "#SIZE_FORMATTED#" => isset($row['data']['FILE_SIZE']) ? $row['data']['FILE_SIZE'] : '', "#SIZE#" => isset($row['data']['FILE']['FILE_SIZE']) ? intval($row['data']['FILE']['FILE_SIZE']) : 0, "#MODIFIED_BY#" => CUtil::JSEscape($row['data']['MODIFIED_BY']['FULL_NAME']), "#MODIFIED_DATE_FORMATTED#" => $timeStampXUnixD, "#MODIFIED_DATE#" => $timeStampXUnix);
    $items .= str_replace(array_keys($data), array_values($data), "'#ID#' : {'id' : '#ID#', 'type': '#TYPE#', 'link': '#LINK#', 'name': '#NAME#', 'path': '#PATH#', 'size': '#SIZE_FORMATTED#', 'sizeInt': '#SIZE#', 'modifyBy': '#MODIFIED_BY#', 'modifyDate': '#MODIFIED_DATE_FORMATTED#', 'modifyDateInt': '#MODIFIED_DATE#'},\n");
}
$items .= "}";
if (isset($_REQUEST['WD_LOAD_ITEMS'])) {
    ?>
	{
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:template.php

示例10: array

        $base = CCurrency::GetBaseCurrency();
        $r = CSaleOrder::GetList(array(), array(">=DATE_INSERT" => ConvertTimeStamp(time() - $monitoring->getInterval() * 24 * 3400, "SHORT")), array("LID", "CURRENCY", "SUM" => "PRICE"));
        while ($a = $r->fetch()) {
            $sum += CCurrencyRates::ConvertCurrency($a["PRICE"], $a["CURRENCY"], $base);
        }
        $sum *= 1 - $uptimeRate;
        if ($sum <= 0.0) {
            $sumHtml = number_format((1 - $uptimeRate) * 100, 2, '.', ' ') . "%";
            $alertIntervalText = $intervalLang["uptime"][$monitoring->getInterval()];
        } else {
            $sumHtml = CurrencyFormat($sum, $base);
            $alertIntervalText = $intervalLang["sale"][$monitoring->getInterval()];
        }
    } elseif ($testCount === 1 && HasMessage("GD_BITRIXCLOUD_MONITOR_" . strtoupper($testAlert->getName()))) {
        $uptimeRate = 1;
        $resultText = FormatDate("ddiff", time(), $testAlert->getResult());
        $sumHtml = GetMessage("GD_BITRIXCLOUD_MONITOR_" . strtoupper($testAlert->getName()), array("#DOMAIN#" => $converter->Decode($testDomain), "#DAYS#" => $resultText));
    } elseif ($uptimeRate < 1) {
        $sumHtml = number_format((1 - $uptimeRate) * 100, 2, '.', ' ') . "%";
        $alertIntervalText = $intervalLang["uptime"][$monitoring->getInterval()];
    } else {
        $sumHtml = GetMessage("GD_BITRIXCLOUD_MONITOR_PROBLEMS", array("#COUNT#" => $testCount));
    }
}
?>
<div class="bx-gadgets-content-layout-inspector">
	<div class="bx-gadgets-title"><?php 
echo GetMessage("GD_BITRIXCLOUD_MONITOR");
?>
</div>
	<div class="bx-gadget-bottom-cont bx-gadget-bottom-button-cont bx-gadget-mark-cont">
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:index.php

示例11: FormatDate

         break;
     case 'WORK_LOGO':
         if (IntVal($val) > 0) {
             $iSize = 150;
             $arImage = CSocNetTools::InitImage($val, $iSize, "/bitrix/images/1.gif", 1, "", false);
             $val = $arImage["IMG"];
         }
         break;
     case 'TIME_ZONE':
         if ($arResult["User"]["AUTO_TIME_ZONE"] != "N") {
             continue 2;
         }
         break;
     case 'LAST_LOGIN':
         if (StrLen($val) > 0) {
             $val = FormatDate($DB->DateFormatToPHP(FORMAT_DATETIME), MakeTimeStamp($val, FORMAT_DATETIME));
         }
         break;
     default:
         if (in_array($userFieldName, $arParams["SONET_USER_FIELDS_SEARCHABLE"])) {
             $strSearch = $arParams["PATH_TO_SEARCH_INNER"] . (StrPos($arParams["PATH_TO_SEARCH_INNER"], "?") !== false ? "&" : "?") . "flt_" . StrToLower($userFieldName) . "=" . UrlEncode($val);
         }
         break;
 }
 if (in_array($userFieldName, $arParams["USER_FIELDS_MAIN"])) {
     $arResult["UserFieldsMain"]["DATA"][$userFieldName] = array("NAME" => GetMessage("SONET_UP1_" . $userFieldName), "VALUE" => $val, "SEARCH" => $strSearch);
 }
 if (in_array($userFieldName, $arParams["USER_FIELDS_CONTACT"])) {
     $arResult["UserFieldsContact"]["DATA"][$userFieldName] = array("NAME" => GetMessage("SONET_UP1_" . $userFieldName), "VALUE" => $val, "SEARCH" => $strSearch);
 }
 if (in_array($userFieldName, $arParams["USER_FIELDS_PERSONAL"])) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例12: FormatBirthDate

function FormatBirthDate($per_BirthYear, $per_BirthMonth, $per_BirthDay, $sSeparator = "-", $bFlags)
{
    if ($bFlags == 1 || $per_BirthYear == "") {
        $birthYear = "1000";
    } else {
        $birthYear = $per_BirthYear;
    }
    if ($per_BirthMonth > 0 && $per_BirthDay > 0) {
        if ($per_BirthMonth < 10) {
            $dBirthMonth = "0" . $per_BirthMonth;
        } else {
            $dBirthMonth = $per_BirthMonth;
        }
        if ($per_BirthDay < 10) {
            $dBirthDay = "0" . $per_BirthDay;
        } else {
            $dBirthDay = $per_BirthDay;
        }
        $dBirthDate = $dBirthMonth . $sSeparator . $dBirthDay;
        if (is_numeric($birthYear)) {
            $dBirthDate = $birthYear . $sSeparator . $dBirthDate;
            if (checkdate($dBirthMonth, $dBirthDay, $birthYear)) {
                $dBirthDate = FormatDate($dBirthDate);
                if (substr($dBirthDate, -6, 6) == ", 1000") {
                    $dBirthDate = str_replace(", 1000", "", $dBirthDate);
                }
            }
        }
    } elseif (is_numeric($birthYear) && $birthYear != 1000) {
        $dBirthDate = $birthYear;
    } else {
        $dBirthDate = "";
    }
    return $dBirthDate;
}
开发者ID:jwigal,项目名称:churchinfo,代码行数:35,代码来源:Functions.php

示例13: mysql_secure

 include '../../../config.php';
 include '../../core.php';
 include '../../..' . $setting['template_url'] . '/template_settings.php';
 $the_comment = mysql_secure($_POST['comment'], 0);
 $id = intval($_POST['id']);
 if (isset($_COOKIE["ava_username"])) {
     $cookie_id = intval($_COOKIE["ava_userid"]);
     $code = preg_replace("/[^a-z,A-Z,0-9]/", "", $_COOKIE['ava_code']);
     $last_comment = mysql_query("SELECT last_comment FROM ava_users WHERE id = {$cookie_id} AND last_comment > NOW() - INTERVAL 1 MINUTE");
     if (mysql_num_rows($last_comment) == '0') {
         $user = mysql_query("SELECT * FROM ava_users WHERE id=" . $cookie_id . "");
         $user2 = mysql_fetch_array($user);
         if ($user2['password'] == $code && $user2['banned'] == 0) {
             $date = date("Y-m-d H:i:s");
             mysql_query("INSERT INTO ava_news_comments (user, comment, link_id, date, ip) VALUES ('{$cookie_id}', '{$the_comment}', '{$id}', '{$date}', '{$_SERVER['REMOTE_ADDR']}')");
             $comment = array('username' => $user2['username'], 'content' => stripslashes(nl2br(htmlspecialchars($_POST['comment']))), 'user_points' => $user2['points'], 'date' => FormatDate($date, 'time'));
             $comment['delete'] = '';
             $comment['report_button'] = '';
             $comment['user_url'] = ProfileUrl($user2['id'], $user2['seo_url']);
             if ($user2['avatar'] == '') {
                 if ($user2['facebook'] == 1) {
                     $comment['avatar_url'] = 'http://graph.facebook.com/' . $user2['facebook_id'] . '/picture';
                 } else {
                     $comment['avatar_url'] = $setting['site_url'] . '/uploads/avatars/default.png';
                 }
             } else {
                 $comment['avatar_url'] = $setting['site_url'] . '/uploads/avatars/' . $user2['avatar'];
             }
             echo '<a name="1"></a>';
             include '../../..' . $setting['template_url'] . '/' . $template['news_comment'];
             mysql_query("UPDATE ava_users SET comments = comments + 1, points = points + {$setting['points_comment']}, last_comment = '{$date}' WHERE id='" . $cookie_id . "'") or die(mysql_error());
开发者ID:digiwin,项目名称:avarcade,代码行数:31,代码来源:news_add_comment.php

示例14: array

								<?php 
            }
            ?>
								<?php 
            break;
        case "U":
            //CALENDAR
            ?>
								<div class="bx_filter_parameters_box_container_block"><div class="bx_filter_input_container bx_filter_calendar_container">
									<?php 
            $APPLICATION->IncludeComponent('bitrix:main.calendar', '', array('FORM_NAME' => $arResult["FILTER_NAME"] . "_form", 'SHOW_INPUT' => 'Y', 'INPUT_ADDITIONAL_ATTR' => 'class="calendar" placeholder="' . FormatDate("SHORT", $arItem["VALUES"]["MIN"]["VALUE"]) . '" onkeyup="smartFilter.keyup(this)" onchange="smartFilter.keyup(this)"', 'INPUT_NAME' => $arItem["VALUES"]["MIN"]["CONTROL_NAME"], 'INPUT_VALUE' => $arItem["VALUES"]["MIN"]["HTML_VALUE"], 'SHOW_TIME' => 'N', 'HIDE_TIMEBAR' => 'Y'), null, array('HIDE_ICONS' => 'Y'));
            ?>
								</div></div>
								<div class="bx_filter_parameters_box_container_block"><div class="bx_filter_input_container bx_filter_calendar_container">
									<?php 
            $APPLICATION->IncludeComponent('bitrix:main.calendar', '', array('FORM_NAME' => $arResult["FILTER_NAME"] . "_form", 'SHOW_INPUT' => 'Y', 'INPUT_ADDITIONAL_ATTR' => 'class="calendar" placeholder="' . FormatDate("SHORT", $arItem["VALUES"]["MAX"]["VALUE"]) . '" onkeyup="smartFilter.keyup(this)" onchange="smartFilter.keyup(this)"', 'INPUT_NAME' => $arItem["VALUES"]["MAX"]["CONTROL_NAME"], 'INPUT_VALUE' => $arItem["VALUES"]["MAX"]["HTML_VALUE"], 'SHOW_TIME' => 'N', 'HIDE_TIMEBAR' => 'Y'), null, array('HIDE_ICONS' => 'Y'));
            ?>
								</div></div>
								<?php 
            break;
        default:
            //CHECKBOXES
            ?>
								<?php 
            foreach ($arItem["VALUES"] as $val => $ar) {
                ?>
									<label data-role="label_<?php 
                echo $ar["CONTROL_ID"];
                ?>
" class="bx_filter_param_label <?php 
                echo $ar["DISABLED"] ? 'disabled' : '';
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:template.php

示例15: mysql_query

            $sql = $sql . " LIMIT $startplayers, $finishplayers";
        } 
        $result = mysql_query($sql);
        $num = mysql_num_rows($result);
        $cur = 1;
        while ($num >= $cur) {
            $row = mysql_fetch_array($result);
            $name = $row["name"];
            $approved = $row["approved"];
            $id = $row['player_id'];
            $nameClass = colorNameClass($name, $approved);

            $alias = $row["alias"];
            $forum = $row["forum"];
            $versions = $row["versions"];
            $joined = FormatDate($row["joindate"]);
            
            if ($forum == "[none]") {
                $forum = "";
            } 

            $mail = $row["mail"];
            if ($mail == "n/a" || empty($mail)) {
                $mailaddress = "n/a";
                $mailpic = "";
            } 
			else {
                $mailaddress = "
	        <a href='mailto:$mail'>
	        <font color='$color1'>
	        mail
开发者ID:kinj1987,项目名称:evo-league,代码行数:31,代码来源:players.php


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