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


PHP formatDateTime函数代码示例

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


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

示例1: printItemBody

    public function printItemBody($id)
    {
        global $dbh;
        $return = '<section>
				<h2>Expenses</h2>
				<div class="sectionData">
					<table class="dataTable stripe row-border"> 
						<thead>
							<tr>
								<th class="dateTimeHeader textLeft">Time</th>
								<th class="textLeft">Order</th>
								<th class="textLeft">Employee</th>
							</tr>
						</thead>
						<tbody>';
        $sth = $dbh->prepare('SELECT expenseID, employeeID, date
								FROM expenses
								WHERE supplierID = :supplierID AND active = 1');
        $sth->execute([':supplierID' => $id]);
        while ($row = $sth->fetch()) {
            $return .= '<tr><td data-sort="' . $row['date'] . '">' . formatDateTime($row['date']) . '</td>';
            $return .= '<td>' . getLinkedName('expense', $row['expenseID']) . '</td>';
            $return .= '<td>' . getLinkedName('employee', $row['employeeID']) . '</td></tr>';
        }
        $return .= '</tbody>
					</table>
				</div>
			</section>';
        return $return;
    }
开发者ID:jewelhuq,项目名称:erp,代码行数:30,代码来源:Supplier.php

示例2: message_box

function message_box()
{
    global $prefix, $MAIN_CFG, $currentlang, $db, $userinfo;
    require_once CORE_PATH . 'nbbcode.php';
    $query = $MAIN_CFG['global']['multilingual'] ? "AND (mlanguage='{$currentlang}' OR mlanguage='')" : '';
    if (!is_admin()) {
        if (is_user()) {
            $query .= ' AND view!=2 AND view!=3';
        } else {
            $query .= ' AND (view=0 OR view=3)';
        }
    }
    $result = $db->sql_query('SELECT mid, title, content, date, expire, view FROM ' . $prefix . "_message WHERE active='1' {$query} ORDER BY date DESC");
    while (list($mid, $title, $content, $date, $expire, $view) = $db->sql_fetchrow($result)) {
        $content = decode_bb_all($content, 1, true);
        if (!empty($title) && !empty($content)) {
            $output = '';
            if ($view == 0) {
                $output = _MVIEWALL;
            } elseif ($view == 1) {
                $output = _MVIEWUSERS;
            } elseif ($view == 2) {
                $output = _MVIEWADMIN;
            } elseif ($view == 3) {
                $output = _MVIEWANON;
            } elseif ($view > 3 && (in_group($view - 3) || is_admin())) {
                // <= phpBB User Groups Integration
                $view = $view - 3;
                if (!in_group($view)) {
                    list($output) = $db->sql_ufetchrow("SELECT group_name FROM " . $prefix . "_bbgroups WHERE group_id='{$view}'", SQL_NUM);
                } else {
                    $output = in_group($view);
                }
            }
            if ($output != '') {
                $remain = '';
                if (can_admin()) {
                    if ($expire == 0) {
                        $remain = _UNLIMITED;
                    } else {
                        $etime = ($date + $expire - time()) / 3600;
                        $etime = intval($etime);
                        $remain = $etime < 1 ? _EXPIRELESSHOUR : _EXPIREIN . " {$etime} " . _HOURS;
                    }
                }
                global $cpgtpl;
                $cpgtpl->assign_block_vars('messageblock', array('S_TITLE' => $title, 'S_CONTENT' => $content, 'S_OUTPUT' => $output, 'S_DATE' => _POSTEDON . ' ' . formatDateTime($date, _DATESTRING2), 'S_REMAIN' => $remain, 'S_EDIT' => _EDIT, 'U_EDITMSG' => URL::admin('messages&amp;edit=' . $mid)));
            }
            if ($expire != 0) {
                if ($date + $expire < time()) {
                    $db->sql_query("UPDATE " . $prefix . "_message SET active='0' WHERE mid='{$mid}'");
                }
            }
        }
    }
    $db->sql_freeresult($result);
}
开发者ID:cbsistem,项目名称:nexos,代码行数:57,代码来源:messagebox.php

示例3: __toString

 function __toString()
 {
     $str = $this->comment;
     $u = $this->w->Auth->getUser($this->creator_id);
     if ($u) {
         $str .= "<br>By <i>" . $u->getFullName() . ",</i>";
     }
     $str .= "<i>" . formatDateTime($this->dt_created) . "</i>";
     return $str;
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:10,代码来源:AComment.php

示例4: get_ban_type

function get_ban_type($type)
{
    if ($type < 0) {
        return _FOREVER;
    }
    if ($type > 0) {
        return formatDateTime($type, _DATESTRING);
    }
    return '';
}
开发者ID:cbsistem,项目名称:nexos,代码行数:10,代码来源:security.php

示例5: backup

 public static function backup($database, $tables, $filename, $structure = true, $data = true, $drop = true, $compress = true, $full = false)
 {
     if (!is_array($tables) || empty($tables)) {
         trigger_error('No tables to backup', E_USER_WARNING);
         return false;
     }
     $crlf = "\n";
     $esc = SQL_LAYER == 'postgresql' ? '--' : '#';
     # doing some DOS-CRLF magic...
     # this looks better under WinX
     if (preg_match('#[^(]*\\((.*)\\)[^)]*#', $_SERVER['HTTP_USER_AGENT'], $regs)) {
         if (false !== stripos($regs[1], 'Win')) {
             $crlf = "\r\n";
         }
     }
     if (GZIPSUPPORT) {
         while (ob_end_clean()) {
         }
         header('Content-Encoding: ');
     } else {
         $compress = false;
     }
     if ($compress) {
         $filename .= '.gz';
         header("Content-Type: application/x-gzip; name=\"{$filename}\"");
     } else {
         header("Content-Type: text/x-delimtext; name=\"{$filename}\"");
     }
     header("Content-disposition: attachment; filename={$filename}");
     DBCtrl::output("{$esc} ========================================================{$crlf}" . "{$esc}{$crlf}" . "{$esc} Database : {$database}{$crlf}" . "{$esc} " . _ON . " " . formatDateTime(time(), _DATESTRING) . " !{$crlf}" . "{$esc}{$crlf}" . "{$esc} ========================================================{$crlf}" . "{$crlf}", $compress);
     set_time_limit(0);
     if (SQL_LAYER == 'mysql') {
         $database = "`{$database}`";
     }
     foreach ($tables as $table) {
         if ($structure) {
             DBCtrl::output("{$crlf}{$esc}{$crlf}" . "{$esc} Table structure for table '{$table}'{$crlf}" . "{$esc}{$crlf}{$crlf}", $compress);
             DBCtrl::output(SQLCtrl::get_table_struct($database, $table, $crlf, $drop) . ";{$crlf}{$crlf}", $compress);
         }
         if ($data) {
             DBCtrl::output("{$crlf}{$esc}{$crlf}" . "{$esc} Dumping data for table '{$table}'{$crlf}" . "{$esc}{$crlf}{$crlf}", $compress);
             SQLCtrl::get_table_content($database, $table, $crlf, false, true, $compress);
         }
     }
     if ($compress) {
         DBCtrl::output('', true, true);
     }
     exit;
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:49,代码来源:mysql.php

示例6: printAttachments

    public function printAttachments($type, $id)
    {
        global $dbh;
        global $SETTINGS;
        $return = '';
        $allowsAttachments = in_array($type, ['employee', 'order', 'expense']);
        //anything that has an attachment, show it with a delete option
        $sth = $dbh->prepare('SELECT attachmentID, employeeID, uploadTime, name, extension
				FROM attachments
				WHERE type = :type AND id = :id');
        $sth->execute([':type' => $type, ':id' => $id]);
        $result = $sth->fetchAll();
        $hasAttachments = count($result) > 0 ? true : false;
        //if type currently allows attachments OR already has attachments, build the section
        if ($allowsAttachments || $hasAttachments) {
            $addStr = $allowsAttachments == true ? 'class="controlAdd addEnabled" href="#"' : 'class="controlAdd addDisabled" href="#" title="This item type is not currently configured to allow attachments."';
            $return = '<section>
					<h2>Attachments</h2>
					<div class="sectionData">
						<div class="customAddLink" id="addAttachment"><a ' . $addStr . '>Add Attachment</a></div>
						<table class="attachmentTable" style="width:100%;">
							<thead>
								<tr>
									<th class="textLeft">Attachment</th>
									<th class="textLeft">Added By</th>
									<th class="textLeft">Uploaded</th>
									<th></th>
								</tr>
							</thead>
							<tbody>';
            if ($hasAttachments) {
                foreach ($result as $row) {
                    $return .= '<tr><td><a href="attachment.php?id=' . $row['attachmentID'] . '">' . $row['name'] . '.' . $row['extension'] . '</a></td>';
                    $return .= '<td>' . getLinkedName('employee', $row['employeeID']) . '</td>';
                    $return .= '<td>' . formatDateTime($row['uploadTime']) . '</td>';
                    $return .= '<td class="textCenter"><a class="controlDelete deleteEnabled" href="#" data-id="' . $row['attachmentID'] . '"></a></td></tr>';
                }
            }
            $return .= '</tbody>
						</table>
					</div>
				</section>';
        }
        return $return;
    }
开发者ID:jewelhuq,项目名称:erp,代码行数:45,代码来源:GenericItem.php

示例7: afterFind

 public function afterFind($results, $primary = false)
 {
     foreach ($results as $key => $val) {
         if (isset($val[$this->alias]['date_joined']) && $val[$this->alias]['date_joined'] != '0000-00-00 00:00:00') {
             $results[$key][$this->alias]['date_joined'] = formatDate($val[$this->alias]['date_joined']);
         }
         if (isset($val[$this->alias]['last_login']) && $val[$this->alias]['last_login'] != '0000-00-00 00:00:00') {
             $results[$key][$this->alias]['last_login'] = formatDateTime($val[$this->alias]['last_login']);
         } else {
             $results[$key][$this->alias]['last_login'] = __('Never');
         }
         // if (isset($val[$this->alias]['active'])){
         // $states = $this->stateOptions();
         // $results[$key][$this->alias]['active'] = $states[$results[$key][$this->alias]['active']];
         // }
     }
     return $results;
 }
开发者ID:a0108393,项目名称:cms-system,代码行数:18,代码来源:User.php

示例8: generate_user_info

function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www)
{
    global $lang, $images, $board_config, $MAIN_CFG;
    static $ranksrow;
    if (!is_array($ranksrow)) {
        global $db;
        $ranksrow = $db->sql_ufetchrowset("SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_special, rank_min", SQL_ASSOC);
    }
    $from = !empty($row['user_from']) ? $row['user_from'] : '&nbsp;';
    $joined = formatDateTime($row['user_regdate'], _DATESTRING2);
    $posts = $row['user_posts'] ? $row['user_posts'] : 0;
    $email_img = $email = '';
    for ($j = 0; $j < count($ranksrow); $j++) {
        if ($row['user_rank'] && $row['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] || !$row['user_rank'] && $row['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special']) {
            $email = $ranksrow[$j]['rank_title'];
            $email_img = $ranksrow[$j]['rank_image'] ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $email . '" title="' . $email . '" style="border:0;" />' : '';
        }
    }
    $temp_url = URL::index("Your_Account&amp;profile=" . $row['user_id']);
    $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" /></a>';
    $profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
    if (is_user() && is_active('Private_Messages')) {
        $temp_url = URL::index("Private_Messages&amp;mode=post&amp;" . POST_USERS_URL . "=" . $row['user_id']);
        $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" style="border:0;" /></a>';
        $pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
    } else {
        $pm = $pm_img = '';
    }
    if ($row['user_website'] == 'http:///' || $row['user_website'] == 'http://') {
        $row['user_website'] = '';
    }
    if ($row['user_website'] != '' && substr($row['user_website'], 0, 7) != 'http://') {
        $row['user_website'] = 'http://' . $row['user_website'];
    }
    $www_img = $row['user_website'] ? '<a href="' . $row['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" style="border:0;" /></a>' : '';
    $www = $row['user_website'] ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
    $temp_url = URL::index("Forums&amp;file=search&amp;search_author=" . urlencode($row['user_id']) . "&amp;showresults=posts");
    $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" style="border:0;" /></a>';
    $search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
    return;
}
开发者ID:cbsistem,项目名称:nexos,代码行数:41,代码来源:index.php

示例9: listfeed_ALL

function listfeed_ALL(Web &$w)
{
    $w->Report->navigation($w, "Feeds");
    // get all feeds
    $feeds = $w->Report->getFeeds();
    // prepare table headings
    $line = array(array("Feed", "Report", "Description", "Created", ""));
    // if feeds exists and i am suitably authorised, list them
    if ($feeds && ($w->Auth->user()->hasRole("report_editor") || $w->Auth->user()->hasRole("report_admin"))) {
        foreach ($feeds as $feed) {
            // get report data
            $rep = $w->Report->getReportInfo($feed->report_id);
            // display the details
            if ($rep) {
                $line[] = array($feed->title, $rep->title, $feed->description, formatDateTime($feed->dt_created), Html::b(WEBROOT . "/report/editfeed/" . $feed->id, " View ") . Html::b(WEBROOT . "/report/deletefeed/" . $feed->id, " Delete ", "Are you sure you wish to DELETE this feed?"));
            }
        }
    } else {
        // no feeds and/or no access
        $line[] = array("No feeds to list", "", "", "", "");
    }
    // display results
    $w->ctx("feedlist", Html::table($line, null, "tablesorter", true));
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:24,代码来源:listfeed.php

示例10: while

}
// Messages
$result = $db->sql_query('SELECT * FROM ' . $prefix . "_shoutblock ORDER BY id DESC LIMIT {$conf['number']}");
$bgcolor = $conf['color2'];
while ($row = $db->sql_fetchrow($result)) {
    $bgcolor = $bgcolor != $conf['color1'] ? $conf['color1'] : $conf['color2'];
    $content .= '<div style="background-color:' . $bgcolor . ';" class="content">';
    $row[2] = set_smilies($row[2]);
    $content .= '<a href="' . getlink('Your_Account&amp;profile=' . $row[1]) . "\"><b>{$row['1']}:</b></a>";
    $content .= " {$row['2']}<br />";
    if ($conf['date']) {
        $content .= formatDateTime($row[3], '%d-%b-%Y ');
    }
    // date
    if ($conf['time']) {
        $content .= formatDateTime($row[3], '%H:%M:%S');
    }
    // time
    $content .= '</div>';
}
$content .= '</div>';
// bottom half
if (!$conf['anonymouspost'] && !is_user()) {
    $content .= '<div style="text-align:center;"><a href="' . getlink('Shoutblock') . '">' . _SSHOUTHISTORY . '</a><br />' . _SREGSHOUT . '<br /><a href="' . getlink('Your_Account') . '">' . _SLOGIN . '</a></div>';
} else {
    $content .= '<table width="100%" border="0" cellspacing="0" cellpadding="1">';
    $content .= '<form id="form1" method="post" action="' . getlink('Shoutblock') . '">';
    $content .= '<tr><td align="center" colspan="2"><a href="' . getlink('Shoutblock') . '">' . _SSHOUTHISTORY . '</a><br />';
    if ($conf['delyourlastpost'] && !is_user()) {
        $content .= 'Name: <input type="text" name="uid" size="10" maxlength="30" /><br />';
    }
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:block-ShoutBlock.php

示例11: NewDownloadsDate

function NewDownloadsDate()
{
    global $downloadsprefix, $db, $module_name;
    $selectdate = intval($_GET['selectdate']);
    $dateDB = date("d-M-Y", $selectdate);
    $dateView = date("F d, Y", $selectdate);
    include "header.php";
    downl_menu_tpl(1);
    echo '<br />';
    OpenTable();
    $newdownloadDB = Date("Y-m-d", $selectdate);
    $totaldownloads = $db->sql_numrows($db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%'"));
    echo "<font class=\"option\"><b>{$dateView} - {$totaldownloads} " . _NEWDOWNLOADS . "</b></font>" . "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">";
    $sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%' ORDER BY title ASC";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $lid = $row['lid'];
        $cid = $row['cid'];
        $title = $row['title'];
        $description = $row['description'];
        $time = $row['date'];
        $hits = $row['hits'];
        $url = $row['url'];
        $downloadratingsummary = $row['downloadratingsummary'];
        $totalvotes = $row['totalvotes'];
        $totalcomments = $row['totalcomments'];
        $filesize = $row['filesize'];
        $version = $row['version'];
        $homepage = $row['homepage'];
        $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
        if (can_admin('downloads')) {
            if (eregi("http", $url)) {
                echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&amp;lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
            } else {
                echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&amp;lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
            }
        } else {
            if (eregi("http", $url)) {
                echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
            } else {
                echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
            }
        }
        echo "&nbsp;<a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\" class=\"title\">{$title}</a>";
        $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
        newdownloadgraphic($datetime);
        popgraphic($hits);
        detecteditorial($lid, 1);
        echo "<br /><b>" . _DESCRIPTION . ":</b> {$description}<br />";
        echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
        echo "<b>" . _ADDEDON . ":</b> <b>{$datetime}</b> <b>" . _UDOWNLOADS . ":</b> {$hits}";
        $transfertitle = str_replace(" ", "_", $title);
        /* voting & comments stats */
        $votestring = $totalvotes == 1 ? _VOTE : _VOTES;
        if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
            echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
        }
        echo '<br />';
        $sql2 = "SELECT title FROM " . $downloadsprefix . "_categories WHERE cid='{$cid}'";
        $result2 = $db->sql_query($sql2);
        $row2 = $db->sql_fetchrow($result2);
        $ctitle = $row2[title];
        $ctitle = getparent($cid, $ctitle);
        echo "<B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\">{$ctitle}</A><br />";
        if ($homepage != "") {
            echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | ";
        }
        echo "<a href=\"" . getlink("&amp;d_op=ratedownload&amp;lid={$lid}") . "\">" . _RATERESOURCE . "</a>";
        if (is_user()) {
            echo " | <a href=\"" . getlink("&amp;d_op=brokendownload&amp;lid={$lid}") . "\">" . _REPORTBROKEN . "</a>";
        }
        echo " | <a href=\"" . getlink("&amp;d_op=viewdownloaddetails&amp;lid={$lid}") . "\">" . _DETAILS . "</a>";
        if ($totalcomments != 0) {
            echo " | <a href=\"" . getlink("&amp;d_op=viewdownloadcomments&amp;lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>";
        }
        detecteditorial($lid, 0);
        echo "<br /><br />";
    }
    echo "</font></td></tr></table>";
    CloseTable();
    include "footer.php";
}
开发者ID:cbsistem,项目名称:nexos,代码行数:82,代码来源:new.php

示例12: PageUrl2

   }
   #   $listingelement = '<!--'.$msg['id'].'-->'.stripslashes($messagedata["campaigntitle"]);
   if ($msg['status'] == 'draft') {
       $editlink = PageUrl2('send&id=' . $msg['id']);
   }
   $ls->addElement($listingelement, $editlink);
   $ls->setClass($listingelement, 'row1');
   $uniqueviews = Sql_Fetch_Row_Query("select count(userid) from {$tables['usermessage']} where viewed is not null and status = 'sent' and messageid = " . $msg['id']);
   $clicks = Sql_Fetch_Row_Query("select sum(clicked) from {$tables['linktrack_ml']} where messageid = " . $msg['id']);
   #    $clicks = array(0);
   /*
               foreach ($messagedata as $key => $val) {
                 $ls->addColumn($listingelement,$key,$val);
               }
   */
   $ls->addColumn($listingelement, $GLOBALS['I18N']->get('Entered'), formatDateTime($msg['entered']));
   $_GET['id'] = $msg['id'];
   $statusdiv = '<div id="messagestatus' . $msg['id'] . '">';
   include 'actions/msgstatus.php';
   $statusdiv .= $status;
   $statusdiv .= '</div>';
   $GLOBALS['pagefooter']['statusupdate' . $msg['id']] = '<script type="text/javascript">
 updateMessages.push(' . $msg['id'] . ');</script>';
   $GLOBALS['pagefooter']['statusupdate'] = '<script type="text/javascript">window.setInterval("messagesStatusUpdate()",5000);</script>';
   if ($msg['status'] == 'sent') {
       $statusdiv = $GLOBALS['I18N']->get('Sent') . ': ' . $msg['sent'];
   }
   $ls->addColumn($listingelement, $GLOBALS['I18N']->get('Status'), $statusdiv);
   if ($msg['status'] != 'draft') {
       #    $ls->addColumn($listingelement,$GLOBALS['I18N']->get("total"), $msg['astext'] + $msg['ashtml'] + $msg['astextandhtml'] + $msg['aspdf'] + $msg['astextandpdf']);
       #    $ls->addColumn($listingelement,$GLOBALS['I18N']->get("text"), $msg['astext']);
开发者ID:gillima,项目名称:phplist3,代码行数:31,代码来源:messages.php

示例13: replaceDates

/**
 * @param $string
 * @param string $tag
 * @param string $format
 * @param null $timezone
 * @return mixed
 */
function replaceDates($string, $tag = '%%', $format = DATE_W3C, $timezone = null)
{
    return preg_replace_callback('/' . preg_quote($tag) . '(.*?)' . preg_quote($tag) . '/', function ($matches) use($format, $timezone) {
        return formatDateTime($matches[1], $format, $timezone);
    }, $string);
}
开发者ID:keboola,项目名称:php-utils,代码行数:13,代码来源:replaceDates.php

示例14: date_default_timezone_set

date_default_timezone_set('UTC');
include 'functions.php';
include 'credentials.php';
$pass = $_POST['pass'];
if ($pass != APPPASSWORD) {
    die('Password Incorrect');
}
include 'db_connect.php';
$id = $_POST['id'];
$heading = $_POST['heading'];
$entry = $_POST['entry'];
$entrycontent = $_POST['entrycontent'];
$now = $_POST['now'];
$seconds = $now;
$query = "SELECT * from entries WHERE id=" . $id;
$res = $con->query($query);
$row = mysqli_fetch_array($res, MYSQLI_ASSOC);
// die(date("Y-m-d H:i:s", $seconds));
$handle = fopen("entries/" . $id . ".entry", 'w+') or die("Unable to open file!");
$str = fread($handle, filesize($id . ".entry"));
if (htmlspecialchars($heading, ENT_QUOTES) == $row['heading'] && $entry == $str) {
    die('Last Updated ' . formatDateTime(strtotime($row['updated'])));
}
fwrite($handle, $entry) or die("Unable to write to file!");
fclose($handle);
$query = "UPDATE entries SET heading = '" . htmlspecialchars($heading, ENT_QUOTES) . "', entry = '" . htmlspecialchars($entrycontent, ENT_QUOTES) . "', created = created, updated = '" . date("Y-m-d H:i:s", $seconds) . "' WHERE id=" . $id;
if ($con->query($query)) {
    echo die('Last Updated ' . formatDateTime(strtotime(date("Y-m-d H:i:s", $seconds))));
} else {
    echo mysqli_error($con);
}
开发者ID:scottk2112,项目名称:SleekArchive,代码行数:31,代码来源:updatenote.php

示例15: formatDateTime

                                            </tr>
                                        </thead>
                                        <tbody>
<?php 
function formatDateTime($dt)
{
    return $dt->format('j-M-Y') . "<br/>" . $dt->format('g:iA');
}
foreach ($soldiers as $s) {
    $userid = $s->id;
    $name = $s->name;
    $email = $s->email;
    $phone = $s->phone;
    $notes = $s->notes;
    $joindate = formatDateTime($s->joindate);
    $updatedate = formatDateTime($s->updatedate);
    $notesclass = '';
    if (!is_null($notes)) {
        $notes = htmlentities($notes);
        $notesclass = 'hasnotes';
    }
    $notgivenhtml = '';
    foreach ($s->stops_notgiven as $st) {
        $notgivenhtml .= getStopHtml($st, 'not-given');
    }
    $givenhtml = '';
    foreach ($s->stops_given as $st) {
        $givenhtml .= getStopHtml($st, 'no-tasks');
    }
    echo <<<SOLDIER_ROW
                                            <tr data-userid='{$userid}'>
开发者ID:jrharshath,项目名称:martaarmy_barracks,代码行数:31,代码来源:index.php


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