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


PHP Format::date方法代码示例

本文整理汇总了PHP中Format::date方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::date方法的具体用法?PHP Format::date怎么用?PHP Format::date使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Format的用法示例。


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

示例1: presenceTask

 public function presenceTask()
 {
     require_once _base_ . '/lib/lib.form.php';
     YuiLib::load();
     $user_date = $this->model->getUserDateForCourse(getLogUserId(), $_SESSION['idCourse']);
     $date_info = $this->model->getDateInfoForPublicPresence($user_date);
     if ($this->id_date == 0) {
         $this->id_date = isset($date_info[0]['id_date']) ? $date_info[0]['id_date'] : 0;
     }
     $this->model->setIdDate($this->id_date);
     if (isset($_POST['save'])) {
         $this->model->savePresence();
     }
     foreach ($date_info as $info_date) {
         $date_for_dropdown[$info_date['id_date']] = $info_date['code'] . ' - ' . $info_date['name'] . ' (' . Format::date($info_date['date_begin'], 'date') . ')';
     }
     if ($this->id_date == 0) {
         $this->render('presence_empty', array());
     } else {
         $params = array();
         $params['model'] = $this->model;
         $params['dropdown'] = $date_for_dropdown;
         $params['tb'] = $this->model->getPresenceTable();
         $params['test_type'] = $this->model->getTestType();
         $params['date_for_dropdown'] = $date_for_dropdown;
         $this->render('presence', $params);
     }
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:28,代码来源:PresenceLmsController.php

示例2: getSubstitution

 function getSubstitution()
 {
     $subs = array();
     $subs['[today]'] = Format::date(date("Y-m-d H:i:s"), 'date');
     $subs['[year]'] = date("Y");
     return $subs;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:7,代码来源:certificate.misc.php

示例3: gettimeperiodslistTask

 public function gettimeperiodslistTask()
 {
     //read input data (table parameters and filter)
     $startIndex = Get::req('startIndex', DOTY_INT, 0);
     $results = Get::req('results', DOTY_INT, Get::sett('visuItem'));
     $rowsPerPage = Get::req('rowsPerPage', DOTY_INT, $results);
     $sort = Get::req('sort', DOTY_STRING, "");
     $dir = Get::req('dir', DOTY_STRING, "asc");
     $filter_text = Get::req('filter_text', DOTY_STRING, '');
     $searchFilter = array('text' => $filter_text);
     //calculate total records to display
     $total = $this->model->getTimePeriodsTotal($searchFilter);
     if ($startIndex >= $total) {
         if ($total < $results) {
             $startIndex = 0;
         } else {
             $startIndex = $total - $results;
         }
     }
     //get records from DB and format data
     $list = $this->model->getTimePeriodsList($startIndex, $results, $sort, $dir, $searchFilter);
     $output_records = array();
     if (is_array($list) && count($list) > 0) {
         foreach ($list as $record) {
             $output_records[] = array('id' => (int) $record->id_period, 'title' => Layout::highlight($record->title, $filter_text), 'label' => Layout::highlight($record->label, $filter_text), 'start_date' => Format::date($record->start_date, "date"), 'end_date' => Format::date($record->end_date, "date"), 'mod' => 'ajax.adm_server.php?r=alms/timeperiods/mod&id=' . (int) $record->id_period, 'del' => 'ajax.adm_server.php?r=alms/timeperiods/del&id=' . (int) $record->id_period);
         }
     }
     //prepare the output for the datatable
     $output = array('totalRecords' => $total, 'startIndex' => $startIndex, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $rowsPerPage, 'results' => count($output_records), 'records' => $output_records);
     echo $this->json->encode($output);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:31,代码来源:TimeperiodsAlmsController.php

示例4: getTransaction

 public function getTransaction($start_index, $results, $sort, $dir, $filter = false)
 {
     $query = "SELECT t.id_trans, t.date_creation, t.date_activated, t.paid, SUM(ti.price) as price, u.userid, u.firstname, u.lastname" . " FROM %adm_transaction as t" . " JOIN %adm_transaction_info as ti ON t.id_trans = ti.id_trans" . " JOIN %adm_user as u ON t.id_user = u.idst" . " WHERE 1";
     $query .= " GROUP BY t.id_trans";
     switch ($sort) {
         case 'userid':
             $query .= " ORDER BY u.userid " . $dir;
             break;
         case 'firstname':
             $query .= " ORDER BY u.firstname " . $dir;
             break;
         case 'lastname':
             $query .= " ORDER BY u.lastname " . $dir;
             break;
         case 'date_creation':
             $query .= " ORDER BY t.date_creation " . $dir;
             break;
         case 'date_activated':
             $query .= " ORDER BY t.date_activated " . $dir;
             break;
     }
     $start_index === false ? '' : ($query .= " LIMIT " . $start_index . ", " . $results);
     $result = sql_query($query);
     $res = array();
     while ($row = sql_fetch_assoc($result)) {
         $row['userid'] = $this->acl_man->relativeId($row['userid']);
         $row['date_creation'] = Format::date($row['date_creation'], 'datetime');
         $row['date_activated'] = Format::date($row['date_activated'], 'datetime');
         $row['paid'] = $row['paid'] == 1 ? Get::img('standard/status_active.png', Lang::t('_ACTIVATED', 'transaction')) : Get::img('standard/status_deactive.png', Lang::t('_NOT_ACTIVATED', 'transaction'));
         $row['edit'] = '<a href="index.php?r=alms/transaction/mod&amp;id_trans=' . $row['id_trans'] . '" title="' . Lang::t('_MOD', 'transaction') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'transaction')) . '</a>';
         $res[] = $row;
     }
     return $res;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:34,代码来源:TransactionAlms.php

示例5: displaynotes

 function displaynotes()
 {
     checkPerm('view');
     require_once _base_ . '/lib/lib.table.php';
     $lang =& DoceboLanguage::createInstance('notes', 'lms');
     list($data, $title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT data,title,textof \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\tWHERE idNotes='" . $_GET['idNotes'] . "' AND owner ='" . getLogUserid() . "' and idCourse='" . $_SESSION['idCourse'] . "'"));
     $page_title = array('index.php?modname=notes&amp;op=notes' => $lang->def('_NOTES'), $title);
     $GLOBALS['page']->add(getTitleArea($page_title, 'notes') . '<div class="std_block">' . getBackUi('index.php?modname=notes&amp;op=notes', $lang->def('_BACK')) . '<h2>' . $title . '</h2>' . '<div class="boxinfo_container">' . Format::date($data) . '<br /><br />' . '<b>' . $lang->def('_TEXTOF') . '</b><br />' . $textof . '</div>' . getBackUi('index.php?modname=notes&amp;op=notes', $lang->def('_BACK')) . '</div>', 'content');
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:9,代码来源:notes.php

示例6: setDefaultLogName

 public static function setDefaultLogName($addName = '', $logKey = 'default', $runFileName = '')
 {
     if (empty($addName)) {
         $fileName = DIR_LOG . Format::date() . $addName . '.log';
     } else {
         $fileName = DIR_LOG . $addName . '.log';
     }
     FileSystem::createDirectory(DIR_LOG);
     self::$_fileNames[$logKey] = $fileName;
     self::$_runFileName = $runFileName;
 }
开发者ID:binocchi,项目名称:my_snippet,代码行数:11,代码来源:Logger.php

示例7: export

 function export($value)
 {
     $config = $this->getConfiguration();
     if (!$value) {
         return '';
     } elseif ($config['gmt']) {
         return Format::userdate('Y-m-d H:i:s', $value);
     } else {
         return Format::date('Y-m-d H:i:s', $value);
     }
 }
开发者ID:iHunt101,项目名称:phlite,代码行数:11,代码来源:DatetimeField.php

示例8: reportList

function reportList()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.table.php';
    $lang =& DoceboLanguage::createInstance('report', 'framework');
    $_SESSION['report_tempdata'] = array();
    $can_mod = checkPerm('mod', true);
    $acl_man = Docebo::aclm();
    $public_admin_mod = true;
    $query = "SELECT t1.*, t2.userid \r\n\tFROM %lms_report_filter as t1 \r\n\t\tLEFT JOIN %adm_user as t2 ON t1.author=t2.idst\r\n\tWHERE t1.is_public = 1 OR t1.author = " . Docebo::user()->getId();
    $tb = new Table();
    $tb->initNavBar('ini', 'button');
    $col_type = array('', 'align_center', 'align_center', 'image');
    $col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR', 'report', 'framework'), $lang->def('_CREATION_DATE'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS') . '" title="' . $lang->def('REPORT_SHOW_RESULTS') . '" />');
    if ($public_admin_mod && $can_mod) {
        $col_type[] = 'image';
        $col_content[] = '<img src="' . getPathImage() . 'standard/edit.png"  alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>';
        $col_type[] = 'image';
        $col_content[] = '<img src="' . getPathImage() . 'standard/delete.png"  alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '"/>';
    }
    $tb->setColsStyle($col_type);
    $tb->addHead($col_content);
    $res = sql_query($query);
    if ($res) {
        while ($row = sql_fetch_assoc($res)) {
            $id = $row['id_filter'];
            $opn_link = '<a href="index.php?modname=public_report_admin&amp;op=view_report&amp;idrep=' . $id . '" ' . ' title="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '" />' . '</a>';
            $tb_content = array($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'], $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), Format::date($row['creation_date']), $opn_link);
            if ($public_admin_mod && $can_mod) {
                if ($row['author'] == Docebo::user()->getId()) {
                    $tb_content[] = '<a href="index.php?modname=public_report_admin&amp;op=modify_name&amp;modid=' . $id . '" ' . ' title="' . $lang->def('_MOD', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'report', 'framework') . '" />' . '</a>';
                } else {
                    $tb_content[] = '';
                }
                if ($row['author'] == Docebo::user()->getId()) {
                    $tb_content[] = '<a href="index.php?modname=public_report_admin&amp;op=del_public_report&amp;idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'report', 'framework') . '" />' . '</a>';
                } else {
                    $tb_content[] = '';
                }
            }
            $tb->addBody($tb_content);
        }
    }
    require_once _base_ . '/lib/lib.dialog.php';
    setupHrefDialogBox('a[href*=del_public_report]');
    if ($public_admin_mod && $can_mod) {
        $tb->addActionAdd('<a href="index.php?modname=public_report_admin&amp;op=create_name">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>');
    }
    cout(getTitleArea($lang->def('_REPORT')) . '<div class="std_block">' . $tb->getTable() . '</div>', 'content');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:50,代码来源:public_report_admin.php

示例9: news

 /**
  * The news link for the home pages
  * @return <html>
  */
 public static function news($hnumber = 2)
 {
     $html = '<div id="news">';
     $textQuery = "\r\n\t\tSELECT idNews, publish_date, title, short_desc\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_news\r\n\t\tWHERE language = '" . getLanguage() . "'\r\n\t\tORDER BY important DESC, publish_date DESC\r\n\t\tLIMIT 0," . Get::sett('visuNewsHomePage');
     //do query
     $result = sql_query($textQuery);
     if (sql_num_rows($hnumber)) {
         $html .= '<p>' . Lang::set('_NO_CONTENT', 'login') . '</p>';
     }
     while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) {
         $html .= '<h' . $hnumber . '>' . '<a href="index.php?modname=login&amp;op=readnews&amp;idNews=' . $idNews . '">' . $title . '</a>' . '</h' . $hnumber . '>' . '<p class="news_textof">' . '<span class="news_data">' . Format::date($publish_date) . ' - </span>' . $short_desc . '</p>';
     }
     $html .= '</div>';
     return $html;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:19,代码来源:lib.loginlayout.php

示例10: loadNewsBlock

function loadNewsBlock()
{
    $lang = DoceboLanguage::createInstance('login');
    $textQuery = "\r\n\tSELECT idNews, publish_date, title, short_desc \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_news \r\n\tWHERE language = '" . getLanguage() . "'\r\n\tORDER BY important DESC, publish_date DESC";
    $result = sql_query($textQuery);
    $html = '<div class="home_news_block">' . '<h1>' . $lang->def('_NEWS') . '</h1>';
    while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) {
        $html .= '<h2>' . '<a href="index.php?modname=login&amp;op=readnews&amp;idNews=' . $idNews . '">' . $title . '</a></h2>' . '<p><span class="news_data">' . $lang->def('_DATE') . ' ' . Format::date($publish_date, 'date') . ': </span>' . $short_desc . '</p>';
    }
    if (mysql_num_rows($result) == 0) {
        $html .= $lang->def('_NO_CONTENT');
    }
    $html .= '</div>';
    return $html;
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:15,代码来源:menu_login.php

示例11: public_get_one

 public function public_get_one()
 {
     $total = $this->comment_check_db->count();
     $comment_check_data = $this->comment_check_db->order('id desc')->limit('19,1')->select();
     $comment_check_data = $comment_check_data[0];
     $r = array();
     if (is_array($comment_check_data) && !empty($comment_check_data)) {
         $this->comment_data_db->table_name($comment_check_data['tableid']);
         $r = $this->comment_data_db->getby_id($comment_check_data['comment_data_id']);
         $r['creat_at'] = Format::date($r['creat_at'], 1);
         if (CHARSET == 'gbk') {
             foreach ($r as $k => $v) {
                 $r[$k] = iconv('gbk', 'utf-8', $v);
             }
         }
     }
     echo json_encode(array('total' => $total, 'data' => $r));
 }
开发者ID:hubs,项目名称:yuncms,代码行数:18,代码来源:CheckController.php

示例12: loadNews

function loadNews()
{
    if (Get::sett('visuNewsHomePage') == '0') {
        return;
    }
    if (Get::sett('activeNews') == 'off') {
        return;
    }
    $textQuery = "\r\n\tSELECT idNews, publish_date, title, short_desc\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_news\r\n\tWHERE language = '" . getLanguage() . "'\r\n\tORDER BY important DESC, publish_date DESC\r\n\tLIMIT 0," . Get::sett('visuNewsHomePage');
    $lang = DoceboLanguage::createInstance('login');
    $GLOBALS['page']->add('<li><a href="#home_page">' . $lang->def('_JUMP_TO') . ' : ' . $lang->def('_NEWS') . '</a></li>', 'blind_navigation');
    $GLOBALS['page']->add('<div class="news_block">' . '<h1>' . $lang->def('_NEWS') . '</h1>' . '<div class="news_list">', 'content');
    //do query
    $result = sql_query($textQuery);
    while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) {
        $GLOBALS['page']->add('<h2><a href="index.php?modname=login&amp;op=readnews&amp;idNews=' . $idNews . '">' . $title . '</a></h2>' . '<p class="news_textof">' . '<span class="news_data">' . $lang->def('_DATE') . ' ' . Format::date($publish_date) . ' - </span>' . $short_desc . '</p>', 'content');
    }
    $GLOBALS['page']->add('</div>' . '</div>', 'content');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:19,代码来源:login.php

示例13: mycompetences

function mycompetences(&$url)
{
    checkPerm('view');
    $html = "";
    $html .= getTitleArea(Lang::t('_COMPETENCES'), 'competences');
    $html .= '<div class="std_block">';
    $cmodel = new CompetencesAdm();
    $fmodel = new FunctionalrolesAdm();
    $id_user = getLogUserId();
    $ucomps = $cmodel->getUserCompetences($id_user);
    $rcomps = $fmodel->getUserRequiredCompetences($id_user);
    $ucomps_info = $cmodel->getCompetencesInfo(array_keys($ucomps));
    $language = getLanguage();
    $_typologies = $cmodel->getCompetenceTypologies();
    $_types = $cmodel->getCompetenceTypes();
    $icon_actv = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_COMPETENCE_OBTAINED', 'competences') . '</span></span>';
    $icon_req = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_MANDATORY', 'competences') . '</span></span>';
    //*******************
    require_once _base_ . '/lib/lib.table.php';
    $table = new Table(Get::sett('visuItem'), Lang::t('_COMPETENCES'), Lang::t('_COMPETENCES'));
    $style_h = array('', '', 'image', 'image', 'image', 'image', 'image');
    $label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPOLOGY', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_SCORE', 'competences'), Lang::t('_DATE_LAST_COMPLETE', 'subscribe'), Lang::t('_COMPETENCES_REQUIRED', 'competences'));
    $table->addHead($label_h, $style_h);
    foreach ($ucomps_info as $id_competence => $cinfo) {
        $line = array();
        $line[] = $cinfo->langs[$language]['name'];
        $line[] = $_typologies[$cinfo->typology];
        $line[] = $_types[$cinfo->type];
        $line[] = $cinfo->type == 'score' ? '<b>' . $ucomps[$id_competence]->score_got . '</b>' : $icon_actv;
        $line[] = Format::date($ucomps[$id_competence]->last_assign_date, 'datetime');
        $line[] = array_key_exists($id_competence, $rcomps) ? $icon_req : '';
        $table->addBody($line);
    }
    $html .= $table->getTable();
    $html .= '</div>';
    $html .= Form::openForm('beck_url', 'index.php');
    $html .= Form::openButtonSpace();
    $html .= Form::getButton('close', 'close', Lang::t('_CLOSE', 'standard'));
    $html .= Form::closeButtonSpace();
    $html .= Form::closeform();
    cout($html, 'content');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:42,代码来源:mycompetences.php

示例14: Header

 function Header()
 {
     global $cfg;
     //Common header
     $logo = $this->getLogoFile();
     $this->Image($logo, null, $this->tMargin, 0, 20);
     if (strpos($logo, INCLUDE_DIR) === false) {
         unlink($logo);
     }
     $this->SetFont('Times', 'B', 16);
     $this->SetY($this->tMargin + 20);
     $this->SetX($this->lMargin);
     $this->Cell(0, 0, '', "B", 2, 'L');
     $this->Ln(1);
     $this->SetFont('Arial', 'B', 10);
     $this->Cell(0, 5, $cfg->getTitle(), 0, 0, 'L');
     $this->SetFont('Arial', 'I', 10);
     $this->Cell(0, 5, Format::date($cfg->getDateTimeFormat(), Misc::gmtime(), $_SESSION['TZ_OFFSET'], $_SESSION['TZ_DST']) . ' GMT ' . $_SESSION['TZ_OFFSET'], 0, 1, 'R');
     $this->Ln(5);
 }
开发者ID:pkdevboxy,项目名称:osTicket-1.7,代码行数:20,代码来源:class.pdf.php

示例15: Header

 function Header()
 {
     global $cfg;
     //Common header
     $this->Ln(2);
     $this->SetFont('Times', 'B', 16);
     $this->Image(FPDF_DIR . 'print-logo.png', null, 10, 0, 20);
     $this->SetX(200, 15);
     $this->Cell(0, 15, "Support Ticket System", 0, 1, 'R', 0);
     //$this->SetY(40);
     $this->SetXY(60, 25);
     $this->SetFont('Arial', 'B', 16);
     $this->Cell(0, 3, 'Ticket #' . $this->getTicket()->getExtId(), 0, 2, 'L');
     $this->SetX($this->lMargin);
     $this->Cell(0, 3, '', "B", 2, 'L');
     $this->SetFont('Arial', 'I', 10);
     $this->Cell(0, 5, 'Generated on ' . Format::date($cfg->getDateTimeFormat(), Misc::gmtime(), $_SESSION['TZ_OFFSET'], $_SESSION['TZ_DST']), 0, 0, 'L');
     $this->Cell(0, 5, 'Date & Time based on GMT ' . $_SESSION['TZ_OFFSET'], 0, 1, 'R');
     $this->Ln(10);
 }
开发者ID:nunomartins,项目名称:osTicket-1.7,代码行数:20,代码来源:class.pdf.php


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