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


PHP date::now方法代码示例

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


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

示例1: batchEdit

 /**
  * Batch edit todo.
  * 
  * @param  string $from example:myTodo, todoBatchEdit.
  * @param  string $type 
  * @param  string $account 
  * @param  string $status 
  * @access public
  * @return void
  */
 public function batchEdit($from = '', $type = 'today', $account = '', $status = 'all')
 {
     /* Get form data for my-todo. */
     if ($from == 'myTodo') {
         /* Initialize vars. */
         $editedTodos = array();
         $todoIDList = array();
         $columns = 7;
         $showSuhosinInfo = false;
         if ($account == '') {
             $account = $this->app->user->account;
         }
         $bugs = $this->bug->getUserBugPairs($account);
         $tasks = $this->task->getUserTaskPairs($account, $status);
         $allTodos = $this->todo->getList($type, $account, $status);
         if ($this->post->todoIDList) {
             $todoIDList = $this->post->todoIDList;
         }
         /* Initialize todos whose need to edited. */
         foreach ($allTodos as $todo) {
             if (in_array($todo->id, $todoIDList)) {
                 $editedTodos[$todo->id] = $todo;
             }
         }
         foreach ($editedTodos as $todo) {
             if ($todo->type == 'task') {
                 $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name');
             }
             if ($todo->type == 'bug') {
                 $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title');
             }
             $todo->begin = str_replace(':', '', $todo->begin);
             $todo->end = str_replace(':', '', $todo->end);
         }
         /* Judge whether the edited todos is too large. */
         $showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting(count($editedTodos), $columns);
         /* Set the sessions. */
         $this->app->session->set('showSuhosinInfo', $showSuhosinInfo);
         /* Assign. */
         $title = $this->lang->todo->common . $this->lang->colon . $this->lang->todo->batchEdit;
         $position[] = html::a($this->createLink('my', 'todo'), $this->lang->my->todo);
         $position[] = $this->lang->todo->common;
         $position[] = $this->lang->todo->batchEdit;
         if ($showSuhosinInfo) {
             $this->view->suhosinInfo = $this->lang->suhosinInfo;
         }
         $this->view->bugs = $bugs;
         $this->view->tasks = $tasks;
         $this->view->editedTodos = $editedTodos;
         $this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
         $this->view->time = date::now();
         $this->view->title = $title;
         $this->view->position = $position;
         $this->display();
     } elseif ($from == 'todoBatchEdit') {
         $allChanges = $this->todo->batchUpdate();
         foreach ($allChanges as $todoID => $changes) {
             if (empty($changes)) {
                 continue;
             }
             $actionID = $this->loadModel('action')->create('todo', $todoID, 'edited');
             $this->action->logHistory($actionID, $changes);
         }
         die(js::locate($this->session->todoList, 'parent'));
     }
 }
开发者ID:XMGmen,项目名称:zentao,代码行数:76,代码来源:control.php

示例2: batchCreate

 /**
  * Batch create todo
  * 
  * @param  string $date 
  * @access public
  * @return void
  */
 public function batchCreate($date = 'today')
 {
     if ($date == 'today') {
         $date = date(DT_DATE1, time());
     }
     if (!empty($_POST)) {
         $this->todo->batchCreate();
         if (dao::isError()) {
             $this->send(array('result' => 'fail', 'message' => dao::getError()));
         }
         /* Locate the browser. */
         $date = str_replace('-', '', $this->post->date);
         if ($date == '') {
             $date = 'future';
         } else {
             if ($date == date('Ymd')) {
                 $date = 'today';
             }
         }
         $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('todo', 'calendar', "date={$date}")));
     }
     $this->view->title = $this->lang->todo->common . $this->lang->colon . $this->lang->todo->batchCreate;
     $this->view->date = (int) $date == 0 ? $date : date('Y-m-d', strtotime($date));
     $this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
     $this->view->time = date::now();
     $this->view->users = $this->loadModel('user')->getPairs('noclosed,nodeleted');
     $this->view->modalWidth = '85%';
     $this->display();
 }
开发者ID:leowh,项目名称:colla,代码行数:36,代码来源:control.php


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