本文整理汇总了PHP中mydate函数的典型用法代码示例。如果您正苦于以下问题:PHP mydate函数的具体用法?PHP mydate怎么用?PHP mydate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mydate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: comment
public function comment($f3)
{
$id = $f3->get('PARAMS.3');
$post = $this->Model->Posts->fetch($id);
if ($this->request->is('post')) {
$comment = $this->Model->Comments;
$comment->copyfrom('POST');
$comment->blog_id = $id;
$comment->created = mydate();
//Moderation of comments
if (!empty($this->Settings['moderate']) && $this->Auth->user('level') < 2) {
$comment->moderated = 0;
} else {
$comment->moderated = 1;
}
//Default subject
if (empty($this->request->data['subject'])) {
$comment->subject = 'RE: ' . $post->title;
}
$comment->save();
//Redirect
if ($comment->moderated == 0) {
StatusMessage::add('Your comment has been submitted for moderation and will appear once it has been approved', 'success');
} else {
StatusMessage::add('Your comment has been posted', 'success');
}
return $f3->reroute('/blog/view/' . $id);
}
}
示例2: tpl_input_date
function tpl_input_date($params, $ctl)
{
if (!$params['id']) {
$params['id'] = $ctl->new_dom_id();
}
if (!$params['type']) {
$params['type'] = 'date';
}
if (!$params['vtype']) {
$params['vtype'] = 'date';
}
if (is_numeric($params['value'])) {
$params['value'] = mydate('Y-m-d', $params['value']);
}
if (isset($params['concat'])) {
$params['name'] .= $params['concat'];
unset($params['concat']);
}
if (!$params['format'] || $params['format'] == 'timestamp') {
$prefix = '<input type="hidden" name="_DTYPE_' . strtoupper($params['type']) . '[]" value="' . htmlspecialchars($params['name']) . '" />';
} else {
$prefix = '';
}
$params['type'] = 'text';
$return = buildTag($params, 'input class="cal ' . $params['class'] . '" size="10" maxlength="10" autocomplete="off"');
return $prefix . $return . '<script>$("' . $params['id'] . '").makeCalable();</script>';
}
示例3: addView
function addView($catid)
{
$this->pagedata['params'] = array('cat_id' => $catid);
$this->pagedata['item'] = array('label' => 'New View ' . mydate('H:i:s'));
$this->setView('product/category/view_row.html');
$this->output();
}
示例4: add
public function add($f3)
{
if ($this->request->is('post')) {
extract($this->request->data);
$check = $this->Model->Users->fetch(array('username' => $username));
if (!empty($check)) {
StatusMessage::add('User already exists', 'danger');
} else {
if ($password != $password2) {
StatusMessage::add('Passwords must match', 'danger');
} else {
$user = $this->Model->Users;
$user->copyfrom('POST');
$user->created = mydate();
$user->bio = '';
$user->level = 1;
$user->setPassword($password);
if (empty($displayname)) {
$user->displayname = $user->username;
}
//Set the users password
$user->setPassword($user->password);
$user->save();
StatusMessage::add('Registration complete', 'success');
return $f3->reroute('/user/login');
}
}
}
}
示例5: tpl_modifier_userdate
function tpl_modifier_userdate($timestamp)
{
if (!$GLOBALS['site_dateformat']) {
$system =& $GLOBALS['system'];
if (!($GLOBALS['site_dateformat'] = $system->getConf('site.dateFormat'))) {
$GLOBALS['site_dateformat'] = "Y-m-d";
}
}
return mydate($GLOBALS['site_dateformat'], $timestamp);
}
示例6: smarty_modifier_usertime
function smarty_modifier_usertime($timestamp)
{
if (!$GLOBALS['site_timeformat']) {
$system =& $GLOBALS['system'];
if (!($GLOBALS['site_timeformat'] = $system->getConf('site.timeFormat'))) {
$GLOBALS['site_timeformat'] = "Y-m-d H:i:s";
}
}
return mydate($GLOBALS['site_timeformat'], $timestamp);
}
示例7: edit
public function edit($f3)
{
$postid = $f3->get('PARAMS.3');
$post = $this->Model->Posts->fetchById($postid);
$blog = $this->Model->map($post, array('post_id', 'Post_Categories', 'category_id'), 'Categories', false);
if ($this->request->is('post')) {
extract($this->request->data);
$post->copyfrom('POST');
$post->modified = mydate();
$post->user_id = $this->Auth->user('id');
//Determine whether to publish or draft
if (!isset($Publish)) {
$post->published = null;
} else {
$post->published = mydate($published);
}
//Save changes
$post->save();
$link = $this->Model->Post_Categories;
//Remove previous categories
$old = $link->fetchAll(array('post_id' => $postid));
foreach ($old as $oldcategory) {
$oldcategory->erase();
}
//Now assign new categories
if (!isset($categories)) {
$categories = array();
}
foreach ($categories as $category) {
$link->reset();
$link->category_id = $category;
$link->post_id = $postid;
$link->save();
}
\StatusMessage::add('Post updated succesfully', 'success');
return $f3->reroute('/admin/blog');
}
$_POST = $post->cast();
foreach ($blog['Categories'] as $cat) {
if (!$cat) {
continue;
}
$_POST['categories'][] = $cat->id;
}
$categories = $this->Model->Categories->fetchList();
$f3->set('categories', $categories);
$f3->set('post', $post);
}
示例8: add
public function add($f3)
{
if ($this->request->is('post')) {
$settings = $this->Model->Settings;
$debug = $settings->getSetting('debug');
if ($debug != 1) {
$captcha = $_POST['g-recaptcha-response'];
if (empty($captcha)) {
StatusMessage::add('Enter captcha please', 'danger');
$f3->reroute('/');
}
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6Ld6wBITAAAAAOSA4kywtpw1UbJExz1jz-j0EAyp&response=" . $captcha);
$response = json_decode($response, true);
if ($response["success"] == false) {
StatusMessage::add('No entry for spammers, sorry', 'danger');
$f3->reroute('/');
}
}
extract($this->request->data);
$check = $this->Model->Users->fetch(array('username' => $username));
if (!empty($check)) {
StatusMessage::add('User already exists', 'danger');
} else {
if ($password != $password2) {
StatusMessage::add('Passwords must match', 'danger');
} else {
$user = $this->Model->Users;
$user->copyfrom('POST');
$user->created = mydate();
$user->bio = '';
$user->level = 1;
$user->setPassword($password);
if (empty($displayname)) {
$user->displayname = $user->username;
}
//Set the users password
$user->setPassword($user->password);
$user->save();
StatusMessage::add('Registration complete', 'success');
return $f3->reroute('/user/login');
}
}
}
}
示例9: smarty_modifier_cdate
function smarty_modifier_cdate($string, $type)
{
$system =& $GLOBALS['system'];
$time = $string ? intval($string) : time();
$time += ($system->getConf('system.timezone.default') - SERVER_TIMEZONE) * 3600;
if (!$GLOBALS['site_dateformat']) {
$system =& $GLOBALS['system'];
if (!($GLOBALS['site_dateformat'] = $system->getConf('site.dateFormat'))) {
$GLOBALS['site_dateformat'] = "Y-m-d";
}
}
switch ($type) {
case 'FDATE':
$dateFormat = 'Y-m-d';
break;
case 'SDATE':
$dateFormat = 'y-m-d';
break;
case 'DATE':
$dateFormat = 'm-d';
break;
case 'FDATE_FTIME':
$dateFormat = 'Y-m-d H:i:s';
break;
case 'FDATE_STIME':
$dateFormat = 'Y-m-d H:i';
break;
case 'SDATE_FTIME':
$dateFormat = 'y-m-d H:i:s';
break;
case 'SDATE_STIME':
$dateFormat = 'y-m-d H:i';
break;
case 'DATE_FTIME':
$dateFormat = 'm-d H:i:s';
break;
case 'DATE_STIME':
$dateFormat = 'm-d H:i';
break;
default:
$dateFormat = $GLOBALS['site_dateformat'];
}
return mydate($dateFormat, $time);
}
示例10: operator
function operator()
{
$this->path[] = array('text' => __('帐号设置'));
$oOpt =& $this->system->loadModel('admin/operator');
$data = $oOpt->instance($this->system->op_id);
$this->pagedata['op_id'] = $this->system->op_id;
$this->pagedata['data'] = $data;
$data['config'] = unserialize($data['config']);
$this->pagedata['timezone_value'] = $GLOBALS['user_timezone'];
$zones = array();
$realtime = time() - SERVER_TIMEZONE * 3600;
$tzs = timezone_list();
foreach ($tzs as $i => $tz) {
$zones[$i] = mydate('H:i', $realtime + $i * 3600) . ' - ' . $tz;
}
$this->pagedata['timezones'] = $zones;
$this->pagedata['server_tz'] = $tzs[SERVER_TIMEZONE];
$this->pagedata['tzlist'] = $tzs;
$this->display('admin/self.html');
}
示例11: smarty_modifier_cdate
function smarty_modifier_cdate($string, $type)
{
$system =& $GLOBALS['system'];
if (!$string) {
return 'NULL';
} else {
$time = intval($string) + ($GLOBALS['user_timezone'] - SERVER_TIMEZONE) * 3600;
}
switch ($type) {
case 'FDATE':
$dateFormat = 'Y-m-d';
break;
case 'SDATE':
$dateFormat = 'y-m-d';
break;
case 'DATE':
$dateFormat = 'm-d';
break;
case 'FDATE_FTIME':
$dateFormat = 'Y-m-d H:i:s';
break;
case 'FDATE_STIME':
$dateFormat = 'Y-m-d H:i';
break;
case 'SDATE_FTIME':
$dateFormat = 'y-m-d H:i:s';
break;
case 'SDATE_STIME':
$dateFormat = 'y-m-d H:i';
break;
case 'DATE_FTIME':
$dateFormat = 'm-d H:i:s';
break;
case 'DATE_STIME':
$dateFormat = 'm-d H:i';
break;
default:
$dateFormat = $system->getConf('admin.dateFormat');
}
return mydate($dateFormat, $time);
}
示例12: tpl_input_time
function tpl_input_time($params, $ctl)
{
$params['type'] = 'time';
$return = tpl_input_date($params, $ctl);
if ($params['value']) {
$hour = mydate('H', $params['value']);
$minute = mydate('i', $params['value']);
}
$select = ' <select name="_DTIME_[H][' . htmlspecialchars($params['name']) . ']">';
for ($i = 0; $i < 24; $i++) {
$tmpNum = str_pad($i, 2, '0', STR_PAD_LEFT);
$select .= ($hour == $i ? '<option value="' . $tmpNum . '" selected="selected">' : '<option value="' . $tmpNum . '">') . $tmpNum . '</option>';
}
$select .= '</select> : <select name="_DTIME_[M][' . htmlspecialchars($params['name']) . ']">';
for ($i = 0; $i < 60; $i++) {
$tmpNum = str_pad($i, 2, '0', STR_PAD_LEFT);
$select .= ($minute == $i ? '<option value="' . $tmpNum . '" selected="selected">' : '<option value="' . $tmpNum . '">') . $tmpNum . '</option>';
}
$select .= '</select>';
return $return . $select;
}
示例13: updateMessage
function updateMessage()
{
$sqlString = "select message from sdb_orders\n where order_id = '" . $this->orderId;
$this->db->Query($sqlString);
$this->db->next_record();
$tmp_message = do_slash($this->db->f(message));
if (!empty($tmp_message)) {
$tmp_message .= "<br><br>";
}
$tmptime = mydate("Y-m-d H:i:s", mktime());
$sqlString = "UPDATE sdb_orders SET message= '" . $tmp_message . $this->message . "<br> -- " . $tmptime . "',\n userrecsts = 1, recsts = 5, feedbacktime = " . time() . "\n WHERE order_id='" . $this->orderId . "'";
return $this->db->exec($sqlString);
}
示例14: echo
<input name="customer_name" style="width:190px" id="title" type="text" value="<?php echo ($search["customer_name"]); ?>">
<span>不填则不限制</span>
</dd>
</dl>
<dl class="lineD">
<dt>借款金额:</dt>
<dd>
<select name="bj" id="bj" style="width:80px" class="c_select"><option value="">--请选择--</option><?php foreach($bj as $key=>$v){ if($search["bj"]==$key && $search["bj"]!=""){ ?><option value="<?php echo ($key); ?>" selected="selected"><?php echo ($v); ?></option><?php }else{ ?><option value="<?php echo ($key); ?>"><?php echo ($v); ?></option><?php }} ?></select>
<input name="money" id="money" style="width:100px" class="input" type="text" value="<?php echo ($search["money"]); ?>" >
<span>不填则不限制</span>
</dd>
</dl>
<dl class="lineD"><dt>借款时间(开始):</dt><dd><input onclick="WdatePicker({maxDate:'#F{$dp.$D(\'end_time\')||\'2020-10-01\'}',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true,lang:'zh-cn'});" name="start_time" id="start_time" class="input Wdate" type="text" value="<?php echo (mydate('Y-m-d H:i:s',$search["start_time"])); ?>"><span id="tip_start_time" class="tip">只选开始时间则查询从开始时间往后所有</span></dd></dl>
<dl class="lineD"><dt>借款时间(结束):</dt><dd><input onclick="WdatePicker({minDate:'#F{$dp.$D(\'start_time\')}',maxDate:'2020-10-01',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true,lang:'zh-cn'});" name="end_time" id="end_time" class="input Wdate" type="text" value="<?php echo (mydate('Y-m-d H:i:s',$search["end_time"])); ?>"><span id="tip_end_time" class="tip">只选结束时间则查询从结束时间往前所有</span></dd></dl>
<div class="page_btm">
<input type="submit" class="btn_b" value="确定" />
</div>
</form>
</div>
</div>
<!--搜索/筛选会员-->
<div class="Toolbar_inbox">
<div class="page right"><?php echo ($pagebar); ?></div>
<a onclick="dosearch();" class="btn_a" href="javascript:void(0);"><span class="search_action">搜索/筛选借款</span></a>
</div>
<div class="list">
示例15: mydate
</head>
<body>
<script type="text/javascript" src="__ROOT__/Style/My97DatePicker/WdatePicker.js" language="javascript"></script>
<style type="text/css">
.tip{color:#F2F4F6}
</style>
<div class="so_main">
<!--列表模块-->
<!-- <form name="sdf" id="sdf" action="__URL__/index" method="get">
<div class="Toolbar_inbox">
<span>从<input onclick="WdatePicker({maxDate:'#F{$dp.$D(\'end_time\')||\'2020-10-01\'}',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true});" name="start_time" id="start_time" class="input Wdate" type="text" value="<?php
echo mydate('Y-m-d H:i:s', $search["start_time"]);
?>
"><span id="tip_start_time" class="tip">只选开始时间则查询从开始时间往后所有</span>到<input onclick="WdatePicker({minDate:'#F{$dp.$D(\'start_time\')}',maxDate:'2020-10-01',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true});" name="end_time" id="end_time" class="input Wdate" type="text" value="<?php
echo mydate('Y-m-d H:i:s', $search["end_time"]);
?>
"><span id="tip_end_time" class="tip">只选结束时间则查询从结束时间往前所有</span></span>
<a href="javascript:;" onclick="javascript:document.forms.sdf.submit();" class="btn_a"><span>统计</span></a></div>
</form> -->
<style type="text/css">
.ssx a{height:30px; line-height:30px}
.list td{border-right:1px solid #E3E6EB; width:30%}
.lx{width:100%; overflow:hidden; height:30px; line-height:30px}
.lx dt,.lx dd{float:left; width:40%}
.lx dt{text-align:right;}
.lx dd{text-align:left; text-indent:10px}
</style>
<div class="list">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>