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


PHP DBQuery::dbfnNow方法代码示例

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


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

示例1: store

 public function store()
 {
     $q = new DBQuery();
     if ($this->task_log_id) {
         $this->task_log_updated = $q->dbfnNow();
     } else {
         $this->task_log_created = $q->dbfnNow();
         $this->task_log_updated = $q->dbfnNow();
     }
     parent::store();
     $this->updateHoursWorked($this->task_log_task);
 }
开发者ID:joly,项目名称:web2project,代码行数:12,代码来源:tasks.class.php

示例2: addHistory

function addHistory($table, $id, $action = 'modify', $description = '', $project_id = 0)
{
    global $AppUI;
    /*
     * TODO:
     * 1) description should be something like:
     * 		command(arg1, arg2...)
     *  The command should be as module_action
     *  for example:
     * 		forums_new('Forum Name', 'URL')
     *
     * This way, the history module will be able to display descriptions
     * using locale definitions:
     * 		"forums_new" -> "New forum '%s' was created" -> "Se ha creado un nuevo foro llamado '%s'"
     *
     * 2) project_id and module_id should be provided in order to filter history entries
     *
     */
    if (!w2PgetConfig('log_changes')) {
        return;
    }
    $description = str_replace("'", "\\'", $description);
    $q = new DBQuery();
    $q->addTable('modules');
    $q->addWhere('mod_name = \'History\' and mod_active = 1');
    $qid = $q->exec();
    if (!$qid || db_num_rows($qid) == 0) {
        $AppUI->setMsg('History module is not loaded, but your config file has requested that changes be logged.  You must either change the config file or install and activate the history module to log changes.', UI_MSG_ALERT);
        $q->clear();
        return;
    }
    $q->clear();
    $q->addTable('history');
    $q->addInsert('history_action', $action);
    $q->addInsert('history_item', $id);
    $q->addInsert('history_description', $description);
    $q->addInsert('history_user', $AppUI->user_id);
    $q->addInsert('history_date', $q->dbfnNow(), false, true);
    $q->addInsert('history_project', $project_id);
    $q->addInsert('history_table', $table);
    $q->exec();
    echo db_error();
    $q->clear();
}
开发者ID:joly,项目名称:web2project,代码行数:44,代码来源:main_functions.php

示例3: store

 public function store(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $stored = false;
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     if ($this->link_id && $perms->checkModuleItem('links', 'edit', $this->link_id)) {
         $q = new DBQuery();
         $this->link_date = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('links', $this->link_id, 'update', $this->link_name, $this->link_id);
         $stored = true;
     }
     if (0 == $this->link_id && $perms->checkModuleItem('links', 'add')) {
         $q = new DBQuery();
         $this->link_date = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('links', $this->link_id, 'add', $this->link_name, $this->link_id);
         $stored = true;
     }
     return $stored;
 }
开发者ID:joly,项目名称:web2project,代码行数:28,代码来源:links.class.php

示例4: updateLastAction

 /**
  *@Function for update table user_acces_log in field date_time_lost_action
  */
 public function updateLastAction($last_insert_id)
 {
     $q = new DBQuery();
     $q->addTable('user_access_log');
     $q->addUpdate('date_time_last_action', $q->dbfnNow(), false, true);
     $q->addWhere('user_access_log_id = ' . $last_insert_id);
     if ($last_insert_id > 0) {
         $q->exec();
         $q->clear();
     }
 }
开发者ID:joly,项目名称:web2project,代码行数:14,代码来源:ui.class.php

示例5: getCalendarEvents

 public function getCalendarEvents($userId, $days = 30)
 {
     /*
      * This list of fields - id, name, description, startDate, endDate,
      * updatedDate - are named specifically for the iCal creation.
      * If you change them, it's probably going to break.  So don't do that.
      */
     $q = new DBQuery();
     $q->addQuery('e.event_id as id');
     $q->addQuery('event_title as name');
     $q->addQuery('event_description as description');
     $q->addQuery('event_start_date as startDate');
     $q->addQuery('event_end_date as endDate');
     $q->addQuery($q->dbfnNow() . ' as updatedDate');
     $q->addQuery('CONCAT(\'' . W2P_BASE_URL . '/index.php?m=calendar&a=view&event_id=' . '\', e.event_id) as url');
     $q->addQuery('projects.project_id, projects.project_name');
     $q->addTable('events', 'e');
     $q->leftJoin('projects', 'projects', 'e.event_project = projects.project_id');
     $q->addWhere('(event_start_date > ' . $q->dbfnNow() . ' OR event_end_date > ' . $q->dbfnNow() . ')');
     $q->addWhere('(event_start_date < ' . $q->dbfnDateAdd($q->dbfnNow(), $days, 'DAY') . ' OR event_end_date < ' . $q->dbfnDateAdd($q->dbfnNow(), $days, 'DAY') . ')');
     $q->innerJoin('user_events', 'ue', 'ue.event_id = e.event_id');
     $q->addWhere('ue.user_id = ' . $userId);
     $q->addOrder('event_start_date');
     return $q->loadList();
 }
开发者ID:joly,项目名称:web2project,代码行数:25,代码来源:calendar.class.php

示例6: CProject

        $q->exec();
        echo db_error();
        $q->clear();
    }
}
$AppUI->savePlace();
$proj = new CProject();
$tobj = new CTask();
$allowedProjects = $proj->getAllowedSQL($AppUI->user_id, 'pr.project_id');
$allowedTasks = $tobj->getAllowedSQL($AppUI->user_id, 'ta.task_id');
// query my sub-tasks (ignoring task parents)
$q = new DBQuery();
$q->addQuery('ta.*');
$q->addQuery('project_name, pr.project_id, project_color_identifier');
$q->addQuery('tp.task_pinned');
$dateDiffString = $q->dbfnDateDiff('ta.task_end_date', $q->dbfnNow()) . ' AS task_due_in';
$q->addQuery($dateDiffString);
$q->addTable('projects', 'pr');
$q->addTable('tasks', 'ta');
$q->addTable('user_tasks', 'ut');
$q->leftJoin('user_task_pin', 'tp', 'tp.task_id = ta.task_id and tp.user_id = ' . (int) $user_id);
$q->leftJoin('project_departments', 'project_departments', 'pr.project_id = project_departments.project_id OR project_departments.project_id IS NULL');
$q->leftJoin('departments', 'departments', 'departments.dept_id = project_departments.department_id OR dept_id IS NULL');
$q->addWhere('ut.task_id = ta.task_id');
$q->addWhere('ut.user_id = ' . (int) $user_id);
$q->addWhere('( ta.task_percent_complete < 100 or ta.task_percent_complete is null)');
$q->addWhere('ta.task_status = 0');
$q->addWhere('pr.project_id = ta.task_project');
if (!$showArcProjs) {
    $q->addWhere('project_active = 1');
    if (($template_status = w2PgetConfig('template_projects_status_id')) != '') {
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:todo.php

示例7: store

 public function store(CAppUI $AppUI = null)
 {
     global $AppUI;
     $errorMsgArray = $this->check();
     $this->contact_company = (int) $this->contact_company;
     $this->contact_department = (int) $this->contact_department;
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     /*
      *  This  validates that any Contact saved will have a Display Name as
      * required by various dropdowns, etc throughout the system.  This is
      * mostly required when Contacts are generated via programatic methods and
      * not through the add/edit UI.
      */
     if (mb_strlen($this->contact_order_by) <= 1 || $this->contact_order_by == null) {
         //TODO: this should use the USERFORMAT to determine how display names are generated
         if ($this->contact_first_name == null && $this->contact_last_name == null) {
             $this->contact_order_by = $this->contact_email;
         } else {
             $this->contact_order_by = mb_trim($this->contact_first_name . ' ' . $this->contact_last_name);
         }
     }
     if ($this->contact_first_name == null) {
         $this->contact_first_name = '';
     }
     if ($this->contact_last_name == null) {
         $this->contact_last_name = '';
     }
     if ($this->contact_birthday == '') {
         $this->contact_birthday = null;
     }
     $q = new DBQuery();
     $this->contact_lastupdate = $q->dbfnNow();
     addHistory('contacts', $this->contact_id, 'store', $this->contact_first_name . ' ' . $this->contact_last_name, $this->contact_id);
     parent::store();
 }
开发者ID:joly,项目名称:web2project,代码行数:37,代码来源:contacts.class.php

示例8: store

 public function store(CAppUI $AppUI = null)
 {
     global $AppUI;
     $perms = $AppUI->acl();
     $stored = false;
     $this->w2PTrimAll();
     $this->project_target_budget = str_replace(',', '', $this->project_target_budget);
     // ensure changes of state in checkboxes is captured
     $this->project_active = (int) $this->project_active;
     $this->project_private = (int) $this->project_private;
     $this->project_target_budget = $this->project_target_budget ? $this->project_target_budget : 0.0;
     $this->project_actual_budget = $this->project_actual_budget ? $this->project_actual_budget : 0.0;
     // Make sure project_short_name is the right size (issue for languages with encoded characters)
     if (mb_strlen($this->project_short_name) > 10) {
         $this->project_short_name = mb_substr($this->project_short_name, 0, 10);
     }
     if (empty($this->project_end_date)) {
         $this->project_end_date = null;
     }
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     $this->project_id = (int) $this->project_id;
     // convert dates to SQL format first
     if ($this->project_start_date) {
         $date = new CDate($this->project_start_date);
         $this->project_start_date = $date->format(FMT_DATETIME_MYSQL);
     }
     if ($this->project_end_date) {
         $date = new CDate($this->project_end_date);
         $date->setTime(23, 59, 59);
         $this->project_end_date = $date->format(FMT_DATETIME_MYSQL);
     }
     if ($this->project_actual_end_date) {
         $date = new CDate($this->project_actual_end_date);
         $this->project_actual_end_date = $date->format(FMT_DATETIME_MYSQL);
     }
     // let's check if there are some assigned departments to project
     if ('' != $this->project_actual_end_date) {
         $obj->project_departments = implode(',', w2PgetParam($_POST, 'dept_ids', array()));
     }
     // check project parents and reset them to self if they do not exist
     if (!$this->project_parent) {
         $this->project_parent = $this->project_id;
         $this->project_original_parent = $this->project_id;
     } else {
         $parent_project = new CProject();
         $parent_project->load($this->project_parent);
         $this->project_original_parent = $parent_project->project_original_parent;
     }
     if (!$this->project_original_parent) {
         $this->project_original_parent = $this->project_id;
     }
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->project_id && $perms->checkModuleItem('projects', 'edit', $this->company_id)) {
         $q = new DBQuery();
         $this->project_updated = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('projects', $this->project_id, 'update', $this->project_name, $this->project_id);
         $stored = true;
     }
     if (0 == $this->project_id && $perms->checkModuleItem('projects', 'add')) {
         $q = new DBQuery();
         $this->project_updated = $q->dbfnNow();
         $this->project_created = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         if (0 == $this->project_parent || 0 == $this->project_original_parent) {
             $this->project_parent = $this->project_id;
             $this->project_original_parent = $this->project_id;
             if ($msg = parent::store()) {
                 return $msg;
             }
         }
         addHistory('projects', $this->project_id, 'add', $this->project_name, $this->project_id);
         $stored = true;
     }
     //split out related departments and store them seperatly.
     $q = new DBQuery();
     $q->setDelete('project_departments');
     $q->addWhere('project_id=' . (int) $this->project_id);
     $q->exec();
     $q->clear();
     if ($this->project_departments) {
         $departments = explode(',', $this->project_departments);
         foreach ($departments as $department) {
             $q->addTable('project_departments');
             $q->addInsert('project_id', $this->project_id);
             $q->addInsert('department_id', $department);
             $q->exec();
             $q->clear();
         }
     }
//.........这里部分代码省略.........
开发者ID:joly,项目名称:web2project,代码行数:101,代码来源:projects.class.php


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