本文整理汇总了PHP中dateFormat函数的典型用法代码示例。如果您正苦于以下问题:PHP dateFormat函数的具体用法?PHP dateFormat怎么用?PHP dateFormat使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dateFormat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addPromotion
function addPromotion($pmtId = null, $pmtaId = null)
{
$this->path[] = array('text' => __('促销规则选择'));
$oPromotion =& $this->system->loadModel('trading/promotion');
$oPromotionActivity =& $this->system->loadModel('trading/promotionActivity');
if (!$pmtaId) {
$aTmp = $oPromotion->getPromotionFieldById($pmtId, array('pmta_id'));
$pmtaId = $aTmp['pmta_id'];
}
$_SESSION['SWP_PROMOTION'] = NULL;
$_SESSION['SWP_PROMOTION']['activityInfo'] = $oPromotionActivity->getActivityById($pmtaId);
$_SESSION['SWP_PROMOTION']['activityInfo']['pmta_time_begin'] = dateFormat($_SESSION['SWP_PROMOTION']['activityInfo']['pmta_time_begin']);
$_SESSION['SWP_PROMOTION']['activityInfo']['pmta_time_end'] = dateFormat($_SESSION['SWP_PROMOTION']['activityInfo']['pmta_time_end']);
if ($pmtId) {
$aData = $oPromotion->getPromotionFieldById($pmtId, array('*'));
//echo "<pre>";print_r($aData);exit;
$_SESSION['SWP_PROMOTION']['writePromotionRule'] = array('pmt_solution' => unserialize($aData['pmt_solution']), 'pmt_ifcoupon' => $aData['pmt_ifcoupon'], 'pmt_time_begin' => dateFormat($aData['pmt_time_begin']), 'pmt_time_end' => dateFormat($aData['pmt_time_end']), 'pmt_describe' => $aData['pmt_describe']);
$_SESSION['SWP_PROMOTION']['selectPromotionRule']['pmts_id'] = $aData['pmts_id'];
$_SESSION['SWP_PROMOTION']['selectProduct']['pmt_bond_type'] = $aData['pmt_bond_type'];
switch ($aData['pmt_bond_type']) {
case 1:
$_SESSION['SWP_PROMOTION']['selectProduct']['bind_goods'] = $oPromotion->getBondGoods($pmtId);
break;
case 2:
break;
case 0:
default:
break;
}
}
$_SESSION['SWP_PROMOTION']['basic']['pmta_id'] = $pmtaId;
$_SESSION['SWP_PROMOTION']['basic']['pmt_id'] = $pmtId;
$this->selectPromotionRule($pmtId);
}
示例2: addCoupon
function addCoupon($cpnsId = null)
{
$this->path[] = array('text' => __('优惠券内容'));
$_SESSION['SWP_PROMOTION'] = null;
if ($cpnsId != null) {
$this->pagedata['ediateable'] = 'true';
$oCoupon =& $this->system->loadModel('trading/coupon');
$oPromotion =& $this->system->loadModel('trading/promotion');
$aData = $oCoupon->getCouponById($cpnsId);
$_SESSION['SWP_PROMOTION']['couponInfo'] = array('cpns_name' => $aData['cpns_name'], 'cpns_prefix' => substr($aData['cpns_prefix'], 1), 'cpns_status' => $aData['cpns_status'], 'cpns_type' => $aData['cpns_type']);
$_SESSION['SWP_PROMOTION']['writePromotionRule'] = array('pmt_solution' => unserialize($aData['pmt_solution']), 'pmt_ifcoupon' => $aData['pmt_ifcoupon'], 'pmt_time_begin' => dateFormat($aData['pmt_time_begin']), 'pmt_time_end' => dateFormat($aData['pmt_time_end']), 'pmt_describe' => $aData['pmt_describe']);
$_SESSION['SWP_PROMOTION']['selectPromotionRule']['pmts_id'] = $aData['pmts_id'];
$_SESSION['SWP_PROMOTION']['selectProduct']['pmt_bond_type'] = $aData['pmt_bond_type'];
switch ($aData['pmt_bond_type']) {
case 1:
$_SESSION['SWP_PROMOTION']['selectProduct']['bind_goods'] = $oPromotion->getBondGoods($aData['pmt_id']);
break;
case 2:
break;
case 0:
default:
break;
}
$_SESSION['SWP_PROMOTION']['basic']['cpns_id'] = $cpnsId;
$_SESSION['SWP_PROMOTION']['basic']['pmt_id'] = $aData['pmt_id'];
}
$this->couponInfo();
}
示例3: viewInfoBlock
function viewInfoBlock()
{
//Custom Function from helpers.php
$bdateview = dateFormat($_SESSION['loggedUser']['u_b_day']);
echo '<div class="userInfoContainer">
<h3>My Page:</h3>
<div class="userInfo">
<div class="profileImg">
<img src="css/images/man.jpg" alt="Profile Photo"/>
</div>
<div class="infoTest">
<div class="perfonalInfo">
<ul>
<li><strong>First Name: </strong>' . $_SESSION['loggedUser']['u_f_name'] . '</li>
<li><strong>Last Name: </strong>' . $_SESSION['loggedUser']['u_l_name'] . '</li>
<li><strong>Birthday: </strong>' . $bdateview . '</li>
</ul>
</div>
<div class="personalAbout">
<p><strong>About me:</strong></p>
<div class="aboutText">' . $_SESSION['loggedUser']['u_about'] . '</div>
</div>
</div>
</div>
</div>';
}
示例4: showAddGift
function showAddGift($giftId = null)
{
$this->path[] = array('text' => '赠品内容页');
$oGift = $this->system->loadModel('trading/gift');
$oMember = $this->system->loadModel('member/member');
$this->pagedata['catList'] = $oGift->getTypeArr();
if (count($this->pagedata['catList']) < 1) {
$this->splash('failed', 'index.php?ctl=sale/gift&act=showAddType', '缺少赠品类别,无法添加赠品。转到添加赠品类别');
}
$aMemberLevelList = $oMember->getLevelList(false);
foreach ($aMemberLevelList as $k => $v) {
$aTmpMList[$v['member_lv_id']] = $v['name'];
}
$this->pagedata['mLev'] = $aTmpMList;
if ($giftId) {
$this->pagedata['gift'] = $oGift->getGiftById($giftId);
$this->pagedata['gift']['limit_end_time'] = dateFormat($this->pagedata['gift']['limit_end_time']);
$this->pagedata['gift']['limit_start_time'] = dateFormat($this->pagedata['gift']['limit_start_time']);
$this->pagedata['gift']['mLev'] = explode(',', $this->pagedata['gift']['limit_level']);
} else {
$this->pagedata['gift']['giftcat_id'] = $aType[0][0]['giftcat_id'];
$this->pagedata['gift']['shop_iffb'] = 1;
$this->pagedata['gift']['ifrecommend'] = 1;
$this->pagedata['gift']['limit_num'] = 1;
$this->pagedata['gift']['orderlist'] = $oGift->getInitOrder();
}
$this->page('sale/gift/addGift.html');
}
示例5: testIndexOnLogined
/**
* @dataProvider allDataProvider
*
* @param Memo $memo
*/
public function testIndexOnLogined(Memo $memo)
{
if ($memo->user_id !== static::$all->id_str) {
return;
}
$this->visitWithLogined('/user/memo')->see('作成日時')->see($memo->created_at->format(dateFormat()))->see(autoLink($memo->content))->see('詳しく見る')->see("/memo/show/{$memo->id}")->see('編集')->see("/user/memo/edit/{$memo->id}")->see('削除')->see("/user/memo/delete/{$memo->id}");
}
示例6: dateIsFuture
function dateIsFuture($date)
{
if ($date = dateFormat($date)) {
$date = substr($date, -4) . substr($date, 0, 2) . substr($date, 3, 2);
if ($date >= date('Ymd')) {
return true;
}
}
return false;
}
示例7: testUser
/**
* @dataProvider userDataProvider
*
* @param string $sn
*/
public function testUser($sn)
{
$tmp = $this->memo->where('user_sn', $sn);
$memos = $tmp->orderBy('id', 'desc')->paginate(10);
$count = $tmp->count();
foreach ($memos as $memo) {
$this->visit("/memo/user/{$memo->user_sn}")->see("@{$memo->user_sn}のメモ")->see("https://twitter.com/{$memo->user_sn}")->see($count)->see($memo->created_at->format(dateFormat()))->see($memo->user_sn)->see(autoLink($memo->content))->seeInfo()->assertResponseOk();
if ($count > 10) {
$this->see("/memo/user/{$memo->user_sn}");
}
}
}
示例8: init
/**
* Инициализация тизера.
*
* @global array $js_file
*
* @param array $options [kind, uid]
*/
public function init($options = array())
{
if ($options) {
$this->kind = (int) $options['kind'];
$this->uid = (int) $options['uid'];
}
$this->data = array();
$tservices_binds = new tservices_binds($this->kind);
$this->data['bind_up_price'] = $tservices_binds->getPrice(true, $this->uid);
$this->data['date_stop'] = dateFormat('j', $this->date_stop) . ' ' . monthtostr(dateFormat('m', $this->date_stop), true);
$this->data['allow_up'] = $this->allow_up;
$this->data['tservice_id'] = $this->tservice_id;
}
示例9: videoadd
public function videoadd()
{
$this->view->assign('active', 'active');
if (isset($_GET['id'])) {
$data = $this->models->get_video_id($_GET['id']);
if ($data) {
$data['created_date'] = dateFormat($data['created_date'], 'dd-mm-yyyy');
$data['posted_date'] = dateFormat($data['posted_date'], 'dd-mm-yyyy');
}
$this->view->assign('data', $data);
}
$this->view->assign('admin', $this->admin['admin']);
return $this->loadView('video/addvideo');
}
示例10: comments
/**
* Выводит дерево комментариев. Используется здесь и в xajax/contest.server.php
* @param integer $pid id проекта
* @param string $name название проекта
* @param array $comments массив с деревом комментариев (подробнее в classes/contest.php)
* @param boolean $comm_blocked автор отключил возможность оставлять комментарии?
* @param boolean $project_end проект закрыт?
* @param integer $s_level уровень вложенности комментария
* @return string HTML с кнопками управления
*/
function comments($pid, $name, &$comments, $comm_blocked, $project_end, $s_level = 0)
{
global $stop_words, $contest, $project, $session;
static $level = 0;
$level = ($s_level ? $s_level : $level) + 1;
$html = '';
$set_branch_as_read = false;
for ($i = 0, $c = count($comments); $i < $c; $i++) {
if (($comments[$i]['is_banned'] || $comments[$i]['usr_banned'] || $comments[$i]['user_blocked'] === 't') && !hasPermissions('projects') && !$contest->is_owner) {
$msg = $msg2 = 'Ответ от заблокированного пользователя';
} else {
if (!trim($comments[$i]['deleted'])) {
$sMsg = $comments[$i]['moderator_status'] === '0' ? $stop_words->replace($comments[$i]['msg']) : $comments[$i]['msg'];
$msg = reformat($sMsg, 30, 0, 0, 1);
$msg2 = reformat($comments[$i]['msg'], 30, 0, 0, 1);
} else {
$msg2 = $msg = "Комментарий удален модератором";
if (hasPermissions("comments")) {
$moderator = '';
$moderatorData = new users();
$moderatorData->GetUserByUID($comments[$i]['deluser_id']);
if ($moderatorData->login) {
$moderator = ' ' . $moderatorData->login . ' (' . $moderatorData->uname . ' ' . $moderatorData->usurname . ') ';
}
$msg2 = $msg = $msg . " {$moderator}";
}
if ($comments[$i]['deluser_id'] == $comments[$i]['user_id']) {
$msg2 = $msg = "Комментарий удален автором";
} else {
if (trim($comments[$i]['deleted_reason']) && (hasPermissions("comments") || $comments[$i]['user_id'] == get_uid(false))) {
$msg2 = $msg = $msg . "<div style='color:#ff0000'>Причина: " . $comments[$i]['deleted_reason'] . "</div>";
}
}
}
}
$a_is_banned = ($comments[$i]['is_banned'] || $comments[$i]['usr_banned']) && hasPermissions('projects');
$html .= "\n\t\t\t<li class='thread' id='thread-{$comments[$i]['id']}'" . ($level >= 9 ? " style='margin-left: 0'" : "") . ">\n\t\t\t\t<a name='c-comment-{$comments[$i]['id']}'></a>\n\t\t\t\t<div class='comment-one" . ($comments[$i]['deleted'] || $comments[$i]['hidden'] ? " comment-deleted" : "") . "' id='comment-{$comments[$i]['id']}'>\n\t\t\t\t\t<div class='contest-ea'>" . view_avatar($comments[$i]['login'], $comments[$i]['photo'], 1) . "</div>\n\t\t\t\t\t<div class='comment-body'>\n\t\t\t\t\t\t<h3 class='username'>" . $session->view_online_status($comments[$i]['login']) . "\n\t\t\t\t\t\t\t<a href='/users/{$comments[$i]['login']}' class='" . (is_emp($comments[$i]['role']) ? 'employer-name' : 'freelancer-name') . "'>{$comments[$i]['uname']} {$comments[$i]['usurname']} [{$comments[$i]['login']}]</a> " . view_mark_user($comments[$i]) . " " . ($comments[$i]['completed_cnt'] > 0 ? '<a href="/promo/bezopasnaya-sdelka/" title="Пользователь работал через Безопасную Сделку" target="_blank"><span class="b-icon b-icon__shield b-icon_top_1"></span></a>' : '') . "\n\t\t\t\t\t\t\t<span>[" . dateFormat('d.m.Y | H:i', $comments[$i]['post_date']) . "]</span>\n\t\t\t\t\t\t\t<span id='comment-modified-{$comments[$i]['id']}'>" . ($comments[$i]['modified'] ? "[изменен " . dateFormat('d.m.Y | H:i', $comments[$i]['modified']) . "]" : ' ') . "</span>\n\t\t\t\t\t\t\t" . ($a_is_banned ? "<b style=\"color:#ff0000\">Пользователь забанен</b>" : "") . "\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t" . ($_SESSION['uid'] && $comments[$i]['is_new'] ? "<p><img src='/images/mark-new.png' width='53' height='12' alt='новое' class='mark-new' /></p>" : "") . "\n\t\t\t\t\t\t<div id='comment-change-{$comments[$i]['id']}'>\n\t\t\t\t\t\t<p id='comment-msg-{$comments[$i]['id']}' " . ($a_is_banned ? "style='color:silver'" : "") . ".>" . $msg . "</p>\n\t\t\t\t\t\t<div id='comment-msg-original-{$comments[$i]['id']}' style='display:none'>" . $msg2 . "</div>\n\t\t\t\t\t\t<script type=\"text/javascript\">\n banned.addContext( 'p{$pid}c{$comments[$i]['id']}', 3, '" . HTTP_PREFIX . "{$_SERVER['HTTP_HOST']}" . getFriendlyURL("project", $pid) . "?comm={$comments[$i]['id']}#comment-{$comments[$i]['id']}', \"" . htmlspecialchars($name) . "\" );\n </script>\n\t\t\t\t\t\t<ul class='thread-options' id='comment-options-{$comments[$i]['id']}'>\n\t\t\t\t\t\t\t" . comment_options($pid, $comments[$i], $comm_blocked, $project_end, $level, $name) . "\n\t\t\t\t\t\t</ul>\n <div id='warnreason-" . $comments[$i]['id'] . "-" . $comments[$i]['user_id'] . "' style='display:none; padding: 0 0 5px 0px;'> </div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t" . (empty($comments[$i]['comments']) ? '' : '<ul>' . comments($pid, $name, $comments[$i]['comments'], $comm_blocked, $project_end) . '</ul>') . "\n\t\t\t</li>\n\t\t";
if ($comments[$i]['is_new']) {
$set_branch_as_read = true;
}
}
if ($set_branch_as_read) {
$p = new projects();
$data = array("id" => $pid, "kind" => 7, "user_id" => $project["user_id"]);
$p->SetRead($data, get_uid(false), true);
}
--$level;
return $html;
}
示例11: setAssignee
public function setAssignee($as){
$this->assigneeName = $as['assigneeName'];
$asGender = $as['gender'];
switch($asGender){
case 'M': $assigneeGender = 'Male'; break;
case 'F': $assigneeGender = 'Female'; break;
default: break;
}
$this->assigneeCostCenter = $as['costCenter'];
$this->assigneeAge = $as['age'];
$this->assigneecontactNo = $as['contactNo1'] . ' / ' . $as['contactNo2'];
$this->assigneeAddress = $as['address'];
$this->assigneeLicenseNo = $as['licenseNo'];
$this->licenseExpirationDate = dateFormat($as['expirationDate'],"F d, Y");
}
示例12: addarticle
public function addarticle()
{
$this->view->assign('active', 'active');
if (isset($_GET['id'])) {
$data = $this->models->get_article_id($_GET['id']);
if ($data) {
$data['created_date'] = dateFormat($data['created_date'], 'dd-mm-yyyy');
$data['posted_date'] = dateFormat($data['posted_date'], 'dd-mm-yyyy');
$data['expired_date'] = dateFormat($data['expired_date'], 'dd-mm-yyyy');
}
$this->view->assign('data', $data);
}
$this->view->assign('admin', $this->admin['admin']);
return $this->loadView('article/inputarticle');
}
示例13: content
public function content()
{
$this->view->assign('active', 'active');
if (isset($_GET['cat']) and isset($_GET['type'])) {
$data = $this->models->get_article_site($_GET['cat'], $_GET['type']);
if (!empty($data['created_date']) || !empty($data['posted_date']) || !empty($data['expired_date'])) {
$data['created_date'] = dateFormat($data['created_date'], 'dd-mm-yyyy');
$data['posted_date'] = dateFormat($data['posted_date'], 'dd-mm-yyyy');
$data['expired_date'] = dateFormat($data['expired_date'], 'dd-mm-yyyy');
}
$this->view->assign('data', $data);
}
$this->view->assign('admin', $this->admin['admin']);
return $this->loadView('site/inputdata');
}
示例14: index
function index()
{
$where = "category = '3' AND n_status = '1'";
$data = $this->models->getData(TRUE, '*', 'floraINA_digirepo', $where);
//pr($data);
if ($data) {
foreach ($data as $key => $value) {
$data[$key]['created_date'] = dateFormat($value['created_date'], 'article');
$data[$key]['content'] = html_entity_decode($value['content'], ENT_QUOTES, 'UTF-8');
}
$this->view->assign('data', $data);
}
$this->view->assign('title', 'Publication');
return $this->loadView('publication/all');
}
示例15: view
function view()
{
$id = $_GET['id'];
//Get all news
$where = "id = '" . $id . "' AND n_status = '1'";
$data = $this->models->getData(TRUE, '*', 'floraINA_news_content', $where);
if ($data) {
foreach ($data as $key => $value) {
$data[$key]['content'] = html_entity_decode($value['content'], ENT_QUOTES, 'UTF-8');
$data[$key]['posted_date'] = dateFormat($value['posted_date'], 'article');
}
$this->view->assign('data', $data);
}
return $this->loadView('news/post_view');
}