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


PHP global_common::getDateTime方法代码示例

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


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

示例1: writeLogRequest

 /**
  * Ghi full request vao file
  *
  * @return int 1: thanh cong; 0: that bai
  *
  */
 public function writeLogRequest($type = 1)
 {
     // Duoc goi tu crontab nen khong co tham so can thiet va khong can ghi lai
     if (empty($_SERVER['REQUEST_URI'])) {
         return;
     }
     // Get all value of POST (neu dang thuc thi bang POST)
     $postValues = '';
     if ($_SERVER['REQUEST_METHOD'] != 'GET') {
         foreach ($_POST as $var => $value) {
             $postValues .= "&{$var}={$value}";
         }
         if (!empty($postValues)) {
             $postValues = "({$postValues})";
         }
     }
     // Tao noi dung de ghi file
     $strContent = "[" . global_common::getDateTime() . "]\t";
     $strContent .= global_common::getClientIP() . "\t";
     $strContent .= session_id() . "\t";
     // "CUSER_INFO" va "SES_AUTHENTICATED" ko duoc goi tu trong global_common va admin_global_common
     $strContent .= ($type == 1 ? $_SESSION['CUSER_INFO']['user_id'] : $_SESSION['SES_AUTHENTICATED']['user_id']) . "\t";
     $strContent .= $_SERVER['REQUEST_METHOD'] . "\t";
     $strContent .= $_SERVER['REQUEST_URI'] . "{$postValues}\n";
     // File name
     $suffix = global_common::getTableSuffixByMonth(global_common::buildIDByMonth(1, global_common::getDateTime()));
     if ($type == 1) {
         $fileName = global_common::FOLDER_LOG . 'request_front_end' . $suffix . '.log';
     } else {
         $fileName = global_common::FOLDER_LOG . 'request_back_end' . $suffix . '.log';
     }
     // Ghi va tra ve ket qua
     return self::writeFileAppend($fileName, $strContent);
 }
开发者ID:roni5,项目名称:sela,代码行数:40,代码来源:application.php

示例2: insert

 public function insert($prefix, $title, $filename, $articletype, $content, $notificationtype, $tags, $catalogueid, $sectionid, $numview, $numcomment, $createdby, $createddate, $modifiedby, $modifieddate, $deletedby, $deleteddate, $isdeleted, $status)
 {
     //$intID = global_common::getMaxID(self::TBL_SL_ARTICLE);
     $date = global_common::getDateTime();
     $intID = global_common::buildIDByMonth(global_common::getMaxID(Model_Article::TBL_SL_ARTICLE), $date, Model_Article::TABLE_BY_MONTHS_ARTICLE);
     $strTableName = global_common::builtTableName(Model_Article::TBL_SL_ARTICLE, global_common::getTableSuffixByMonth($intID));
     $strSQL = global_common::prepareQuery(self::SQL_INSERT_SL_ARTICLE, array($strTableName, $intID, global_common::escape_mysql_string($prefix), global_common::escape_mysql_string($title), global_common::escape_mysql_string($filename), global_common::escape_mysql_string($articletype), global_common::escape_mysql_string($content), global_common::escape_mysql_string($notificationtype), global_common::escape_mysql_string($tags), global_common::escape_mysql_string($catalogueid), global_common::escape_mysql_string($sectionid), global_common::escape_mysql_string($numview), global_common::escape_mysql_string($numcomment), global_common::escape_mysql_string($createdby), global_common::escape_mysql_string($createddate), global_common::escape_mysql_string($modifiedby), global_common::escape_mysql_string($modifieddate), global_common::escape_mysql_string($deletedby), global_common::escape_mysql_string($deleteddate), global_common::escape_mysql_string($isdeleted), global_common::escape_mysql_string($status)));
     if (!global_common::ExecutequeryWithCheckExistedTable($strSQL, self::SQL_CREATE_TABLE_SL_ARTICLE, $this->_objConnection, $strTableName)) {
         //echo $strSQL;
         global_common::writeLog('Error add sl_article:' . $strSQL, 1);
         return false;
     } else {
         $arrResult = global_common::updateContents($this->_objConnection, $articletype, $intID, global_common::ARTICLE_TYPE);
         if (!$arrResult) {
             global_common::writeLog('sp_update_content_summary: ' . $strSQL, 1);
         }
     }
     return $intID;
 }
开发者ID:roni5,项目名称:sela,代码行数:19,代码来源:model_article.php

示例3: insert

 public function insert($commenttype, $articleid, $content)
 {
     $date = global_common::getDateTime();
     $intID = global_common::buildIDByMonth(global_common::getMaxID(self::TBL_SL_COMMENT), $date, Model_Comment::TABLE_BY_MONTHS_COMMENT);
     //echo 'Comment id:'.$intID;
     //$intID = global_common::getMaxID(self::TBL_SL_COMMENT);
     // lấy tên table c_comment_detail_ để lưu thông tin comment
     $strTableName = global_common::builtTableName(Model_Comment::TBL_SL_COMMENT, global_common::getTableSuffixByMonth($intID));
     //$strTableName = self::TBL_SL_COMMENT;
     $strSQL = global_common::prepareQuery(Model_Comment::SQL_INSERT_SL_COMMENT, array($strTableName, $intID, global_common::escape_mysql_string($commenttype), global_common::escape_mysql_string($articleid), global_common::escape_mysql_string($content), global_common::escape_mysql_string($createdby), global_common::escape_mysql_string($createddate), global_common::escape_mysql_string($modifiedby), global_common::escape_mysql_string($modifieddate), global_common::escape_mysql_string($deletedby), global_common::escape_mysql_string($deleteddate), global_common::escape_mysql_string($isdeleted), global_common::escape_mysql_string($status)));
     //echo $strSQL;
     if (!global_common::ExecutequeryWithCheckExistedTable($strSQL, Model_Comment::SQL_CREATE_TABLE_SL_COMMENT, $this->_objConnection, $strTableName)) {
         global_common::writeLog('Error add sl_comment:' . $strSQL, 1);
         return false;
     } else {
         $arrResult = global_common::updateContents($this->_objConnection, $articleid, $intID, global_common::COMMENT_TYPE);
         if (!$arrResult) {
             global_common::writeLog('sp_update_content_summary: ' . $strSQL, 1);
         }
     }
     return $intID;
 }
开发者ID:roni5,项目名称:sela,代码行数:22,代码来源:model_comment.php


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