本文整理汇总了PHP中DATE函数的典型用法代码示例。如果您正苦于以下问题:PHP DATE函数的具体用法?PHP DATE怎么用?PHP DATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DATE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$this->load->language('module/blog_latest');
$data['heading_title'] = html_entity_decode($this->config->get('blog_latest_title'));
$group_id = $this->customer->getGroupId();
// $cacheKey = 'blog_categories.' . $group_id;
// $category_tree = $this->cache->get($cacheKey);
// if (!$category_tree) {
$this->load->model('blog/category');
$this->load->model('setting/rights');
$posts = $this->model_blog_category->getLatestPosts(array('start' => 0, 'limit' => $this->config->get('blog_latest_post_count')));
$data['posts'] = array();
$this->load->model('tool/image');
foreach ($posts as $post) {
$post = $this->model_blog_category->loadParent($post['ams_page_id'])->toArray();
$post['image'] = $this->model_tool_image->resize($post['featured_image'], 80, 80);
if (!$post['image']) {
$post['image'] = $this->model_tool_image->resize('no_image.jpg', 80, 80);
}
$post['name'] = html_entity_decode($post['name']);
$post['date'] = DATE($this->language->get('post_date_format'), $post['publish_date']);
$post['blurb'] = html_entity_decode($post['blurb']);
$post['href'] = $this->url->link('blog/post', 'ams_page_id=' . $post['id']);
$data['posts'][] = $post;
}
$this->data = $data;
$this->template = 'module/blog_latest.phtml';
return $this->render();
}
示例2: send_file
function send_file($name)
{
OB_END_CLEAN();
$path = $name;
//"../temp/".$name;
if (!IS_FILE($path) or CONNECTION_STATUS() != 0) {
return FALSE;
}
HEADER("Cache-Control: no-store, no-cache, must-revalidate");
HEADER("Cache-Control: post-check=0, pre-check=0", FALSE);
HEADER("Pragma: no-cache");
HEADER("Expires: " . GMDATE("D, d M Y H:i:s", MKTIME(DATE("H") + 2, DATE("i"), DATE("s"), DATE("m"), DATE("d"), DATE("Y"))) . " GMT");
HEADER("Last-Modified: " . GMDATE("D, d M Y H:i:s") . " GMT");
HEADER("Content-Type: application/octet-stream");
HEADER("Content-Length: " . (string) FILESIZE($path));
HEADER("Content-Disposition: inline; filename={$name}");
HEADER("Content-Transfer-Encoding: binary\n");
if ($file = FOPEN($path, 'rb')) {
while (!FEOF($file) and CONNECTION_STATUS() == 0) {
print FREAD($file, 1024 * 8);
FLUSH();
}
FCLOSE($file);
}
return CONNECTION_STATUS() == 0 and !CONNECTION_ABORTED();
}
示例3: display
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$option = JRequest::getCmd('option');
$mypage = JFactory::getDocument();
$mypage->setMetaData("EXPIRES", DATE(DATE_RFC1123, time() + 86400), true);
$mypage->setMetaData("pragma", "no-cache", false);
//get all topics, create select and assign to view
$alltopics = JHTML::_('select.genericlist', $this->get('alltopics'), 'topic', 'style="width: 225px"', $key = 'id', $text = 'topic', JRequest::getString('topic', 'All'));
$this->assignRef('alltopics', $alltopics);
// get types, create select and assign to view
$type = JHTML::_('select.genericlist', $this->get('alltypes'), 'type', 'style="width: 125px"', $key = 'id', $text = 'type', JRequest::getString('type', 'All'));
$this->assignRef('types', $type);
// get dates(years), create select and assign to view
$years = JHTML::_('select.genericlist', $this->get('years'), 'year', 'style="width: 75px"', $key = 'id', $text = 'year', JRequest::getInt('year', 0));
$this->assignRef('years', $years);
$this->assign('query', $this->get('query'));
$this->assignRef('rows', $this->get('data'));
$this->assign('search', JRequest::getString('search', ''));
$this->assignRef('pagination', $this->get('pagination'));
$layout = JRequest::getVar('layout');
if (!$layout) {
JRequest::setVar('layout', 'default');
}
parent::display($tpl);
}
示例4: init
/**
* Page を初期化する.
*
* @return void
*/
function init()
{
parent::init();
$this->tpl_mainpage = 'products/index.tpl';
$this->tpl_mainno = 'products';
$this->tpl_subno = 'index';
$this->tpl_pager = 'pager.tpl';
$this->tpl_maintitle = '商品管理';
$this->tpl_subtitle = '商品マスター';
$masterData = new SC_DB_MasterData_Ex();
$this->arrPageMax = $masterData->getMasterData('mtb_page_max');
$this->arrDISP = $masterData->getMasterData('mtb_disp');
$this->arrSTATUS = $masterData->getMasterData('mtb_status');
$this->arrPRODUCTSTATUS_COLOR = $masterData->getMasterData('mtb_product_status_color');
$objDate = new SC_Date();
// 登録・更新検索開始年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrStartYear = $objDate->getYear();
$this->arrStartMonth = $objDate->getMonth();
$this->arrStartDay = $objDate->getDay();
// 登録・更新検索終了年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrEndYear = $objDate->getYear();
$this->arrEndMonth = $objDate->getMonth();
$this->arrEndDay = $objDate->getDay();
}
示例5: init
/**
* Page を初期化する.
*
* @return void
*/
function init()
{
parent::init();
// GDライブラリのインストール判定
$this->install_GD = function_exists('gd_info') ? true : false;
$this->tpl_mainpage = 'total/index.tpl';
$this->tpl_graphsubtitle = 'total/subtitle.tpl';
$this->tpl_titleimage = ROOT_URLPATH . 'img/title/title_sale.jpg';
$this->tpl_maintitle = $this->tpl_maintitle = t('c_Sales (history)_01');
$this->tpl_mainno = 'total';
$masterData = new SC_DB_MasterData_Ex();
$this->arrWDAY = $masterData->getMasterData('mtb_wday');
$this->arrSex = $masterData->getMasterData('mtb_sex');
$this->arrJob = $masterData->getMasterData('mtb_job');
// 登録・更新日検索用
$objDate = new SC_Date_Ex();
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrYear = $objDate->getYear();
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
// ページタイトル todo あとでなおす
$this->arrTitle[''] = t('c_Sales by period_01');
$this->arrTitle['term'] = t('c_Sales by period_01');
$this->arrTitle['products'] = t('c_Sales by product_01');
$this->arrTitle['age'] = t('c_Sales by age group_01');
$this->arrTitle['job'] = t('c_Sales by occupation_01');
$this->arrTitle['member'] = t('c_Sales by member_01');
// 月度集計のkey名
$this->arrSearchForm1 = array('search_startyear_m', 'search_startmonth_m');
// 期間別集計のkey名
$this->arrSearchForm2 = array('search_startyear', 'search_startmonth', 'search_startday', 'search_endyear', 'search_endmonth', 'search_endday');
}
示例6: init
/**
* Page を初期化する.
*
* @return void
*/
public function init()
{
parent::init();
$this->tpl_mainpage = 'order/index.tpl';
$this->tpl_mainno = 'order';
$this->tpl_subno = 'index';
$this->tpl_pager = 'pager.tpl';
$this->tpl_maintitle = '受注管理';
$this->tpl_subtitle = '受注管理';
$masterData = Application::alias('eccube.db.master_data');
$this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status');
$this->arrORDERSTATUS_COLOR = $masterData->getMasterData('mtb_order_status_color');
$this->arrSex = $masterData->getMasterData('mtb_sex');
$this->arrPageMax = $masterData->getMasterData('mtb_page_max');
/* @var $objDate Date */
$objDate = Application::alias('eccube.date');
// 登録・更新日検索用
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrRegistYear = $objDate->getYear();
// 生年月日検索用
$objDate->setStartYear(BIRTH_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrBirthYear = $objDate->getYear();
// 月日の設定
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
// 支払い方法の取得
$this->arrPayments = Application::alias('eccube.helper.payment')->getIDValueList();
$this->httpCacheControl('nocache');
}
示例7: init
/**
* Page を初期化する.
*
* @return void
*/
public function init()
{
parent::init();
$this->tpl_mainpage = 'customer/index.tpl';
$this->tpl_mainno = 'customer';
$this->tpl_subno = 'index';
$this->tpl_pager = 'pager.tpl';
$this->tpl_maintitle = '会員管理';
$this->tpl_subtitle = '会員マスター';
$masterData = new SC_DB_MasterData_Ex();
$this->arrPref = $masterData->getMasterData('mtb_pref');
$this->arrJob = $masterData->getMasterData('mtb_job');
$this->arrJob['不明'] = '不明';
$this->arrSex = $masterData->getMasterData('mtb_sex');
$this->arrPageMax = $masterData->getMasterData('mtb_page_max');
$this->arrStatus = $masterData->getMasterData('mtb_customer_status');
$this->arrMagazineType = $masterData->getMasterData('mtb_magazine_type');
// 日付プルダウン設定
$objDate = new SC_Date_Ex();
// 登録・更新日検索用
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrRegistYear = $objDate->getYear();
// 生年月日検索用
$objDate->setStartYear(BIRTH_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrBirthYear = $objDate->getYear();
// 月日の設定
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
// カテゴリ一覧設定
$objDb = new SC_Helper_DB_Ex();
$this->arrCatList = $objDb->sfGetCategoryList();
$this->httpCacheControl('nocache');
}
示例8: init
/**
* Page を初期化する.
*
* @return void
*/
function init()
{
parent::init();
$this->tpl_mainpage = 'products/review.tpl';
$this->tpl_mainno = 'products';
$this->tpl_subno = 'review';
$this->tpl_pager = 'pager.tpl';
$this->tpl_maintitle = '商品管理';
$this->tpl_subtitle = 'レビュー管理';
$masterData = new SC_DB_MasterData_Ex();
$this->arrPageMax = $masterData->getMasterData("mtb_page_max");
$this->arrRECOMMEND = $masterData->getMasterData("mtb_recommend");
$this->arrSex = $masterData->getMasterData("mtb_sex");
$objDate = new SC_Date_Ex();
// 登録・更新検索開始年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrStartYear = $objDate->getYear();
$this->arrStartMonth = $objDate->getMonth();
$this->arrStartDay = $objDate->getDay();
// 登録・更新検索終了年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrEndYear = $objDate->getYear();
$this->arrEndMonth = $objDate->getMonth();
$this->arrEndDay = $objDate->getDay();
}
示例9: init
/**
* Page を初期化する.
*
* @return void
*/
function init()
{
parent::init();
$this->tpl_mainpage = 'order/index.tpl';
$this->tpl_mainno = 'order';
$this->tpl_subno = 'index';
$this->tpl_pager = 'pager.tpl';
$this->tpl_maintitle = t('c_Orders_01');
$this->tpl_subtitle = t('c_Order master_01');
$masterData = new SC_DB_MasterData_Ex();
$this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status');
$this->arrORDERSTATUS_COLOR = $masterData->getMasterData('mtb_order_status_color');
$this->arrSex = $masterData->getMasterData('mtb_sex');
$this->arrPageMax = $masterData->getMasterData('mtb_page_max');
$objDate = new SC_Date_Ex();
// 登録・更新日検索用
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrRegistYear = $objDate->getYear();
// 生年月日検索用
$objDate->setStartYear(BIRTH_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrBirthYear = $objDate->getYear();
// 月日の設定
$this->arrMonth = $objDate->getMonth();
$this->arrDay = $objDate->getDay();
// 支払い方法の取得
$this->arrPayments = SC_Helper_DB_Ex::sfGetIDValueList('dtb_payment', 'payment_id', 'payment_method');
$this->httpCacheControl('nocache');
}
示例10: CHECKOUTS
public static function CHECKOUTS($COST, $TAXABLE, $TAX, $USER, $M1, $M1COST, $M2, $M2COST, $PM = '+', $D = '')
{
if ($D == '') {
$D = DATE("Y-m-d");
} else {
$D = EXPLODE(" ", $D);
$D = $D[0];
}
$CASH = 0;
$CHECK = 0;
$AMEX = 0;
$DISCOVER = 0;
$MASTER = 0;
$VISA = 0;
$DEBIT = 0;
if ($M1 == "Cash") {
$CASH += $M1COST;
}
if ($M2 == "Cash") {
$CASH += $M2COST;
}
if ($M1 == "Check") {
$CHECK += $M1COST;
}
if ($M2 == "Check") {
$CHECK += $M2COST;
}
if ($M1 == "American Express") {
$AMEX += $M1COST;
}
if ($M2 == "American Express") {
$AMEX += $M2COST;
}
if ($M1 == "Discover") {
$DISCOVER += $M1COST;
}
if ($M2 == "Discover") {
$DISCOVER += $M2COST;
}
if ($M1 == "MasterCard") {
$MASTER += $M1COST;
}
if ($M2 == "MasterCard") {
$MASTER += $M2COST;
}
if ($M1 == "Visa") {
$VISA += $M1COST;
}
if ($M2 == "Visa") {
$VISA += $M2COST;
}
if ($M1 == "Debit Card") {
$DEBIT += $M1COST;
}
if ($M2 == "Debit Card") {
$DEBIT += $M2COST;
}
$QUERY = "INSERT INTO core_stores_daily_checkouts (s_id, d_key, d_gross_nontaxable, d_gross_taxable, d_tax, d_cash, d_check, d_amex, d_discover, d_master, d_visa, d_debit, d_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)\n\t\t ON DUPLICATE KEY UPDATE d_key=d_key" . $PM . "1,d_gross_nontaxable=d_gross_nontaxable" . $PM . "?,d_gross_taxable=d_gross_taxable" . $PM . "?,d_tax=d_tax" . $PM . "?,d_cash=d_cash" . $PM . "?,d_check=d_check" . $PM . "?,d_amex=d_amex" . $PM . "?,d_discover=d_discover" . $PM . "?,d_master=d_master" . $PM . "?,d_visa=d_visa" . $PM . "?,d_debit=d_debit" . $PM . "?";
MYSQL::QUERY($QUERY, array($USER['store'], 1, $COST, $TAXABLE, $TAX, $CASH, $CHECK, $AMEX, $DISCOVER, $MASTER, $VISA, $DEBIT, $D, $COST, $TAXABLE, $TAX, $CASH, $CHECK, $AMEX, $DISCOVER, $MASTER, $VISA, $DEBIT));
}
示例11: init
/**
* Page を初期化する.
*
* @return void
*/
public function init()
{
parent::init();
$this->tpl_mainpage = 'products/review.tpl';
$this->tpl_mainno = 'products';
$this->tpl_subno = 'review';
$this->tpl_pager = 'pager.tpl';
$this->tpl_maintitle = '商品管理';
$this->tpl_subtitle = 'レビュー管理';
$masterData = Application::alias('eccube.db.master_data');
$this->arrPageMax = $masterData->getMasterData('mtb_page_max');
$this->arrRECOMMEND = $masterData->getMasterData('mtb_recommend');
$this->arrSex = $masterData->getMasterData('mtb_sex');
/* @var $objDate Date */
$objDate = Application::alias('eccube.date');
// 登録・更新検索開始年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrStartYear = $objDate->getYear();
$this->arrStartMonth = $objDate->getMonth();
$this->arrStartDay = $objDate->getDay();
// 登録・更新検索終了年
$objDate->setStartYear(RELEASE_YEAR);
$objDate->setEndYear(DATE('Y'));
$this->arrEndYear = $objDate->getYear();
$this->arrEndMonth = $objDate->getMonth();
$this->arrEndDay = $objDate->getDay();
}
示例12: actionCreate
/**
* Creates a new AnItems model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new AnItems();
$NeccFunc = new NeccFunctions();
// вибираємо головних батьків
$parentCats = AnCats::find()->roots()->all();
$list = $NeccFunc->getCorrectList($parentCats);
// вибираємо регіони
$regionsQuery = AnRegions::find()->asArray()->all();
$regions = array();
// формую правильний масив для select форми
// хоча потрібно було б використати ArrayHelper::map($array, 'key', 'key')
foreach ($regionsQuery as $region) {
$regions[$region['id']] = $region['name'];
}
if ($model->load(Yii::$app->request->post())) {
$model->created_at = DATE('Y-m-d H:i:s');
$model->status = 0;
$model->local = Yii::$app->language;
$model->save();
return $this->redirect('/announcement/anitems');
} else {
return $this->render('create', ['model' => $model, 'regions' => $regions, 'list' => $list]);
}
}
示例13: inserirFichaCorreio
public function inserirFichaCorreio($id_empresa, $id_usuario, $id_fichacorreio, $quantidade)
{
$data = DATE('Y-m-d');
$this->table = 'vsites_emp_correios';
$this->fields = array("id_empresa", "id_usuario", "id_fichacorreio", "quantidade", "data");
$this->values = array("id_empresa" => $id_empresa, "id_usuario" => $id_usuario, "id_fichacorreio" => $id_fichacorreio, "quantidade" => $quantidade, "data" => $data);
return $this->insert();
}
示例14: index
public function index()
{
$this->load->language('marketing/newsletter/send');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('marketing/newsletter');
$this->load->model('marketing/newsletter/group');
$data['groups'] = array();
$data['groups'][0] = $this->language->get('text_all_members');
$groups = $this->model_marketing_newsletter_group->getGroups();
foreach ($groups as $group) {
$data['groups'][$group['group_id']] = $group['group_name'];
}
$url = '';
if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}
if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}
$this->document->addScript('view/plugins/datetimepicker/moment.min.js');
$this->document->addScript('view/plugins/datetimepicker/bootstrap-datetimepicker.min.js');
$this->document->addStyle('view/plugins/datetimepicker/bootstrap-datetimepicker.min.css');
$data['action'] = $this->url->link('marketing/newsletter/send', 'newsletter_id=' . (int) $this->request->get['newsletter_id'] . '&token=' . $this->session->data['token'] . $url);
$data['dont_send_duplicate'] = 0;
$data['group_ids'] = array();
$data['error_group_send_to'] = '';
if (isset($this->request->post['send_later'])) {
$data['send_later'] = $this->request->post['send_later'];
} else {
$data['send_later'] = DATE("Y-m-d H:i:s", time());
}
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
if (!isset($this->request->post['dont_send_duplicate'])) {
$data['dont_send_duplicate'] = 0;
}
$data['group_ids'] = !empty($this->request->post['group_ids']) ? $this->request->post['group_ids'] : array();
if (empty($data['group_ids'])) {
$data['error_group_send_to'] = $this->language->get('error_group_send_to');
} else {
$post = array('group_ids' => $data['group_ids'], 'dont_send_duplicate' => $data['dont_send_duplicate'], 'send_later' => strtotime($data['send_later']));
if ($post['send_later'] < time()) {
$post['send_later'] = time();
}
$newsletter_id = $this->request->get['newsletter_id'];
if ($this->model_marketing_newsletter->createSend($newsletter_id, $post)) {
$this->redirect($this->url->link('marketing/newsletter/newsletter', 'token=' . $this->session->data['token'] . $url, 'SSL'));
} else {
$data['error_group_send_to'] = $this->language->get('error_group_no_members');
}
}
}
$data['header'] = $this->getChild('common/header');
$data['footer'] = $this->getChild('common/footer');
$this->response->setOutput($this->render('marketing/newsletter/send.phtml', $data));
}
示例15: copyright_year
function copyright_year($args = array())
{
$year = DATE('Y');
ob_start();
?>
© <?php
echo $year;
return ob_get_clean();
}