• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP formatDateTime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: endtimelog_ALL

function endtimelog_ALL(Web &$w)
{
    // get time log
    $log = $w->Task->getTimeLogEntry($_REQUEST['logid']);
    // get the task
    $task = $w->Task->getTask($_REQUEST["taskid"]);
    $tasktitle = $task->title;
    if ($log) {
        // set log end. used in comment
        $log->dt_end = date("Y-m-d G:i");
        // set comment
        $comment = "Time Log Entry: " . $w->Task->getUserById($log->user_id) . " - " . formatDateTime($log->dt_start) . " to " . formatDateTime($log->dt_end);
        if ($_REQUEST['comments'] != "") {
            $comment .= " - Comments: " . htmlspecialchars($_REQUEST['comments']);
        }
        // add comment
        $comm = new TaskComment($w);
        $comm->obj_table = $task->getDbTableName();
        $comm->obj_id = $_REQUEST["taskid"];
        $comm->comment = $comment;
        $comm->insert();
        // add to context for notifications post listener
        $w->ctx("TaskComment", $comm);
        $w->ctx("TaskEvent", "time_log");
        // update time log entry
        $log->dt_end = date("Y-m-d G:i");
        $log->comment_id = $comm->id;
        $log->update();
    }
    // if 'Save Comment' display current entry and restart time log
    if ($_REQUEST['restart'] == "yes") {
        // create page
        $html = "<html><head><title>Task Time Log - " . $task->title . "</title>" . "<style type=\"text/css\">" . "body { background-color: #8ad228; }" . "td { background-color: #ffffff; color: #000000; font-family: verdana, arial; font-weight: bold; font-size: .8em; }" . "td.startend { background-color: #d2efab; color: #000000; font-family: verdana, arial; font-weight: bold; font-size: .9em; }" . "td.timelog { background-color: #75ba4d; color: #000000; font-family: verdana, arial; font-weight: bold; font-size: .9em; }" . "td.tasktitle { background-color: #9fea72; color: #000000; font-family: verdana, arial; font-weight: bold; font-size: .8em; }" . "a { text-decoration: none; } " . "a:hover { color: #ffffff; } " . "</style>" . "<script language=\"javascript\">" . "function reStart() {" . "\tlocation.href = \"/task/starttimelog/" . $_REQUEST["taskid"] . "\";" . "}" . "var c = setTimeout('reStart()',2000);" . "</script></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>" . "<table cellpadding=2 cellspacing=2 border=0 width=100%>" . "<tr align=center><td colspan=2 class=timelog>Task Time Log</td></tr>" . "<tr align=center><td colspan=2 class=tasktitle><a title=\"View Task\" href=\"javascript: goTask();\">" . $tasktitle . "</a></td></tr>" . "<tr align=center><td width=50% class=startend>Start</td><td width=50% class=startend>Stop</td></tr>" . "<tr align=center><td>" . date("g:i a", $log->dt_start) . "</td><td>" . date("g:i a", strtotime($log->dt_end)) . "</td></tr>" . "<tr align=center><td colspan=2 class=timelog>&nbsp;</td></tr>" . "<tr><td colspan=2 class=startend>Comments</td></tr>" . "<tr><td colspan=2>" . str_replace("\n", "<br>", $_POST['comments']) . "</td></tr>" . "</table>" . "</body></html>";
    } else {
        $html = "<html><head>" . "<script language=\"javascript\">" . "self.close();" . "</script></head></html>";
    }
    // output page
    $w->setLayout(null);
    $w->out($html);
}
开发者ID:itillawarra,项目名称:cmfive,代码行数:40,代码来源:task.actions.php


示例17: max

    max(um.viewed) as lastview, count(um.viewed) as viewcount,
    abs(unix_timestamp(um.entered) - unix_timestamp(um.viewed)) as responsetime
    from %s um, %s user, %s msg where um.messageid = %d and um.messageid = msg.id and um.userid = user.id and um.status = "sent" and um.viewed is not null %s
    group by userid %s', $GLOBALS['tables']['usermessage'], $GLOBALS['tables']['user'], $GLOBALS['tables']['message'], $id, $subselect, $limit));
$summary = array();
while ($row = Sql_Fetch_Array($req)) {
    if ($download) {
        ## with download, the 50 per page limit is not there.
        set_time_limit(60);
        $element = $row['email'];
    } else {
        $element = shortenTextDisplay($row['email'], 15);
    }
    $ls->addElement($element, PageUrl2('userhistory&amp;id=' . $row['userid']));
    $ls->setClass($element, 'row1');
    $ls->addRow($element, '<div class="listingsmall gray">' . $GLOBALS['I18N']->get('sent') . ': ' . formatDateTime($row['sent'], 1) . '</div>', '');
    if ($row['viewcount'] > 1) {
        $ls->addColumn($element, $GLOBALS['I18N']->get('firstview'), formatDateTime($row['firstview'], 1));
        $ls->addColumn($element, $GLOBALS['I18N']->get('lastview'), formatDateTime($row['lastview']));
        $ls->addColumn($element, $GLOBALS['I18N']->get('views'), $row['viewcount']);
    } else {
        $ls->addColumn($element, $GLOBALS['I18N']->get('firstview'), formatDateTime($row['firstview'], 1));
        $ls->addColumn($element, $GLOBALS['I18N']->get('responsetime'), secs2time($row['responsetime']));
    }
}
if ($download) {
    ob_end_clean();
    print $ls->tabDelimited();
} else {
    print $ls->display();
}
开发者ID:byronjumbo,项目名称:phplist3,代码行数:31,代码来源:mviews.php


示例18: parseHistory

*/
if ($_POST['action'] == 'history') {
    $return = ['status' => 'success', 'html' => ''];
    $limit = (int) $_POST['limit'];
    //cast as int because we can't use a placeholder for LIMIT
    $limit = $limit < 0 || $limit > 10000 ? 10000 : $limit;
    $sth = $dbh->prepare('SELECT *
			FROM changes
			WHERE type = :type AND id = :id
			ORDER BY changeTime DESC
			LIMIT ' . $limit);
    $sth->execute([':type' => $_POST['type'], ':id' => $_POST['id']]);
    $result = $sth->fetchAll();
    $parsed = parseHistory($_POST['type'], $result);
    foreach ($parsed as $row) {
        $return['html'] .= '<tr><td data-sort="' . $row['changeTime'] . '">' . formatDateTime($row['changeTime']) . '</td>';
        $return['html'] .= '<td>' . getLinkedName('employee', $row['employeeID']) . '</td>';
        $return['html'] .= '<td>' . $row['data'] . '</td></tr>';
    }
    echo json_encode($return);
}
/*
	Function: addAttachment
	Inputs: 
	Outputs: 
*/
if ($_POST['action'] == 'addAttachment') {
    $return = ['status' => 'fail'];
    if ($_FILES['uploadFile']['error'] == 0) {
        $pos = strrpos($_FILES['uploadFile']['name'], '.');
        $name = $pos !== false ? substr($_FILES['uploadFile']['name'], 0, $pos) : $_FILES['uploadFile']['name'];
开发者ID:jewelhuq,项目名称:erp,代码行数:31,代码来源:ajax.php


示例19: ON

                $db->sql_freeresult($result_a);
            }
            $sql = 'SELECT s.*, sc.title AS cattitle, t.topicimage, t.topictext FROM ' . $prefix . '_stories AS s
	LEFT JOIN ' . $prefix . '_stories_cat AS sc ON (sc.catid=s.catid)
	LEFT JOIN ' . $prefix . '_topics t ON t.topicid=s.topic WHERE ';
            $sql .= $catid > 0 ? "s.catid='{$catid}' {$querylang} ORDER BY" : "{$qdb} {$querylang} ORDER BY display_order DESC,";
            $result = $db->sql_query($sql . ' sid DESC LIMIT ' . $storynum . ' OFFSET ' . $offset);
            //	$sql .= ($catid > 0) ?  "s.catid='$catid' $querylang ORDER BY sid DESC" : "$qdb $querylang ORDER BY display_order DESC, time DESC";
            //	$result = $db->sql_query($sql.' LIMIT '.$storynum.' OFFSET 0');
            require_once 'includes/nbbcode.php';
            while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) {
                $title = $row['title'];
                $row['hometext'] = decode_bb_all($row['hometext'], 1, true);
                $morecount = strlen($row['bodytext']);
                $comments = $row['comments'];
                $datetime = formatDateTime($row['time'], _DATESTRING);
                $story_link = '<a href="' . URL::index('News&amp;file=article&amp;sid=' . $row['sid']) . '">';
                $morelink = $commentlink = $catlink = '';
                if ($morecount > 0 || $comments > 0) {
                    $morelink .= $story_link . '<b>' . _READMORE . '</b></a>';
                    if ($morecount > 0) {
                        $morelink .= ' (' . filesize_to_human($morecount) . ') | ';
                    } else {
                        $morelink .= ' | ';
                    }
                }
                if ($row['acomm']) {
                    if ($comments == 0) {
                        $commentlink = $story_link . _COMMENTSQ . '</a> | ';
                    } elseif ($comments == 1) {
                        $commentlink = $story_link . $comments . ' ' . _COMMENT . '</a> | ';
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:index.php


示例20: formatDateTime

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP formatDuit函数代码示例发布时间:2022-05-15
下一篇:
PHP formatDate2STD函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap